diff --git a/.github/workflows/ContinuousIntegration.yml b/.github/workflows/ContinuousIntegration.yml index 6f987cf69..553db2007 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,16 +16,22 @@ 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 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..9ec40f82e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,61 +30,347 @@ include( cmake/GNDStk_dependencies.cmake ) ######################################################################## # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# GNDStk : library +# GNDStk: library # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - include_directories( src/ ) add_library( GNDStk INTERFACE ) target_include_directories( GNDStk INTERFACE src/ ) -target_link_libraries( GNDStk +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 +# GNDStk: python bindings # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -include_directories( python/src/ ) +include_directories( + python/src/ + autogen/prototype/proto/src/ + standards/gnds-2.0-alpha/alpha/src + standards/gnds-2.0-alpha/alpha/python/src + ) -pybind11_add_module( GNDStk.python +pybind11_add_module( + GNDStk.python.old EXCLUDE_FROM_ALL python/src/GNDStk.python.cpp + python/src/v2.0/GNDS.python.cpp python/src/core/Node.python.cpp - python/src/Interpolation.python.cpp + python/src/BoundaryCondition.python.cpp + python/src/ContributorType.python.cpp + python/src/DateType.python.cpp + python/src/DecayType.python.cpp + python/src/Frame.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 + python/src/HashAlgorithm.python.cpp + python/src/Interaction.python.cpp + python/src/Interpolation.python.cpp + python/src/InterpolationQualifier.python.cpp + python/src/Parity.python.cpp + python/src/RelationType.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Starts.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Lengths.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Array.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SelfScatteringKernel.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Sums.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Values.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearTerm.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ImaginaryAnomalousFactor.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BoundAtomCrossSection.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotopes.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Standard.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unresolved.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayMode.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/InternalConversionCoefficients.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Temperature.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Polynomial1d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Product.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearPlusInterference.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Branching1d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FreeGasApproximation.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotope.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MultiplicitySums.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringAtom.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nuclide.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PrimaryGamma.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spectrum.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OrphanProduct.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutronKE.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Time.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncidentEnergies.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Distribution.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Gridded3d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageProductEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Q.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AngularTwoBody.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/R.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayPath.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Summand.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Title.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Continuum.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceReactions.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/G.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EnergyAngular.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Institution.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/String.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Width.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionSum.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringRadius.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Table.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nuclides.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearAmplitudeExpansion.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GaugeBoson.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spectra.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProductYields.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Theta.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/LevelSpacing.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/J.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptProductKE.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Widths.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MultiplicitySum.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Parameters.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Grid.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Add.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Slice.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProductYield.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MadlandNix.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BindingEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DebyeWallerIntegral.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceSections.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Link.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageParameterCovariance.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Energy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Body.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Alias.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Uncertainty.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reactions.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs1d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Configurations.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Weighted.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Resolved.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionEnergyReleases.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Baryon.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncoherentPhotonScattering.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ENDFconversionFlags.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionComponent.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringAtoms.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Configuration.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptGammaEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/E_max.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncompleteReactions.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionReconstructed.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Productions.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Charge.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PhotonEmissionProbabilities.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Probability.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionComponents.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs3d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SpinGroups.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/T_M.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SpinGroup.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DiscreteGamma.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Production.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CoulombPlusNuclearElastic.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ChemicalElements.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unorthodox.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FormFactor.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/S_table.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SimpleMaxwellianFission.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageEnergies.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Shell.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RealAnomalousFactor.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CoherentPhotonScattering.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Background.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayData.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/KalbachMann.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedBetaEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Lepton.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Dates.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DoubleDifferentialCrossSection.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Authors.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ElapsedTimes.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringFactor.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Ls.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RutherfordScattering.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Fraction.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NBodyPhaseSpace.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ExternalFiles.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Conversion.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovarianceMatrix.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RMatrix.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EFH.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterLink.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ChemicalElement.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Constant1d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Baryons.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovariance.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncidentEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NonNeutrinoEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FastRegion.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Halflife.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Angular.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProjectileEnergyDomain.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ExternalFile.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceReaction.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Data.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ApplicationData.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptNeutronKE.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/HardSphereRadius.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reference.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nucleus.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Function2ds.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unspecified.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ShortRangeSelfScalingVariance.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spin.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Leptons.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Author.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceSection.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionEnergyRelease.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Channels.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unorthodoxes.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Gridded2d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OrphanProducts.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutron.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Slices.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ListOfCovariances.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Decay.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Axes.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Covariance.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Mass.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AngularEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SCTApproximation.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutrons.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Multiplicity.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/WeightedFunctionals.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EFL.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Column.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Integer.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayModes.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs2d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Branching3d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceParameters.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResolvedRegion.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/UnresolvedRegion.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RealInterferenceTerm.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Intensity.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Discrete.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/TotalEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovariances.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Regions1d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedGammaEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NeutrinoEnergy.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ColumnData.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ElapsedTime.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ColumnHeaders.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PositronEmissionIntensity.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Recoil.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Evaluated.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Atomic.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionSums.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Resonances.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSection.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BreitWigner.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Date.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Uncorrelated.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotropic2d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/L.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Products.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/F.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Legendre.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/U.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Mixed.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/E_critical.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/T_effective.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Channel.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Parity.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Sum.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Double.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Summands.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GeneralEvaporation.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/TabulatedWidths.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Evaporation.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Yields.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Regions2d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ImaginaryInterferenceTerm.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OutputChannel.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Js.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EndfCompatible.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reaction.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Documentation.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MetaStable.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Rate.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceMatrix.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Styles.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Array.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Axis.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Aliases.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RowData.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Function1ds.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GaugeBosons.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonancesWithBackground.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Polynomial1d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Product.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Distribution.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Nuclides.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/CrossSection.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Products.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Double.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/OutputChannel.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Function1ds.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/g2d/Array.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/FissionFragmentData.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/ReactionSuite.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/PoPs.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/CovarianceSuite.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/general.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/top.python.cpp + standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced.python.cpp + standards/gnds-2.0-alpha/alpha/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) + +pybind11_add_module( + GNDStk.python + EXCLUDE_FROM_ALL + 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) ####################################################################### @@ -92,10 +378,8 @@ set_target_properties( GNDStk.python PROPERTIES POSITION_INDEPENDENT_CODE ON) ####################################################################### 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..a895b0e3a 100644 --- a/autogen/changes.json +++ b/autogen/changes.json @@ -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", diff --git a/autogen/json2class.cpp b/autogen/json2class.cpp index ff4a91686..8eabd9db2 100644 --- a/autogen/json2class.cpp +++ b/autogen/json2class.cpp @@ -4,13 +4,26 @@ // ----------------------------------------------------------------------------- #include "GNDStk.hpp" -#include "cstring" -using namespace njoy::GNDStk::core; +#include +using namespace njoy::GNDStk; // 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; +// Extra debug/informational printing? +const bool debugging = false; + +// 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; // ----------------------------------------------------------------------------- @@ -18,11 +31,9 @@ const bool singletons = true; // ----------------------------------------------------------------------------- // KeyValue -// Too bad the JSON library doesn't provide this more straightforwardly +// Too bad the JSON library doesn't provide this directly using KeyValue = nlohmann::detail::iteration_proxy_value< - nlohmann::detail::iter_impl< - const nlohmann::basic_json<> - > + nlohmann::detail::iter_impl >; // NamespaceAndClass @@ -57,31 +68,58 @@ struct Class2Dependencies { // InfoMetadata struct InfoMetadata { - // A .json spec can make a metadatum be: - // - a std::optional, or - // - a GNDStk::defaulted + // 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 + // 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). + // 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<> + 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 (see later in this file), + // the mtype_param() and mtype_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: - // - a std::optional, and/or - // - a std::vector - // but can't make it be a GNDStk::defaulted. (The use of a default value for + // 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<> @@ -92,7 +130,9 @@ struct InfoChildren { // InfoVariantsChildren struct InfoVariantsChildren { std::string name; - std::string type; + std::string ns; // enclosing namespace + std::string plain; // underlying type, excluding namespace + std::string type; // underlying type bool isVector; }; @@ -116,6 +156,8 @@ struct PerNamespace { 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 nsname; // name of this class' namespace std::string clname; // name of this class @@ -138,17 +180,24 @@ struct PerClass { { 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; + // 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 // ----------------------------------------------------------------------------- @@ -156,26 +205,32 @@ struct PerClass { // 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 + // From the JSON file on the command line + std::string Path; + std::string Project; std::string JSONDir; - std::vector JSONFiles; - std::string GNDSDir; std::string Version; + std::vector JSONFiles; - // Version, but with '_' in place of '.' + // Version, but with '_'s in place of '.'s 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 + 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 or child node's name. - // Example: "double" (GNDS v1.9 does have this) to "Double" for C++. + // Changes to apply to a metadatum's name or a child node's name. + // Example: "double" (GNDS v1.9 actually has "double") to "Double" for C++. std::map mapName; - // Changes to apply to metadata/attribute type and default. + // Changes to apply to metadata/attribute type. // Examples: "Boolean" to "bool", "interpolation" to "enums::Interpolation". - std::map mapMetaType; + // 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) @@ -194,21 +249,64 @@ struct InfoSpecs { std::map namespace2data; // Map from namespace::class to information about the class - std::map class2data; -}; - + static inline const auto compare = + [](const auto &a, const auto &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 // ----------------------------------------------------------------------------- // Miscellaneous short functions // ----------------------------------------------------------------------------- +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; + */ +} + // Print text describing an action the code is about to take -void action(const std::string &str) +template +void action(const ARGS &...args) { - std::cout - << "\n" - << colors::plain::blue << str << "..." << colors::reset << std::endl; + 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; } // Is the string all whitespace? @@ -269,27 +367,40 @@ std::string capital(const std::string &str) std::string allcaps(const std::string &str) { std::string ret = str; - for (auto i = ret.size(); i--; ) + 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 character std::string replace(const std::string &str, const char from, const char to) { std::string ret = str; - for (auto i = ret.size(); i--; ) + for (size_t 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) +// See https://github.com/nlohmann/json/issues/642 +std::string stringify(const orderedJSON &j) { const auto tmp = j.dump(); - return j.type() == nlohmann::json::value_t::string + return j.type() == orderedJSON::value_t::string ? tmp.substr(1, tmp.size()-2) : tmp; } @@ -322,6 +433,33 @@ bool isClass(const KeyValue &keyval) return true; } +// getTimes +std::string getTimes( + const PerClass &per, const std::string &key, const orderedJSON &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.contains(times) == value.contains(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.contains(times) + ? value[times] + : value[occurrence]; +} + +// sep +std::string sep(int &count, const int total) +{ + return ++count < total ? "," : ""; +} // ----------------------------------------------------------------------------- @@ -329,11 +467,28 @@ bool isClass(const KeyValue &keyval) // ----------------------------------------------------------------------------- // 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. +// Name in a GNDS file (e.g., name of an XML element) +std::string nameGNDS( + const KeyValue &keyval, + const std::string &nsname = "", + const bool print = false +) { + // For debugging + if (debugging && print) { + const std::string key = keyval.key(); + const std::string name = keyval.value().contains("name") + ? std::string(keyval.value()["name"]) + : 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.value().contains("name") ? std::string(keyval.value()["name"]) : keyval.key(); @@ -343,10 +498,11 @@ std::string nameGNDS(const KeyValue &keyval) // 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 std::string name = keyval.key(); + // 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; } @@ -355,8 +511,11 @@ std::string nameField(const KeyValue &keyval, const InfoSpecs &specs) // 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)); + // 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.key(); + const auto it = specs.mapName.find(name); + return capital(it == specs.mapName.end() ? name : it->second); } // namePython @@ -376,13 +535,12 @@ std::string namePython(const std::string &name) } - // ----------------------------------------------------------------------------- // Functions for getting certain information from JSON input // ----------------------------------------------------------------------------- // Get the JSON's "namespace" -std::string getFileNamespace(const nlohmann::json &j) +std::string getFileNamespace(const orderedJSON &j) { return j.contains("__namespace__") ? j["__namespace__"] @@ -390,7 +548,7 @@ std::string getFileNamespace(const nlohmann::json &j) } // Get the JSON's "type", with any relevant specs.mapMetaType entry applied -std::string getMetadatumType(const nlohmann::json &j, const InfoSpecs &specs) +std::string getMetadatumType(const orderedJSON &j, const InfoSpecs &specs) { const std::string type = j["type"]; const auto it = specs.mapMetaType.find(type); @@ -400,9 +558,9 @@ std::string getMetadatumType(const nlohmann::json &j, const InfoSpecs &specs) // 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. +// named childClass. Parameter j is the JSON value ({...}) for this child node. std::string getChildNamespace( - const nlohmann::json &j, const InfoSpecs &specs, + const orderedJSON &j, const InfoSpecs &specs, const PerClass &per, const std::string &childClass ) { // childClass' namespace... @@ -414,7 +572,7 @@ std::string getChildNamespace( // ...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 {}", + "{}::{} has a child of unknown class {}", per.nsname, per.clname, childClass ); return "unknownNamespace"; @@ -429,7 +587,13 @@ std::string getChildNamespace( 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 + 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; } @@ -440,7 +604,7 @@ std::string getChildNamespace( for (auto it = range.first; it != range.second; ++it) warn << (count++ == 0 ? "" : ", ") << it->second; log::warning( - "{}::{} has child of ambiguous class {}.\n" + "{}::{} 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() ); @@ -449,22 +613,28 @@ std::string getChildNamespace( } - // ----------------------------------------------------------------------------- // getClass* functions re: metadata, children, variant children // ----------------------------------------------------------------------------- // getClassMetadata void getClassMetadata( - const nlohmann::json &j, const InfoSpecs &specs, PerClass &per + const orderedJSON &j, const InfoSpecs &specs, + PerClass &per ) { for (const auto &field : j.items()) { + if (beginsin(field.key(), "//")) + continue; const auto &metaRHS = field.value(); // Name InfoMetadata m; + m.original = nameGNDS(field); m.name = nameField(field,specs); + // Converter, if given + m.converter = metaRHS.contains("converter") ? metaRHS["converter"] : ""; + // Type m.type = getMetadatumType(metaRHS,specs); @@ -472,13 +642,22 @@ void getClassMetadata( m.defaultValue = ""; if (metaRHS.contains("default") && !metaRHS["default"].is_null()) { 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... - assert(!metaRHS["required"]); + if (metaRHS["required"]) { + 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) @@ -491,7 +670,7 @@ void getClassMetadata( const std::string defPrefix = m.isDefaulted ? "Defaulted<" : ""; const std::string defSuffix = m.isDefaulted ? ">" : ""; - // Full type, including any optional or defaulted + // Full type, including any optional<> or Defaulted<> m.typeFull = optPrefix + defPrefix + m.type + @@ -505,25 +684,35 @@ void getClassMetadata( // getClassChildren void getClassChildren( - const nlohmann::json &j, const InfoSpecs &specs, + const orderedJSON &j, const InfoSpecs &specs, PerClass &per, Class2Dependencies &dep ) { for (const auto &field : j.items()) { + if (beginsin(field.key(), "//")) + continue; const auto &elemRHS = field.value(); // Choice children are handled elsewhere - const std::string occ = elemRHS["occurrence"]; - if (occ == "choice" || occ == "choice+" || occ == "choice2+") + const std::string times = getTimes(per, field.key(), 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.contains("converter") ? elemRHS["converter"] : ""; + c.filter = elemRHS.contains("filter") ? elemRHS["filter"] : ""; + c.label = elemRHS.contains("label") ? elemRHS["label"] : ""; + + // Type, excluding namespace + c.plain = nameClass(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; + c.ns = getChildNamespace(elemRHS, specs, per, c.plain); + c.type = c.ns + "::" + c.plain; // Optional? c.isOptional = !elemRHS["required"]; @@ -531,11 +720,11 @@ void getClassChildren( const std::string optSuffix = c.isOptional ? ">" : ""; // Vector? - c.isVector = occ == "0+" || occ == "1+" || occ == "2+"; + 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 + // Full type, including any optional<> or vector<> // If both, use optional; the reverse makes less sense c.typeFull = optPrefix + vecPrefix + @@ -553,7 +742,7 @@ void getClassChildren( // 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))); + NamespaceAndClass(c.ns,nameClass(field,specs))); // Add to per.children per.children.push_back(c); @@ -563,7 +752,7 @@ void getClassChildren( // getClassVariants void getClassVariants( - const nlohmann::json &j, const InfoSpecs &specs, + const orderedJSON &j, const InfoSpecs &specs, PerClass &per, Class2Dependencies &dep ) { // Initialize per.variants, a vector that has the "choice" @@ -585,10 +774,13 @@ void getClassVariants( // 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()) { + if (beginsin(field.key(), "//")) + continue; + // Is it a choice child? const auto &elemRHS = field.value(); - const std::string occ = elemRHS["occurrence"]; - if (occ != "choice" && occ != "choice+" && occ != "choice2+") + const std::string times = getTimes(per,field.key(),elemRHS); + if (times != "choice" && times != "choice+" && times != "choice2+") continue; // Variant name @@ -600,29 +792,33 @@ void getClassVariants( // Pass 2 for (const auto &field : j.items()) { + if (beginsin(field.key(), "//")) + continue; + // Is it a choice child? const auto &elemRHS = field.value(); - const std::string occ = elemRHS["occurrence"]; - if (occ != "choice" && occ != "choice+" && occ != "choice2+") + const std::string times = getTimes(per,field.key(),elemRHS); + if (times != "choice" && times != "choice+" && times != "choice2+") continue; // Variant name - const std::string variant = elemRHS.contains("variant") + const std::string variantName = elemRHS.contains("variant") ? elemRHS["variant"] : ""; - auto it = map.find(variant); + 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.type = nameClass(field,specs); - const std::string ns = getChildNamespace(elemRHS, specs, per, c.type); - c.type = ns + "::" + c.type; + c.ns = getChildNamespace(elemRHS, specs, per, c.plain); + c.type = c.ns + "::" + c.plain; // ...its vector-ness - c.isVector = occ == "choice+" || occ == "choice2+"; + 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 @@ -637,7 +833,7 @@ void getClassVariants( // 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))); + NamespaceAndClass(c.ns,nameClass(field,specs))); } // Pass 3 @@ -664,7 +860,6 @@ void getClassVariants( } // getClassVariants - // ----------------------------------------------------------------------------- // writer // ----------------------------------------------------------------------------- @@ -695,7 +890,7 @@ class writer { if (recurse == 0) { using last = decltype( std::get(std::make_tuple(value,args...))); - const size_t nsub = std::count(str.begin(), str.end(), substitute); + 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>; @@ -817,636 +1012,859 @@ class writer { int writer::recurse = 0; +// helper +template +void section(writer &out, const std::string &str, Ts &&...args) +{ + out(); + out(); + out(largeComment); + out(str, std::forward(args)...); + out(largeComment); +} // ----------------------------------------------------------------------------- -// write* -// Autogenerated admonishment, and class prefix/suffix +// writeClassPrefix // ----------------------------------------------------------------------------- -// Class prefix void writeClassPrefix(writer &out, const PerClass &per) { + // namespace + out("namespace @ {", per.nsname); + // 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); + // 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 @ : public Component<@@> {", - per.clname, per.clname, - per.isData - ? (",true" + (per.dataType == "" ? "" : "," + per.dataType)) - : "" - ); + 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 +// ----------------------------------------------------------------------------- +// 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" } }, + + // 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" } } +}; + + +// ----------------------------------------------------------------------------- // writeClassForComponent +// ----------------------------------------------------------------------------- + void writeClassForComponent(writer &out, const PerClass &per) { // using [name for variant] = ... - out(); + if (per.variants.size()) + out(); for (const auto &v : per.variants) { out(1,"using @ = std::variant<", v.type); - int count = 0, total = v.children.size(); + int count = 0; + const int total = v.children.size(); for (const auto &c : v.children) - out(2,"@@", c.type, ++count == total ? "" : ","); + 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,"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); + 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 + // KEYS() begin out(); - out(1,"// Core Interface multi-query to extract metadata and child nodes"); - out(1,"static auto keys()"); + 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, total = per.nfields(); - if (total == 0) - out(2,"return std::tuple<>{};"); - else { - out(2,"return"); + // KEYS() contents + int count = 0; + const int total = per.nfields() + int(per.isDataNode); + 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 ? " |" : ""); - } + // comment + out(3,"// comment"); + out(3,"++Child(special::comment) / CommentConverter{}@", + std::string(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 ? " |" : ""); - } + // 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 ? " |" : "" + ); + } - // 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 ? " |" : ""); - } + // 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 ? " |" : "" + ); + } - out(2,";"); + // 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 + // KEYS() end + out(2,";"); out(1,"}"); + + // ------------------------ + // FIELDNAMES() + // ------------------------ + out(); - out("public:"); + 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 -// Class suffix +// ----------------------------------------------------------------------------- +// writeClassSuffix +// ----------------------------------------------------------------------------- + void writeClassSuffix( - writer &out, const PerClass &per, const std::string &version + writer &out, const PerClass &per, const InfoSpecs &specs ) { + // ------------------------ // assignment + // ------------------------ + out(); out(1,smallComment); - out(1,"// Assignment"); + out(1,"// Assignment operators"); out(1,smallComment); out(); + + // copy out(1,"// copy"); - out(1,"@ &operator=(const @ &) = default;", per.clname, per.clname); + 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=(@ &&) = default;", per.clname, per.clname); + 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 \"GNDStk/@/@/@/src/custom.hpp\"", - version, per.nsname, per.clname); + 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 GNDSTK_COMPONENT"); + + // ------------------------ // 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"); +void writeClassContentMetadata( + writer &out, const PerClass &per, + std::string &title +) { + if (per.metadata.size()) { + out(); + out(1,"// 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.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("{@}", initializer(m), false); - out(";"); + out(",defaults.@", m.name, 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); + 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(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); + if (per.variants.size()) { + out(); + out(1,"// children - variant"); + } - // variant alternatives for (const auto &v : per.variants) { + out(1,"Field<@>", v.typeFull); + out(2,"@{this};", v.name); + 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); - } + out(1,"FieldPart @{@};", + v.name, c.type, c.name, v.name); } } -} // writeClassGetters - +} // ----------------------------------------------------------------------------- -// writeClassSetter* +// writeClassCtor* // ----------------------------------------------------------------------------- -// writeClassSetterChild -template // InfoChildren or InfoVariants -void writeClassSetterChild( - writer &out, const PerClass &parent, const INFO &child +// writeClassCtorComponent +void writeClassCtorComponent( + writer &out, const PerClass &per, const bool copyOrMove, + const bool newline = true ) { - // 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); + out(2,"GNDSTK_COMPONENT(@)", + std::string(copyOrMove ? "other.baseBlockData()" : "BlockData{}"), + newline); +} - 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 +// 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,"}"); +} -// writeClassSetters -void writeClassSetters(writer &out, const PerClass &per) +// writeClassCtors +void writeClassCtors(writer &out, const PerClass &per) { - out(); - out(1,smallComment); - out(1,"// Setters"); - out(1,"// non-const"); - out(1,"// All return *this"); - out(1,smallComment); + // ------------------------ + // macro + // ------------------------ - // Reminder: - // metadata can have: optional, defaulted (but not vector) - // children can have: optional, vector (but not defaulted) + int count; const int total = per.nfields(); - // 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); - } - } + out(); + out(1,"#define 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,")"); - // children, variants - for (const auto &c : per.children) writeClassSetterChild(out, per, c); - for (const auto &v : per.variants) writeClassSetterChild(out, per, v); + // ------------------------ + // ctor: default + // ------------------------ - // 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"); + writeClassCtorBody(out, "default", per.clname, ""); // ------------------------ - // ctor: fields + // ctor: from fields // ------------------------ - const auto total = per.nfields(); - if (total != 0) { + if (total > 0) { out(); - out(1,"// from fields"); + + // 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,"// std::optional replaces Defaulted; " + out(1,"// 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; + // signature + 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 ? "," : ""); + 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); + writeClassCtorComponent(out, per, false, 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 ? "," : ""); + 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(3,"@@", c.name, ++count < total ? "," : ""); + out(2,"@(this,@)@", c.name, c.name, sep(count,total)); for (const auto &v : per.variants) - out(3,"@@", v.name, ++count < total ? "," : ""); - out(2,"}"); + out(2,"@(this,@)@", v.name, v.name, sep(count,total)); // body - writeClassCtorBody(out, ""); + 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.isData) { + if (per.isDataVector && per.elementType == "") { out(); out(1,"// from vector"); out(1,"template>>"); - out(1,"@(const std::vector &vector) :", per.clname); + "std::enable_if_t>>"); + out(1,"explicit @(const std::vector &vector) :", + per.clname); writeClassCtorComponent(out, per, false); + writeClassCtorBody(out, "vector", per.clname, "vector"); + } else if (per.isDataVector) { out(); - writeClassCtorBody(out, "vector"); + 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. } -} // writeClassCtors + // ------------------------ + // 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(PerClass &per, const InfoSpecs &specs) +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); + writeClassPrefix(out, per); // output: for the Component base - writeClassForComponent(out,per); + 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.isData) - out(1,"using BodyText::operator=;"); + 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) - 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) + size_t ndefaults = 0; + for (const auto &m : per.metadata) if (m.isDefaulted) - out(2,"static inline const @ @ = @;", m.type, m.name, initializer(m)); - out(1,"} defaults;"); + ++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;"); + } - // output: content (the metadata/children computed earlier) + // section: data members out(); out(1,smallComment); - out(1,"// Raw GNDS content"); + out(1,"// Data members"); out(1,smallComment); + + // output: comment out(); - out(1,"struct {"); - writeClassContentMetadata(out, per); + out(1,"// comment"); + out(1,"Field> comment{this};"); + + // output: fields + writeClassContentMetadata(out, per, title); 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); + // 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 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,"GNDSTK_SHORTCUT(@,@);", full, name); + } + + out(1,"#undef GNDSTK_SHORTCUT"); } // output: constructors out(); out(1,smallComment); - out(1,"// Construction"); + out(1,"// Constructors"); out(1,smallComment); writeClassCtors(out, per); // output: class end - writeClassSuffix(out, per, specs.Version); + writeClassSuffix(out, per, specs); // done - per.code = out.str(); + code = out.str(); } // writeClass - // ----------------------------------------------------------------------------- // Miscellaneous functions for getting JSON content // ----------------------------------------------------------------------------- // readJSONFile -nlohmann::json readJSONFile(const std::string &file, const bool print = false) +orderedJSON 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 + // Depending on the call context, we might or might not 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; + 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); @@ -1455,55 +1873,38 @@ nlohmann::json readJSONFile(const std::string &file, const bool print = false) throw std::exception{}; } - nlohmann::json j; + orderedJSON j; ifs >> j; return j; } // readJSONFile // getMetadataJSON -template -auto getMetadataJSON(const nlohmann::json &j) +orderedJSON getMetadataJSON(const orderedJSON &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{}); - } + assert(!(meta && attr)); // not both + return meta ? j[metastr] : attr ? j[attrstr] : orderedJSON{}; } // getMetadataJSON // getChildrenJSON -template -auto getChildrenJSON(const nlohmann::json &j) +orderedJSON getChildrenJSON(const orderedJSON &j) { static const std::string chldstr = "children"; static const std::string nodestr = "childNodes"; - const bool chld = j.contains(chldstr); const bool node = j.contains(nodestr); - 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{}); - } + assert(!(chld && node)); // not both + return chld ? j[chldstr] : node ? j[nodestr] : orderedJSON{}; } // getChildrenJSON - // ----------------------------------------------------------------------------- // commandLine and its helper functions // ----------------------------------------------------------------------------- @@ -1511,7 +1912,7 @@ auto getChildrenJSON(const nlohmann::json &j) // readChangesFile void readChangesFile(const std::string &file, InfoSpecs &specs) { - const nlohmann::json jchanges = readJSONFile(file); + const orderedJSON jchanges = readJSONFile(file); using pair = std::pair; // Changes to name? @@ -1521,95 +1922,123 @@ void readChangesFile(const std::string &file, InfoSpecs &specs) 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())); - } + const orderedJSON metadata = getMetadataJSON(jchanges); + + // 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) { - const nlohmann::json &jfile = readJSONFile(file,true); + const orderedJSON &jfile = readJSONFile(file,true); for (const auto &item : jfile.items()) { - const std::string parent = item.key(); - const nlohmann::json rhs = item.value(); + if (beginsin(item.key(), "//")) + continue; + + const orderedJSON rhs = item.value(); if (!isClass(item)) continue; - const auto metadata = getMetadataJSON(rhs); - const auto children = getChildrenJSON(rhs); + const bool hasdata = + (rhs.contains("string" ) && !rhs["string" ].is_null()) || + (rhs.contains("vector" ) && !rhs["vector" ].is_null()) || + (rhs.contains("bodyText") && !rhs["bodyText"].is_null()); - 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); + const orderedJSON metadata = getMetadataJSON(rhs); + const orderedJSON children = getChildrenJSON(rhs); + + const std::string parent = item.key(); + 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 +// 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) { + if (argc < 2) { std::cout << "Usage: " << argv[0] << " file.json" << std::endl; exit(EXIT_FAILURE); } // Input file - const nlohmann::json jmain = readJSONFile(argv[1]); + const orderedJSON 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 changes = "Changes"; + + // Need "Version" + if (!jmain.contains(version)) { + log::error("The input JSON file needs {}", version); + throw std::exception{}; + } - // 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); + // Need "JSONFiles" + if (!jmain.contains(files)) { + log::error("The input JSON file needs {}", files); throw std::exception{}; } - // 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]; + // Extract information from the command line JSON file... + // ...these are optional: + specs.Path = jmain.contains(path ) ? jmain[path ] : "."; + specs.Project = jmain.contains(project) ? jmain[project] : "GNDStk"; + specs.JSONDir = jmain.contains(input ) ? jmain[input ] : "."; + // ...these are required: + specs.Version = jmain[version]; + for (const auto &str : jmain[files]) + specs.JSONFiles.push_back(str); + + // 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 - specs.hppVersion = specs.GNDSDir + "/src/GNDStk/" + specs.Version + ".hpp"; - specs.hppKey = specs.GNDSDir + "/src/GNDStk/" + specs.Version + "/key.hpp"; + // File names... - // Report on "singletons" - if (singletons) { - action("Finding possible simplifications"); - for (const std::string &file : specs.JSONFiles) - printSingletons(file); - } + // 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"; // Changes? if (jmain.contains(changes)) @@ -1617,7 +2046,6 @@ void commandLine( } // commandLine - // ----------------------------------------------------------------------------- // preprocess* functions // ----------------------------------------------------------------------------- @@ -1637,44 +2065,83 @@ void preprocessClass( specs.class2nspace.insert(std::make_pair(clname,nsname)); // ------------------------ - // Create directories and - // custom files as needed + // Create directories // ------------------------ - // 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"; + // 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; + + // 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"; // 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()); + system(("mkdir -p " + nsdircpp ).data()); + system(("mkdir -p " + nsdirpy ).data()); + system(("mkdir -p " + nsdirc ).data()); + system(("mkdir -p " + clsrccpp ).data()); + system(("mkdir -p " + cltestcpp).data()); + system(("mkdir -p " + clsrcc ).data()); + system(("mkdir -p " + cltestc ).data()); + + // ------------------------ + // Create custom files + // ------------------------ // 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; - - writer out(custom,false); // false: no "file was autogenerated" message + // 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 // ------------------------ @@ -1688,11 +2155,14 @@ void preprocessClass( // For this namespace::class: // The cpp file for Python // The hpp file for GNDStk + // The C/C++ header, and the C++ backend for the C interface 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"; + 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"; } // preprocessClass @@ -1708,10 +2178,9 @@ void preprocessClass( // 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 orderedJSON jmain = readJSONFile(file,true); const std::string nsname = getFileNamespace(jmain); // classes in the file for (const auto &cl : jmain.items()) @@ -1720,17 +2189,18 @@ void preprocessFiles(InfoSpecs &specs) } // preprocessFiles - // ----------------------------------------------------------------------------- // validate* // getClass -// getFiles +// getFilesAndClasses // ----------------------------------------------------------------------------- // Helper: validateMetadata -void validateMetadata(const nlohmann::json &metadata) +void validateMetadata(const orderedJSON &metadata) { for (const auto &field : metadata.items()) { + if (beginsin(field.key(), "//")) + continue; assert(field.value().contains("type")); assert(field.value().contains("required")); } @@ -1738,19 +2208,34 @@ void validateMetadata(const nlohmann::json &metadata) // Helper: validateChildren -void validateChildren(const nlohmann::json &children) +void validateChildren(const orderedJSON &children, const PerClass &per) { for (const auto &field : children.items()) { - assert(field.value().contains("occurrence")); + if (beginsin(field.key(), "//")) + continue; assert(field.value().contains("required")); - // Consistency check: certain "occurrence" values imply *not* 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+") + const std::string times = getTimes(per,field.key(),field.value()); + if (times == "0+" || times == "choice" || times == "choice+") assert(!field.value()["required"]); // not required + + if (debugging) { + const std::string key = field.key(); + const std::string name = field.value().contains("name") + ? std::string(field.value()["name"]) + : 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; + } } } @@ -1759,14 +2244,12 @@ void validateChildren(const nlohmann::json &children) 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 @@ -1776,48 +2259,55 @@ void getClass( // names per.nsname = nsname; per.clname = clname; - per.nameGNDS = nameGNDS(keyval); + per.nameGNDS = nameGNDS(keyval,nsname,true); // metadata/children information - const nlohmann::json attrs = getMetadataJSON(classRHS); - const nlohmann::json elems = getChildrenJSON(classRHS); + const auto &classRHS = keyval.value(); + const orderedJSON attrs = getMetadataJSON(classRHS); + const orderedJSON elems = getChildrenJSON(classRHS); validateMetadata(attrs); - validateChildren(elems); + validateChildren(elems, per); getClassMetadata(attrs, specs, per); getClassChildren(elems, specs, per, dep); getClassVariants(elems, specs, per, dep); // 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); + const bool + str = classRHS.contains("string" ) && !classRHS["string" ].is_null(), + vec = classRHS.contains("vector" ) && !classRHS["vector" ].is_null(), + body = classRHS.contains("bodyText") && !classRHS["bodyText"].is_null(); + 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"]; + 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.contains("cdata") && classRHS["cdata"]; // save dependencies specs.ClassDependenciesRaw.push_back(dep); } // getClass -// getFiles -void getFiles(InfoSpecs &specs) +// getFilesAndClasses +void getFilesAndClasses(InfoSpecs &specs) { - action("Creating classes"); - // files + // each file for (const std::string &file : specs.JSONFiles) { - const nlohmann::json jmain = readJSONFile(file,true); + const orderedJSON jmain = readJSONFile(file); const std::string nsname = getFileNamespace(jmain); - // classes in the file + // each class for (const auto &cl : jmain.items()) getClass(specs, nsname, cl); } -} // getFiles - +} // getFilesAndClasses // ----------------------------------------------------------------------------- @@ -1856,61 +2346,91 @@ void sortDependencies(InfoSpecs &specs) } - // ----------------------------------------------------------------------------- -// Functions for creating output files +// For the C++ header files +// fileGNDStkVersion +// fileGNDStkKey +// fileGNDStkClass // ----------------------------------------------------------------------------- +// ------------------------ // 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)); + // ------------------------ + // Create a C++ header + // for this version + // ------------------------ - 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); + { + writer out(specs.hppVersion); + out(); + out("#ifndef @_@", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); + out("#define @_@", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); + + 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"); } - out(); - out("#include \"GNDStk/@/key.hpp\"", specs.Version); - 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 -// 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) { @@ -1930,7 +2450,7 @@ void fileGNDStkKey(const InfoSpecs &specs) std::multimap> namespace2children; for (const auto &file : specs.JSONFiles) { - const nlohmann::json jmain = readJSONFile(file); + const orderedJSON jmain = readJSONFile(file); auto it = namespace2children.insert( std::make_pair(getFileNamespace(jmain),std::set{})); @@ -1939,14 +2459,17 @@ void fileGNDStkKey(const InfoSpecs &specs) // nodes ==> children it->second.insert(std::make_pair( nameField(node,specs), - nameGNDS (node))); + nameGNDS(node))); // attributes ==> metadata - const auto attrs = getMetadataJSON(node.value()); - for (const auto &attr : attrs.items()) + const orderedJSON attrs = getMetadataJSON(node.value()); + for (const auto &attr : attrs.items()) { + if (beginsin(attr.key(), "//")) + continue; metadata.insert(std::make_pair( nameField(attr,specs), - nameGNDS (attr))); + nameGNDS(attr))); + } } } } @@ -1958,54 +2481,60 @@ void fileGNDStkKey(const InfoSpecs &specs) writer out(specs.hppKey); out(); - out("/*",false); - out(file_key_comment,false); - out("*/"); + out("#ifndef @_@_KEY", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); + out("#define @_@_KEY", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); out(); - out("#ifndef NJOY_GNDSTK_@_KEY", allcaps(specs.VersionUnderscore)); - out("#define NJOY_GNDSTK_@_KEY", allcaps(specs.VersionUnderscore)); + out("// GNDStk Core Interface"); + out("#include \"GNDStk.hpp\""); out(); - out("namespace njoy {"); - out("namespace GNDStk {"); + 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(); - out(largeComment); - out("// key::meta::"); - out(largeComment); - out(); - out("namespace key {"); out("namespace meta {"); if (metadata.size() > 0) { out(); + out(0,"#define 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("inline const Meta<> @(\"@\");", meta.first, meta.second); + out("GNDSTK_MAKE_LOOKUP(@,@);", meta.first, meta.second); + out(); + out(0,"#undef GNDSTK_MAKE_LOOKUP"); out(); } out("} // namespace meta"); - out("using namespace meta;"); - out("} // namespace key"); // ------------------------ // Child<> objects // ------------------------ for (const auto &nspace : namespace2children) { - out(); - out(); - out(largeComment); - out("// @::key::child::", nspace.first); - out(largeComment); + section(out, "// @::child::", nspace.first); out(); out("namespace @ {", nspace.first); - out("namespace key {"); out("namespace child {"); const auto &children = nspace.second; @@ -2018,10 +2547,25 @@ void fileGNDStkKey(const InfoSpecs &specs) out("} // namespace child"); out("using namespace child;"); - out("} // namespace key"); 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 // ------------------------ @@ -2032,62 +2576,1005 @@ void fileGNDStkKey(const InfoSpecs &specs) out(largeComment); out(); out("} // namespace @", specs.VersionUnderscore); - out("} // namespace GNDStk"); - out("} // namespace njoy"); + 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 = - "NJOY_GNDSTK_" + allcaps(specs.VersionUnderscore) + "_" + - allcaps(per.nsname) + "_" + allcaps(per.clname); + allcaps(specs.Project) + "_" + + 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(); + 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(); - out("namespace njoy {"); - out("namespace GNDStk {"); + if (specs.Project == "GNDStk") + out("namespace njoy {"); + out("namespace @ {", specs.Project); 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("} // namespace @", specs.Project); + if (specs.Project == "GNDStk") + out("} // namespace njoy"); out(); out("#endif"); } // fileGNDStkClass -// filePythonNamespace -void filePythonNamespace(const InfoSpecs &specs, const PerNamespace &per) +// ----------------------------------------------------------------------------- +// C interface: +// Helpers +// ----------------------------------------------------------------------------- + +// two +// Forward args to two places: header and source +template +void two(writer &hdr, writer &src, Ts &&...args) { - writer out(per.cppPython); + 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{"); +} + +// mtype_param +// Get metadata type, for C interface +std::string mtype_param(const InfoMetadata &m) +{ + return m.type == "std::string" + ? "char *const" + : m.type; +} + +// mtype_return +// Get metadata type, for C interface +std::string mtype_return(const InfoMetadata &m) +{ + return m.type == "std::string" + ? "const char *" + : m.type; +} + +// ctype +// Get child-node type, for 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); +} + + +// ----------------------------------------------------------------------------- +// C interface: +// fileCInterfaceCreate* +// ----------------------------------------------------------------------------- + +// 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 @ @@", + mtype_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("}"); +} + + +// ----------------------------------------------------------------------------- +// C interface: +// 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"); + 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"); + 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 + + +// ----------------------------------------------------------------------------- +// C interface: +// 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 + + +// ----------------------------------------------------------------------------- +// C interface: +// 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) + // Class: "Foobar" (class type; for brevity) + // types: "doubles" + // Types: "Doubles" + const std::string Class = per.clname; + const std::string types = type + 's'; + const std::string Types = capital(type) + 's'; + + 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("}"); + + 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("}"); + + 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("}"); + + 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("}"); + + 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("}"); + + 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("}"); + + 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 + + +// ----------------------------------------------------------------------------- +// C interface: +// 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 + // if (m.isOptional) // <== may or may not want this + { + 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,"@", mtype_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, mtype_param(m), meta, false); + sig(hdr,src); + src(1,"detail::setField"); + src(2,"(CLASSNAME, CLASSNAME+\"@Set\", self, extract::@, @);", + Meta, meta, meta); + src("}"); +} + + +// ----------------------------------------------------------------------------- +// C interface: +// fileCInterfaceChild +// ----------------------------------------------------------------------------- + +void fileCInterfaceChild( + writer &hdr, writer &src, + const InfoSpecs &specs, + const PerClass &per, const InfoChildren &c +) { + 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 + // if (c.isOptional) // <== may or may not want this + { + 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("}"); + + 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: has, get, set + 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; + } + + for (const auto &m : it->second.metadata) { + const std::string Meta = UpperCamel(m.name); + const std::string meta = m.name; + + // 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 @ @", mtype_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 @ @", mtype_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 @ @", mtype_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 @ @,", mtype_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 Determine how the C interface should deal with C++ variants + + // 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, specs, per, c); + + // 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 + + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// For the Python interface +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +// filePythonNamespace +// ----------------------------------------------------------------------------- + +void filePythonNamespace(const InfoSpecs &specs, const PerNamespace &per) +{ + writer out(per.cppPython); out(); out("#include "); out("#include "); out(); - out("namespace python = pybind11;"); + out("namespace py = pybind11;"); out(); out("// @ interface", specs.Version); out("namespace python_@ {", specs.VersionUnderscore); @@ -2095,24 +3582,27 @@ void filePythonNamespace(const InfoSpecs &specs, const PerNamespace &per) out(); out("// @ declarations", per.nsname); out("namespace python_@ {", per.nsname); - for (auto &cl : specs.ClassDependenciesSorted) + for (const auto &cl : specs.ClassDependenciesSorted) if (cl.theClass.nsname == per.nsname) - out(1,"void wrap@(python::module &);", cl.theClass.clname); + out(1,"void wrap@(py::module &);", cl.theClass.clname); out("} // namespace python_@", per.nsname); out(); - out("// @ wrapper", per.nsname); - out("void wrap@(python::module &module)", capital(per.nsname)); + out("// wrapper for @", per.nsname); + out("void wrap@(py::module &module)", capital(per.nsname)); out("{"); out(1,"// create the @ submodule", per.nsname); - out(1,"python::module submodule = module.def_submodule("); + out(1,"py::module submodule = module.def_submodule("); out(2,"\"@\",", per.nsname); - out(2,"\"GNDS @ @\"", specs.Version, per.nsname); + if (specs.Project == "GNDStk") + out(2,"\"GNDS @ @\"", specs.Version, per.nsname); // "GNDS", not "GNDStk" + else + out(2,"\"@ @ @\"", specs.Project, specs.Version, per.nsname); out(1,");"); out(); out(1,"// wrap @ components", per.nsname); - for (auto &cl : specs.ClassDependenciesSorted) + for (const auto &cl : specs.ClassDependenciesSorted) if (cl.theClass.nsname == per.nsname) out(1,"python_@::wrap@(submodule);", per.nsname, cl.theClass.clname); out("};"); @@ -2121,74 +3611,37 @@ void filePythonNamespace(const InfoSpecs &specs, const PerNamespace &per) } // 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 ); + 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 "); @@ -2196,144 +3649,590 @@ void filePythonClass(const InfoSpecs &specs, const PerClass &per) out(); out("// local includes"); - out("#include \"GNDStk/@/@/@.hpp\"", specs.Version, nsname, clname); + out("#include \"@/@/@/@.hpp\"", + specs.Project, specs.Version, nsname, clname); out("#include \"definitions.hpp\""); out(); out("// namespace aliases"); - out("namespace python = pybind11;"); + out("namespace py = pybind11;"); out(); out("namespace python_@ {", specs.VersionUnderscore); out("namespace python_@ {", nsname); out(); - out("// @ wrapper", clname); - out("void wrap@(python::module &module)", clname); + out("// wrapper for @::@", nsname, clname); + out("void wrap@(py::module &module)", clname); out("{"); - out(1,"using namespace njoy::GNDStk;"); - out(1,"using namespace njoy::GNDStk::@;", specs.VersionUnderscore); + 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 Component = @::@;", nsname, clname); + 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, total = v.children.size(); + int count = 0; + const int total = v.children.size(); for (const auto &c : v.children) - out(2, "@@", c.type, ++count == total ? "" : ","); + out(2,"@@", c.type, sep(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,"// create the Python object"); + out(1,"py::class_ object("); + out(2,"module, \"@\",", clname); + out(2,"cppCLASS::component_t::documentation().data()"); out(1,");"); + + // ------------------------ + // py::init<...> + // for construction from + // metadata and children + // ------------------------ + + int count = 0; + const int total = per.nfields(); + 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(\"@\")@,", + out(1,"// constructor: from fields"); + out(1,"object.def("); + out(2,"py::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,"py::arg(\"@\")@,", namePython(m.name), m.isOptional || m.isDefaulted ? " = std::nullopt" : ""); - for (auto &c : per.children) - out(3,"python::arg(\"@\")@,", namePython(c.name), + for (const auto &c : per.children) + out(2,"py::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) { + for (const auto &v : per.variants) + out(2,"py::arg(\"@\"),", + namePython(v.name)); + out(2,"cppCLASS::component_t::documentation(\"constructor\").data()"); + out(1,");"); // object.def( + + // ------------------------ + // py::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,"py::init<"); + out(3,"const std::vector<@> &", dataTypeName.first); + out(2,">(),"); + out(2,"py::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(2,".def_property_readonly("); - out(3,"\"@\",", pyname); + 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(3,"[](const Component &self) { return self.@().value(); },", - m.name) - : out(3,"&Component::@,", - m.name); - out(3,"Component::documentation(\"@\").data()", pyname); - out(2,")"); + ? 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,");"); } - for (auto &c : per.children) { + // ------------------------ + // def_property + // children + // ------------------------ + + for (const 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,")"); + 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,");"); } - for (auto &v : per.variants) { - if (!v.isVector) - for (auto &c : v.children) { + // ------------------------ + // 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(2,".def_property_readonly("); - out(3,"\"@\",", pyname); - out(3,"python::overload_cast<>(&Component::@),", c.name); - out(3,"Component::documentation(\"@\").data()", pyname); - out(2,")"); + 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(2,".def_property_readonly("); - out(3,"\"@\",", pyname); - out(3,"python::overload_cast<>(&Component::@),", v.name); - out(3,"Component::documentation(\"@\").data()", pyname); - out(2,")"); + 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,");"); } - 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,")"); + // ------------------------ + // 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(1,";"); + // ------------------------ + out(); - out(1,"// add standard component definitions"); - out(1,"addStandardComponentDefinitions< Component >( component );"); + out(1,"// add standard definitions"); + out(1,"addStandardComponentDefinitions(object);"); out("}"); + out(); out("} // namespace python_@", nsname); out("} // namespace python_@", specs.VersionUnderscore); } // filePythonClass +// ----------------------------------------------------------------------------- +// 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 +} + // ----------------------------------------------------------------------------- // main @@ -2342,41 +4241,105 @@ void filePythonClass(const InfoSpecs &specs, const PerClass &per) int main(const int argc, const char *const *const argv) { // For GNDStk's diagnostics - color = true; + colors = true; + + // ------------------------ + // Read .json + // ------------------------ // 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); + // ------------------------ + // Simplifications? + // ------------------------ + + // REPORT regarding potential simplifications + if (singletons) { + action("Finding Potential Simplifications"); + for (const std::string &file : specs.JSONFiles) + printSingletons(file); + } + + // ------------------------ + // Preprocessing + // ------------------------ + // PREPROCESS, to get information needed upfront for detailed processing + action("Preprocessing"); preprocessFiles(specs); - - // PRINT CLASS CODE into temporary strings, which are written to the - // class-specific files later, after class dependencies are computed - getFiles(specs); + getFilesAndClasses(specs); // COMPUTE AN ORDERING that respects dependencies sortDependencies(specs); - // GNDStk hpp file for this GNDS version + // ------------------------ + // Shortcuts + // ------------------------ + + // 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 this 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); + + // ------------------------ + // C++ + // ------------------------ + + // 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); - // GNDStk hpp file for Meta and Child keys + // Create 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); - } + // For each namespace::class: create GNDStk hpp file + for (const auto &obj : specs.ClassDependenciesSorted) + fileGNDStkClass(specs, specs.class2data.find(obj.theClass)->second, obj); - // Python cpp file for each namespace - for (auto &obj : specs.namespace2data) - filePythonNamespace(specs, obj.second); + // ------------------------ + // C Interface + // ------------------------ + + // For each namespace::class: create header+source files for the C interface + action("Writing Code: C Interface"); + for (const auto &obj : specs.ClassDependenciesSorted) + fileCInterface(specs, specs.class2data.find(obj.theClass)->second, obj); - // Python cpp file for each namespace::class - for (auto &obj : specs.class2data) + // ------------------------ + // Python Interface + // ------------------------ + + // Create Python cpp file for each namespace + // Create Python cpp file for each namespace::class + action("Writing Code: Python Interface"); + for (const auto &obj : specs.namespace2data) + filePythonNamespace(specs, obj.second); + 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/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/v1.9/containers.python.cpp b/autogen/prototype/proto/python/src/v1.9/containers.python.cpp new file mode 100644 index 000000000..e13f37238 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers.python.cpp @@ -0,0 +1,43 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v1.9 interface +namespace python_v1_9 { + +// containers declarations +namespace python_containers { + void wrapLink(py::module &); + void wrapAxis(py::module &); + void wrapValues(py::module &); + void wrapGrid(py::module &); + void wrapAxes(py::module &); + void wrapXYs1d(py::module &); + void wrapRegions1d(py::module &); +} // namespace python_containers + +// wrapper for containers +void wrapContainers(py::module &module) +{ + // create the containers submodule + py::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..29e54610e --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Axes.python.cpp @@ -0,0 +1,81 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Axes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Axes +void wrapAxes(py::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 + py::class_ object( + module, "Axes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::vector & + >(), + py::arg("href") = std::nullopt, + py::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..6ab3c8bc8 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Axis.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Axis.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Axis +void wrapAxis(py::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Axis; + + // create the Python object + py::class_ object( + module, "Axis", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("index") = std::nullopt, + py::arg("label") = std::nullopt, + py::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..dff7a27fc --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Grid.python.cpp @@ -0,0 +1,171 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Grid.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Grid +void wrapGrid(py::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 + py::class_ object( + module, "Grid", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const link_values_t & + >(), + py::arg("index") = std::nullopt, + py::arg("interpolation") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("style") = std::nullopt, + py::arg("unit") = std::nullopt, + py::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..479103d85 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Link.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Link.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Link +void wrapLink(py::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Link; + + // create the Python object + py::class_ object( + module, "Link", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::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..4a363a7a4 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Regions1d.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Regions1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Regions1d +void wrapRegions1d(py::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Regions1d; + + // create the Python object + py::class_ object( + module, "Regions1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::vector & + >(), + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::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..476f0a667 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Values.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Values.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Values +void wrapValues(py::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Values; + + // create the Python object + py::class_ object( + module, "Values", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("value_type") = std::nullopt, + py::arg("start") = std::nullopt, + py::arg("length") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::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..61f2a6b03 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/XYs1d.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/XYs1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::XYs1d +void wrapXYs1d(py::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::XYs1d; + + // create the Python object + py::class_ object( + module, "XYs1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Values & + >(), + py::arg("index") = std::nullopt, + py::arg("interpolation") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::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/python/src/v1.9/GNDS.python.cpp b/autogen/prototype/proto/python/src/v1.9/proto.python.cpp similarity index 100% rename from python/src/v1.9/GNDS.python.cpp rename to autogen/prototype/proto/python/src/v1.9/proto.python.cpp 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..165343a14 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v1.9 interface +namespace python_v1_9 { + +// transport declarations +namespace python_transport { + void wrapCrossSection(py::module &); + void wrapReaction(py::module &); + void wrapReactions(py::module &); + void wrapReactionSuite(py::module &); +} // namespace python_transport + +// wrapper for transport +void wrapTransport(py::module &module) +{ + // create the transport submodule + py::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..41d3b3e37 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport/CrossSection.python.cpp @@ -0,0 +1,65 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/transport/CrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_transport { + +// wrapper for transport::CrossSection +void wrapCrossSection(py::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 + py::class_ object( + module, "CrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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..7da7ab35c --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport/Reaction.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/transport/Reaction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_transport { + +// wrapper for transport::Reaction +void wrapReaction(py::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = transport::Reaction; + + // create the Python object + py::class_ object( + module, "Reaction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const int &, + const std::optional &, + const std::string &, + const transport::CrossSection & + >(), + py::arg("endf_mt"), + py::arg("fission_genre") = std::nullopt, + py::arg("label"), + py::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..e06f243b9 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport/ReactionSuite.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/transport/ReactionSuite.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_transport { + +// wrapper for transport::ReactionSuite +void wrapReactionSuite(py::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = transport::ReactionSuite; + + // create the Python object + py::class_ object( + module, "ReactionSuite", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string &, + const enums::Frame &, + const std::string &, + const std::optional &, + const std::optional & + >(), + py::arg("evaluation"), + py::arg("format"), + py::arg("projectile"), + py::arg("projectile_frame"), + py::arg("target"), + py::arg("interaction") = std::nullopt, + py::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..25cc19c9f --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport/Reactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/transport/Reactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1_9 { +namespace python_transport { + +// wrapper for transport::Reactions +void wrapReactions(py::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = transport::Reactions; + + // create the Python object + py::class_ object( + module, "Reactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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..b9293a85b --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->axis_grid \ + ) + + // default + Axes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axes( + const wrapper> + &href, + const wrapper> + &axis_grid = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href), + axis_grid(this,axis_grid) + { + Component::finish(); + } + + // from node + explicit Axes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axes(const Axes &other) : + 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) : + 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 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..da83dc625 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Axes/test/Axes.test.cpp @@ -0,0 +1,335 @@ + +#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.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[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[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(label("radius"))]); + CHECK(component.axis.has(label("radius"))); + CHECK(component.axis_grid.has(label)); + CHECK(component.axis_grid.has(label("radius"))); + decltype(auto) axis_v0 = component.axis[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(label("energy_in"))]); + CHECK(component.axis.has(label("energy_in"))); + CHECK(component.axis_grid.has(label)); + CHECK(component.axis_grid.has(label("energy_in"))); + decltype(auto) axis_v1 = component.axis[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..94f78889c --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->label, \ + this->unit \ + ) + + // default + Axis() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axis( + const wrapper> + &index, + const wrapper> + &label = {}, + const wrapper> + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + label(this,label), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Axis(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axis(const Axis &other) : + 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) : + 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 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..390294922 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Grid.hpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_CONTAINERS_GRID +#define PROTO_V1_9_CONTAINERS_GRID + +#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{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 enums::Interpolation interpolation = 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->interpolation, \ + this->label, \ + this->style, \ + this->unit, \ + this->link_values \ + ) + + // default + Grid() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Grid(const Grid &other) : + 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) : + 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 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..1a98ebcec --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Grid/test/Grid.test.cpp @@ -0,0 +1,310 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "proto/v1.9/containers/Grid.hpp" + +// 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"; + enums::GridStyle style = enums::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"; + 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 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( 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/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..58bb142a1 --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Link() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Link( + const wrapper + &href + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Link(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Link(const Link &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Link(Link &&other) : + 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 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..94561816f --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->XYs1d \ + ) + + // default + Regions1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Regions1d( + const wrapper> + &label, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper> + &XYs1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit Regions1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Regions1d(const Regions1d &other) : + 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) : + 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 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 83% 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..3175fa715 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,15 @@ + #define CATCH_CONFIG_MAIN #include "catch.hpp" -#include "GNDStk/v1.9/containers/Regions1d.hpp" +#include "proto/v1.9/containers/Regions1d.hpp" // 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 +23,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 +65,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 +108,7 @@ SCENARIO( "Regions1d" ) { } // THEN } // WHEN - WHEN( "the data is moved" ) { + WHEN( "the data are moved" ) { Node node; node << chunk(); @@ -143,18 +149,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 +171,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 +180,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() ); @@ -224,15 +231,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..c6c59fa6b --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->valueType, \ + this->start, \ + this->length \ + ) + + // default + Values() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Values(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Values(const Values &other) : + 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) : + 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 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..7ae755e1e --- /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 ) : + 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..2b3937b9c --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/XYs1d.hpp @@ -0,0 +1,260 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_CONTAINERS_XYS1D +#define PROTO_V1_9_CONTAINERS_XYS1D + +#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{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 enums::Interpolation interpolation = 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->interpolation, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->values \ + ) + + // default + XYs1d() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs1d(const XYs1d &other) : + 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) : + 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 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 87% 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..1429a2a15 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,15 @@ + #define CATCH_CONFIG_MAIN #include "catch.hpp" -#include "GNDStk/v1.9/containers/XYs1d.hpp" +#include "proto/v1.9/containers/XYs1d.hpp" // 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 +22,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 +52,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 +95,7 @@ SCENARIO( "XYs1d" ) { } // THEN } // WHEN - WHEN( "the data is moved" ) { + WHEN( "the data are moved" ) { Node node; node << chunk(); @@ -135,9 +140,8 @@ R"***( - 1e-05 1 0.0253 2 2500 3 - -)***"; + 1e-05 1 0.0253 2 2500 3 +)***"; } void verifyChunk( const XYs1d& component ) { @@ -150,7 +154,8 @@ void verifyChunk( const XYs1d& component ) { CHECK( enums::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 +165,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 +202,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..52dca868a --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/key.hpp @@ -0,0 +1,114 @@ + +// 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 GNDSTK_MAKE_LOOKUP(nameField,nameGNDS) \ + inline const auto nameField = makeLookup( \ + #nameGNDS, \ + [](const auto &obj) -> decltype(obj.nameField()) \ + { return obj.nameField(); } \ + ) +// nameField vs. nameGNDS: for, e.g., Double vs. double in GNDS + +GNDSTK_MAKE_LOOKUP(ENDF_MT,ENDF_MT); +GNDSTK_MAKE_LOOKUP(evaluation,evaluation); +GNDSTK_MAKE_LOOKUP(fissionGenre,fissionGenre); +GNDSTK_MAKE_LOOKUP(format,format); +GNDSTK_MAKE_LOOKUP(href,href); +GNDSTK_MAKE_LOOKUP(index,index); +GNDSTK_MAKE_LOOKUP(interaction,interaction); +GNDSTK_MAKE_LOOKUP(interpolation,interpolation); +GNDSTK_MAKE_LOOKUP(label,label); +GNDSTK_MAKE_LOOKUP(length,length); +GNDSTK_MAKE_LOOKUP(outerDomainValue,outerDomainValue); +GNDSTK_MAKE_LOOKUP(projectile,projectile); +GNDSTK_MAKE_LOOKUP(projectileFrame,projectileFrame); +GNDSTK_MAKE_LOOKUP(start,start); +GNDSTK_MAKE_LOOKUP(style,style); +GNDSTK_MAKE_LOOKUP(target,target); +GNDSTK_MAKE_LOOKUP(unit,unit); +GNDSTK_MAKE_LOOKUP(valueType,valueType); + +#undef 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..f4914035b --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d_regions1d \ + ) + + // default + CrossSection() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSection( + const wrapper> + &XYs1d_regions1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d_regions1d(this,XYs1d_regions1d) + { + Component::finish(); + } + + // from node + explicit CrossSection(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSection(const CrossSection &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d_regions1d(this,other.XYs1d_regions1d) + { + Component::finish(other); + } + + // move + CrossSection(CrossSection &&other) : + 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 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..749405b8c --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MT, \ + this->fissionGenre, \ + this->label, \ + this->crossSection \ + ) + + // default + Reaction() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reaction( + const wrapper + &ENDF_MT, + const wrapper> + &fissionGenre = {}, + const wrapper + &label = {}, + const wrapper + &crossSection = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reaction(const Reaction &other) : + 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) : + 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 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..74bb5ccda --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->evaluation, \ + this->format, \ + this->projectile, \ + this->projectileFrame, \ + this->target, \ + this->interaction, \ + this->reactions \ + ) + + // default + ReactionSuite() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ReactionSuite(const ReactionSuite &other) : + 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) : + 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 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..5d538bebe --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->reaction \ + ) + + // default + Reactions() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reactions( + const wrapper> + &reaction + ) : + GNDSTK_COMPONENT(BlockData{}), + reaction(this,reaction) + { + Component::finish(); + } + + // from node + explicit Reactions(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reactions(const Reactions &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + reaction(this,other.reaction) + { + Component::finish(other); + } + + // move + Reactions(Reactions &&other) : + 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 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..d6e8efc30 --- /dev/null +++ b/autogen/simple/compile-c @@ -0,0 +1,47 @@ +#!/bin/bash + +# C++ compilation command +COMPILE=" + clang++ -std=c++17 + -I../../../GNDStk/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/json-src/include + -I../../../GNDStk/build/_deps/json-src/include/nlohmann + -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..7411e1bba --- /dev/null +++ b/autogen/simple/compile-cpp @@ -0,0 +1,31 @@ +#!/bin/bash + +# C++ compilation command +COMPILE=" + clang++ -std=c++17 + -I../../../GNDStk/src + -Imulti/src + -I../../../GNDStk/build/_deps/pugixml-adapter-src/src/src + -I../../../GNDStk/build/_deps/hdf5-src/include + -I../../../GNDStk/build/_deps/json-src/include + -I../../../GNDStk/build/_deps/json-src/include/nlohmann + -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..485934881 --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup.python.cpp @@ -0,0 +1,39 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v1 interface +namespace python_v1 { + +// multigroup declarations +namespace python_multigroup { + void wrapIsotope(py::module &); + void wrapFoobar(py::module &); + void wrapElement(py::module &); + void wrapLibrary(py::module &); + void wrapMultigroup(py::module &); +} // namespace python_multigroup + +// wrapper for multigroup +void wrapMultigroup(py::module &module) +{ + // create the multigroup submodule + py::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..ff70f49a2 --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Element.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Element.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Element +void wrapElement(py::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Element; + + // create the Python object + py::class_ object( + module, "Element", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const int &, + const std::vector &, + const std::optional & + >(), + py::arg("symbol") = std::nullopt, + py::arg("atomic_number"), + py::arg("isotope"), + py::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..b0dc32357 --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Foobar.python.cpp @@ -0,0 +1,85 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Foobar.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Foobar +void wrapFoobar(py::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Foobar; + + // create the Python object + py::class_ object( + module, "Foobar", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::arg("value"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::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..94d87904f --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Isotope.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Isotope.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Isotope +void wrapIsotope(py::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Isotope; + + // create the Python object + py::class_ object( + module, "Isotope", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const int & + >(), + py::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..0db032a07 --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Library.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Library.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Library +void wrapLibrary(py::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Library; + + // create the Python object + py::class_ object( + module, "Library", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::vector & + >(), + py::arg("name"), + py::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..4332e2906 --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Multigroup.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Multigroup.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Multigroup +void wrapMultigroup(py::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Multigroup; + + // create the Python object + py::class_ object( + module, "Multigroup", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::vector & + >(), + py::arg("projectile"), + py::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..b4101dbe7 --- /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 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 + +GNDSTK_MAKE_LOOKUP(atomic_number,atomic_number); +GNDSTK_MAKE_LOOKUP(mass_number,mass_number); +GNDSTK_MAKE_LOOKUP(name,name); +GNDSTK_MAKE_LOOKUP(projectile,projectile); +GNDSTK_MAKE_LOOKUP(symbol,symbol); +GNDSTK_MAKE_LOOKUP(value,value); + +#undef 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..87d4f3a40 --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symbol, \ + this->atomic_number, \ + this->isotope, \ + this->foobar \ + ) + + // default + Element() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Element( + const wrapper> + &symbol, + const wrapper + &atomic_number = {}, + const wrapper> + &isotope = {}, + const wrapper> + &foobar = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Element(const Element &other) : + 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) : + 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 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..5efdf776b --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + static_cast(*this) \ + ) + + // default + Foobar() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Foobar( + const wrapper + &value + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value) + { + Component::finish(); + } + + // from node + explicit Foobar(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Foobar(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Foobar(const Foobar &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment), + value(this,other.value) + { + Component::finish(other); + } + + // move + Foobar(Foobar &&other) : + 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 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..0955a30f9 --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->mass_number \ + ) + + // default + Isotope() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Isotope( + const wrapper + &mass_number + ) : + GNDSTK_COMPONENT(BlockData{}), + mass_number(this,mass_number) + { + Component::finish(); + } + + // from node + explicit Isotope(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotope(const Isotope &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + mass_number(this,other.mass_number) + { + Component::finish(other); + } + + // move + Isotope(Isotope &&other) : + 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 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..2b7178136 --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->element \ + ) + + // default + Library() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Library( + const wrapper + &name, + const wrapper> + &element = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name), + element(this,element) + { + Component::finish(); + } + + // from node + explicit Library(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Library(const Library &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + element(this,other.element) + { + Component::finish(other); + } + + // move + Library(Library &&other) : + 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 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..a540ee2f8 --- /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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->projectile, \ + this->library \ + ) + + // default + Multigroup() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Multigroup( + const wrapper + &projectile, + const wrapper> + &library = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + projectile(this,projectile), + library(this,library) + { + Component::finish(); + } + + // from node + explicit Multigroup(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Multigroup(const Multigroup &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + projectile(this,other.projectile), + library(this,other.library) + { + Component::finish(other); + } + + // move + Multigroup(Multigroup &&other) : + 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 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..a355119b4 100644 --- a/cmake/GNDStk_dependencies.cmake +++ b/cmake/GNDStk_dependencies.cmake @@ -10,28 +10,28 @@ include( FetchContent ) # Declare project dependencies ######################################################################## -FetchContent_Declare( catch-adapter - GIT_REPOSITORY http://github.com/njoy/catch-adapter - GIT_TAG origin/master - 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/build/fetchcontent - 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(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 + GIT_REPOSITORY https://github.com/nlohmann/json.git + GIT_TAG origin/master + GIT_SHALLOW TRUE ) FetchContent_GetProperties(json) @@ -41,10 +41,19 @@ if(NOT json_POPULATED) 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(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 ) @@ -57,5 +66,6 @@ FetchContent_MakeAvailable( Log pugixml-adapter json + hdf5 pybind11 ) diff --git a/cmake/unit_testing.cmake b/cmake/unit_testing.cmake index bf5bacd44..9573a46de 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,37 @@ 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/DateType/test ) +add_subdirectory( src/GNDStk/enums/ContributorType/test ) +add_subdirectory( src/GNDStk/enums/RelationType/test ) +add_subdirectory( src/GNDStk/enums/Parity/test ) add_subdirectory( src/GNDStk/enums/Frame/test ) +add_subdirectory( src/GNDStk/enums/Interpolation/test ) +add_subdirectory( src/GNDStk/enums/InterpolationQualifier/test ) +add_subdirectory( src/GNDStk/enums/HashAlgorithm/test ) +add_subdirectory( src/GNDStk/enums/DecayType/test ) add_subdirectory( src/GNDStk/enums/GridStyle/test ) +add_subdirectory( src/GNDStk/enums/BoundaryCondition/test ) + +add_subdirectory( src/GNDStk/enums/Encoding/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( 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/files/code-tables/node-add-child.cc b/docs/files/code-tables/node-add-child.cc index 820bb982b..97dd3372c 100644 --- a/docs/files/code-tables/node-add-child.cc +++ b/docs/files/code-tables/node-add-child.cc @@ -1,6 +1,6 @@ // string -Node &add( const string &name = "" ); +Node &add( const string &name = emptyNodeName ); // value Node &add( const T &val ); diff --git a/docs/files/code-tables/node-multi.cc b/docs/files/code-tables/node-multi.cc index 9b3fe048a..2d9090a6e 100644 --- a/docs/files/code-tables/node-multi.cc +++ b/docs/files/code-tables/node-multi.cc @@ -1,3 +1,3 @@ -auto operator()( const KeywordTup &kwds ) const; -auto operator()( const KeywordTup &kwds ); +auto operator()( const KeyTuple &keytup ) const; +auto operator()( const KeyTuple &keytup ); 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/ref-core.rst b/docs/ref-core.rst index 76058e2da..a427144bd 100644 --- a/docs/ref-core.rst +++ b/docs/ref-core.rst @@ -28,5 +28,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/BoundaryCondition.python.cpp b/python/src/BoundaryCondition.python.cpp new file mode 100644 index 000000000..c1d9434aa --- /dev/null +++ b/python/src/BoundaryCondition.python.cpp @@ -0,0 +1,38 @@ + +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapBoundaryCondition( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::BoundaryCondition; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "BoundaryCondition", + "Enumeration class giving acceptable boundary condition values", + python::arithmetic() + ); + + // wrap the component + component + .value( "EliminateShiftFunction", Component::EliminateShiftFunction ) + .value( "NegativeOrbitalMomentum", Component::NegativeOrbitalMomentum ) + .value( "Brune", Component::Brune ) + .value( "Given", Component::Given ); +} + +} // namespace python_core diff --git a/python/src/ContributorType.python.cpp b/python/src/ContributorType.python.cpp new file mode 100644 index 000000000..d4e532371 --- /dev/null +++ b/python/src/ContributorType.python.cpp @@ -0,0 +1,54 @@ +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapContributorType( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::ContributorType; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "ContributorType", + "Enumeration class giving acceptable contributor type values", + python::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_core diff --git a/python/src/DateType.python.cpp b/python/src/DateType.python.cpp new file mode 100644 index 000000000..13a6bf1aa --- /dev/null +++ b/python/src/DateType.python.cpp @@ -0,0 +1,43 @@ +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapDateType( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::DateType; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "DateType", + "Enumeration class giving acceptable date type values", + python::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_core diff --git a/python/src/DecayType.python.cpp b/python/src/DecayType.python.cpp new file mode 100644 index 000000000..1a15438f9 --- /dev/null +++ b/python/src/DecayType.python.cpp @@ -0,0 +1,45 @@ +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapDecayType( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::DecayType; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "DecayType", + "Enumeration class giving acceptable decay type values", + python::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_core diff --git a/python/src/Frame.python.cpp b/python/src/Frame.python.cpp new file mode 100644 index 000000000..73be0d84e --- /dev/null +++ b/python/src/Frame.python.cpp @@ -0,0 +1,35 @@ +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapFrame( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::Frame; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "Frame", + "Enumeration class giving acceptable reference frame values", + python::arithmetic() + ); + + // wrap the component + component + .value( "lab", Component::lab ) + .value( "centerOfMass", Component::centerOfMass ); +} + +} // namespace python_core diff --git a/python/src/GNDStk.python.cpp b/python/src/GNDStk.python.cpp index 2a0ec7ad4..1d3188830 100644 --- a/python/src/GNDStk.python.cpp +++ b/python/src/GNDStk.python.cpp @@ -1,49 +1,275 @@ + +// 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" // namespace aliases namespace python = pybind11; + +// ----------------------------------------------------------------------------- +// macros +// ----------------------------------------------------------------------------- + +// GNDSTK_PROPERTY +#define GNDSTK_PROPERTY(class,pyname,cppvar) \ +class.def_property_static( \ + #pyname, \ + [](python::object) \ + { \ + return cppvar; \ + }, \ + [](python::object, const std::decay_t &value) \ + { \ + cppvar = value; \ + } \ +) + +// GNDSTK_COLOR +#define GNDSTK_COLOR(class,pyname,cppvar) \ +class.def_property_static( \ + #pyname, \ + [](python::object) \ + { \ + return cppvar; \ + }, \ + [](python::object, const std::array &rgb) \ + { \ + cppvar = njoy::GNDStk::color::makeColor(rgb[0],rgb[1],rgb[2]); \ + } \ +); + + +// ----------------------------------------------------------------------------- // core interface declarations -namespace core { +// ----------------------------------------------------------------------------- + +namespace python_core { + void wrapNode( python::module& ); + + void wrapContributorType( python::module& ); + void wrapDateType( python::module& ); + void wrapDecayType( python::module& ); + void wrapFrame( python::module& ); + void wrapGridStyle( python::module& ); + void wrapHashAlgorithm( python::module& ); + void wrapInteraction( python::module& ); + void wrapInterpolation( python::module& ); + void wrapInterpolationQualifier( python::module& ); + void wrapParity( python::module& ); + void wrapRelationType( python::module& ); + void wrapBoundaryCondition( python::module& ); +} + + +// ----------------------------------------------------------------------------- +// v2.0 interface declarations +// ----------------------------------------------------------------------------- + +namespace python_v2_0 { + void wrapGNDS( python::module& ); +} + + +// ----------------------------------------------------------------------------- +// Submodule: settings +// ----------------------------------------------------------------------------- + +void submodule_settings(python::module &gnds) +{ + python::module settings = gnds.def_submodule( + "settings", + "Global behavioral settings" + ); + + // ------------------------ + // Module: settings + // Class: read + // ------------------------ + + struct Read { }; + python::class_ read(settings,"read"); + + GNDSTK_PROPERTY(read, threads, njoy::GNDStk::threads); + + // ------------------------ + // Module: settings + // Class: write + // ------------------------ + + struct Write { }; + python::class_ write(settings,"write"); + + GNDSTK_PROPERTY(write, comments, njoy::GNDStk::comments); + GNDSTK_PROPERTY(write, indent, njoy::GNDStk::indent ); + GNDSTK_PROPERTY(write, align, njoy::GNDStk::align ); + GNDSTK_PROPERTY(write, columns, njoy::GNDStk::columns ); + GNDSTK_PROPERTY(write, elements, njoy::GNDStk::elements); + GNDSTK_PROPERTY(write, colors, njoy::GNDStk::colors ); + GNDSTK_PROPERTY(write, shades, njoy::GNDStk::shades ); + + // ------------------------ + // Module: settings + // Class: report + // ------------------------ - void wrapNode( python::module& ); + struct Report { }; + python::class_ report(settings,"report"); - void wrapGridStyle( python::module& ); - void wrapInterpolation( python::module& ); + GNDSTK_PROPERTY(report, notes, njoy::GNDStk::notes); + GNDSTK_PROPERTY(report, warnings, njoy::GNDStk::warnings); + GNDSTK_PROPERTY(report, context, njoy::GNDStk::context); + GNDSTK_PROPERTY(report, debug, njoy::GNDStk::debug); + + // ------------------------ + // Module: settings + // Class: sort + // ------------------------ + + struct Sort { }; + python::class_ sort(settings,"sort"); + + GNDSTK_PROPERTY(sort, fields, njoy::GNDStk::sort); +} + + +// ----------------------------------------------------------------------------- +// Submodule: colors +// ----------------------------------------------------------------------------- + +void submodule_colors(python::module &gnds) +{ + python::module colors = gnds.def_submodule( + "colors", + "Colors for diagnostics and printing" + ); + + // ------------------------ + // Module: colors + // Class: required + // ------------------------ + + struct Required { }; + python::class_ required(colors,"required"); + + GNDSTK_COLOR(required, field, njoy::GNDStk::color::field); + GNDSTK_COLOR(required, vector, njoy::GNDStk::color::vector); + GNDSTK_COLOR(required, label, njoy::GNDStk::color::label); + GNDSTK_COLOR(required, value, njoy::GNDStk::color::value); + GNDSTK_COLOR(required, comment, njoy::GNDStk::color::comment); + + // ------------------------ + // Module: colors + // Class: optional + // ------------------------ + + struct Optional { }; + python::class_ optional(colors,"optional"); + + GNDSTK_COLOR(optional, field, njoy::GNDStk::color::optional::field); + GNDSTK_COLOR(optional, vector, njoy::GNDStk::color::optional::vector); + GNDSTK_COLOR(optional, label, njoy::GNDStk::color::optional::label); + GNDSTK_COLOR(optional, value, njoy::GNDStk::color::optional::value); + + // ------------------------ + // Module: colors + // Class: data + // ------------------------ + + struct Data { }; + python::class_ data(colors,"data"); + + GNDSTK_COLOR(data, string, njoy::GNDStk::color::data::string); + GNDSTK_COLOR(data, vector, njoy::GNDStk::color::data::vector); } -// v1.9 interface declarations -namespace python_v1_9 { - void wrapGNDS( python::module& ); +// ----------------------------------------------------------------------------- +// Submodule: format +// ----------------------------------------------------------------------------- + +void submodule_format(python::module &gnds) +{ + // todo + /* + python::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 { }; + python::class_ todo(format,"todo"); + + GNDSTK_COLOR(todo, field, njoy::GNDStk::color::field); + GNDSTK_COLOR(todo, vector, njoy::GNDStk::color::vector); + GNDSTK_COLOR(todo, label, njoy::GNDStk::color::label); + GNDSTK_COLOR(todo, value, njoy::GNDStk::color::value); + 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 + // ------------------------ + + python::module core = module.def_submodule( + "core", + "core - GNDStk core interface components" + ); - "core", - "core - GNDS core interface components" - ); + // wrap core components (in the core module) + python_core::wrapNode(core); - // wrap core components (in the core module) - core::wrapNode( submodule ); + // enumerations (in the GNDStk module) + python_core::wrapContributorType(module); + python_core::wrapDateType(module); + python_core::wrapDecayType(module); + python_core::wrapFrame(module); + python_core::wrapGridStyle(module); + python_core::wrapHashAlgorithm(module); + python_core::wrapInteraction(module); + python_core::wrapInterpolation(module); + python_core::wrapInterpolationQualifier(module); + python_core::wrapParity(module); + python_core::wrapRelationType(module); + python_core::wrapBoundaryCondition(module); - // enumerations (in the GNDStk module) - core::wrapGridStyle( module ); - core::wrapInterpolation( module ); + // v2.0 components (in the v2_0 module, created in this function) + python_v2_0::wrapGNDS(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 GNDSTK_PROPERTY +#undef GNDSTK_COLOR diff --git a/python/src/GridStyle.python.cpp b/python/src/GridStyle.python.cpp index 25d7b15ee..a324924c3 100644 --- a/python/src/GridStyle.python.cpp +++ b/python/src/GridStyle.python.cpp @@ -8,7 +8,7 @@ // namespace aliases namespace python = pybind11; -namespace core { +namespace python_core { void wrapGridStyle( python::module& module ) { @@ -35,4 +35,4 @@ void wrapGridStyle( python::module& module ) { .value( "parameters", Component::parameters ); } -} // namespace core +} // namespace python_core diff --git a/python/src/HashAlgorithm.python.cpp b/python/src/HashAlgorithm.python.cpp new file mode 100644 index 000000000..235b3d6ec --- /dev/null +++ b/python/src/HashAlgorithm.python.cpp @@ -0,0 +1,35 @@ +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapHashAlgorithm( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::HashAlgorithm; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "HashAlgorithm", + "Enumeration class giving acceptable hash algorithm values", + python::arithmetic() + ); + + // wrap the component + component + .value( "md5", Component::md5 ) + .value( "sha1", Component::sha1 ); +} + +} // namespace python_core diff --git a/python/src/Interaction.python.cpp b/python/src/Interaction.python.cpp new file mode 100644 index 000000000..e5348f492 --- /dev/null +++ b/python/src/Interaction.python.cpp @@ -0,0 +1,36 @@ +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapInteraction( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::Interaction; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "Interaction", + "Enumeration class giving acceptable interaction type values", + python::arithmetic() + ); + + // wrap the component + component + .value( "nuclear", Component::nuclear ) + .value( "atomic", Component::atomic ) + .value( "thermalNeutronScatteringLaw", Component::thermalNeutronScatteringLaw ); +} + +} // namespace python_core diff --git a/python/src/Interpolation.python.cpp b/python/src/Interpolation.python.cpp index 8db3ecf03..ee7b0b82e 100644 --- a/python/src/Interpolation.python.cpp +++ b/python/src/Interpolation.python.cpp @@ -8,7 +8,7 @@ // namespace aliases namespace python = pybind11; -namespace core { +namespace python_core { void wrapInterpolation( python::module& module ) { @@ -36,4 +36,4 @@ void wrapInterpolation( python::module& module ) { .value( "chargedparticle", Component::chargedparticle ); } -} // namespace core +} // namespace python_core diff --git a/python/src/InterpolationQualifier.python.cpp b/python/src/InterpolationQualifier.python.cpp new file mode 100644 index 000000000..adf94dea0 --- /dev/null +++ b/python/src/InterpolationQualifier.python.cpp @@ -0,0 +1,37 @@ +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapInterpolationQualifier( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::InterpolationQualifier; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "InterpolationQualifier", + "Enumeration class giving acceptable interpolation qualifier values", + python::arithmetic() + ); + + // wrap the component + component + .value( "direct", Component::direct ) + .value( "unitBase", Component::unitBase ) + .value( "correspondingEnergies", Component::correspondingEnergies ) + .value( "correspondingPoints", Component::correspondingPoints ); +} + +} // namespace python_core diff --git a/python/src/Parity.python.cpp b/python/src/Parity.python.cpp new file mode 100644 index 000000000..c5982edc8 --- /dev/null +++ b/python/src/Parity.python.cpp @@ -0,0 +1,35 @@ +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapParity( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::Parity; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "Parity", + "Enumeration class giving acceptable parity values", + python::arithmetic() + ); + + // wrap the component + component + .value( "minus", Component::minus ) + .value( "plus", Component::plus ); +} + +} // namespace python_core diff --git a/python/src/RelationType.python.cpp b/python/src/RelationType.python.cpp new file mode 100644 index 000000000..70a62c11d --- /dev/null +++ b/python/src/RelationType.python.cpp @@ -0,0 +1,67 @@ +// system includes +#include +#include + +// local includes +#include "GNDStk.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_core { + +void wrapRelationType( python::module& module ) { + + // type aliases + using Component = njoy::GNDStk::enums::RelationType; + + // wrap views created by this component + + // create the component + python::enum_< Component > component( + + module, + "RelationType", + "Enumeration class giving acceptable relation type values", + python::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_core diff --git a/python/src/all.python.cpp b/python/src/all.python.cpp new file mode 100644 index 000000000..c882c1434 --- /dev/null +++ b/python/src/all.python.cpp @@ -0,0 +1,290 @@ + +// together: node, enumerations, and v2.0 +#include "GNDStk.python.cpp" + +// node +#include "core/Node.python.cpp" + +// enumerations +#include "Parity.python.cpp" +#include "RelationType.python.cpp" +#include "Interpolation.python.cpp" +#include "BoundaryCondition.python.cpp" +#include "ContributorType.python.cpp" +#include "DateType.python.cpp" +#include "Interaction.python.cpp" +#include "GridStyle.python.cpp" +#include "HashAlgorithm.python.cpp" +#include "DecayType.python.cpp" +#include "Frame.python.cpp" +#include "InterpolationQualifier.python.cpp" + +// v2.0 +#include "v2.0/GNDS.python.cpp" + +// v2.0 constituent parts +#include "v2.0/g3d/Starts.python.cpp" +#include "v2.0/g3d/Lengths.python.cpp" +#include "v2.0/g3d/Array.python.cpp" +#include "v2.0/general/Sums.python.cpp" +#include "v2.0/general/SelfScatteringKernel.python.cpp" +#include "v2.0/general/Values.python.cpp" +#include "v2.0/general/NuclearTerm.python.cpp" +#include "v2.0/general/ImaginaryAnomalousFactor.python.cpp" +#include "v2.0/general/BoundAtomCrossSection.python.cpp" +#include "v2.0/general/Isotopes.python.cpp" +#include "v2.0/general/Standard.python.cpp" +#include "v2.0/general/Unresolved.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp" +#include "v2.0/general/DecayMode.python.cpp" +#include "v2.0/general/InternalConversionCoefficients.python.cpp" +#include "v2.0/general/Temperature.python.cpp" +#include "v2.0/general/Polynomial1d.python.cpp" +#include "v2.0/general/Product.python.cpp" +#include "v2.0/general/NuclearPlusInterference.python.cpp" +#include "v2.0/general/Branching1d.python.cpp" +#include "v2.0/general/FreeGasApproximation.python.cpp" +#include "v2.0/general/Isotope.python.cpp" +#include "v2.0/general/MultiplicitySums.python.cpp" +#include "v2.0/general/ScatteringAtom.python.cpp" +#include "v2.0/general/Nuclide.python.cpp" +#include "v2.0/general/AverageEnergy.python.cpp" +#include "v2.0/general/PrimaryGamma.python.cpp" +#include "v2.0/general/Spectrum.python.cpp" +#include "v2.0/general/OrphanProduct.python.cpp" +#include "v2.0/general/DelayedNeutronKE.python.cpp" +#include "v2.0/general/Time.python.cpp" +#include "v2.0/general/IncidentEnergies.python.cpp" +#include "v2.0/general/Distribution.python.cpp" +#include "v2.0/general/Gridded3d.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp" +#include "v2.0/general/AverageProductEnergy.python.cpp" +#include "v2.0/general/Q.python.cpp" +#include "v2.0/general/AngularTwoBody.python.cpp" +#include "v2.0/general/R.python.cpp" +#include "v2.0/general/DecayPath.python.cpp" +#include "v2.0/general/Summand.python.cpp" +#include "v2.0/general/Title.python.cpp" +#include "v2.0/general/Continuum.python.cpp" +#include "v2.0/general/ResonanceReactions.python.cpp" +#include "v2.0/general/G.python.cpp" +#include "v2.0/general/EnergyAngular.python.cpp" +#include "v2.0/general/Institution.python.cpp" +#include "v2.0/general/String.python.cpp" +#include "v2.0/general/Width.python.cpp" +#include "v2.0/general/CrossSectionSum.python.cpp" +#include "v2.0/general/ScatteringRadius.python.cpp" +#include "v2.0/general/Table.python.cpp" +#include "v2.0/general/Nuclides.python.cpp" +#include "v2.0/general/NuclearAmplitudeExpansion.python.cpp" +#include "v2.0/general/GaugeBoson.python.cpp" +#include "v2.0/general/Spectra.python.cpp" +#include "v2.0/general/ProductYields.python.cpp" +#include "v2.0/general/Theta.python.cpp" +#include "v2.0/general/LevelSpacing.python.cpp" +#include "v2.0/general/J.python.cpp" +#include "v2.0/general/PromptProductKE.python.cpp" +#include "v2.0/general/Widths.python.cpp" +#include "v2.0/general/MultiplicitySum.python.cpp" +#include "v2.0/general/Parameters.python.cpp" +#include "v2.0/general/Grid.python.cpp" +#include "v2.0/general/Add.python.cpp" +#include "v2.0/general/Slice.python.cpp" +#include "v2.0/general/ProductYield.python.cpp" +#include "v2.0/general/MadlandNix.python.cpp" +#include "v2.0/general/BindingEnergy.python.cpp" +#include "v2.0/general/DebyeWallerIntegral.python.cpp" +#include "v2.0/general/CovarianceSections.python.cpp" +#include "v2.0/general/Link.python.cpp" +#include "v2.0/general/AverageParameterCovariance.python.cpp" +#include "v2.0/general/Energy.python.cpp" +#include "v2.0/general/Body.python.cpp" +#include "v2.0/general/Alias.python.cpp" +#include "v2.0/general/Uncertainty.python.cpp" +#include "v2.0/general/Reactions.python.cpp" +#include "v2.0/general/XYs1d.python.cpp" +#include "v2.0/general/Configurations.python.cpp" +#include "v2.0/general/Weighted.python.cpp" +#include "v2.0/general/Resolved.python.cpp" +#include "v2.0/general/FissionEnergyReleases.python.cpp" +#include "v2.0/general/Baryon.python.cpp" +#include "v2.0/general/IncoherentPhotonScattering.python.cpp" +#include "v2.0/general/ENDFconversionFlags.python.cpp" +#include "v2.0/general/FissionComponent.python.cpp" +#include "v2.0/general/ScatteringAtoms.python.cpp" +#include "v2.0/general/Configuration.python.cpp" +#include "v2.0/general/PromptGammaEnergy.python.cpp" +#include "v2.0/general/E_max.python.cpp" +#include "v2.0/general/IncompleteReactions.python.cpp" +#include "v2.0/general/CrossSectionReconstructed.python.cpp" +#include "v2.0/general/Productions.python.cpp" +#include "v2.0/general/Charge.python.cpp" +#include "v2.0/general/PhotonEmissionProbabilities.python.cpp" +#include "v2.0/general/Probability.python.cpp" +#include "v2.0/general/FissionComponents.python.cpp" +#include "v2.0/general/XYs3d.python.cpp" +#include "v2.0/general/SpinGroups.python.cpp" +#include "v2.0/general/T_M.python.cpp" +#include "v2.0/general/SpinGroup.python.cpp" +#include "v2.0/general/DiscreteGamma.python.cpp" +#include "v2.0/general/Production.python.cpp" +#include "v2.0/general/CoulombPlusNuclearElastic.python.cpp" +#include "v2.0/general/ChemicalElements.python.cpp" +#include "v2.0/general/Unorthodox.python.cpp" +#include "v2.0/general/FormFactor.python.cpp" +#include "v2.0/general/S_table.python.cpp" +#include "v2.0/general/SimpleMaxwellianFission.python.cpp" +#include "v2.0/general/AverageEnergies.python.cpp" +#include "v2.0/general/Shell.python.cpp" +#include "v2.0/general/RealAnomalousFactor.python.cpp" +#include "v2.0/general/CoherentPhotonScattering.python.cpp" +#include "v2.0/general/Background.python.cpp" +#include "v2.0/general/DecayData.python.cpp" +#include "v2.0/general/KalbachMann.python.cpp" +#include "v2.0/general/DelayedBetaEnergy.python.cpp" +#include "v2.0/general/Lepton.python.cpp" +#include "v2.0/general/Dates.python.cpp" +#include "v2.0/general/DoubleDifferentialCrossSection.python.cpp" +#include "v2.0/general/Authors.python.cpp" +#include "v2.0/general/ElapsedTimes.python.cpp" +#include "v2.0/general/ScatteringFactor.python.cpp" +#include "v2.0/general/Ls.python.cpp" +#include "v2.0/general/RutherfordScattering.python.cpp" +#include "v2.0/general/Fraction.python.cpp" +#include "v2.0/general/NBodyPhaseSpace.python.cpp" +#include "v2.0/general/ExternalFiles.python.cpp" +#include "v2.0/general/Conversion.python.cpp" +#include "v2.0/general/ParameterCovarianceMatrix.python.cpp" +#include "v2.0/general/RMatrix.python.cpp" +#include "v2.0/general/EFH.python.cpp" +#include "v2.0/general/ParameterLink.python.cpp" +#include "v2.0/general/ChemicalElement.python.cpp" +#include "v2.0/general/Constant1d.python.cpp" +#include "v2.0/general/Baryons.python.cpp" +#include "v2.0/general/ParameterCovariance.python.cpp" +#include "v2.0/general/IncidentEnergy.python.cpp" +#include "v2.0/general/NonNeutrinoEnergy.python.cpp" +#include "v2.0/general/FastRegion.python.cpp" +#include "v2.0/general/Halflife.python.cpp" +#include "v2.0/general/Angular.python.cpp" +#include "v2.0/general/ProjectileEnergyDomain.python.cpp" +#include "v2.0/general/ExternalFile.python.cpp" +#include "v2.0/general/ResonanceReaction.python.cpp" +#include "v2.0/general/Data.python.cpp" +#include "v2.0/general/ApplicationData.python.cpp" +#include "v2.0/general/PromptNeutronKE.python.cpp" +#include "v2.0/general/HardSphereRadius.python.cpp" +#include "v2.0/general/Reference.python.cpp" +#include "v2.0/general/Nucleus.python.cpp" +#include "v2.0/general/Function2ds.python.cpp" +#include "v2.0/general/Unspecified.python.cpp" +#include "v2.0/general/ShortRangeSelfScalingVariance.python.cpp" +#include "v2.0/general/Spin.python.cpp" +#include "v2.0/general/Leptons.python.cpp" +#include "v2.0/general/Author.python.cpp" +#include "v2.0/general/CovarianceSection.python.cpp" +#include "v2.0/general/FissionEnergyRelease.python.cpp" +#include "v2.0/general/Channels.python.cpp" +#include "v2.0/general/Unorthodoxes.python.cpp" +#include "v2.0/general/Gridded2d.python.cpp" +#include "v2.0/general/OrphanProducts.python.cpp" +#include "v2.0/general/DelayedNeutron.python.cpp" +#include "v2.0/general/Slices.python.cpp" +#include "v2.0/general/ListOfCovariances.python.cpp" +#include "v2.0/general/Decay.python.cpp" +#include "v2.0/general/Axes.python.cpp" +#include "v2.0/general/Covariance.python.cpp" +#include "v2.0/general/Mass.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp" +#include "v2.0/general/AngularEnergy.python.cpp" +#include "v2.0/general/SCTApproximation.python.cpp" +#include "v2.0/general/DelayedNeutrons.python.cpp" +#include "v2.0/general/Multiplicity.python.cpp" +#include "v2.0/general/WeightedFunctionals.python.cpp" +#include "v2.0/general/EFL.python.cpp" +#include "v2.0/general/Column.python.cpp" +#include "v2.0/general/Integer.python.cpp" +#include "v2.0/general/DecayModes.python.cpp" +#include "v2.0/general/XYs2d.python.cpp" +#include "v2.0/general/Branching3d.python.cpp" +#include "v2.0/general/ResonanceParameters.python.cpp" +#include "v2.0/general/ResolvedRegion.python.cpp" +#include "v2.0/general/UnresolvedRegion.python.cpp" +#include "v2.0/general/RealInterferenceTerm.python.cpp" +#include "v2.0/general/Intensity.python.cpp" +#include "v2.0/general/Discrete.python.cpp" +#include "v2.0/general/TotalEnergy.python.cpp" +#include "v2.0/general/ParameterCovariances.python.cpp" +#include "v2.0/general/Regions1d.python.cpp" +#include "v2.0/general/DelayedGammaEnergy.python.cpp" +#include "v2.0/general/NeutrinoEnergy.python.cpp" +#include "v2.0/general/ColumnData.python.cpp" +#include "v2.0/general/ElapsedTime.python.cpp" +#include "v2.0/general/ColumnHeaders.python.cpp" +#include "v2.0/general/PositronEmissionIntensity.python.cpp" +#include "v2.0/general/Recoil.python.cpp" +#include "v2.0/general/Evaluated.python.cpp" +#include "v2.0/general/Atomic.python.cpp" +#include "v2.0/general/CrossSectionSums.python.cpp" +#include "v2.0/general/Resonances.python.cpp" +#include "v2.0/general/CrossSection.python.cpp" +#include "v2.0/general/BreitWigner.python.cpp" +#include "v2.0/general/Date.python.cpp" +#include "v2.0/general/Uncorrelated.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp" +#include "v2.0/general/Isotropic2d.python.cpp" +#include "v2.0/general/L.python.cpp" +#include "v2.0/general/Products.python.cpp" +#include "v2.0/general/F.python.cpp" +#include "v2.0/general/Legendre.python.cpp" +#include "v2.0/general/U.python.cpp" +#include "v2.0/general/Mixed.python.cpp" +#include "v2.0/general/E_critical.python.cpp" +#include "v2.0/general/T_effective.python.cpp" +#include "v2.0/general/Channel.python.cpp" +#include "v2.0/general/Parity.python.cpp" +#include "v2.0/general/Sum.python.cpp" +#include "v2.0/general/Double.python.cpp" +#include "v2.0/general/Summands.python.cpp" +#include "v2.0/general/GeneralEvaporation.python.cpp" +#include "v2.0/general/TabulatedWidths.python.cpp" +#include "v2.0/general/Evaporation.python.cpp" +#include "v2.0/general/Yields.python.cpp" +#include "v2.0/general/Regions2d.python.cpp" +#include "v2.0/general/ImaginaryInterferenceTerm.python.cpp" +#include "v2.0/general/OutputChannel.python.cpp" +#include "v2.0/general/Js.python.cpp" +#include "v2.0/general/EndfCompatible.python.cpp" +#include "v2.0/general/Reaction.python.cpp" +#include "v2.0/general/Documentation.python.cpp" +#include "v2.0/general/MetaStable.python.cpp" +#include "v2.0/general/Rate.python.cpp" +#include "v2.0/general/CovarianceMatrix.python.cpp" +#include "v2.0/general/Styles.python.cpp" +#include "v2.0/general/Array.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw.python.cpp" +#include "v2.0/general/Axis.python.cpp" +#include "v2.0/general/Aliases.python.cpp" +#include "v2.0/general/RowData.python.cpp" +#include "v2.0/general/Function1ds.python.cpp" +#include "v2.0/general/GaugeBosons.python.cpp" +#include "v2.0/general/ResonancesWithBackground.python.cpp" +#include "v2.0/reduced/Polynomial1d.python.cpp" +#include "v2.0/reduced/Product.python.cpp" +#include "v2.0/reduced/Distribution.python.cpp" +#include "v2.0/reduced/Nuclides.python.cpp" +#include "v2.0/reduced/CrossSection.python.cpp" +#include "v2.0/reduced/Products.python.cpp" +#include "v2.0/reduced/Double.python.cpp" +#include "v2.0/reduced/OutputChannel.python.cpp" +#include "v2.0/reduced/Function1ds.python.cpp" +#include "v2.0/g2d/Array.python.cpp" +#include "v2.0/top/FissionFragmentData.python.cpp" +#include "v2.0/top/ReactionSuite.python.cpp" +#include "v2.0/top/PoPs.python.cpp" +#include "v2.0/top/CovarianceSuite.python.cpp" +#include "v2.0/g3d.python.cpp" +#include "v2.0/general.python.cpp" +#include "v2.0/top.python.cpp" +#include "v2.0/reduced.python.cpp" +#include "v2.0/g2d.python.cpp" diff --git a/python/src/core/Node.python.cpp b/python/src/core/Node.python.cpp index ff2e7f377..ae4d51c2a 100644 --- a/python/src/core/Node.python.cpp +++ b/python/src/core/Node.python.cpp @@ -1,3 +1,4 @@ + // system includes #include #include @@ -8,150 +9,153 @@ // 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(python::module &module) +{ + // type aliases + using Component = njoy::GNDStk::Node; + using RefConstComponent = std::reference_wrapper< const Component >; + // create the core component + python::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( + 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(), + 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(), + 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 + { + 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); + }, + 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()) + 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..cb7b47d2e 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 @@ -9,79 +10,287 @@ #include "GNDStk.hpp" // namespace aliases -namespace python = pybind11; +namespace py = 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( + py::init<>(), + "Initialise the object with its default contents.\n\n" + "Arguments:\n" + " self The object." + ); + + // constructor: copy + object.def( + py::init(), + py::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; + }, + py::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"); + }, + py::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 + // ------------------------ + + // 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"); + }, + py::arg("file"), + "Write the object to a JSON file.\n\n" + "Arguments:\n" + " self The object.\n" + " file The name of the JSON file." + ); + + // ------------------------ + // re: 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"); + }, + py::arg("file"), + "Write the object to an HDF5 file.\n\n" + "Arguments:\n" + " self The object.\n" + " file The name of the HDF5 file." + ); + + // ------------------------ + // 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(); + } + ); + + // write into string, as JSON + object.def( + "json", + [](const cppCLASS &self) -> decltype(auto) + { + std::ostringstream oss; + self.write(oss,"json"); + return oss.str(); + } + ); + + // write into string, as HDF5 + object.def( + "hdf5", + [](const cppCLASS &self) -> decltype(auto) + { + std::ostringstream oss; + self.write(oss,"hdf5"); + return oss.str(); + } + ); + + // 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); + }, + py::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); + }, + py::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/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/src/v2.0/GNDS.python.cpp b/python/src/v2.0/GNDS.python.cpp new file mode 100644 index 000000000..9c72193e8 --- /dev/null +++ b/python/src/v2.0/GNDS.python.cpp @@ -0,0 +1,29 @@ + +// system includes +#include +#include + +// namespace aliases +namespace python = pybind11; + +// v2.0 interface declarations +namespace python_v2_0 { + void wrapG2d( python::module& ); + void wrapG3d( python::module& ); + void wrapGeneral( python::module& ); + void wrapReduced( python::module& ); + void wrapTop( python::module& ); + + void wrapGNDS( python::module& module ) { + // create the core submodule + python::module submodule = module.def_submodule( + "v2_0", + "GNDS 2.0 standard components" + ); + 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 ); + } +} // v2_0 namespace diff --git a/python/src/v2.0/abstract.python.cpp b/python/src/v2.0/abstract.python.cpp new file mode 100644 index 000000000..b159ad793 --- /dev/null +++ b/python/src/v2.0/abstract.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// abstract declarations +namespace python_abstract { + void wrapFunctional(python::module &); + void wrapLabel(python::module &); + void wrapPhysicalQuantity(python::module &); + void wrapText(python::module &); +} // namespace python_abstract + +// abstract wrapper +void wrapAbstract(python::module &module) +{ + // create the abstract submodule + python::module submodule = module.def_submodule( + "abstract", + "GNDS v2.0 abstract" + ); + + // wrap abstract components + python_abstract::wrapFunctional(submodule); + python_abstract::wrapLabel(submodule); + python_abstract::wrapPhysicalQuantity(submodule); + python_abstract::wrapText(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/abstract/Functional.python.cpp b/python/src/v2.0/abstract/Functional.python.cpp new file mode 100644 index 000000000..39dd179ba --- /dev/null +++ b/python/src/v2.0/abstract/Functional.python.cpp @@ -0,0 +1,98 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/abstract/Functional.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_abstract { + +// Functional wrapper +void wrapFunctional(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = abstract::Functional; + using _t = std::variant< + abstract::Functional, + containers::Values + >; + + // create the component + python::class_ component( + module, + "Functional", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const containers::Axes &, + const std::optional &, + const _t & + >(), + python::arg("label") = std::nullopt, + python::arg("outer_domain_value") = std::nullopt, + python::arg("axes"), + python::arg("uncertainty") = std::nullopt, + python::arg("_functionalvalues"), + 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( + "axes", + python::overload_cast<>(&Component::axes), + Component::documentation("axes").data() + ) + .def_property_readonly( + "uncertainty", + python::overload_cast<>(&Component::uncertainty), + Component::documentation("uncertainty").data() + ) + .def_property_readonly( + "functional", + python::overload_cast<>(&Component::functional), + Component::documentation("functional").data() + ) + .def_property_readonly( + "values", + python::overload_cast<>(&Component::values), + Component::documentation("values").data() + ) + .def_property_readonly( + "_functionalvalues", + python::overload_cast<>(&Component::_functionalvalues), + Component::documentation("_functionalvalues").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_abstract +} // namespace python_v2_0 diff --git a/python/src/v2.0/abstract/Label.python.cpp b/python/src/v2.0/abstract/Label.python.cpp new file mode 100644 index 000000000..5c9a2d544 --- /dev/null +++ b/python/src/v2.0/abstract/Label.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/abstract/Label.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_abstract { + +// Label wrapper +void wrapLabel(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = abstract::Label; + + // create the component + python::class_ component( + module, + "Label", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName & + >(), + python::arg("label"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_abstract +} // namespace python_v2_0 diff --git a/python/src/v2.0/abstract/PhysicalQuantity.python.cpp b/python/src/v2.0/abstract/PhysicalQuantity.python.cpp new file mode 100644 index 000000000..722a31ca3 --- /dev/null +++ b/python/src/v2.0/abstract/PhysicalQuantity.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/abstract/PhysicalQuantity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_abstract { + +// PhysicalQuantity wrapper +void wrapPhysicalQuantity(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = abstract::PhysicalQuantity; + + // create the component + python::class_ component( + module, + "PhysicalQuantity", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + python::arg("label"), + python::arg("unit") = std::nullopt, + python::arg("value"), + python::arg("documentation") = std::nullopt, + python::arg("uncertainty") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + .def_property_readonly( + "documentation", + python::overload_cast<>(&Component::documentation), + Component::documentation("documentation").data() + ) + .def_property_readonly( + "uncertainty", + python::overload_cast<>(&Component::uncertainty), + Component::documentation("uncertainty").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_abstract +} // namespace python_v2_0 diff --git a/python/src/v2.0/abstract/Text.python.cpp b/python/src/v2.0/abstract/Text.python.cpp new file mode 100644 index 000000000..fdca89ed1 --- /dev/null +++ b/python/src/v2.0/abstract/Text.python.cpp @@ -0,0 +1,106 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/abstract/Text.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_abstract { + +// Text wrapper +void wrapText(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = abstract::Text; + + // create the component + python::class_ component( + module, + "Text", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("encoding") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("markup") = 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( + "encoding", + [](const Component &self) { return self.encoding().value(); }, + Component::documentation("encoding").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "markup", + [](const Component &self) { return self.markup().value(); }, + Component::documentation("markup").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_abstract +} // namespace python_v2_0 diff --git a/python/src/v2.0/appData.python.cpp b/python/src/v2.0/appData.python.cpp new file mode 100644 index 000000000..d666c02a2 --- /dev/null +++ b/python/src/v2.0/appData.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// appData declarations +namespace python_appData { + void wrapConversion(python::module &); + void wrapENDFconversionFlags(python::module &); + void wrapInstitution(python::module &); + void wrapApplicationData(python::module &); +} // namespace python_appData + +// appData wrapper +void wrapAppData(python::module &module) +{ + // create the appData submodule + python::module submodule = module.def_submodule( + "appData", + "GNDS v2.0 appData" + ); + + // wrap appData components + python_appData::wrapConversion(submodule); + python_appData::wrapENDFconversionFlags(submodule); + python_appData::wrapInstitution(submodule); + python_appData::wrapApplicationData(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/appData/ApplicationData.python.cpp b/python/src/v2.0/appData/ApplicationData.python.cpp new file mode 100644 index 000000000..e7750a1b8 --- /dev/null +++ b/python/src/v2.0/appData/ApplicationData.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/appData/ApplicationData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_appData { + +// ApplicationData wrapper +void wrapApplicationData(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = appData::ApplicationData; + + // create the component + python::class_ component( + module, + "ApplicationData", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("institution") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "institution", + python::overload_cast<>(&Component::institution), + Component::documentation("institution").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_appData +} // namespace python_v2_0 diff --git a/python/src/v2.0/appData/Conversion.python.cpp b/python/src/v2.0/appData/Conversion.python.cpp new file mode 100644 index 000000000..613eb720f --- /dev/null +++ b/python/src/v2.0/appData/Conversion.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/appData/Conversion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_appData { + +// Conversion wrapper +void wrapConversion(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = appData::Conversion; + + // create the component + python::class_ component( + module, + "Conversion", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("flags") = std::nullopt, + python::arg("href") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "flags", + &Component::flags, + Component::documentation("flags").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_appData +} // namespace python_v2_0 diff --git a/python/src/v2.0/appData/ENDFconversionFlags.python.cpp b/python/src/v2.0/appData/ENDFconversionFlags.python.cpp new file mode 100644 index 000000000..81c47b7ef --- /dev/null +++ b/python/src/v2.0/appData/ENDFconversionFlags.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/appData/ENDFconversionFlags.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_appData { + +// ENDFconversionFlags wrapper +void wrapENDFconversionFlags(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = appData::ENDFconversionFlags; + + // create the component + python::class_ component( + module, + "ENDFconversionFlags", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("conversion") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "conversion", + python::overload_cast<>(&Component::conversion), + Component::documentation("conversion").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_appData +} // namespace python_v2_0 diff --git a/python/src/v2.0/appData/Institution.python.cpp b/python/src/v2.0/appData/Institution.python.cpp new file mode 100644 index 000000000..c40959734 --- /dev/null +++ b/python/src/v2.0/appData/Institution.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/appData/Institution.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_appData { + +// Institution wrapper +void wrapInstitution(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = appData::Institution; + + // create the component + python::class_ component( + module, + "Institution", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("label") = std::nullopt, + python::arg("endfconversion_flags") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "endfconversion_flags", + python::overload_cast<>(&Component::ENDFconversionFlags), + Component::documentation("endfconversion_flags").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_appData +} // namespace python_v2_0 diff --git a/python/src/v2.0/atomic.python.cpp b/python/src/v2.0/atomic.python.cpp new file mode 100644 index 000000000..f3df7e33d --- /dev/null +++ b/python/src/v2.0/atomic.python.cpp @@ -0,0 +1,41 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// atomic declarations +namespace python_atomic { + void wrapFormFactor(python::module &); + void wrapImaginaryAnomalousFactor(python::module &); + void wrapRealAnomalousFactor(python::module &); + void wrapCoherentPhotonScattering(python::module &); + void wrapScatteringFactor(python::module &); + void wrapIncoherentPhotonScattering(python::module &); +} // namespace python_atomic + +// atomic wrapper +void wrapAtomic(python::module &module) +{ + // create the atomic submodule + python::module submodule = module.def_submodule( + "atomic", + "GNDS v2.0 atomic" + ); + + // wrap atomic components + python_atomic::wrapFormFactor(submodule); + python_atomic::wrapImaginaryAnomalousFactor(submodule); + python_atomic::wrapRealAnomalousFactor(submodule); + python_atomic::wrapCoherentPhotonScattering(submodule); + python_atomic::wrapScatteringFactor(submodule); + python_atomic::wrapIncoherentPhotonScattering(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/atomic/CoherentPhotonScattering.python.cpp b/python/src/v2.0/atomic/CoherentPhotonScattering.python.cpp new file mode 100644 index 000000000..3a5eea3f7 --- /dev/null +++ b/python/src/v2.0/atomic/CoherentPhotonScattering.python.cpp @@ -0,0 +1,98 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/atomic/CoherentPhotonScattering.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// CoherentPhotonScattering wrapper +void wrapCoherentPhotonScattering(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = atomic::CoherentPhotonScattering; + + // create the component + python::class_ component( + module, + "CoherentPhotonScattering", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const enums::Frame &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("href") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("pid") = std::nullopt, + python::arg("product_frame"), + python::arg("form_factor") = std::nullopt, + python::arg("imaginary_anomalous_factor") = std::nullopt, + python::arg("real_anomalous_factor") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "form_factor", + python::overload_cast<>(&Component::formFactor), + Component::documentation("form_factor").data() + ) + .def_property_readonly( + "imaginary_anomalous_factor", + python::overload_cast<>(&Component::imaginaryAnomalousFactor), + Component::documentation("imaginary_anomalous_factor").data() + ) + .def_property_readonly( + "real_anomalous_factor", + python::overload_cast<>(&Component::realAnomalousFactor), + Component::documentation("real_anomalous_factor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_atomic +} // namespace python_v2_0 diff --git a/python/src/v2.0/atomic/FormFactor.python.cpp b/python/src/v2.0/atomic/FormFactor.python.cpp new file mode 100644 index 000000000..b07a2bd47 --- /dev/null +++ b/python/src/v2.0/atomic/FormFactor.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/atomic/FormFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// FormFactor wrapper +void wrapFormFactor(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = atomic::FormFactor; + + // create the component + python::class_ component( + module, + "FormFactor", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("regions1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_atomic +} // namespace python_v2_0 diff --git a/python/src/v2.0/atomic/ImaginaryAnomalousFactor.python.cpp b/python/src/v2.0/atomic/ImaginaryAnomalousFactor.python.cpp new file mode 100644 index 000000000..89b16ac22 --- /dev/null +++ b/python/src/v2.0/atomic/ImaginaryAnomalousFactor.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/atomic/ImaginaryAnomalousFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// ImaginaryAnomalousFactor wrapper +void wrapImaginaryAnomalousFactor(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = atomic::ImaginaryAnomalousFactor; + + // create the component + python::class_ component( + module, + "ImaginaryAnomalousFactor", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("regions1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_atomic +} // namespace python_v2_0 diff --git a/python/src/v2.0/atomic/IncoherentPhotonScattering.python.cpp b/python/src/v2.0/atomic/IncoherentPhotonScattering.python.cpp new file mode 100644 index 000000000..55582d6e3 --- /dev/null +++ b/python/src/v2.0/atomic/IncoherentPhotonScattering.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/atomic/IncoherentPhotonScattering.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// IncoherentPhotonScattering wrapper +void wrapIncoherentPhotonScattering(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = atomic::IncoherentPhotonScattering; + + // create the component + python::class_ component( + module, + "IncoherentPhotonScattering", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const enums::Frame &, + const std::optional & + >(), + python::arg("href") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("pid") = std::nullopt, + python::arg("product_frame"), + python::arg("scattering_factor") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "scattering_factor", + python::overload_cast<>(&Component::scatteringFactor), + Component::documentation("scattering_factor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_atomic +} // namespace python_v2_0 diff --git a/python/src/v2.0/atomic/RealAnomalousFactor.python.cpp b/python/src/v2.0/atomic/RealAnomalousFactor.python.cpp new file mode 100644 index 000000000..86d6a902f --- /dev/null +++ b/python/src/v2.0/atomic/RealAnomalousFactor.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/atomic/RealAnomalousFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// RealAnomalousFactor wrapper +void wrapRealAnomalousFactor(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = atomic::RealAnomalousFactor; + + // create the component + python::class_ component( + module, + "RealAnomalousFactor", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("regions1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_atomic +} // namespace python_v2_0 diff --git a/python/src/v2.0/atomic/ScatteringFactor.python.cpp b/python/src/v2.0/atomic/ScatteringFactor.python.cpp new file mode 100644 index 000000000..44236cddc --- /dev/null +++ b/python/src/v2.0/atomic/ScatteringFactor.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/atomic/ScatteringFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// ScatteringFactor wrapper +void wrapScatteringFactor(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = atomic::ScatteringFactor; + + // create the component + python::class_ component( + module, + "ScatteringFactor", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("regions1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_atomic +} // namespace python_v2_0 diff --git a/python/src/v2.0/common.python.cpp b/python/src/v2.0/common.python.cpp new file mode 100644 index 000000000..268e13fcc --- /dev/null +++ b/python/src/v2.0/common.python.cpp @@ -0,0 +1,47 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// common declarations +namespace python_common { + void wrapQ(python::module &); + void wrapEnergy(python::module &); + void wrapExternalFile(python::module &); + void wrapExternalFiles(python::module &); + void wrapMass(python::module &); + void wrapProbability(python::module &); + void wrapProduct(python::module &); + void wrapProducts(python::module &); + void wrapTemperature(python::module &); +} // namespace python_common + +// common wrapper +void wrapCommon(python::module &module) +{ + // create the common submodule + python::module submodule = module.def_submodule( + "common", + "GNDS v2.0 common" + ); + + // wrap common components + python_common::wrapQ(submodule); + python_common::wrapEnergy(submodule); + python_common::wrapExternalFile(submodule); + python_common::wrapExternalFiles(submodule); + python_common::wrapMass(submodule); + python_common::wrapProbability(submodule); + python_common::wrapProduct(submodule); + python_common::wrapProducts(submodule); + python_common::wrapTemperature(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/common/Energy.python.cpp b/python/src/v2.0/common/Energy.python.cpp new file mode 100644 index 000000000..763197fb2 --- /dev/null +++ b/python/src/v2.0/common/Energy.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/common/Energy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// Energy wrapper +void wrapEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = common::Energy; + + // create the component + python::class_ component( + module, + "Energy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("double"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/python/src/v2.0/common/ExternalFile.python.cpp b/python/src/v2.0/common/ExternalFile.python.cpp new file mode 100644 index 000000000..e441778ed --- /dev/null +++ b/python/src/v2.0/common/ExternalFile.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/common/ExternalFile.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// ExternalFile wrapper +void wrapExternalFile(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = common::ExternalFile; + + // create the component + python::class_ component( + module, + "ExternalFile", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const XMLName &, + const XMLName & + >(), + python::arg("algorithm") = std::nullopt, + python::arg("checksum") = std::nullopt, + python::arg("label"), + python::arg("path"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "algorithm", + &Component::algorithm, + Component::documentation("algorithm").data() + ) + .def_property_readonly( + "checksum", + &Component::checksum, + Component::documentation("checksum").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "path", + &Component::path, + Component::documentation("path").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/python/src/v2.0/common/ExternalFiles.python.cpp b/python/src/v2.0/common/ExternalFiles.python.cpp new file mode 100644 index 000000000..a07d48218 --- /dev/null +++ b/python/src/v2.0/common/ExternalFiles.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/common/ExternalFiles.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// ExternalFiles wrapper +void wrapExternalFiles(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = common::ExternalFiles; + + // create the component + python::class_ component( + module, + "ExternalFiles", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("external_file"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "external_file", + python::overload_cast<>(&Component::externalFile), + Component::documentation("external_file").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/python/src/v2.0/common/Mass.python.cpp b/python/src/v2.0/common/Mass.python.cpp new file mode 100644 index 000000000..a39795673 --- /dev/null +++ b/python/src/v2.0/common/Mass.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/common/Mass.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// Mass wrapper +void wrapMass(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = common::Mass; + + // create the component + python::class_ component( + module, + "Mass", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("double"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/python/src/v2.0/common/Probability.python.cpp b/python/src/v2.0/common/Probability.python.cpp new file mode 100644 index 000000000..eaa4a8398 --- /dev/null +++ b/python/src/v2.0/common/Probability.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/common/Probability.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// Probability wrapper +void wrapProbability(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = common::Probability; + + // create the component + python::class_ component( + module, + "Probability", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("double") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/python/src/v2.0/common/Product.python.cpp b/python/src/v2.0/common/Product.python.cpp new file mode 100644 index 000000000..3033c0de9 --- /dev/null +++ b/python/src/v2.0/common/Product.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/common/Product.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// Product wrapper +void wrapProduct(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = common::Product; + + // create the component + python::class_ component( + module, + "Product", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const transport::Distribution &, + const transport::Multiplicity &, + const std::optional & + >(), + python::arg("label"), + python::arg("pid"), + python::arg("distribution"), + python::arg("multiplicity"), + python::arg("output_channel") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + .def_property_readonly( + "distribution", + python::overload_cast<>(&Component::distribution), + Component::documentation("distribution").data() + ) + .def_property_readonly( + "multiplicity", + python::overload_cast<>(&Component::multiplicity), + Component::documentation("multiplicity").data() + ) + .def_property_readonly( + "output_channel", + python::overload_cast<>(&Component::outputChannel), + Component::documentation("output_channel").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/python/src/v2.0/common/Products.python.cpp b/python/src/v2.0/common/Products.python.cpp new file mode 100644 index 000000000..25d69fcc2 --- /dev/null +++ b/python/src/v2.0/common/Products.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/common/Products.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// Products wrapper +void wrapProducts(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = common::Products; + + // create the component + python::class_ component( + module, + "Products", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("product") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "product", + python::overload_cast<>(&Component::product), + Component::documentation("product").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/python/src/v2.0/common/Q.python.cpp b/python/src/v2.0/common/Q.python.cpp new file mode 100644 index 000000000..7ef93a75e --- /dev/null +++ b/python/src/v2.0/common/Q.python.cpp @@ -0,0 +1,88 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/common/Q.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// Q wrapper +void wrapQ(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = common::Q; + using _t = std::variant< + containers::XYs1d, + containers::Constant1d, + containers::Gridded1d, + containers::Polynomial1d, + containers::Regions1d + >; + + // create the component + python::class_ component( + module, + "Q", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_xys1dconstant1dgridded1dpolynomial1dregions1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "constant1d", + python::overload_cast<>(&Component::constant1d), + Component::documentation("constant1d").data() + ) + .def_property_readonly( + "gridded1d", + python::overload_cast<>(&Component::gridded1d), + Component::documentation("gridded1d").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + .def_property_readonly( + "_xys1dconstant1dgridded1dpolynomial1dregions1d", + python::overload_cast<>(&Component::_XYs1dconstant1dgridded1dpolynomial1dregions1d), + Component::documentation("_xys1dconstant1dgridded1dpolynomial1dregions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/python/src/v2.0/common/Temperature.python.cpp b/python/src/v2.0/common/Temperature.python.cpp new file mode 100644 index 000000000..f139892a2 --- /dev/null +++ b/python/src/v2.0/common/Temperature.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/common/Temperature.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// Temperature wrapper +void wrapTemperature(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = common::Temperature; + + // create the component + python::class_ component( + module, + "Temperature", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("unit") = std::nullopt, + python::arg("value") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers.python.cpp b/python/src/v2.0/containers.python.cpp new file mode 100644 index 000000000..dd02d5077 --- /dev/null +++ b/python/src/v2.0/containers.python.cpp @@ -0,0 +1,89 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// 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 wrapLegendre(python::module &); + void wrapConstant1d(python::module &); + void wrapArray(python::module &); + void wrapGridded1d(python::module &); + void wrapPolynomial1d(python::module &); + void wrapFunction1ds(python::module &); + void wrapRegions1d(python::module &); + void wrapDouble(python::module &); + void wrapXYs2d(python::module &); + void wrapGridded2d(python::module &); + void wrapFunction2ds(python::module &); + void wrapRegions2d(python::module &); + void wrapYs1d(python::module &); + void wrapXYs3d(python::module &); + void wrapGridded3d(python::module &); + void wrapString(python::module &); + void wrapColumn(python::module &); + void wrapColumnHeaders(python::module &); + void wrapData(python::module &); + void wrapFraction(python::module &); + void wrapFunction3ds(python::module &); + void wrapInteger(python::module &); + void wrapRegions3d(python::module &); + void wrapTable(python::module &); +} // namespace python_containers + +// containers wrapper +void wrapContainers(python::module &module) +{ + // create the containers submodule + python::module submodule = module.def_submodule( + "containers", + "GNDS v2.0 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::wrapLegendre(submodule); + python_containers::wrapConstant1d(submodule); + python_containers::wrapArray(submodule); + python_containers::wrapGridded1d(submodule); + python_containers::wrapPolynomial1d(submodule); + python_containers::wrapFunction1ds(submodule); + python_containers::wrapRegions1d(submodule); + python_containers::wrapDouble(submodule); + python_containers::wrapXYs2d(submodule); + python_containers::wrapGridded2d(submodule); + python_containers::wrapFunction2ds(submodule); + python_containers::wrapRegions2d(submodule); + python_containers::wrapYs1d(submodule); + python_containers::wrapXYs3d(submodule); + python_containers::wrapGridded3d(submodule); + python_containers::wrapString(submodule); + python_containers::wrapColumn(submodule); + python_containers::wrapColumnHeaders(submodule); + python_containers::wrapData(submodule); + python_containers::wrapFraction(submodule); + python_containers::wrapFunction3ds(submodule); + python_containers::wrapInteger(submodule); + python_containers::wrapRegions3d(submodule); + python_containers::wrapTable(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Array.python.cpp b/python/src/v2.0/containers/Array.python.cpp new file mode 100644 index 000000000..88621ba67 --- /dev/null +++ b/python/src/v2.0/containers/Array.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Array.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Array wrapper +void wrapArray(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Array; + + // create the component + python::class_ component( + module, + "Array", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const IntegerTuple &, + const std::optional &, + const std::optional &, + const std::optional> &, + const std::optional> & + >(), + python::arg("compression") = std::nullopt, + python::arg("offset") = std::nullopt, + python::arg("permutation") = std::nullopt, + python::arg("shape"), + python::arg("storage_order") = std::nullopt, + python::arg("symmetry") = std::nullopt, + python::arg("array") = std::nullopt, + python::arg("values") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "compression", + [](const Component &self) { return self.compression().value(); }, + Component::documentation("compression").data() + ) + .def_property_readonly( + "offset", + &Component::offset, + Component::documentation("offset").data() + ) + .def_property_readonly( + "permutation", + [](const Component &self) { return self.permutation().value(); }, + Component::documentation("permutation").data() + ) + .def_property_readonly( + "shape", + &Component::shape, + Component::documentation("shape").data() + ) + .def_property_readonly( + "storage_order", + [](const Component &self) { return self.storageOrder().value(); }, + Component::documentation("storage_order").data() + ) + .def_property_readonly( + "symmetry", + [](const Component &self) { return self.symmetry().value(); }, + Component::documentation("symmetry").data() + ) + .def_property_readonly( + "array", + python::overload_cast<>(&Component::array), + Component::documentation("array").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_v2_0 diff --git a/python/src/v2.0/containers/Axes.python.cpp b/python/src/v2.0/containers/Axes.python.cpp new file mode 100644 index 000000000..bc2c6c773 --- /dev/null +++ b/python/src/v2.0/containers/Axes.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Axes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Axes wrapper +void wrapAxes(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Axes; + + // create the component + python::class_ component( + module, + "Axes", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional> &, + const std::optional> & + >(), + python::arg("href") = std::nullopt, + python::arg("axis") = std::nullopt, + python::arg("grid") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "axis", + python::overload_cast<>(&Component::axis), + Component::documentation("axis").data() + ) + .def_property_readonly( + "grid", + python::overload_cast<>(&Component::grid), + Component::documentation("grid").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Axis.python.cpp b/python/src/v2.0/containers/Axis.python.cpp new file mode 100644 index 000000000..5d19b1fb9 --- /dev/null +++ b/python/src/v2.0/containers/Axis.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Axis.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Axis wrapper +void wrapAxis(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // 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_v2_0 diff --git a/python/src/v2.0/containers/Column.python.cpp b/python/src/v2.0/containers/Column.python.cpp new file mode 100644 index 000000000..3829a96cd --- /dev/null +++ b/python/src/v2.0/containers/Column.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Column.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Column wrapper +void wrapColumn(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Column; + + // create the component + python::class_ component( + module, + "Column", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Integer32 &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + python::arg("index"), + python::arg("name"), + python::arg("types") = std::nullopt, + python::arg("unit") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "index", + &Component::index, + Component::documentation("index").data() + ) + .def_property_readonly( + "name", + &Component::name, + Component::documentation("name").data() + ) + .def_property_readonly( + "types", + &Component::types, + Component::documentation("types").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/ColumnHeaders.python.cpp b/python/src/v2.0/containers/ColumnHeaders.python.cpp new file mode 100644 index 000000000..27ff66229 --- /dev/null +++ b/python/src/v2.0/containers/ColumnHeaders.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/ColumnHeaders.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// ColumnHeaders wrapper +void wrapColumnHeaders(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::ColumnHeaders; + + // create the component + python::class_ component( + module, + "ColumnHeaders", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("column"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "column", + python::overload_cast<>(&Component::column), + Component::documentation("column").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Constant1d.python.cpp b/python/src/v2.0/containers/Constant1d.python.cpp new file mode 100644 index 000000000..114a529e0 --- /dev/null +++ b/python/src/v2.0/containers/Constant1d.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Constant1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Constant1d wrapper +void wrapConstant1d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Constant1d; + + // create the component + python::class_ component( + module, + "Constant1d", + 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::Axes & + >(), + python::arg("domain_max") = std::nullopt, + python::arg("domain_min") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("outer_domain_value") = std::nullopt, + python::arg("value") = std::nullopt, + python::arg("axes"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "domain_max", + &Component::domainMax, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + &Component::domainMin, + Component::documentation("domain_min").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( + "value", + &Component::value, + Component::documentation("value").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_v2_0 diff --git a/python/src/v2.0/containers/Data.python.cpp b/python/src/v2.0/containers/Data.python.cpp new file mode 100644 index 000000000..25555de02 --- /dev/null +++ b/python/src/v2.0/containers/Data.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Data.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Data wrapper +void wrapData(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Data; + + // create the component + python::class_ component( + module, + "Data", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("sep") = 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( + "sep", + [](const Component &self) { return self.sep().value(); }, + Component::documentation("sep").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_v2_0 diff --git a/python/src/v2.0/containers/Double.python.cpp b/python/src/v2.0/containers/Double.python.cpp new file mode 100644 index 000000000..783c2029d --- /dev/null +++ b/python/src/v2.0/containers/Double.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Double.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Double wrapper +void wrapDouble(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Double; + + // create the component + python::class_ component( + module, + "Double", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const Float64 & + >(), + python::arg("label") = std::nullopt, + python::arg("unit") = std::nullopt, + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Fraction.python.cpp b/python/src/v2.0/containers/Fraction.python.cpp new file mode 100644 index 000000000..6c20d5221 --- /dev/null +++ b/python/src/v2.0/containers/Fraction.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Fraction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Fraction wrapper +void wrapFraction(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Fraction; + + // create the component + python::class_ component( + module, + "Fraction", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const Fraction32 & + >(), + python::arg("label") = std::nullopt, + python::arg("unit") = std::nullopt, + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Function1ds.python.cpp b/python/src/v2.0/containers/Function1ds.python.cpp new file mode 100644 index 000000000..b60b9be90 --- /dev/null +++ b/python/src/v2.0/containers/Function1ds.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Function1ds.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Function1ds wrapper +void wrapFunction1ds(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Function1ds; + using _t = std::variant< + containers::Legendre, + containers::XYs1d, + containers::Constant1d, + containers::Gridded1d, + containers::Polynomial1d + >; + + // create the component + python::class_ component( + module, + "Function1ds", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector<_t> & + >(), + python::arg("_legendre_xys1dconstant1dgridded1dpolynomial1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "_legendre_xys1dconstant1dgridded1dpolynomial1d", + python::overload_cast<>(&Component::_LegendreXYs1dconstant1dgridded1dpolynomial1d), + Component::documentation("_legendre_xys1dconstant1dgridded1dpolynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Function2ds.python.cpp b/python/src/v2.0/containers/Function2ds.python.cpp new file mode 100644 index 000000000..f227d07f0 --- /dev/null +++ b/python/src/v2.0/containers/Function2ds.python.cpp @@ -0,0 +1,60 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Function2ds.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Function2ds wrapper +void wrapFunction2ds(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Function2ds; + using _t = std::variant< + containers::XYs2d, + containers::Gridded2d + >; + + // create the component + python::class_ component( + module, + "Function2ds", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector<_t> & + >(), + python::arg("_xys2dgridded2d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "_xys2dgridded2d", + python::overload_cast<>(&Component::_XYs2dgridded2d), + Component::documentation("_xys2dgridded2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Function3ds.python.cpp b/python/src/v2.0/containers/Function3ds.python.cpp new file mode 100644 index 000000000..2350092aa --- /dev/null +++ b/python/src/v2.0/containers/Function3ds.python.cpp @@ -0,0 +1,60 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Function3ds.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Function3ds wrapper +void wrapFunction3ds(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Function3ds; + using _t = std::variant< + containers::XYs3d, + containers::Gridded3d + >; + + // create the component + python::class_ component( + module, + "Function3ds", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector<_t> & + >(), + python::arg("_xys3dgridded3d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "_xys3dgridded3d", + python::overload_cast<>(&Component::_XYs3dgridded3d), + Component::documentation("_xys3dgridded3d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Grid.python.cpp b/python/src/v2.0/containers/Grid.python.cpp new file mode 100644 index 000000000..602ad3d60 --- /dev/null +++ b/python/src/v2.0/containers/Grid.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Grid.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Grid wrapper +void wrapGrid(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Grid; + using _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 _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("_linkvalues"), + 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( + "_linkvalues", + python::overload_cast<>(&Component::_linkvalues), + Component::documentation("_linkvalues").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Gridded1d.python.cpp b/python/src/v2.0/containers/Gridded1d.python.cpp new file mode 100644 index 000000000..3ce9c5bd7 --- /dev/null +++ b/python/src/v2.0/containers/Gridded1d.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Gridded1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Gridded1d wrapper +void wrapGridded1d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Gridded1d; + + // create the component + python::class_ component( + module, + "Gridded1d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const containers::Array &, + const containers::Axes & + >(), + python::arg("label") = std::nullopt, + python::arg("array"), + python::arg("axes"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "array", + python::overload_cast<>(&Component::array), + Component::documentation("array").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_v2_0 diff --git a/python/src/v2.0/containers/Gridded2d.python.cpp b/python/src/v2.0/containers/Gridded2d.python.cpp new file mode 100644 index 000000000..22a05b606 --- /dev/null +++ b/python/src/v2.0/containers/Gridded2d.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Gridded2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Gridded2d wrapper +void wrapGridded2d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Gridded2d; + + // create the component + python::class_ component( + module, + "Gridded2d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const containers::Array &, + const containers::Axes & + >(), + python::arg("label") = std::nullopt, + python::arg("array"), + python::arg("axes"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "array", + python::overload_cast<>(&Component::array), + Component::documentation("array").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_v2_0 diff --git a/python/src/v2.0/containers/Gridded3d.python.cpp b/python/src/v2.0/containers/Gridded3d.python.cpp new file mode 100644 index 000000000..2afb0c8a1 --- /dev/null +++ b/python/src/v2.0/containers/Gridded3d.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Gridded3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Gridded3d wrapper +void wrapGridded3d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Gridded3d; + + // create the component + python::class_ component( + module, + "Gridded3d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const containers::Array &, + const containers::Axes & + >(), + python::arg("label") = std::nullopt, + python::arg("array"), + python::arg("axes"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "array", + python::overload_cast<>(&Component::array), + Component::documentation("array").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_v2_0 diff --git a/python/src/v2.0/containers/Integer.python.cpp b/python/src/v2.0/containers/Integer.python.cpp new file mode 100644 index 000000000..35ac60981 --- /dev/null +++ b/python/src/v2.0/containers/Integer.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Integer.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Integer wrapper +void wrapInteger(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Integer; + + // create the component + python::class_ component( + module, + "Integer", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const Integer32 & + >(), + python::arg("label") = std::nullopt, + python::arg("unit") = std::nullopt, + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Legendre.python.cpp b/python/src/v2.0/containers/Legendre.python.cpp new file mode 100644 index 000000000..55d64b096 --- /dev/null +++ b/python/src/v2.0/containers/Legendre.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Legendre.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Legendre wrapper +void wrapLegendre(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Legendre; + + // create the component + python::class_ component( + module, + "Legendre", + 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("domain_max") = std::nullopt, + python::arg("domain_min") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("lower_index") = std::nullopt, + python::arg("outer_domain_value") = std::nullopt, + python::arg("values"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "domain_max", + [](const Component &self) { return self.domainMax().value(); }, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + [](const Component &self) { return self.domainMin().value(); }, + Component::documentation("domain_min").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "lower_index", + [](const Component &self) { return self.lowerIndex().value(); }, + Component::documentation("lower_index").data() + ) + .def_property_readonly( + "outer_domain_value", + &Component::outerDomainValue, + Component::documentation("outer_domain_value").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_v2_0 diff --git a/python/src/v2.0/containers/Link.python.cpp b/python/src/v2.0/containers/Link.python.cpp new file mode 100644 index 000000000..d33ab3fe1 --- /dev/null +++ b/python/src/v2.0/containers/Link.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Link.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Link wrapper +void wrapLink(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // 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::optional & + >(), + python::arg("href") = std::nullopt, + 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_v2_0 diff --git a/python/src/v2.0/containers/Polynomial1d.python.cpp b/python/src/v2.0/containers/Polynomial1d.python.cpp new file mode 100644 index 000000000..bd2907a84 --- /dev/null +++ b/python/src/v2.0/containers/Polynomial1d.python.cpp @@ -0,0 +1,98 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Polynomial1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Polynomial1d wrapper +void wrapPolynomial1d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Polynomial1d; + + // create the component + python::class_ component( + module, + "Polynomial1d", + 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::Axes &, + const containers::Values & + >(), + python::arg("domain_max") = std::nullopt, + python::arg("domain_min") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("lower_index") = std::nullopt, + python::arg("outer_domain_value") = std::nullopt, + python::arg("axes"), + python::arg("values"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "domain_max", + &Component::domainMax, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + &Component::domainMin, + Component::documentation("domain_min").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "lower_index", + [](const Component &self) { return self.lowerIndex().value(); }, + Component::documentation("lower_index").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_v2_0 diff --git a/python/src/v2.0/containers/Regions1d.python.cpp b/python/src/v2.0/containers/Regions1d.python.cpp new file mode 100644 index 000000000..7a360511f --- /dev/null +++ b/python/src/v2.0/containers/Regions1d.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Regions1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Regions1d wrapper +void wrapRegions1d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // 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::optional &, + const containers::Function1ds & + >(), + python::arg("label") = std::nullopt, + python::arg("outer_domain_value") = std::nullopt, + python::arg("axes") = std::nullopt, + python::arg("function1ds"), + 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( + "axes", + python::overload_cast<>(&Component::axes), + Component::documentation("axes").data() + ) + .def_property_readonly( + "function1ds", + python::overload_cast<>(&Component::function1ds), + Component::documentation("function1ds").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Regions2d.python.cpp b/python/src/v2.0/containers/Regions2d.python.cpp new file mode 100644 index 000000000..2e815efa1 --- /dev/null +++ b/python/src/v2.0/containers/Regions2d.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Regions2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Regions2d wrapper +void wrapRegions2d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Regions2d; + + // create the component + python::class_ component( + module, + "Regions2d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Function2ds & + >(), + python::arg("label") = std::nullopt, + python::arg("outer_domain_value") = std::nullopt, + python::arg("axes") = std::nullopt, + python::arg("function2ds"), + 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( + "axes", + python::overload_cast<>(&Component::axes), + Component::documentation("axes").data() + ) + .def_property_readonly( + "function2ds", + python::overload_cast<>(&Component::function2ds), + Component::documentation("function2ds").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Regions3d.python.cpp b/python/src/v2.0/containers/Regions3d.python.cpp new file mode 100644 index 000000000..2b8aff7a6 --- /dev/null +++ b/python/src/v2.0/containers/Regions3d.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Regions3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Regions3d wrapper +void wrapRegions3d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Regions3d; + + // create the component + python::class_ component( + module, + "Regions3d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Function3ds & + >(), + python::arg("label") = std::nullopt, + python::arg("outer_domain_value") = std::nullopt, + python::arg("axes") = std::nullopt, + python::arg("function3ds"), + 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( + "axes", + python::overload_cast<>(&Component::axes), + Component::documentation("axes").data() + ) + .def_property_readonly( + "function3ds", + python::overload_cast<>(&Component::function3ds), + Component::documentation("function3ds").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/String.python.cpp b/python/src/v2.0/containers/String.python.cpp new file mode 100644 index 000000000..c33b29969 --- /dev/null +++ b/python/src/v2.0/containers/String.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/String.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// String wrapper +void wrapString(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::String; + + // create the component + python::class_ component( + module, + "String", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const XMLName & + >(), + python::arg("label") = std::nullopt, + python::arg("unit") = std::nullopt, + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Table.python.cpp b/python/src/v2.0/containers/Table.python.cpp new file mode 100644 index 000000000..94239c1ba --- /dev/null +++ b/python/src/v2.0/containers/Table.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Table.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Table wrapper +void wrapTable(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Table; + + // create the component + python::class_ component( + module, + "Table", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Integer32 &, + const Integer32 &, + const std::optional &, + const containers::ColumnHeaders &, + const containers::Data & + >(), + python::arg("columns"), + python::arg("rows"), + python::arg("storage_order") = std::nullopt, + python::arg("column_headers"), + python::arg("data"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "columns", + &Component::columns, + Component::documentation("columns").data() + ) + .def_property_readonly( + "rows", + &Component::rows, + Component::documentation("rows").data() + ) + .def_property_readonly( + "storage_order", + [](const Component &self) { return self.storageOrder().value(); }, + Component::documentation("storage_order").data() + ) + .def_property_readonly( + "column_headers", + python::overload_cast<>(&Component::columnHeaders), + Component::documentation("column_headers").data() + ) + .def_property_readonly( + "data", + python::overload_cast<>(&Component::data), + Component::documentation("data").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Values.python.cpp b/python/src/v2.0/containers/Values.python.cpp new file mode 100644 index 000000000..b2358a8f6 --- /dev/null +++ b/python/src/v2.0/containers/Values.python.cpp @@ -0,0 +1,127 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Values.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Values wrapper +void wrapValues(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // 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 &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("count") = std::nullopt, + python::arg("href") = std::nullopt, + python::arg("length") = std::nullopt, + python::arg("start") = std::nullopt, + python::arg("start_index") = 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( + "count", + &Component::count, + Component::documentation("count").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").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( + "start_index", + &Component::startIndex, + Component::documentation("start_index").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_v2_0 diff --git a/python/src/v2.0/containers/XYs1d.python.cpp b/python/src/v2.0/containers/XYs1d.python.cpp new file mode 100644 index 000000000..44a5ea6cc --- /dev/null +++ b/python/src/v2.0/containers/XYs1d.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/XYs1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// XYs1d wrapper +void wrapXYs1d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // 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_v2_0 diff --git a/python/src/v2.0/containers/XYs2d.python.cpp b/python/src/v2.0/containers/XYs2d.python.cpp new file mode 100644 index 000000000..869f3b455 --- /dev/null +++ b/python/src/v2.0/containers/XYs2d.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/XYs2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// XYs2d wrapper +void wrapXYs2d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::XYs2d; + + // create the component + python::class_ component( + module, + "XYs2d", + 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::Function1ds & + >(), + python::arg("index") = std::nullopt, + python::arg("interpolation") = std::nullopt, + python::arg("interpolation_qualifier") = std::nullopt, + python::arg("outer_domain_value") = std::nullopt, + python::arg("axes") = std::nullopt, + python::arg("function1ds"), + 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( + "interpolation_qualifier", + &Component::interpolationQualifier, + Component::documentation("interpolation_qualifier").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( + "function1ds", + python::overload_cast<>(&Component::function1ds), + Component::documentation("function1ds").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/XYs3d.python.cpp b/python/src/v2.0/containers/XYs3d.python.cpp new file mode 100644 index 000000000..00e7e247a --- /dev/null +++ b/python/src/v2.0/containers/XYs3d.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/XYs3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// XYs3d wrapper +void wrapXYs3d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::XYs3d; + + // create the component + python::class_ component( + module, + "XYs3d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Function2ds & + >(), + python::arg("interpolation") = std::nullopt, + python::arg("interpolation_qualifier") = std::nullopt, + python::arg("axes") = std::nullopt, + python::arg("function2ds"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "interpolation", + [](const Component &self) { return self.interpolation().value(); }, + Component::documentation("interpolation").data() + ) + .def_property_readonly( + "interpolation_qualifier", + &Component::interpolationQualifier, + Component::documentation("interpolation_qualifier").data() + ) + .def_property_readonly( + "axes", + python::overload_cast<>(&Component::axes), + Component::documentation("axes").data() + ) + .def_property_readonly( + "function2ds", + python::overload_cast<>(&Component::function2ds), + Component::documentation("function2ds").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/python/src/v2.0/containers/Ys1d.python.cpp b/python/src/v2.0/containers/Ys1d.python.cpp new file mode 100644 index 000000000..4c6ca9ecb --- /dev/null +++ b/python/src/v2.0/containers/Ys1d.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/containers/Ys1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// Ys1d wrapper +void wrapYs1d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = containers::Ys1d; + + // create the component + python::class_ component( + module, + "Ys1d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const containers::Axes &, + const containers::Values & + >(), + python::arg("interpolation") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("axes"), + python::arg("values"), + Component::documentation("constructor").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( + "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_v2_0 diff --git a/python/src/v2.0/covariance.python.cpp b/python/src/v2.0/covariance.python.cpp new file mode 100644 index 000000000..88456fdfe --- /dev/null +++ b/python/src/v2.0/covariance.python.cpp @@ -0,0 +1,73 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// covariance declarations +namespace python_covariance { + void wrapSlice(python::module &); + void wrapSlices(python::module &); + void wrapColumnData(python::module &); + void wrapRowData(python::module &); + void wrapColumnSensitivity(python::module &); + void wrapCovariance(python::module &); + void wrapRowSensitivity(python::module &); + void wrapSandwichProduct(python::module &); + void wrapCovarianceMatrix(python::module &); + void wrapAverageParameterCovariance(python::module &); + void wrapShortRangeSelfScalingVariance(python::module &); + void wrapSummand(python::module &); + void wrapSum(python::module &); + void wrapMixed(python::module &); + void wrapCovarianceSection(python::module &); + void wrapCovarianceSections(python::module &); + void wrapParameterCovariance(python::module &); + void wrapParameterCovariances(python::module &); + void wrapCovarianceSuite(python::module &); + void wrapParameterLink(python::module &); + void wrapParameters(python::module &); + void wrapParameterCovariancMatrix(python::module &); +} // namespace python_covariance + +// covariance wrapper +void wrapCovariance(python::module &module) +{ + // create the covariance submodule + python::module submodule = module.def_submodule( + "covariance", + "GNDS v2.0 covariance" + ); + + // wrap covariance components + python_covariance::wrapSlice(submodule); + python_covariance::wrapSlices(submodule); + python_covariance::wrapColumnData(submodule); + python_covariance::wrapRowData(submodule); + python_covariance::wrapColumnSensitivity(submodule); + python_covariance::wrapCovariance(submodule); + python_covariance::wrapRowSensitivity(submodule); + python_covariance::wrapSandwichProduct(submodule); + python_covariance::wrapCovarianceMatrix(submodule); + python_covariance::wrapAverageParameterCovariance(submodule); + python_covariance::wrapShortRangeSelfScalingVariance(submodule); + python_covariance::wrapSummand(submodule); + python_covariance::wrapSum(submodule); + python_covariance::wrapMixed(submodule); + python_covariance::wrapCovarianceSection(submodule); + python_covariance::wrapCovarianceSections(submodule); + python_covariance::wrapParameterCovariance(submodule); + python_covariance::wrapParameterCovariances(submodule); + python_covariance::wrapCovarianceSuite(submodule); + python_covariance::wrapParameterLink(submodule); + python_covariance::wrapParameters(submodule); + python_covariance::wrapParameterCovariancMatrix(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/AverageParameterCovariance.python.cpp b/python/src/v2.0/covariance/AverageParameterCovariance.python.cpp new file mode 100644 index 000000000..84cbc2b01 --- /dev/null +++ b/python/src/v2.0/covariance/AverageParameterCovariance.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/AverageParameterCovariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// AverageParameterCovariance wrapper +void wrapAverageParameterCovariance(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::AverageParameterCovariance; + using _t = std::variant< + covariance::CovarianceMatrix + >; + + // create the component + python::class_ component( + module, + "AverageParameterCovariance", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const _t & + >(), + python::arg("cross_term") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("column_data") = std::nullopt, + python::arg("row_data") = std::nullopt, + python::arg("_covariance_matrix"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "cross_term", + &Component::crossTerm, + Component::documentation("cross_term").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "column_data", + python::overload_cast<>(&Component::columnData), + Component::documentation("column_data").data() + ) + .def_property_readonly( + "row_data", + python::overload_cast<>(&Component::rowData), + Component::documentation("row_data").data() + ) + .def_property_readonly( + "covariance_matrix", + python::overload_cast<>(&Component::covarianceMatrix), + Component::documentation("covariance_matrix").data() + ) + .def_property_readonly( + "_covariance_matrix", + python::overload_cast<>(&Component::_covarianceMatrix), + Component::documentation("_covariance_matrix").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/ColumnData.python.cpp b/python/src/v2.0/covariance/ColumnData.python.cpp new file mode 100644 index 000000000..fcc5b7044 --- /dev/null +++ b/python/src/v2.0/covariance/ColumnData.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/ColumnData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// ColumnData wrapper +void wrapColumnData(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::ColumnData; + + // create the component + python::class_ component( + module, + "ColumnData", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("endf_mfmt") = std::nullopt, + python::arg("dimension") = std::nullopt, + python::arg("href") = std::nullopt, + python::arg("slices") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "endf_mfmt", + &Component::ENDF_MFMT, + Component::documentation("endf_mfmt").data() + ) + .def_property_readonly( + "dimension", + &Component::dimension, + Component::documentation("dimension").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "slices", + python::overload_cast<>(&Component::slices), + Component::documentation("slices").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/ColumnSensitivity.python.cpp b/python/src/v2.0/covariance/ColumnSensitivity.python.cpp new file mode 100644 index 000000000..6abc20ce7 --- /dev/null +++ b/python/src/v2.0/covariance/ColumnSensitivity.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/ColumnSensitivity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// ColumnSensitivity wrapper +void wrapColumnSensitivity(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::ColumnSensitivity; + + // create the component + python::class_ component( + module, + "ColumnSensitivity", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Array & + >(), + python::arg("array"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "array", + python::overload_cast<>(&Component::array), + Component::documentation("array").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/Covariance.python.cpp b/python/src/v2.0/covariance/Covariance.python.cpp new file mode 100644 index 000000000..e7dc38304 --- /dev/null +++ b/python/src/v2.0/covariance/Covariance.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/Covariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// Covariance wrapper +void wrapCovariance(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::Covariance; + + // create the component + python::class_ component( + module, + "Covariance", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Array & + >(), + python::arg("array"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "array", + python::overload_cast<>(&Component::array), + Component::documentation("array").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/CovarianceMatrix.python.cpp b/python/src/v2.0/covariance/CovarianceMatrix.python.cpp new file mode 100644 index 000000000..703aff5e3 --- /dev/null +++ b/python/src/v2.0/covariance/CovarianceMatrix.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/CovarianceMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// CovarianceMatrix wrapper +void wrapCovarianceMatrix(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::CovarianceMatrix; + using _t = std::variant< + containers::Gridded2d, + covariance::SandwichProduct + >; + + // create the component + python::class_ component( + module, + "CovarianceMatrix", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const XMLName &, + const _t & + >(), + python::arg("label") = std::nullopt, + python::arg("product_frame") = std::nullopt, + python::arg("type"), + python::arg("_gridded2dsandwich_product"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "type", + &Component::type, + Component::documentation("type").data() + ) + .def_property_readonly( + "gridded2d", + python::overload_cast<>(&Component::gridded2d), + Component::documentation("gridded2d").data() + ) + .def_property_readonly( + "sandwich_product", + python::overload_cast<>(&Component::sandwichProduct), + Component::documentation("sandwich_product").data() + ) + .def_property_readonly( + "_gridded2dsandwich_product", + python::overload_cast<>(&Component::_gridded2dsandwichProduct), + Component::documentation("_gridded2dsandwich_product").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/CovarianceSection.python.cpp b/python/src/v2.0/covariance/CovarianceSection.python.cpp new file mode 100644 index 000000000..683e94fc7 --- /dev/null +++ b/python/src/v2.0/covariance/CovarianceSection.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/CovarianceSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// CovarianceSection wrapper +void wrapCovarianceSection(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::CovarianceSection; + using _t = std::variant< + covariance::CovarianceMatrix, + covariance::Mixed, + covariance::Sum + >; + + // create the component + python::class_ component( + module, + "CovarianceSection", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const covariance::RowData &, + const _t & + >(), + python::arg("cross_term") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("column_data") = std::nullopt, + python::arg("row_data"), + python::arg("_covariance_matrixmixedsum"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "cross_term", + [](const Component &self) { return self.crossTerm().value(); }, + Component::documentation("cross_term").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "column_data", + python::overload_cast<>(&Component::columnData), + Component::documentation("column_data").data() + ) + .def_property_readonly( + "row_data", + python::overload_cast<>(&Component::rowData), + Component::documentation("row_data").data() + ) + .def_property_readonly( + "covariance_matrix", + python::overload_cast<>(&Component::covarianceMatrix), + Component::documentation("covariance_matrix").data() + ) + .def_property_readonly( + "mixed", + python::overload_cast<>(&Component::mixed), + Component::documentation("mixed").data() + ) + .def_property_readonly( + "sum", + python::overload_cast<>(&Component::sum), + Component::documentation("sum").data() + ) + .def_property_readonly( + "_covariance_matrixmixedsum", + python::overload_cast<>(&Component::_covarianceMatrixmixedsum), + Component::documentation("_covariance_matrixmixedsum").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/CovarianceSections.python.cpp b/python/src/v2.0/covariance/CovarianceSections.python.cpp new file mode 100644 index 000000000..3adc2f904 --- /dev/null +++ b/python/src/v2.0/covariance/CovarianceSections.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/CovarianceSections.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// CovarianceSections wrapper +void wrapCovarianceSections(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::CovarianceSections; + + // create the component + python::class_ component( + module, + "CovarianceSections", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("covariance_section") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "covariance_section", + python::overload_cast<>(&Component::covarianceSection), + Component::documentation("covariance_section").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/CovarianceSuite.python.cpp b/python/src/v2.0/covariance/CovarianceSuite.python.cpp new file mode 100644 index 000000000..165492548 --- /dev/null +++ b/python/src/v2.0/covariance/CovarianceSuite.python.cpp @@ -0,0 +1,112 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/CovarianceSuite.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// CovarianceSuite wrapper +void wrapCovarianceSuite(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::CovarianceSuite; + + // create the component + python::class_ component( + module, + "CovarianceSuite", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const enums::Interaction &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("evaluation") = std::nullopt, + python::arg("version") = std::nullopt, + python::arg("interaction"), + python::arg("projectile") = std::nullopt, + python::arg("target") = std::nullopt, + python::arg("covariance_sections") = std::nullopt, + python::arg("external_files") = std::nullopt, + python::arg("parameter_covariances") = std::nullopt, + python::arg("styles") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "evaluation", + &Component::evaluation, + Component::documentation("evaluation").data() + ) + .def_property_readonly( + "version", + &Component::version, + Component::documentation("version").data() + ) + .def_property_readonly( + "interaction", + &Component::interaction, + Component::documentation("interaction").data() + ) + .def_property_readonly( + "projectile", + &Component::projectile, + Component::documentation("projectile").data() + ) + .def_property_readonly( + "target", + &Component::target, + Component::documentation("target").data() + ) + .def_property_readonly( + "covariance_sections", + python::overload_cast<>(&Component::covarianceSections), + Component::documentation("covariance_sections").data() + ) + .def_property_readonly( + "external_files", + python::overload_cast<>(&Component::externalFiles), + Component::documentation("external_files").data() + ) + .def_property_readonly( + "parameter_covariances", + python::overload_cast<>(&Component::parameterCovariances), + Component::documentation("parameter_covariances").data() + ) + .def_property_readonly( + "styles", + python::overload_cast<>(&Component::styles), + Component::documentation("styles").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/Mixed.python.cpp b/python/src/v2.0/covariance/Mixed.python.cpp new file mode 100644 index 000000000..1d82d3864 --- /dev/null +++ b/python/src/v2.0/covariance/Mixed.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/Mixed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// Mixed wrapper +void wrapMixed(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::Mixed; + + // create the component + python::class_ component( + module, + "Mixed", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional> &, + const std::optional> &, + const std::optional> & + >(), + python::arg("label"), + python::arg("covariance_matrix") = std::nullopt, + python::arg("short_range_self_scaling_variance") = std::nullopt, + python::arg("sum") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "covariance_matrix", + python::overload_cast<>(&Component::covarianceMatrix), + Component::documentation("covariance_matrix").data() + ) + .def_property_readonly( + "short_range_self_scaling_variance", + python::overload_cast<>(&Component::shortRangeSelfScalingVariance), + Component::documentation("short_range_self_scaling_variance").data() + ) + .def_property_readonly( + "sum", + python::overload_cast<>(&Component::sum), + Component::documentation("sum").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/ParameterCovariancMatrix.python.cpp b/python/src/v2.0/covariance/ParameterCovariancMatrix.python.cpp new file mode 100644 index 000000000..63259079e --- /dev/null +++ b/python/src/v2.0/covariance/ParameterCovariancMatrix.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/ParameterCovariancMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// ParameterCovariancMatrix wrapper +void wrapParameterCovariancMatrix(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::ParameterCovariancMatrix; + + // create the component + python::class_ component( + module, + "ParameterCovariancMatrix", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional &, + const containers::Array &, + const covariance::Parameters & + >(), + python::arg("label"), + python::arg("type") = std::nullopt, + python::arg("array"), + python::arg("parameters"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "type", + &Component::type, + Component::documentation("type").data() + ) + .def_property_readonly( + "array", + python::overload_cast<>(&Component::array), + Component::documentation("array").data() + ) + .def_property_readonly( + "parameters", + python::overload_cast<>(&Component::parameters), + Component::documentation("parameters").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/ParameterCovariance.python.cpp b/python/src/v2.0/covariance/ParameterCovariance.python.cpp new file mode 100644 index 000000000..10a2fedb5 --- /dev/null +++ b/python/src/v2.0/covariance/ParameterCovariance.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/ParameterCovariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// ParameterCovariance wrapper +void wrapParameterCovariance(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::ParameterCovariance; + + // create the component + python::class_ component( + module, + "ParameterCovariance", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::vector &, + const covariance::RowData & + >(), + python::arg("label") = std::nullopt, + python::arg("parameter_covariance_matrix"), + python::arg("row_data"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "parameter_covariance_matrix", + python::overload_cast<>(&Component::parameterCovarianceMatrix), + Component::documentation("parameter_covariance_matrix").data() + ) + .def_property_readonly( + "row_data", + python::overload_cast<>(&Component::rowData), + Component::documentation("row_data").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/ParameterCovariances.python.cpp b/python/src/v2.0/covariance/ParameterCovariances.python.cpp new file mode 100644 index 000000000..cf937a7d0 --- /dev/null +++ b/python/src/v2.0/covariance/ParameterCovariances.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/ParameterCovariances.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// ParameterCovariances wrapper +void wrapParameterCovariances(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::ParameterCovariances; + + // create the component + python::class_ component( + module, + "ParameterCovariances", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> &, + const std::optional> & + >(), + python::arg("average_parameter_covariance") = std::nullopt, + python::arg("parameter_covariance") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "average_parameter_covariance", + python::overload_cast<>(&Component::averageParameterCovariance), + Component::documentation("average_parameter_covariance").data() + ) + .def_property_readonly( + "parameter_covariance", + python::overload_cast<>(&Component::parameterCovariance), + Component::documentation("parameter_covariance").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/ParameterLink.python.cpp b/python/src/v2.0/covariance/ParameterLink.python.cpp new file mode 100644 index 000000000..679c108f5 --- /dev/null +++ b/python/src/v2.0/covariance/ParameterLink.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/ParameterLink.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// ParameterLink wrapper +void wrapParameterLink(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::ParameterLink; + + // create the component + python::class_ component( + module, + "ParameterLink", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("href") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("matrix_start_index") = std::nullopt, + python::arg("n_parameters") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "matrix_start_index", + [](const Component &self) { return self.matrixStartIndex().value(); }, + Component::documentation("matrix_start_index").data() + ) + .def_property_readonly( + "n_parameters", + [](const Component &self) { return self.nParameters().value(); }, + Component::documentation("n_parameters").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/Parameters.python.cpp b/python/src/v2.0/covariance/Parameters.python.cpp new file mode 100644 index 000000000..578b63bca --- /dev/null +++ b/python/src/v2.0/covariance/Parameters.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/Parameters.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// Parameters wrapper +void wrapParameters(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::Parameters; + + // create the component + python::class_ component( + module, + "Parameters", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("parameter_link") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "parameter_link", + python::overload_cast<>(&Component::parameterLink), + Component::documentation("parameter_link").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/RowData.python.cpp b/python/src/v2.0/covariance/RowData.python.cpp new file mode 100644 index 000000000..13b0d699c --- /dev/null +++ b/python/src/v2.0/covariance/RowData.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/RowData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// RowData wrapper +void wrapRowData(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::RowData; + + // create the component + python::class_ component( + module, + "RowData", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("endf_mfmt") = std::nullopt, + python::arg("dimension") = std::nullopt, + python::arg("href") = std::nullopt, + python::arg("slices") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "endf_mfmt", + &Component::ENDF_MFMT, + Component::documentation("endf_mfmt").data() + ) + .def_property_readonly( + "dimension", + &Component::dimension, + Component::documentation("dimension").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "slices", + python::overload_cast<>(&Component::slices), + Component::documentation("slices").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/RowSensitivity.python.cpp b/python/src/v2.0/covariance/RowSensitivity.python.cpp new file mode 100644 index 000000000..06ed2dd2f --- /dev/null +++ b/python/src/v2.0/covariance/RowSensitivity.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/RowSensitivity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// RowSensitivity wrapper +void wrapRowSensitivity(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::RowSensitivity; + + // create the component + python::class_ component( + module, + "RowSensitivity", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Array & + >(), + python::arg("array"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "array", + python::overload_cast<>(&Component::array), + Component::documentation("array").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/SandwichProduct.python.cpp b/python/src/v2.0/covariance/SandwichProduct.python.cpp new file mode 100644 index 000000000..9e0a11c62 --- /dev/null +++ b/python/src/v2.0/covariance/SandwichProduct.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/SandwichProduct.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// SandwichProduct wrapper +void wrapSandwichProduct(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::SandwichProduct; + + // create the component + python::class_ component( + module, + "SandwichProduct", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Axes &, + const std::optional &, + const covariance::Covariance &, + const covariance::RowSensitivity & + >(), + python::arg("axes"), + python::arg("column_sensitivity") = std::nullopt, + python::arg("covariance"), + python::arg("row_sensitivity"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "axes", + python::overload_cast<>(&Component::axes), + Component::documentation("axes").data() + ) + .def_property_readonly( + "column_sensitivity", + python::overload_cast<>(&Component::columnSensitivity), + Component::documentation("column_sensitivity").data() + ) + .def_property_readonly( + "covariance", + python::overload_cast<>(&Component::covariance), + Component::documentation("covariance").data() + ) + .def_property_readonly( + "row_sensitivity", + python::overload_cast<>(&Component::rowSensitivity), + Component::documentation("row_sensitivity").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/ShortRangeSelfScalingVariance.python.cpp b/python/src/v2.0/covariance/ShortRangeSelfScalingVariance.python.cpp new file mode 100644 index 000000000..e3cb40ee0 --- /dev/null +++ b/python/src/v2.0/covariance/ShortRangeSelfScalingVariance.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/ShortRangeSelfScalingVariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// ShortRangeSelfScalingVariance wrapper +void wrapShortRangeSelfScalingVariance(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::ShortRangeSelfScalingVariance; + + // create the component + python::class_ component( + module, + "ShortRangeSelfScalingVariance", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("dependence_on_processed_group_width") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("type") = std::nullopt, + python::arg("gridded2d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "dependence_on_processed_group_width", + &Component::dependenceOnProcessedGroupWidth, + Component::documentation("dependence_on_processed_group_width").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "type", + &Component::type, + Component::documentation("type").data() + ) + .def_property_readonly( + "gridded2d", + python::overload_cast<>(&Component::gridded2d), + Component::documentation("gridded2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/Slice.python.cpp b/python/src/v2.0/covariance/Slice.python.cpp new file mode 100644 index 000000000..77eb6e2e2 --- /dev/null +++ b/python/src/v2.0/covariance/Slice.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/Slice.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// Slice wrapper +void wrapSlice(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::Slice; + + // create the component + python::class_ component( + module, + "Slice", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Integer32 &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("dimension"), + python::arg("domain_max") = std::nullopt, + python::arg("domain_min") = std::nullopt, + python::arg("domain_unit") = std::nullopt, + python::arg("domain_value") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "dimension", + &Component::dimension, + Component::documentation("dimension").data() + ) + .def_property_readonly( + "domain_max", + &Component::domainMax, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + &Component::domainMin, + Component::documentation("domain_min").data() + ) + .def_property_readonly( + "domain_unit", + &Component::domainUnit, + Component::documentation("domain_unit").data() + ) + .def_property_readonly( + "domain_value", + &Component::domainValue, + Component::documentation("domain_value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/Slices.python.cpp b/python/src/v2.0/covariance/Slices.python.cpp new file mode 100644 index 000000000..6b749b173 --- /dev/null +++ b/python/src/v2.0/covariance/Slices.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/Slices.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// Slices wrapper +void wrapSlices(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::Slices; + + // create the component + python::class_ component( + module, + "Slices", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("slice"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "slice", + python::overload_cast<>(&Component::slice), + Component::documentation("slice").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/Sum.python.cpp b/python/src/v2.0/covariance/Sum.python.cpp new file mode 100644 index 000000000..bba0976c7 --- /dev/null +++ b/python/src/v2.0/covariance/Sum.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/Sum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// Sum wrapper +void wrapSum(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::Sum; + + // create the component + python::class_ component( + module, + "Sum", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Float64 &, + const Float64 &, + const XMLName &, + const std::optional &, + const std::optional> & + >(), + python::arg("domain_max"), + python::arg("domain_min"), + python::arg("domain_unit"), + python::arg("label") = std::nullopt, + python::arg("summand") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "domain_max", + &Component::domainMax, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + &Component::domainMin, + Component::documentation("domain_min").data() + ) + .def_property_readonly( + "domain_unit", + &Component::domainUnit, + Component::documentation("domain_unit").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "summand", + python::overload_cast<>(&Component::summand), + Component::documentation("summand").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/covariance/Summand.python.cpp b/python/src/v2.0/covariance/Summand.python.cpp new file mode 100644 index 000000000..268787c82 --- /dev/null +++ b/python/src/v2.0/covariance/Summand.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/covariance/Summand.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// Summand wrapper +void wrapSummand(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = covariance::Summand; + + // create the component + python::class_ component( + module, + "Summand", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("endf_mfmt") = std::nullopt, + python::arg("coefficient") = std::nullopt, + python::arg("href") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "endf_mfmt", + &Component::ENDF_MFMT, + Component::documentation("endf_mfmt").data() + ) + .def_property_readonly( + "coefficient", + &Component::coefficient, + Component::documentation("coefficient").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/python/src/v2.0/cpTransport.python.cpp b/python/src/v2.0/cpTransport.python.cpp new file mode 100644 index 000000000..c5513b630 --- /dev/null +++ b/python/src/v2.0/cpTransport.python.cpp @@ -0,0 +1,43 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// cpTransport declarations +namespace python_cpTransport { + void wrapRutherfordScattering(python::module &); + void wrapImaginaryInterferenceTerm(python::module &); + void wrapNuclearTerm(python::module &); + void wrapRealInterferenceTerm(python::module &); + void wrapNuclearAmplitudeExpansion(python::module &); + void wrapNuclearPlusInterference(python::module &); + void wrapCoulombPlusNuclearElastic(python::module &); +} // namespace python_cpTransport + +// cpTransport wrapper +void wrapCpTransport(python::module &module) +{ + // create the cpTransport submodule + python::module submodule = module.def_submodule( + "cpTransport", + "GNDS v2.0 cpTransport" + ); + + // wrap cpTransport components + python_cpTransport::wrapRutherfordScattering(submodule); + python_cpTransport::wrapImaginaryInterferenceTerm(submodule); + python_cpTransport::wrapNuclearTerm(submodule); + python_cpTransport::wrapRealInterferenceTerm(submodule); + python_cpTransport::wrapNuclearAmplitudeExpansion(submodule); + python_cpTransport::wrapNuclearPlusInterference(submodule); + python_cpTransport::wrapCoulombPlusNuclearElastic(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/cpTransport/CoulombPlusNuclearElastic.python.cpp b/python/src/v2.0/cpTransport/CoulombPlusNuclearElastic.python.cpp new file mode 100644 index 000000000..6cc40e4d2 --- /dev/null +++ b/python/src/v2.0/cpTransport/CoulombPlusNuclearElastic.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// CoulombPlusNuclearElastic wrapper +void wrapCoulombPlusNuclearElastic(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = cpTransport::CoulombPlusNuclearElastic; + + // create the component + python::class_ component( + module, + "CoulombPlusNuclearElastic", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const XMLName &, + const XMLName &, + const enums::Frame &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("href") = std::nullopt, + python::arg("identical_particles") = std::nullopt, + python::arg("label"), + python::arg("pid"), + python::arg("product_frame"), + python::arg("rutherford_scattering") = std::nullopt, + python::arg("nuclear_amplitude_expansion") = std::nullopt, + python::arg("nuclear_plus_interference") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "identical_particles", + [](const Component &self) { return self.identicalParticles().value(); }, + Component::documentation("identical_particles").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "rutherford_scattering", + python::overload_cast<>(&Component::RutherfordScattering), + Component::documentation("rutherford_scattering").data() + ) + .def_property_readonly( + "nuclear_amplitude_expansion", + python::overload_cast<>(&Component::nuclearAmplitudeExpansion), + Component::documentation("nuclear_amplitude_expansion").data() + ) + .def_property_readonly( + "nuclear_plus_interference", + python::overload_cast<>(&Component::nuclearPlusInterference), + Component::documentation("nuclear_plus_interference").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/cpTransport/ImaginaryInterferenceTerm.python.cpp b/python/src/v2.0/cpTransport/ImaginaryInterferenceTerm.python.cpp new file mode 100644 index 000000000..f50a617ae --- /dev/null +++ b/python/src/v2.0/cpTransport/ImaginaryInterferenceTerm.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/cpTransport/ImaginaryInterferenceTerm.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// ImaginaryInterferenceTerm wrapper +void wrapImaginaryInterferenceTerm(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = cpTransport::ImaginaryInterferenceTerm; + + // create the component + python::class_ component( + module, + "ImaginaryInterferenceTerm", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys2d") = std::nullopt, + python::arg("regions2d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "regions2d", + python::overload_cast<>(&Component::regions2d), + Component::documentation("regions2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/cpTransport/NuclearAmplitudeExpansion.python.cpp b/python/src/v2.0/cpTransport/NuclearAmplitudeExpansion.python.cpp new file mode 100644 index 000000000..bb2f70589 --- /dev/null +++ b/python/src/v2.0/cpTransport/NuclearAmplitudeExpansion.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/cpTransport/NuclearAmplitudeExpansion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// NuclearAmplitudeExpansion wrapper +void wrapNuclearAmplitudeExpansion(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = cpTransport::NuclearAmplitudeExpansion; + + // create the component + python::class_ component( + module, + "NuclearAmplitudeExpansion", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const cpTransport::ImaginaryInterferenceTerm &, + const cpTransport::NuclearTerm &, + const cpTransport::RealInterferenceTerm & + >(), + python::arg("imaginary_interference_term"), + python::arg("nuclear_term"), + python::arg("real_interference_term"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "imaginary_interference_term", + python::overload_cast<>(&Component::imaginaryInterferenceTerm), + Component::documentation("imaginary_interference_term").data() + ) + .def_property_readonly( + "nuclear_term", + python::overload_cast<>(&Component::nuclearTerm), + Component::documentation("nuclear_term").data() + ) + .def_property_readonly( + "real_interference_term", + python::overload_cast<>(&Component::realInterferenceTerm), + Component::documentation("real_interference_term").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/cpTransport/NuclearPlusInterference.python.cpp b/python/src/v2.0/cpTransport/NuclearPlusInterference.python.cpp new file mode 100644 index 000000000..fd1c96a29 --- /dev/null +++ b/python/src/v2.0/cpTransport/NuclearPlusInterference.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/cpTransport/NuclearPlusInterference.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// NuclearPlusInterference wrapper +void wrapNuclearPlusInterference(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = cpTransport::NuclearPlusInterference; + + // create the component + python::class_ component( + module, + "NuclearPlusInterference", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Float64 &, + const transport::CrossSection &, + const transport::Distribution & + >(), + python::arg("mu_cutoff"), + python::arg("cross_section"), + python::arg("distribution"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "mu_cutoff", + &Component::muCutoff, + Component::documentation("mu_cutoff").data() + ) + .def_property_readonly( + "cross_section", + python::overload_cast<>(&Component::crossSection), + Component::documentation("cross_section").data() + ) + .def_property_readonly( + "distribution", + python::overload_cast<>(&Component::distribution), + Component::documentation("distribution").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/cpTransport/NuclearTerm.python.cpp b/python/src/v2.0/cpTransport/NuclearTerm.python.cpp new file mode 100644 index 000000000..25f0d280b --- /dev/null +++ b/python/src/v2.0/cpTransport/NuclearTerm.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/cpTransport/NuclearTerm.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// NuclearTerm wrapper +void wrapNuclearTerm(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = cpTransport::NuclearTerm; + + // create the component + python::class_ component( + module, + "NuclearTerm", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys2d") = std::nullopt, + python::arg("regions2d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "regions2d", + python::overload_cast<>(&Component::regions2d), + Component::documentation("regions2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/cpTransport/RealInterferenceTerm.python.cpp b/python/src/v2.0/cpTransport/RealInterferenceTerm.python.cpp new file mode 100644 index 000000000..9e8e2aebd --- /dev/null +++ b/python/src/v2.0/cpTransport/RealInterferenceTerm.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/cpTransport/RealInterferenceTerm.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// RealInterferenceTerm wrapper +void wrapRealInterferenceTerm(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = cpTransport::RealInterferenceTerm; + + // create the component + python::class_ component( + module, + "RealInterferenceTerm", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys2d") = std::nullopt, + python::arg("regions2d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "regions2d", + python::overload_cast<>(&Component::regions2d), + Component::documentation("regions2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/cpTransport/RutherfordScattering.python.cpp b/python/src/v2.0/cpTransport/RutherfordScattering.python.cpp new file mode 100644 index 000000000..e0c66a750 --- /dev/null +++ b/python/src/v2.0/cpTransport/RutherfordScattering.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/cpTransport/RutherfordScattering.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// RutherfordScattering wrapper +void wrapRutherfordScattering(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = cpTransport::RutherfordScattering; + + // create the component + python::class_ component( + module, + "RutherfordScattering", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation.python.cpp b/python/src/v2.0/documentation.python.cpp new file mode 100644 index 000000000..412446621 --- /dev/null +++ b/python/src/v2.0/documentation.python.cpp @@ -0,0 +1,89 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// documentation declarations +namespace python_documentation { + void wrapAcknowledgement(python::module &); + void wrapAcknowledgements(python::module &); + void wrapAffiliation(python::module &); + void wrapAffiliations(python::module &); + void wrapAuthor(python::module &); + void wrapAuthors(python::module &); + void wrapBibitem(python::module &); + void wrapBibliography(python::module &); + void wrapCollaboration(python::module &); + void wrapCollaborations(python::module &); + void wrapCodeRepo(python::module &); + void wrapInputDeck(python::module &); + void wrapInputDecks(python::module &); + void wrapOutputDeck(python::module &); + void wrapOutputDecks(python::module &); + void wrapComputerCode(python::module &); + void wrapComputerCodes(python::module &); + void wrapContributor(python::module &); + void wrapContributors(python::module &); + void wrapCopyright(python::module &); + void wrapDate(python::module &); + void wrapDates(python::module &); + void wrapExforDataSet(python::module &); + void wrapExforDataSets(python::module &); + void wrapExperimentalDataSets(python::module &); + void wrapKeyword(python::module &); + void wrapKeywords(python::module &); + void wrapRelatedItem(python::module &); + void wrapRelatedItems(python::module &); + void wrapDocumentation(python::module &); +} // namespace python_documentation + +// documentation wrapper +void wrapDocumentation(python::module &module) +{ + // create the documentation submodule + python::module submodule = module.def_submodule( + "documentation", + "GNDS v2.0 documentation" + ); + + // wrap documentation components + python_documentation::wrapAcknowledgement(submodule); + python_documentation::wrapAcknowledgements(submodule); + python_documentation::wrapAffiliation(submodule); + python_documentation::wrapAffiliations(submodule); + python_documentation::wrapAuthor(submodule); + python_documentation::wrapAuthors(submodule); + python_documentation::wrapBibitem(submodule); + python_documentation::wrapBibliography(submodule); + python_documentation::wrapCollaboration(submodule); + python_documentation::wrapCollaborations(submodule); + python_documentation::wrapCodeRepo(submodule); + python_documentation::wrapInputDeck(submodule); + python_documentation::wrapInputDecks(submodule); + python_documentation::wrapOutputDeck(submodule); + python_documentation::wrapOutputDecks(submodule); + python_documentation::wrapComputerCode(submodule); + python_documentation::wrapComputerCodes(submodule); + python_documentation::wrapContributor(submodule); + python_documentation::wrapContributors(submodule); + python_documentation::wrapCopyright(submodule); + python_documentation::wrapDate(submodule); + python_documentation::wrapDates(submodule); + python_documentation::wrapExforDataSet(submodule); + python_documentation::wrapExforDataSets(submodule); + python_documentation::wrapExperimentalDataSets(submodule); + python_documentation::wrapKeyword(submodule); + python_documentation::wrapKeywords(submodule); + python_documentation::wrapRelatedItem(submodule); + python_documentation::wrapRelatedItems(submodule); + python_documentation::wrapDocumentation(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Acknowledgement.python.cpp b/python/src/v2.0/documentation/Acknowledgement.python.cpp new file mode 100644 index 000000000..ad9aa4096 --- /dev/null +++ b/python/src/v2.0/documentation/Acknowledgement.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Acknowledgement.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Acknowledgement wrapper +void wrapAcknowledgement(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Acknowledgement; + + // create the component + python::class_ component( + module, + "Acknowledgement", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName & + >(), + python::arg("label"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Acknowledgements.python.cpp b/python/src/v2.0/documentation/Acknowledgements.python.cpp new file mode 100644 index 000000000..b4f45ea70 --- /dev/null +++ b/python/src/v2.0/documentation/Acknowledgements.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Acknowledgements.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Acknowledgements wrapper +void wrapAcknowledgements(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Acknowledgements; + + // create the component + python::class_ component( + module, + "Acknowledgements", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("acknowledgement"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "acknowledgement", + python::overload_cast<>(&Component::acknowledgement), + Component::documentation("acknowledgement").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Affiliation.python.cpp b/python/src/v2.0/documentation/Affiliation.python.cpp new file mode 100644 index 000000000..7855ab744 --- /dev/null +++ b/python/src/v2.0/documentation/Affiliation.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Affiliation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Affiliation wrapper +void wrapAffiliation(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Affiliation; + + // create the component + python::class_ component( + module, + "Affiliation", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const UTF8Text & + >(), + python::arg("href") = std::nullopt, + python::arg("name"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "name", + &Component::name, + Component::documentation("name").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Affiliations.python.cpp b/python/src/v2.0/documentation/Affiliations.python.cpp new file mode 100644 index 000000000..c39742815 --- /dev/null +++ b/python/src/v2.0/documentation/Affiliations.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Affiliations.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Affiliations wrapper +void wrapAffiliations(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Affiliations; + + // create the component + python::class_ component( + module, + "Affiliations", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("affiliation"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "affiliation", + python::overload_cast<>(&Component::affiliation), + Component::documentation("affiliation").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Author.python.cpp b/python/src/v2.0/documentation/Author.python.cpp new file mode 100644 index 000000000..1b7e72afd --- /dev/null +++ b/python/src/v2.0/documentation/Author.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Author.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Author wrapper +void wrapAuthor(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Author; + + // create the component + python::class_ component( + module, + "Author", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const UTF8Text &, + const std::optional &, + const std::optional & + >(), + python::arg("email") = std::nullopt, + python::arg("name"), + python::arg("orcid_id") = std::nullopt, + python::arg("affiliations") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "email", + &Component::email, + Component::documentation("email").data() + ) + .def_property_readonly( + "name", + &Component::name, + Component::documentation("name").data() + ) + .def_property_readonly( + "orcid_id", + &Component::orcid_id, + Component::documentation("orcid_id").data() + ) + .def_property_readonly( + "affiliations", + python::overload_cast<>(&Component::affiliations), + Component::documentation("affiliations").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Authors.python.cpp b/python/src/v2.0/documentation/Authors.python.cpp new file mode 100644 index 000000000..2464c7a6c --- /dev/null +++ b/python/src/v2.0/documentation/Authors.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Authors.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Authors wrapper +void wrapAuthors(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Authors; + + // create the component + python::class_ component( + module, + "Authors", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("author"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "author", + python::overload_cast<>(&Component::author), + Component::documentation("author").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Bibitem.python.cpp b/python/src/v2.0/documentation/Bibitem.python.cpp new file mode 100644 index 000000000..597e83915 --- /dev/null +++ b/python/src/v2.0/documentation/Bibitem.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Bibitem.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Bibitem wrapper +void wrapBibitem(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Bibitem; + + // create the component + python::class_ component( + module, + "Bibitem", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName & + >(), + python::arg("xref"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xref", + &Component::xref, + Component::documentation("xref").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Bibliography.python.cpp b/python/src/v2.0/documentation/Bibliography.python.cpp new file mode 100644 index 000000000..92aea4702 --- /dev/null +++ b/python/src/v2.0/documentation/Bibliography.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Bibliography.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Bibliography wrapper +void wrapBibliography(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Bibliography; + + // create the component + python::class_ component( + module, + "Bibliography", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("bibitem"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "bibitem", + python::overload_cast<>(&Component::bibitem), + Component::documentation("bibitem").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Body.python.cpp b/python/src/v2.0/documentation/Body.python.cpp new file mode 100644 index 000000000..f3d692294 --- /dev/null +++ b/python/src/v2.0/documentation/Body.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Body.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Body wrapper +void wrapBody(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Body; + + // create the component + python::class_ component( + module, + "Body", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/CodeRepo.python.cpp b/python/src/v2.0/documentation/CodeRepo.python.cpp new file mode 100644 index 000000000..9bf199e41 --- /dev/null +++ b/python/src/v2.0/documentation/CodeRepo.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/CodeRepo.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// CodeRepo wrapper +void wrapCodeRepo(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::CodeRepo; + + // create the component + python::class_ component( + module, + "CodeRepo", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const XMLName & + >(), + python::arg("href"), + python::arg("revision_id"), + python::arg("revision_system"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "revision_id", + &Component::revisionID, + Component::documentation("revision_id").data() + ) + .def_property_readonly( + "revision_system", + &Component::revisionSystem, + Component::documentation("revision_system").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Collaboration.python.cpp b/python/src/v2.0/documentation/Collaboration.python.cpp new file mode 100644 index 000000000..f18576523 --- /dev/null +++ b/python/src/v2.0/documentation/Collaboration.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Collaboration.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Collaboration wrapper +void wrapCollaboration(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Collaboration; + + // create the component + python::class_ component( + module, + "Collaboration", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const UTF8Text & + >(), + python::arg("href") = std::nullopt, + python::arg("name"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "name", + &Component::name, + Component::documentation("name").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Collaborations.python.cpp b/python/src/v2.0/documentation/Collaborations.python.cpp new file mode 100644 index 000000000..f53919497 --- /dev/null +++ b/python/src/v2.0/documentation/Collaborations.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Collaborations.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Collaborations wrapper +void wrapCollaborations(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Collaborations; + + // create the component + python::class_ component( + module, + "Collaborations", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("collaboration"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "collaboration", + python::overload_cast<>(&Component::collaboration), + Component::documentation("collaboration").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/ComputerCode.python.cpp b/python/src/v2.0/documentation/ComputerCode.python.cpp new file mode 100644 index 000000000..983892e5b --- /dev/null +++ b/python/src/v2.0/documentation/ComputerCode.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/ComputerCode.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// ComputerCode wrapper +void wrapComputerCode(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::ComputerCode; + + // create the component + python::class_ component( + module, + "ComputerCode", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const UTF8Text &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("name"), + python::arg("version"), + python::arg("code_repo") = std::nullopt, + python::arg("input_decks") = std::nullopt, + python::arg("output_decks") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "name", + &Component::name, + Component::documentation("name").data() + ) + .def_property_readonly( + "version", + &Component::version, + Component::documentation("version").data() + ) + .def_property_readonly( + "code_repo", + python::overload_cast<>(&Component::codeRepo), + Component::documentation("code_repo").data() + ) + .def_property_readonly( + "input_decks", + python::overload_cast<>(&Component::inputDecks), + Component::documentation("input_decks").data() + ) + .def_property_readonly( + "output_decks", + python::overload_cast<>(&Component::outputDecks), + Component::documentation("output_decks").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/ComputerCodes.python.cpp b/python/src/v2.0/documentation/ComputerCodes.python.cpp new file mode 100644 index 000000000..7d879cd0c --- /dev/null +++ b/python/src/v2.0/documentation/ComputerCodes.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/ComputerCodes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// ComputerCodes wrapper +void wrapComputerCodes(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::ComputerCodes; + + // create the component + python::class_ component( + module, + "ComputerCodes", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("computer_code"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "computer_code", + python::overload_cast<>(&Component::computerCode), + Component::documentation("computer_code").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Contributor.python.cpp b/python/src/v2.0/documentation/Contributor.python.cpp new file mode 100644 index 000000000..64c3a3c15 --- /dev/null +++ b/python/src/v2.0/documentation/Contributor.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Contributor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Contributor wrapper +void wrapContributor(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Contributor; + + // create the component + python::class_ component( + module, + "Contributor", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const enums::ContributorType &, + const std::optional &, + const UTF8Text &, + const std::optional &, + const std::optional & + >(), + python::arg("contributor_type"), + python::arg("email") = std::nullopt, + python::arg("name"), + python::arg("orcid_id") = std::nullopt, + python::arg("affiliations") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "contributor_type", + &Component::contributorType, + Component::documentation("contributor_type").data() + ) + .def_property_readonly( + "email", + &Component::email, + Component::documentation("email").data() + ) + .def_property_readonly( + "name", + &Component::name, + Component::documentation("name").data() + ) + .def_property_readonly( + "orcid_id", + &Component::orcid_id, + Component::documentation("orcid_id").data() + ) + .def_property_readonly( + "affiliations", + python::overload_cast<>(&Component::affiliations), + Component::documentation("affiliations").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Contributors.python.cpp b/python/src/v2.0/documentation/Contributors.python.cpp new file mode 100644 index 000000000..c419eb923 --- /dev/null +++ b/python/src/v2.0/documentation/Contributors.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Contributors.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Contributors wrapper +void wrapContributors(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Contributors; + + // create the component + python::class_ component( + module, + "Contributors", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("contributor"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "contributor", + python::overload_cast<>(&Component::contributor), + Component::documentation("contributor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Copyright.python.cpp b/python/src/v2.0/documentation/Copyright.python.cpp new file mode 100644 index 000000000..9f0696bb2 --- /dev/null +++ b/python/src/v2.0/documentation/Copyright.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Copyright.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Copyright wrapper +void wrapCopyright(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Copyright; + + // create the component + python::class_ component( + module, + "Copyright", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("href") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/CorrectionScript.python.cpp b/python/src/v2.0/documentation/CorrectionScript.python.cpp new file mode 100644 index 000000000..5aba50f1f --- /dev/null +++ b/python/src/v2.0/documentation/CorrectionScript.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/CorrectionScript.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// CorrectionScript wrapper +void wrapCorrectionScript(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::CorrectionScript; + + // create the component + python::class_ component( + module, + "CorrectionScript", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/CovarianceScript.python.cpp b/python/src/v2.0/documentation/CovarianceScript.python.cpp new file mode 100644 index 000000000..609ec09d1 --- /dev/null +++ b/python/src/v2.0/documentation/CovarianceScript.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/CovarianceScript.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// CovarianceScript wrapper +void wrapCovarianceScript(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::CovarianceScript; + + // create the component + python::class_ component( + module, + "CovarianceScript", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Date.python.cpp b/python/src/v2.0/documentation/Date.python.cpp new file mode 100644 index 000000000..e36e73d16 --- /dev/null +++ b/python/src/v2.0/documentation/Date.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Date.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Date wrapper +void wrapDate(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Date; + + // create the component + python::class_ component( + module, + "Date", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const enums::DateType & + >(), + python::arg("date_type"), + 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( + "date_type", + &Component::dateType, + Component::documentation("date_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_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Dates.python.cpp b/python/src/v2.0/documentation/Dates.python.cpp new file mode 100644 index 000000000..aca6860bc --- /dev/null +++ b/python/src/v2.0/documentation/Dates.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Dates.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Dates wrapper +void wrapDates(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Dates; + + // create the component + python::class_ component( + module, + "Dates", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("date"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + python::overload_cast<>(&Component::date), + Component::documentation("date").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Documentation.python.cpp b/python/src/v2.0/documentation/Documentation.python.cpp new file mode 100644 index 000000000..cdedfe9b9 --- /dev/null +++ b/python/src/v2.0/documentation/Documentation.python.cpp @@ -0,0 +1,147 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Documentation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Documentation wrapper +void wrapDocumentation(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Documentation; + + // create the component + python::class_ component( + module, + "Documentation", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const documentation::Authors &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const documentation::Dates &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("doi") = std::nullopt, + python::arg("publication_date") = std::nullopt, + python::arg("version") = std::nullopt, + python::arg("acknowledgements") = std::nullopt, + python::arg("authors"), + python::arg("bibliography") = std::nullopt, + python::arg("collaborations") = std::nullopt, + python::arg("computer_codes") = std::nullopt, + python::arg("contributors") = std::nullopt, + python::arg("copyright") = std::nullopt, + python::arg("dates"), + python::arg("experimental_data_sets") = std::nullopt, + python::arg("keywords") = std::nullopt, + python::arg("related_items") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "doi", + &Component::doi, + Component::documentation("doi").data() + ) + .def_property_readonly( + "publication_date", + &Component::publicationDate, + Component::documentation("publication_date").data() + ) + .def_property_readonly( + "version", + &Component::version, + Component::documentation("version").data() + ) + .def_property_readonly( + "acknowledgements", + python::overload_cast<>(&Component::acknowledgements), + Component::documentation("acknowledgements").data() + ) + .def_property_readonly( + "authors", + python::overload_cast<>(&Component::authors), + Component::documentation("authors").data() + ) + .def_property_readonly( + "bibliography", + python::overload_cast<>(&Component::bibliography), + Component::documentation("bibliography").data() + ) + .def_property_readonly( + "collaborations", + python::overload_cast<>(&Component::collaborations), + Component::documentation("collaborations").data() + ) + .def_property_readonly( + "computer_codes", + python::overload_cast<>(&Component::computerCodes), + Component::documentation("computer_codes").data() + ) + .def_property_readonly( + "contributors", + python::overload_cast<>(&Component::contributors), + Component::documentation("contributors").data() + ) + .def_property_readonly( + "copyright", + python::overload_cast<>(&Component::copyright), + Component::documentation("copyright").data() + ) + .def_property_readonly( + "dates", + python::overload_cast<>(&Component::dates), + Component::documentation("dates").data() + ) + .def_property_readonly( + "experimental_data_sets", + python::overload_cast<>(&Component::experimentalDataSets), + Component::documentation("experimental_data_sets").data() + ) + .def_property_readonly( + "keywords", + python::overload_cast<>(&Component::keywords), + Component::documentation("keywords").data() + ) + .def_property_readonly( + "related_items", + python::overload_cast<>(&Component::relatedItems), + Component::documentation("related_items").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/EndfCompatible.python.cpp b/python/src/v2.0/documentation/EndfCompatible.python.cpp new file mode 100644 index 000000000..511ee9d89 --- /dev/null +++ b/python/src/v2.0/documentation/EndfCompatible.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/EndfCompatible.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// EndfCompatible wrapper +void wrapEndfCompatible(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::EndfCompatible; + + // create the component + python::class_ component( + module, + "EndfCompatible", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/ExecutionArguments.python.cpp b/python/src/v2.0/documentation/ExecutionArguments.python.cpp new file mode 100644 index 000000000..7c95287c7 --- /dev/null +++ b/python/src/v2.0/documentation/ExecutionArguments.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/ExecutionArguments.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// ExecutionArguments wrapper +void wrapExecutionArguments(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::ExecutionArguments; + + // create the component + python::class_ component( + module, + "ExecutionArguments", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/ExforDataSet.python.cpp b/python/src/v2.0/documentation/ExforDataSet.python.cpp new file mode 100644 index 000000000..d2b649c26 --- /dev/null +++ b/python/src/v2.0/documentation/ExforDataSet.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/ExforDataSet.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// ExforDataSet wrapper +void wrapExforDataSet(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::ExforDataSet; + + // create the component + python::class_ component( + module, + "ExforDataSet", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName & + >(), + python::arg("retrieval_date"), + python::arg("subentry"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "retrieval_date", + &Component::retrievalDate, + Component::documentation("retrieval_date").data() + ) + .def_property_readonly( + "subentry", + &Component::subentry, + Component::documentation("subentry").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/ExforDataSets.python.cpp b/python/src/v2.0/documentation/ExforDataSets.python.cpp new file mode 100644 index 000000000..4d6a7a9ca --- /dev/null +++ b/python/src/v2.0/documentation/ExforDataSets.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/ExforDataSets.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// ExforDataSets wrapper +void wrapExforDataSets(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::ExforDataSets; + + // create the component + python::class_ component( + module, + "ExforDataSets", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("exfor_data_set"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "exfor_data_set", + python::overload_cast<>(&Component::exforDataSet), + Component::documentation("exfor_data_set").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/ExperimentalDataSets.python.cpp b/python/src/v2.0/documentation/ExperimentalDataSets.python.cpp new file mode 100644 index 000000000..7d45df8dd --- /dev/null +++ b/python/src/v2.0/documentation/ExperimentalDataSets.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/ExperimentalDataSets.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// ExperimentalDataSets wrapper +void wrapExperimentalDataSets(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::ExperimentalDataSets; + + // create the component + python::class_ component( + module, + "ExperimentalDataSets", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const documentation::ExforDataSets & + >(), + python::arg("exfor_data_sets"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "exfor_data_sets", + python::overload_cast<>(&Component::exforDataSets), + Component::documentation("exfor_data_sets").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/InputDeck.python.cpp b/python/src/v2.0/documentation/InputDeck.python.cpp new file mode 100644 index 000000000..cce675f10 --- /dev/null +++ b/python/src/v2.0/documentation/InputDeck.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/InputDeck.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// InputDeck wrapper +void wrapInputDeck(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::InputDeck; + + // create the component + python::class_ component( + module, + "InputDeck", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("filename") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "filename", + &Component::filename, + Component::documentation("filename").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/InputDecks.python.cpp b/python/src/v2.0/documentation/InputDecks.python.cpp new file mode 100644 index 000000000..87e030f00 --- /dev/null +++ b/python/src/v2.0/documentation/InputDecks.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/InputDecks.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// InputDecks wrapper +void wrapInputDecks(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::InputDecks; + + // create the component + python::class_ component( + module, + "InputDecks", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("input_deck"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "input_deck", + python::overload_cast<>(&Component::inputDeck), + Component::documentation("input_deck").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Keyword.python.cpp b/python/src/v2.0/documentation/Keyword.python.cpp new file mode 100644 index 000000000..85a7965e3 --- /dev/null +++ b/python/src/v2.0/documentation/Keyword.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Keyword.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Keyword wrapper +void wrapKeyword(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Keyword; + + // create the component + python::class_ component( + module, + "Keyword", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName & + >(), + python::arg("type"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "type", + &Component::type, + Component::documentation("type").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Keywords.python.cpp b/python/src/v2.0/documentation/Keywords.python.cpp new file mode 100644 index 000000000..bf3bf30b5 --- /dev/null +++ b/python/src/v2.0/documentation/Keywords.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Keywords.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Keywords wrapper +void wrapKeywords(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Keywords; + + // create the component + python::class_ component( + module, + "Keywords", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("keyword"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "keyword", + python::overload_cast<>(&Component::keyword), + Component::documentation("keyword").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Note.python.cpp b/python/src/v2.0/documentation/Note.python.cpp new file mode 100644 index 000000000..9dcd6af22 --- /dev/null +++ b/python/src/v2.0/documentation/Note.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Note.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Note wrapper +void wrapNote(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Note; + + // create the component + python::class_ component( + module, + "Note", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/OutputDeck.python.cpp b/python/src/v2.0/documentation/OutputDeck.python.cpp new file mode 100644 index 000000000..ebbf13caf --- /dev/null +++ b/python/src/v2.0/documentation/OutputDeck.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/OutputDeck.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// OutputDeck wrapper +void wrapOutputDeck(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::OutputDeck; + + // create the component + python::class_ component( + module, + "OutputDeck", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("filename") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "filename", + &Component::filename, + Component::documentation("filename").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/OutputDecks.python.cpp b/python/src/v2.0/documentation/OutputDecks.python.cpp new file mode 100644 index 000000000..fd9aeda27 --- /dev/null +++ b/python/src/v2.0/documentation/OutputDecks.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/OutputDecks.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// OutputDecks wrapper +void wrapOutputDecks(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::OutputDecks; + + // create the component + python::class_ component( + module, + "OutputDecks", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("output_deck"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "output_deck", + python::overload_cast<>(&Component::outputDeck), + Component::documentation("output_deck").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/RelatedItem.python.cpp b/python/src/v2.0/documentation/RelatedItem.python.cpp new file mode 100644 index 000000000..946db207b --- /dev/null +++ b/python/src/v2.0/documentation/RelatedItem.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/RelatedItem.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// RelatedItem wrapper +void wrapRelatedItem(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::RelatedItem; + + // create the component + python::class_ component( + module, + "RelatedItem", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const UTF8Text &, + const std::optional & + >(), + python::arg("href") = std::nullopt, + python::arg("name"), + python::arg("relation_type") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "name", + &Component::name, + Component::documentation("name").data() + ) + .def_property_readonly( + "relation_type", + &Component::relationType, + Component::documentation("relation_type").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/RelatedItems.python.cpp b/python/src/v2.0/documentation/RelatedItems.python.cpp new file mode 100644 index 000000000..83755cd6d --- /dev/null +++ b/python/src/v2.0/documentation/RelatedItems.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/RelatedItems.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// RelatedItems wrapper +void wrapRelatedItems(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::RelatedItems; + + // create the component + python::class_ component( + module, + "RelatedItems", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("related_item"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "related_item", + python::overload_cast<>(&Component::relatedItem), + Component::documentation("related_item").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/documentation/Version.python.cpp b/python/src/v2.0/documentation/Version.python.cpp new file mode 100644 index 000000000..653c851db --- /dev/null +++ b/python/src/v2.0/documentation/Version.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/documentation/Version.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// Version wrapper +void wrapVersion(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = documentation::Version; + + // create the component + python::class_ component( + module, + "Version", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionFragmentData.python.cpp b/python/src/v2.0/fissionFragmentData.python.cpp new file mode 100644 index 000000000..f07e98b83 --- /dev/null +++ b/python/src/v2.0/fissionFragmentData.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// fissionFragmentData declarations +namespace python_fissionFragmentData { + void wrapRate(python::module &); + void wrapDelayedNeutron(python::module &); + void wrapDelayedNeutrons(python::module &); + void wrapFissionFragmentData(python::module &); +} // namespace python_fissionFragmentData + +// fissionFragmentData wrapper +void wrapFissionFragmentData(python::module &module) +{ + // create the fissionFragmentData submodule + python::module submodule = module.def_submodule( + "fissionFragmentData", + "GNDS v2.0 fissionFragmentData" + ); + + // wrap fissionFragmentData components + python_fissionFragmentData::wrapRate(submodule); + python_fissionFragmentData::wrapDelayedNeutron(submodule); + python_fissionFragmentData::wrapDelayedNeutrons(submodule); + python_fissionFragmentData::wrapFissionFragmentData(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionFragmentData/DelayedNeutron.python.cpp b/python/src/v2.0/fissionFragmentData/DelayedNeutron.python.cpp new file mode 100644 index 000000000..382706b79 --- /dev/null +++ b/python/src/v2.0/fissionFragmentData/DelayedNeutron.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionFragmentData/DelayedNeutron.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionFragmentData { + +// DelayedNeutron wrapper +void wrapDelayedNeutron(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionFragmentData::DelayedNeutron; + + // create the component + python::class_ component( + module, + "DelayedNeutron", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const pops::Product &, + const fissionFragmentData::Rate & + >(), + python::arg("label"), + python::arg("product"), + python::arg("rate"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product", + python::overload_cast<>(&Component::product), + Component::documentation("product").data() + ) + .def_property_readonly( + "rate", + python::overload_cast<>(&Component::rate), + Component::documentation("rate").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionFragmentData +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionFragmentData/DelayedNeutrons.python.cpp b/python/src/v2.0/fissionFragmentData/DelayedNeutrons.python.cpp new file mode 100644 index 000000000..bf0f6b0cc --- /dev/null +++ b/python/src/v2.0/fissionFragmentData/DelayedNeutrons.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionFragmentData/DelayedNeutrons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionFragmentData { + +// DelayedNeutrons wrapper +void wrapDelayedNeutrons(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionFragmentData::DelayedNeutrons; + + // create the component + python::class_ component( + module, + "DelayedNeutrons", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("delayed_neutron"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "delayed_neutron", + python::overload_cast<>(&Component::delayedNeutron), + Component::documentation("delayed_neutron").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionFragmentData +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionFragmentData/FissionFragmentData.python.cpp b/python/src/v2.0/fissionFragmentData/FissionFragmentData.python.cpp new file mode 100644 index 000000000..ff341ce62 --- /dev/null +++ b/python/src/v2.0/fissionFragmentData/FissionFragmentData.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionFragmentData/FissionFragmentData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionFragmentData { + +// FissionFragmentData wrapper +void wrapFissionFragmentData(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionFragmentData::FissionFragmentData; + + // create the component + python::class_ component( + module, + "FissionFragmentData", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("delayed_neutrons") = std::nullopt, + python::arg("fission_energy_released") = std::nullopt, + python::arg("product_yields") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "delayed_neutrons", + python::overload_cast<>(&Component::delayedNeutrons), + Component::documentation("delayed_neutrons").data() + ) + .def_property_readonly( + "fission_energy_released", + python::overload_cast<>(&Component::fissionEnergyReleased), + Component::documentation("fission_energy_released").data() + ) + .def_property_readonly( + "product_yields", + python::overload_cast<>(&Component::productYields), + Component::documentation("product_yields").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionFragmentData +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionFragmentData/Rate.python.cpp b/python/src/v2.0/fissionFragmentData/Rate.python.cpp new file mode 100644 index 000000000..4f451f1d2 --- /dev/null +++ b/python/src/v2.0/fissionFragmentData/Rate.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionFragmentData/Rate.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionFragmentData { + +// Rate wrapper +void wrapRate(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionFragmentData::Rate; + + // create the component + python::class_ component( + module, + "Rate", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Double & + >(), + python::arg("double"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionFragmentData +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport.python.cpp b/python/src/v2.0/fissionTransport.python.cpp new file mode 100644 index 000000000..b1846e8ff --- /dev/null +++ b/python/src/v2.0/fissionTransport.python.cpp @@ -0,0 +1,67 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// fissionTransport declarations +namespace python_fissionTransport { + void wrapEFH(python::module &); + void wrapEFL(python::module &); + void wrapT_M(python::module &); + void wrapMadlandNix(python::module &); + void wrapB(python::module &); + void wrapWatt(python::module &); + void wrapSimpleMaxwellianFission(python::module &); + void wrapDelayedBetaEnergy(python::module &); + void wrapDelayedGammaEnergy(python::module &); + void wrapDelayedNeutronKE(python::module &); + void wrapNeutrinoEnergy(python::module &); + void wrapNonNeutrinoEnergy(python::module &); + void wrapPromptGammaEnergy(python::module &); + void wrapPromptNeutronKE(python::module &); + void wrapPromptProductKE(python::module &); + void wrapTotalEnergy(python::module &); + void wrapFissionEnergyReleased(python::module &); + void wrapFissionComponent(python::module &); + void wrapFissionComponents(python::module &); +} // namespace python_fissionTransport + +// fissionTransport wrapper +void wrapFissionTransport(python::module &module) +{ + // create the fissionTransport submodule + python::module submodule = module.def_submodule( + "fissionTransport", + "GNDS v2.0 fissionTransport" + ); + + // wrap fissionTransport components + python_fissionTransport::wrapEFH(submodule); + python_fissionTransport::wrapEFL(submodule); + python_fissionTransport::wrapT_M(submodule); + python_fissionTransport::wrapMadlandNix(submodule); + python_fissionTransport::wrapB(submodule); + python_fissionTransport::wrapWatt(submodule); + python_fissionTransport::wrapSimpleMaxwellianFission(submodule); + python_fissionTransport::wrapDelayedBetaEnergy(submodule); + python_fissionTransport::wrapDelayedGammaEnergy(submodule); + python_fissionTransport::wrapDelayedNeutronKE(submodule); + python_fissionTransport::wrapNeutrinoEnergy(submodule); + python_fissionTransport::wrapNonNeutrinoEnergy(submodule); + python_fissionTransport::wrapPromptGammaEnergy(submodule); + python_fissionTransport::wrapPromptNeutronKE(submodule); + python_fissionTransport::wrapPromptProductKE(submodule); + python_fissionTransport::wrapTotalEnergy(submodule); + python_fissionTransport::wrapFissionEnergyReleased(submodule); + python_fissionTransport::wrapFissionComponent(submodule); + python_fissionTransport::wrapFissionComponents(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/B.python.cpp b/python/src/v2.0/fissionTransport/B.python.cpp new file mode 100644 index 000000000..a6dc9e0dc --- /dev/null +++ b/python/src/v2.0/fissionTransport/B.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/B.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// B wrapper +void wrapB(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::B; + + // create the component + python::class_ component( + module, + "B", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/DelayedBetaEnergy.python.cpp b/python/src/v2.0/fissionTransport/DelayedBetaEnergy.python.cpp new file mode 100644 index 000000000..2adfc5aec --- /dev/null +++ b/python/src/v2.0/fissionTransport/DelayedBetaEnergy.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/DelayedBetaEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// DelayedBetaEnergy wrapper +void wrapDelayedBetaEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::DelayedBetaEnergy; + + // create the component + python::class_ component( + module, + "DelayedBetaEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("polynomial1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/DelayedGammaEnergy.python.cpp b/python/src/v2.0/fissionTransport/DelayedGammaEnergy.python.cpp new file mode 100644 index 000000000..e815ed923 --- /dev/null +++ b/python/src/v2.0/fissionTransport/DelayedGammaEnergy.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/DelayedGammaEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// DelayedGammaEnergy wrapper +void wrapDelayedGammaEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::DelayedGammaEnergy; + + // create the component + python::class_ component( + module, + "DelayedGammaEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("polynomial1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/DelayedNeutronKE.python.cpp b/python/src/v2.0/fissionTransport/DelayedNeutronKE.python.cpp new file mode 100644 index 000000000..e88c485cb --- /dev/null +++ b/python/src/v2.0/fissionTransport/DelayedNeutronKE.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/DelayedNeutronKE.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// DelayedNeutronKE wrapper +void wrapDelayedNeutronKE(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::DelayedNeutronKE; + + // create the component + python::class_ component( + module, + "DelayedNeutronKE", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("polynomial1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/EFH.python.cpp b/python/src/v2.0/fissionTransport/EFH.python.cpp new file mode 100644 index 000000000..c3e619f97 --- /dev/null +++ b/python/src/v2.0/fissionTransport/EFH.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/EFH.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// EFH wrapper +void wrapEFH(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::EFH; + + // create the component + python::class_ component( + module, + "EFH", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Float64 & + >(), + python::arg("unit"), + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/EFL.python.cpp b/python/src/v2.0/fissionTransport/EFL.python.cpp new file mode 100644 index 000000000..f2aa103d7 --- /dev/null +++ b/python/src/v2.0/fissionTransport/EFL.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/EFL.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// EFL wrapper +void wrapEFL(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::EFL; + + // create the component + python::class_ component( + module, + "EFL", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Float64 & + >(), + python::arg("unit"), + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/FissionComponent.python.cpp b/python/src/v2.0/fissionTransport/FissionComponent.python.cpp new file mode 100644 index 000000000..27b3d23a8 --- /dev/null +++ b/python/src/v2.0/fissionTransport/FissionComponent.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/FissionComponent.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// FissionComponent wrapper +void wrapFissionComponent(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::FissionComponent; + + // create the component + python::class_ component( + module, + "FissionComponent", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + python::arg("endf_mt") = std::nullopt, + python::arg("fission_genre"), + python::arg("label"), + python::arg("cross_section") = std::nullopt, + python::arg("output_channel") = std::nullopt, + 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() + ) + .def_property_readonly( + "output_channel", + python::overload_cast<>(&Component::outputChannel), + Component::documentation("output_channel").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/FissionComponents.python.cpp b/python/src/v2.0/fissionTransport/FissionComponents.python.cpp new file mode 100644 index 000000000..edb038afb --- /dev/null +++ b/python/src/v2.0/fissionTransport/FissionComponents.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/FissionComponents.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// FissionComponents wrapper +void wrapFissionComponents(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::FissionComponents; + + // create the component + python::class_ component( + module, + "FissionComponents", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("fission_component") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "fission_component", + python::overload_cast<>(&Component::fissionComponent), + Component::documentation("fission_component").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/FissionEnergyReleased.python.cpp b/python/src/v2.0/fissionTransport/FissionEnergyReleased.python.cpp new file mode 100644 index 000000000..e5b217739 --- /dev/null +++ b/python/src/v2.0/fissionTransport/FissionEnergyReleased.python.cpp @@ -0,0 +1,119 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/FissionEnergyReleased.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// FissionEnergyReleased wrapper +void wrapFissionEnergyReleased(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::FissionEnergyReleased; + + // create the component + python::class_ component( + module, + "FissionEnergyReleased", + 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 std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("label") = std::nullopt, + python::arg("delayed_beta_energy") = std::nullopt, + python::arg("delayed_gamma_energy") = std::nullopt, + python::arg("delayed_neutron_ke") = std::nullopt, + python::arg("neutrino_energy") = std::nullopt, + python::arg("non_neutrino_energy") = std::nullopt, + python::arg("prompt_gamma_energy") = std::nullopt, + python::arg("prompt_neutron_ke") = std::nullopt, + python::arg("prompt_product_ke") = std::nullopt, + python::arg("total_energy") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "delayed_beta_energy", + python::overload_cast<>(&Component::delayedBetaEnergy), + Component::documentation("delayed_beta_energy").data() + ) + .def_property_readonly( + "delayed_gamma_energy", + python::overload_cast<>(&Component::delayedGammaEnergy), + Component::documentation("delayed_gamma_energy").data() + ) + .def_property_readonly( + "delayed_neutron_ke", + python::overload_cast<>(&Component::delayedNeutronKE), + Component::documentation("delayed_neutron_ke").data() + ) + .def_property_readonly( + "neutrino_energy", + python::overload_cast<>(&Component::neutrinoEnergy), + Component::documentation("neutrino_energy").data() + ) + .def_property_readonly( + "non_neutrino_energy", + python::overload_cast<>(&Component::nonNeutrinoEnergy), + Component::documentation("non_neutrino_energy").data() + ) + .def_property_readonly( + "prompt_gamma_energy", + python::overload_cast<>(&Component::promptGammaEnergy), + Component::documentation("prompt_gamma_energy").data() + ) + .def_property_readonly( + "prompt_neutron_ke", + python::overload_cast<>(&Component::promptNeutronKE), + Component::documentation("prompt_neutron_ke").data() + ) + .def_property_readonly( + "prompt_product_ke", + python::overload_cast<>(&Component::promptProductKE), + Component::documentation("prompt_product_ke").data() + ) + .def_property_readonly( + "total_energy", + python::overload_cast<>(&Component::totalEnergy), + Component::documentation("total_energy").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/MadlandNix.python.cpp b/python/src/v2.0/fissionTransport/MadlandNix.python.cpp new file mode 100644 index 000000000..120c19301 --- /dev/null +++ b/python/src/v2.0/fissionTransport/MadlandNix.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/MadlandNix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// MadlandNix wrapper +void wrapMadlandNix(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::MadlandNix; + + // create the component + python::class_ component( + module, + "MadlandNix", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const fissionTransport::EFH &, + const fissionTransport::EFL &, + const fissionTransport::T_M & + >(), + python::arg("efh"), + python::arg("efl"), + python::arg("t_m"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "efh", + python::overload_cast<>(&Component::EFH), + Component::documentation("efh").data() + ) + .def_property_readonly( + "efl", + python::overload_cast<>(&Component::EFL), + Component::documentation("efl").data() + ) + .def_property_readonly( + "t_m", + python::overload_cast<>(&Component::T_M), + Component::documentation("t_m").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/NeutrinoEnergy.python.cpp b/python/src/v2.0/fissionTransport/NeutrinoEnergy.python.cpp new file mode 100644 index 000000000..05196fe8d --- /dev/null +++ b/python/src/v2.0/fissionTransport/NeutrinoEnergy.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/NeutrinoEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// NeutrinoEnergy wrapper +void wrapNeutrinoEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::NeutrinoEnergy; + + // create the component + python::class_ component( + module, + "NeutrinoEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("polynomial1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/NonNeutrinoEnergy.python.cpp b/python/src/v2.0/fissionTransport/NonNeutrinoEnergy.python.cpp new file mode 100644 index 000000000..9528782dd --- /dev/null +++ b/python/src/v2.0/fissionTransport/NonNeutrinoEnergy.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/NonNeutrinoEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// NonNeutrinoEnergy wrapper +void wrapNonNeutrinoEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::NonNeutrinoEnergy; + + // create the component + python::class_ component( + module, + "NonNeutrinoEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("polynomial1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/PromptGammaEnergy.python.cpp b/python/src/v2.0/fissionTransport/PromptGammaEnergy.python.cpp new file mode 100644 index 000000000..d9068e41d --- /dev/null +++ b/python/src/v2.0/fissionTransport/PromptGammaEnergy.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/PromptGammaEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// PromptGammaEnergy wrapper +void wrapPromptGammaEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::PromptGammaEnergy; + + // create the component + python::class_ component( + module, + "PromptGammaEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("polynomial1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/PromptNeutronKE.python.cpp b/python/src/v2.0/fissionTransport/PromptNeutronKE.python.cpp new file mode 100644 index 000000000..2dc5eccde --- /dev/null +++ b/python/src/v2.0/fissionTransport/PromptNeutronKE.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/PromptNeutronKE.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// PromptNeutronKE wrapper +void wrapPromptNeutronKE(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::PromptNeutronKE; + + // create the component + python::class_ component( + module, + "PromptNeutronKE", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("polynomial1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/PromptProductKE.python.cpp b/python/src/v2.0/fissionTransport/PromptProductKE.python.cpp new file mode 100644 index 000000000..cf9386a99 --- /dev/null +++ b/python/src/v2.0/fissionTransport/PromptProductKE.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/PromptProductKE.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// PromptProductKE wrapper +void wrapPromptProductKE(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::PromptProductKE; + + // create the component + python::class_ component( + module, + "PromptProductKE", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("polynomial1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/SimpleMaxwellianFission.python.cpp b/python/src/v2.0/fissionTransport/SimpleMaxwellianFission.python.cpp new file mode 100644 index 000000000..8a0a954c7 --- /dev/null +++ b/python/src/v2.0/fissionTransport/SimpleMaxwellianFission.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/SimpleMaxwellianFission.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// SimpleMaxwellianFission wrapper +void wrapSimpleMaxwellianFission(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::SimpleMaxwellianFission; + + // create the component + python::class_ component( + module, + "SimpleMaxwellianFission", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("u") = std::nullopt, + python::arg("theta") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "u", + python::overload_cast<>(&Component::U), + Component::documentation("u").data() + ) + .def_property_readonly( + "theta", + python::overload_cast<>(&Component::theta), + Component::documentation("theta").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/T_M.python.cpp b/python/src/v2.0/fissionTransport/T_M.python.cpp new file mode 100644 index 000000000..7cca5fd4b --- /dev/null +++ b/python/src/v2.0/fissionTransport/T_M.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/T_M.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// T_M wrapper +void wrapT_M(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::T_M; + + // create the component + python::class_ component( + module, + "T_M", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::XYs1d & + >(), + python::arg("xys1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/TotalEnergy.python.cpp b/python/src/v2.0/fissionTransport/TotalEnergy.python.cpp new file mode 100644 index 000000000..842417212 --- /dev/null +++ b/python/src/v2.0/fissionTransport/TotalEnergy.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/TotalEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// TotalEnergy wrapper +void wrapTotalEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::TotalEnergy; + + // create the component + python::class_ component( + module, + "TotalEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("polynomial1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fissionTransport/Watt.python.cpp b/python/src/v2.0/fissionTransport/Watt.python.cpp new file mode 100644 index 000000000..75cded907 --- /dev/null +++ b/python/src/v2.0/fissionTransport/Watt.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fissionTransport/Watt.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// Watt wrapper +void wrapWatt(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fissionTransport::Watt; + + // create the component + python::class_ component( + module, + "Watt", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const transport::U &, + const transport::A &, + const fissionTransport::B & + >(), + python::arg("u"), + python::arg("a"), + python::arg("b"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "u", + python::overload_cast<>(&Component::U), + Component::documentation("u").data() + ) + .def_property_readonly( + "a", + python::overload_cast<>(&Component::a), + Component::documentation("a").data() + ) + .def_property_readonly( + "b", + python::overload_cast<>(&Component::b), + Component::documentation("b").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy.python.cpp b/python/src/v2.0/fpy.python.cpp new file mode 100644 index 000000000..df15af1ee --- /dev/null +++ b/python/src/v2.0/fpy.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// fpy declarations +namespace python_fpy { + void wrapTime(python::module &); + void wrapEnergy(python::module &); + void wrapNuclides(python::module &); + void wrapYields(python::module &); + void wrapIncidentEnergy(python::module &); + void wrapIncidentEnergies(python::module &); + void wrapElapsedTime(python::module &); + void wrapElapsedTimes(python::module &); + void wrapProductYield(python::module &); + void wrapProductYields(python::module &); +} // namespace python_fpy + +// fpy wrapper +void wrapFpy(python::module &module) +{ + // create the fpy submodule + python::module submodule = module.def_submodule( + "fpy", + "GNDS v2.0 fpy" + ); + + // wrap fpy components + python_fpy::wrapTime(submodule); + python_fpy::wrapEnergy(submodule); + python_fpy::wrapNuclides(submodule); + python_fpy::wrapYields(submodule); + python_fpy::wrapIncidentEnergy(submodule); + python_fpy::wrapIncidentEnergies(submodule); + python_fpy::wrapElapsedTime(submodule); + python_fpy::wrapElapsedTimes(submodule); + python_fpy::wrapProductYield(submodule); + python_fpy::wrapProductYields(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/ElapsedTime.python.cpp b/python/src/v2.0/fpy/ElapsedTime.python.cpp new file mode 100644 index 000000000..94dcdc678 --- /dev/null +++ b/python/src/v2.0/fpy/ElapsedTime.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/ElapsedTime.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// ElapsedTime wrapper +void wrapElapsedTime(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::ElapsedTime; + using _t = std::variant< + fpy::IncidentEnergies, + fpy::Yields + >; + + // create the component + python::class_ component( + module, + "ElapsedTime", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const fpy::Time &, + const _t & + >(), + python::arg("label") = std::nullopt, + python::arg("time"), + python::arg("_incident_energiesyields"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "time", + python::overload_cast<>(&Component::time), + Component::documentation("time").data() + ) + .def_property_readonly( + "incident_energies", + python::overload_cast<>(&Component::incidentEnergies), + Component::documentation("incident_energies").data() + ) + .def_property_readonly( + "yields", + python::overload_cast<>(&Component::yields), + Component::documentation("yields").data() + ) + .def_property_readonly( + "_incident_energiesyields", + python::overload_cast<>(&Component::_incidentEnergiesyields), + Component::documentation("_incident_energiesyields").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/ElapsedTimes.python.cpp b/python/src/v2.0/fpy/ElapsedTimes.python.cpp new file mode 100644 index 000000000..f22e9378f --- /dev/null +++ b/python/src/v2.0/fpy/ElapsedTimes.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/ElapsedTimes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// ElapsedTimes wrapper +void wrapElapsedTimes(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::ElapsedTimes; + + // create the component + python::class_ component( + module, + "ElapsedTimes", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("elapsed_time"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "elapsed_time", + python::overload_cast<>(&Component::elapsedTime), + Component::documentation("elapsed_time").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/Energy.python.cpp b/python/src/v2.0/fpy/Energy.python.cpp new file mode 100644 index 000000000..142ba67d4 --- /dev/null +++ b/python/src/v2.0/fpy/Energy.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/Energy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// Energy wrapper +void wrapEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::Energy; + + // create the component + python::class_ component( + module, + "Energy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Double & + >(), + python::arg("double"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/IncidentEnergies.python.cpp b/python/src/v2.0/fpy/IncidentEnergies.python.cpp new file mode 100644 index 000000000..3b4138ae8 --- /dev/null +++ b/python/src/v2.0/fpy/IncidentEnergies.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/IncidentEnergies.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// IncidentEnergies wrapper +void wrapIncidentEnergies(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::IncidentEnergies; + + // create the component + python::class_ component( + module, + "IncidentEnergies", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("incident_energy"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "incident_energy", + python::overload_cast<>(&Component::incidentEnergy), + Component::documentation("incident_energy").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/IncidentEnergy.python.cpp b/python/src/v2.0/fpy/IncidentEnergy.python.cpp new file mode 100644 index 000000000..61fb000ac --- /dev/null +++ b/python/src/v2.0/fpy/IncidentEnergy.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/IncidentEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// IncidentEnergy wrapper +void wrapIncidentEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::IncidentEnergy; + + // create the component + python::class_ component( + module, + "IncidentEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const fpy::Energy &, + const fpy::Yields & + >(), + python::arg("label"), + python::arg("energy"), + python::arg("yields"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "energy", + python::overload_cast<>(&Component::energy), + Component::documentation("energy").data() + ) + .def_property_readonly( + "yields", + python::overload_cast<>(&Component::yields), + Component::documentation("yields").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/Nuclides.python.cpp b/python/src/v2.0/fpy/Nuclides.python.cpp new file mode 100644 index 000000000..c3829ef26 --- /dev/null +++ b/python/src/v2.0/fpy/Nuclides.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/Nuclides.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// Nuclides wrapper +void wrapNuclides(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::Nuclides; + + // create the component + python::class_ component( + module, + "Nuclides", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("href") = 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( + "href", + &Component::href, + Component::documentation("href").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_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/ProductYield.python.cpp b/python/src/v2.0/fpy/ProductYield.python.cpp new file mode 100644 index 000000000..1ea7dad70 --- /dev/null +++ b/python/src/v2.0/fpy/ProductYield.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/ProductYield.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// ProductYield wrapper +void wrapProductYield(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::ProductYield; + + // create the component + python::class_ component( + module, + "ProductYield", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const fpy::ElapsedTimes &, + const std::optional & + >(), + python::arg("label"), + python::arg("elapsed_times"), + python::arg("nuclides") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "elapsed_times", + python::overload_cast<>(&Component::elapsedTimes), + Component::documentation("elapsed_times").data() + ) + .def_property_readonly( + "nuclides", + python::overload_cast<>(&Component::nuclides), + Component::documentation("nuclides").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/ProductYields.python.cpp b/python/src/v2.0/fpy/ProductYields.python.cpp new file mode 100644 index 000000000..5b1d2e7ea --- /dev/null +++ b/python/src/v2.0/fpy/ProductYields.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/ProductYields.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// ProductYields wrapper +void wrapProductYields(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::ProductYields; + + // create the component + python::class_ component( + module, + "ProductYields", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("product_yield"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "product_yield", + python::overload_cast<>(&Component::productYield), + Component::documentation("product_yield").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/Time.python.cpp b/python/src/v2.0/fpy/Time.python.cpp new file mode 100644 index 000000000..9776283a0 --- /dev/null +++ b/python/src/v2.0/fpy/Time.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/Time.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// Time wrapper +void wrapTime(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::Time; + using _t = std::variant< + containers::Double, + containers::String + >; + + // create the component + python::class_ component( + module, + "Time", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_doublestring"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + .def_property_readonly( + "string", + python::overload_cast<>(&Component::string), + Component::documentation("string").data() + ) + .def_property_readonly( + "_doublestring", + python::overload_cast<>(&Component::_Doublestring), + Component::documentation("_doublestring").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/fpy/Yields.python.cpp b/python/src/v2.0/fpy/Yields.python.cpp new file mode 100644 index 000000000..fbc74c730 --- /dev/null +++ b/python/src/v2.0/fpy/Yields.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/fpy/Yields.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// Yields wrapper +void wrapYields(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = fpy::Yields; + + // create the component + python::class_ component( + module, + "Yields", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const fpy::Nuclides &, + const containers::Values & + >(), + python::arg("nuclides"), + python::arg("values"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "nuclides", + python::overload_cast<>(&Component::nuclides), + Component::documentation("nuclides").data() + ) + .def_property_readonly( + "values", + python::overload_cast<>(&Component::values), + Component::documentation("values").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops.python.cpp b/python/src/v2.0/pops.python.cpp new file mode 100644 index 000000000..0f178d45c --- /dev/null +++ b/python/src/v2.0/pops.python.cpp @@ -0,0 +1,129 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// pops declarations +namespace python_pops { + void wrapAlias(python::module &); + void wrapMetaStable(python::module &); + void wrapAliases(python::module &); + void wrapCharge(python::module &); + void wrapAverageEnergy(python::module &); + void wrapAverageEnergies(python::module &); + void wrapQ(python::module &); + void wrapProduct(python::module &); + void wrapProducts(python::module &); + void wrapDecay(python::module &); + void wrapDecayPath(python::module &); + void wrapShell(python::module &); + void wrapInternalConversionCoefficients(python::module &); + void wrapPhotonEmissionProbabilities(python::module &); + void wrapProbability(python::module &); + void wrapContinuum(python::module &); + void wrapEnergy(python::module &); + void wrapIntensity(python::module &); + void wrapInternalPairFormationCoefficient(python::module &); + void wrapDiscrete(python::module &); + void wrapSpectrum(python::module &); + void wrapSpectra(python::module &); + void wrapDecayMode(python::module &); + void wrapDecayModes(python::module &); + void wrapDecayData(python::module &); + void wrapHalflife(python::module &); + void wrapMass(python::module &); + void wrapParity(python::module &); + void wrapSpin(python::module &); + void wrapBaryon(python::module &); + void wrapBaryons(python::module &); + void wrapBindingEnergy(python::module &); + void wrapConfiguration(python::module &); + void wrapConfigurations(python::module &); + void wrapAtomic(python::module &); + void wrapEnergy(python::module &); + void wrapNucleus(python::module &); + void wrapNuclide(python::module &); + void wrapNuclides(python::module &); + void wrapIsotope(python::module &); + void wrapIsotopes(python::module &); + void wrapChemicalElement(python::module &); + void wrapChemicalElements(python::module &); + void wrapGaugeBoson(python::module &); + void wrapGaugeBosons(python::module &); + void wrapLepton(python::module &); + void wrapLeptons(python::module &); + void wrapUnorthodox(python::module &); + void wrapUnorthodoxes(python::module &); + void wrapPoPs(python::module &); +} // namespace python_pops + +// pops wrapper +void wrapPops(python::module &module) +{ + // create the pops submodule + python::module submodule = module.def_submodule( + "pops", + "GNDS v2.0 pops" + ); + + // wrap pops components + python_pops::wrapAlias(submodule); + python_pops::wrapMetaStable(submodule); + python_pops::wrapAliases(submodule); + python_pops::wrapCharge(submodule); + python_pops::wrapAverageEnergy(submodule); + python_pops::wrapAverageEnergies(submodule); + python_pops::wrapQ(submodule); + python_pops::wrapProduct(submodule); + python_pops::wrapProducts(submodule); + python_pops::wrapDecay(submodule); + python_pops::wrapDecayPath(submodule); + python_pops::wrapShell(submodule); + python_pops::wrapInternalConversionCoefficients(submodule); + python_pops::wrapPhotonEmissionProbabilities(submodule); + python_pops::wrapProbability(submodule); + python_pops::wrapContinuum(submodule); + python_pops::wrapEnergy(submodule); + python_pops::wrapIntensity(submodule); + python_pops::wrapInternalPairFormationCoefficient(submodule); + python_pops::wrapDiscrete(submodule); + python_pops::wrapSpectrum(submodule); + python_pops::wrapSpectra(submodule); + python_pops::wrapDecayMode(submodule); + python_pops::wrapDecayModes(submodule); + python_pops::wrapDecayData(submodule); + python_pops::wrapHalflife(submodule); + python_pops::wrapMass(submodule); + python_pops::wrapParity(submodule); + python_pops::wrapSpin(submodule); + python_pops::wrapBaryon(submodule); + python_pops::wrapBaryons(submodule); + python_pops::wrapBindingEnergy(submodule); + python_pops::wrapConfiguration(submodule); + python_pops::wrapConfigurations(submodule); + python_pops::wrapAtomic(submodule); + python_pops::wrapEnergy(submodule); + python_pops::wrapNucleus(submodule); + python_pops::wrapNuclide(submodule); + python_pops::wrapNuclides(submodule); + python_pops::wrapIsotope(submodule); + python_pops::wrapIsotopes(submodule); + python_pops::wrapChemicalElement(submodule); + python_pops::wrapChemicalElements(submodule); + python_pops::wrapGaugeBoson(submodule); + python_pops::wrapGaugeBosons(submodule); + python_pops::wrapLepton(submodule); + python_pops::wrapLeptons(submodule); + python_pops::wrapUnorthodox(submodule); + python_pops::wrapUnorthodoxes(submodule); + python_pops::wrapPoPs(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Alias.python.cpp b/python/src/v2.0/pops/Alias.python.cpp new file mode 100644 index 000000000..44c9f4e32 --- /dev/null +++ b/python/src/v2.0/pops/Alias.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Alias.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Alias wrapper +void wrapAlias(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Alias; + + // create the component + python::class_ component( + module, + "Alias", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName & + >(), + python::arg("id"), + python::arg("pid"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "id", + &Component::id, + Component::documentation("id").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Aliases.python.cpp b/python/src/v2.0/pops/Aliases.python.cpp new file mode 100644 index 000000000..7aa384847 --- /dev/null +++ b/python/src/v2.0/pops/Aliases.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Aliases.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Aliases wrapper +void wrapAliases(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Aliases; + + // create the component + python::class_ component( + module, + "Aliases", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> &, + const std::optional> & + >(), + python::arg("alias") = std::nullopt, + python::arg("meta_stable") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "alias", + python::overload_cast<>(&Component::alias), + Component::documentation("alias").data() + ) + .def_property_readonly( + "meta_stable", + python::overload_cast<>(&Component::metaStable), + Component::documentation("meta_stable").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Atomic.python.cpp b/python/src/v2.0/pops/Atomic.python.cpp new file mode 100644 index 000000000..3a2b35c71 --- /dev/null +++ b/python/src/v2.0/pops/Atomic.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Atomic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Atomic wrapper +void wrapAtomic(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Atomic; + + // create the component + python::class_ component( + module, + "Atomic", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("configurations") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "configurations", + python::overload_cast<>(&Component::configurations), + Component::documentation("configurations").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/AverageEnergies.python.cpp b/python/src/v2.0/pops/AverageEnergies.python.cpp new file mode 100644 index 000000000..fddc39ac7 --- /dev/null +++ b/python/src/v2.0/pops/AverageEnergies.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/AverageEnergies.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// AverageEnergies wrapper +void wrapAverageEnergies(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::AverageEnergies; + + // create the component + python::class_ component( + module, + "AverageEnergies", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("average_energy"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "average_energy", + python::overload_cast<>(&Component::averageEnergy), + Component::documentation("average_energy").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/AverageEnergy.python.cpp b/python/src/v2.0/pops/AverageEnergy.python.cpp new file mode 100644 index 000000000..109763339 --- /dev/null +++ b/python/src/v2.0/pops/AverageEnergy.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/AverageEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// AverageEnergy wrapper +void wrapAverageEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::AverageEnergy; + + // create the component + python::class_ component( + module, + "AverageEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const Float64 & + >(), + python::arg("label"), + python::arg("unit"), + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Baryon.python.cpp b/python/src/v2.0/pops/Baryon.python.cpp new file mode 100644 index 000000000..6475c9ead --- /dev/null +++ b/python/src/v2.0/pops/Baryon.python.cpp @@ -0,0 +1,98 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Baryon.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Baryon wrapper +void wrapBaryon(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Baryon; + + // create the component + python::class_ component( + module, + "Baryon", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("id"), + python::arg("charge") = std::nullopt, + python::arg("decay_data") = std::nullopt, + python::arg("halflife") = std::nullopt, + python::arg("mass") = std::nullopt, + python::arg("parity") = std::nullopt, + python::arg("spin") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "id", + &Component::id, + Component::documentation("id").data() + ) + .def_property_readonly( + "charge", + python::overload_cast<>(&Component::charge), + Component::documentation("charge").data() + ) + .def_property_readonly( + "decay_data", + python::overload_cast<>(&Component::decayData), + Component::documentation("decay_data").data() + ) + .def_property_readonly( + "halflife", + python::overload_cast<>(&Component::halflife), + Component::documentation("halflife").data() + ) + .def_property_readonly( + "mass", + python::overload_cast<>(&Component::mass), + Component::documentation("mass").data() + ) + .def_property_readonly( + "parity", + python::overload_cast<>(&Component::parity), + Component::documentation("parity").data() + ) + .def_property_readonly( + "spin", + python::overload_cast<>(&Component::spin), + Component::documentation("spin").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Baryons.python.cpp b/python/src/v2.0/pops/Baryons.python.cpp new file mode 100644 index 000000000..29dd9732d --- /dev/null +++ b/python/src/v2.0/pops/Baryons.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Baryons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Baryons wrapper +void wrapBaryons(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Baryons; + + // create the component + python::class_ component( + module, + "Baryons", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("baryon") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "baryon", + python::overload_cast<>(&Component::baryon), + Component::documentation("baryon").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/BindingEnergy.python.cpp b/python/src/v2.0/pops/BindingEnergy.python.cpp new file mode 100644 index 000000000..17f2df4d8 --- /dev/null +++ b/python/src/v2.0/pops/BindingEnergy.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/BindingEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// BindingEnergy wrapper +void wrapBindingEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::BindingEnergy; + + // create the component + python::class_ component( + module, + "BindingEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("double") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Charge.python.cpp b/python/src/v2.0/pops/Charge.python.cpp new file mode 100644 index 000000000..ebb7e5889 --- /dev/null +++ b/python/src/v2.0/pops/Charge.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Charge.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Charge wrapper +void wrapCharge(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Charge; + using _t = std::variant< + containers::Fraction, + containers::Integer + >; + + // create the component + python::class_ component( + module, + "Charge", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_fractioninteger"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "fraction", + python::overload_cast<>(&Component::fraction), + Component::documentation("fraction").data() + ) + .def_property_readonly( + "integer", + python::overload_cast<>(&Component::integer), + Component::documentation("integer").data() + ) + .def_property_readonly( + "_fractioninteger", + python::overload_cast<>(&Component::_fractioninteger), + Component::documentation("_fractioninteger").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/ChemicalElement.python.cpp b/python/src/v2.0/pops/ChemicalElement.python.cpp new file mode 100644 index 000000000..4ab5f32a6 --- /dev/null +++ b/python/src/v2.0/pops/ChemicalElement.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/ChemicalElement.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// ChemicalElement wrapper +void wrapChemicalElement(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::ChemicalElement; + + // create the component + python::class_ component( + module, + "ChemicalElement", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Integer32 &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + python::arg("z"), + python::arg("name") = std::nullopt, + python::arg("symbol"), + python::arg("atomic") = std::nullopt, + python::arg("isotopes") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "z", + &Component::Z, + Component::documentation("z").data() + ) + .def_property_readonly( + "name", + &Component::name, + Component::documentation("name").data() + ) + .def_property_readonly( + "symbol", + &Component::symbol, + Component::documentation("symbol").data() + ) + .def_property_readonly( + "atomic", + python::overload_cast<>(&Component::atomic), + Component::documentation("atomic").data() + ) + .def_property_readonly( + "isotopes", + python::overload_cast<>(&Component::isotopes), + Component::documentation("isotopes").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/ChemicalElements.python.cpp b/python/src/v2.0/pops/ChemicalElements.python.cpp new file mode 100644 index 000000000..0f6112db2 --- /dev/null +++ b/python/src/v2.0/pops/ChemicalElements.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/ChemicalElements.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// ChemicalElements wrapper +void wrapChemicalElements(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::ChemicalElements; + + // create the component + python::class_ component( + module, + "ChemicalElements", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("chemical_element") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "chemical_element", + python::overload_cast<>(&Component::chemicalElement), + Component::documentation("chemical_element").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Configuration.python.cpp b/python/src/v2.0/pops/Configuration.python.cpp new file mode 100644 index 000000000..48c95dd4f --- /dev/null +++ b/python/src/v2.0/pops/Configuration.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Configuration.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Configuration wrapper +void wrapConfiguration(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Configuration; + + // create the component + python::class_ component( + module, + "Configuration", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Float64 &, + const std::string &, + const pops::BindingEnergy &, + const std::optional & + >(), + python::arg("electron_number"), + python::arg("subshell"), + python::arg("binding_energy"), + python::arg("decay_data") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "electron_number", + &Component::electronNumber, + Component::documentation("electron_number").data() + ) + .def_property_readonly( + "subshell", + &Component::subshell, + Component::documentation("subshell").data() + ) + .def_property_readonly( + "binding_energy", + python::overload_cast<>(&Component::bindingEnergy), + Component::documentation("binding_energy").data() + ) + .def_property_readonly( + "decay_data", + python::overload_cast<>(&Component::decayData), + Component::documentation("decay_data").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Configurations.python.cpp b/python/src/v2.0/pops/Configurations.python.cpp new file mode 100644 index 000000000..9f7525447 --- /dev/null +++ b/python/src/v2.0/pops/Configurations.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Configurations.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Configurations wrapper +void wrapConfigurations(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Configurations; + + // create the component + python::class_ component( + module, + "Configurations", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("configuration"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "configuration", + python::overload_cast<>(&Component::configuration), + Component::documentation("configuration").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Continuum.python.cpp b/python/src/v2.0/pops/Continuum.python.cpp new file mode 100644 index 000000000..5730a879d --- /dev/null +++ b/python/src/v2.0/pops/Continuum.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Continuum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Continuum wrapper +void wrapContinuum(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Continuum; + + // create the component + python::class_ component( + module, + "Continuum", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Decay.python.cpp b/python/src/v2.0/pops/Decay.python.cpp new file mode 100644 index 000000000..f4174df78 --- /dev/null +++ b/python/src/v2.0/pops/Decay.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Decay.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Decay wrapper +void wrapDecay(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Decay; + + // create the component + python::class_ component( + module, + "Decay", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const Integer32 &, + const std::optional &, + const std::optional & + >(), + python::arg("complete") = std::nullopt, + python::arg("index"), + python::arg("mode") = std::nullopt, + python::arg("products") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "complete", + [](const Component &self) { return self.complete().value(); }, + Component::documentation("complete").data() + ) + .def_property_readonly( + "index", + &Component::index, + Component::documentation("index").data() + ) + .def_property_readonly( + "mode", + &Component::mode, + Component::documentation("mode").data() + ) + .def_property_readonly( + "products", + python::overload_cast<>(&Component::products), + Component::documentation("products").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/DecayData.python.cpp b/python/src/v2.0/pops/DecayData.python.cpp new file mode 100644 index 000000000..d55ceace9 --- /dev/null +++ b/python/src/v2.0/pops/DecayData.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/DecayData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// DecayData wrapper +void wrapDecayData(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::DecayData; + + // create the component + python::class_ component( + module, + "DecayData", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("average_energies") = std::nullopt, + python::arg("decay_modes") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "average_energies", + python::overload_cast<>(&Component::averageEnergies), + Component::documentation("average_energies").data() + ) + .def_property_readonly( + "decay_modes", + python::overload_cast<>(&Component::decayModes), + Component::documentation("decay_modes").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/DecayMode.python.cpp b/python/src/v2.0/pops/DecayMode.python.cpp new file mode 100644 index 000000000..630db23af --- /dev/null +++ b/python/src/v2.0/pops/DecayMode.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/DecayMode.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// DecayMode wrapper +void wrapDecayMode(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::DecayMode; + + // create the component + python::class_ component( + module, + "DecayMode", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const enums::DecayType &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const pops::Probability &, + const std::optional & + >(), + python::arg("label"), + python::arg("mode"), + python::arg("q") = std::nullopt, + python::arg("decay_path") = std::nullopt, + python::arg("internal_conversion_coefficients") = std::nullopt, + python::arg("photon_emission_probabilities") = std::nullopt, + python::arg("probability"), + python::arg("spectra") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "mode", + &Component::mode, + Component::documentation("mode").data() + ) + .def_property_readonly( + "q", + python::overload_cast<>(&Component::Q), + Component::documentation("q").data() + ) + .def_property_readonly( + "decay_path", + python::overload_cast<>(&Component::decayPath), + Component::documentation("decay_path").data() + ) + .def_property_readonly( + "internal_conversion_coefficients", + python::overload_cast<>(&Component::internalConversionCoefficients), + Component::documentation("internal_conversion_coefficients").data() + ) + .def_property_readonly( + "photon_emission_probabilities", + python::overload_cast<>(&Component::photonEmissionProbabilities), + Component::documentation("photon_emission_probabilities").data() + ) + .def_property_readonly( + "probability", + python::overload_cast<>(&Component::probability), + Component::documentation("probability").data() + ) + .def_property_readonly( + "spectra", + python::overload_cast<>(&Component::spectra), + Component::documentation("spectra").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/DecayModes.python.cpp b/python/src/v2.0/pops/DecayModes.python.cpp new file mode 100644 index 000000000..c13e0a8fa --- /dev/null +++ b/python/src/v2.0/pops/DecayModes.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/DecayModes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// DecayModes wrapper +void wrapDecayModes(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::DecayModes; + + // create the component + python::class_ component( + module, + "DecayModes", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("decay_mode"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "decay_mode", + python::overload_cast<>(&Component::decayMode), + Component::documentation("decay_mode").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/DecayPath.python.cpp b/python/src/v2.0/pops/DecayPath.python.cpp new file mode 100644 index 000000000..f6e2b0811 --- /dev/null +++ b/python/src/v2.0/pops/DecayPath.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/DecayPath.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// DecayPath wrapper +void wrapDecayPath(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::DecayPath; + + // create the component + python::class_ component( + module, + "DecayPath", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("decay"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "decay", + python::overload_cast<>(&Component::decay), + Component::documentation("decay").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Discrete.python.cpp b/python/src/v2.0/pops/Discrete.python.cpp new file mode 100644 index 000000000..b1cbe0a1e --- /dev/null +++ b/python/src/v2.0/pops/Discrete.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Discrete.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Discrete wrapper +void wrapDiscrete(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Discrete; + + // create the component + python::class_ component( + module, + "Discrete", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const pops::Energy &, + const pops::Intensity &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("type") = std::nullopt, + python::arg("energy"), + python::arg("intensity"), + python::arg("internal_conversion_coefficients") = std::nullopt, + python::arg("internal_pair_formation_coefficient") = std::nullopt, + python::arg("photon_emission_probabilities") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "type", + &Component::type, + Component::documentation("type").data() + ) + .def_property_readonly( + "energy", + python::overload_cast<>(&Component::energy), + Component::documentation("energy").data() + ) + .def_property_readonly( + "intensity", + python::overload_cast<>(&Component::intensity), + Component::documentation("intensity").data() + ) + .def_property_readonly( + "internal_conversion_coefficients", + python::overload_cast<>(&Component::internalConversionCoefficients), + Component::documentation("internal_conversion_coefficients").data() + ) + .def_property_readonly( + "internal_pair_formation_coefficient", + python::overload_cast<>(&Component::internalPairFormationCoefficient), + Component::documentation("internal_pair_formation_coefficient").data() + ) + .def_property_readonly( + "photon_emission_probabilities", + python::overload_cast<>(&Component::photonEmissionProbabilities), + Component::documentation("photon_emission_probabilities").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Energy.python.cpp b/python/src/v2.0/pops/Energy.python.cpp new file mode 100644 index 000000000..ec2f9a194 --- /dev/null +++ b/python/src/v2.0/pops/Energy.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Energy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Energy wrapper +void wrapEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Energy; + + // create the component + python::class_ component( + module, + "Energy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Float64 &, + const std::optional> & + >(), + python::arg("unit"), + python::arg("value"), + python::arg("double") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/GaugeBoson.python.cpp b/python/src/v2.0/pops/GaugeBoson.python.cpp new file mode 100644 index 000000000..83ea4000a --- /dev/null +++ b/python/src/v2.0/pops/GaugeBoson.python.cpp @@ -0,0 +1,98 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/GaugeBoson.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// GaugeBoson wrapper +void wrapGaugeBoson(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::GaugeBoson; + + // create the component + python::class_ component( + module, + "GaugeBoson", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("id"), + python::arg("charge") = std::nullopt, + python::arg("decay_data") = std::nullopt, + python::arg("halflife") = std::nullopt, + python::arg("mass") = std::nullopt, + python::arg("parity") = std::nullopt, + python::arg("spin") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "id", + &Component::id, + Component::documentation("id").data() + ) + .def_property_readonly( + "charge", + python::overload_cast<>(&Component::charge), + Component::documentation("charge").data() + ) + .def_property_readonly( + "decay_data", + python::overload_cast<>(&Component::decayData), + Component::documentation("decay_data").data() + ) + .def_property_readonly( + "halflife", + python::overload_cast<>(&Component::halflife), + Component::documentation("halflife").data() + ) + .def_property_readonly( + "mass", + python::overload_cast<>(&Component::mass), + Component::documentation("mass").data() + ) + .def_property_readonly( + "parity", + python::overload_cast<>(&Component::parity), + Component::documentation("parity").data() + ) + .def_property_readonly( + "spin", + python::overload_cast<>(&Component::spin), + Component::documentation("spin").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/GaugeBosons.python.cpp b/python/src/v2.0/pops/GaugeBosons.python.cpp new file mode 100644 index 000000000..f9a364045 --- /dev/null +++ b/python/src/v2.0/pops/GaugeBosons.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/GaugeBosons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// GaugeBosons wrapper +void wrapGaugeBosons(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::GaugeBosons; + + // create the component + python::class_ component( + module, + "GaugeBosons", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("gauge_boson") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "gauge_boson", + python::overload_cast<>(&Component::gaugeBoson), + Component::documentation("gauge_boson").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Halflife.python.cpp b/python/src/v2.0/pops/Halflife.python.cpp new file mode 100644 index 000000000..a81ed4133 --- /dev/null +++ b/python/src/v2.0/pops/Halflife.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Halflife.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Halflife wrapper +void wrapHalflife(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Halflife; + using _t = std::variant< + containers::Double, + containers::String + >; + + // create the component + python::class_ component( + module, + "Halflife", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_doublestring"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + .def_property_readonly( + "string", + python::overload_cast<>(&Component::string), + Component::documentation("string").data() + ) + .def_property_readonly( + "_doublestring", + python::overload_cast<>(&Component::_Doublestring), + Component::documentation("_doublestring").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Intensity.python.cpp b/python/src/v2.0/pops/Intensity.python.cpp new file mode 100644 index 000000000..2032db005 --- /dev/null +++ b/python/src/v2.0/pops/Intensity.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Intensity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Intensity wrapper +void wrapIntensity(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Intensity; + + // create the component + python::class_ component( + module, + "Intensity", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("value") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/InternalConversionCoefficients.python.cpp b/python/src/v2.0/pops/InternalConversionCoefficients.python.cpp new file mode 100644 index 000000000..25dec44f6 --- /dev/null +++ b/python/src/v2.0/pops/InternalConversionCoefficients.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/InternalConversionCoefficients.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// InternalConversionCoefficients wrapper +void wrapInternalConversionCoefficients(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::InternalConversionCoefficients; + + // create the component + python::class_ component( + module, + "InternalConversionCoefficients", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("shell"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "shell", + python::overload_cast<>(&Component::shell), + Component::documentation("shell").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/InternalPairFormationCoefficient.python.cpp b/python/src/v2.0/pops/InternalPairFormationCoefficient.python.cpp new file mode 100644 index 000000000..358d9794d --- /dev/null +++ b/python/src/v2.0/pops/InternalPairFormationCoefficient.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/InternalPairFormationCoefficient.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// InternalPairFormationCoefficient wrapper +void wrapInternalPairFormationCoefficient(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::InternalPairFormationCoefficient; + + // create the component + python::class_ component( + module, + "InternalPairFormationCoefficient", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Float64 & + >(), + python::arg("unit"), + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Isotope.python.cpp b/python/src/v2.0/pops/Isotope.python.cpp new file mode 100644 index 000000000..51832486b --- /dev/null +++ b/python/src/v2.0/pops/Isotope.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Isotope.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Isotope wrapper +void wrapIsotope(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Isotope; + + // create the component + python::class_ component( + module, + "Isotope", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Integer32 &, + const XMLName &, + const std::optional & + >(), + python::arg("a"), + python::arg("symbol"), + python::arg("nuclides") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "a", + &Component::A, + Component::documentation("a").data() + ) + .def_property_readonly( + "symbol", + &Component::symbol, + Component::documentation("symbol").data() + ) + .def_property_readonly( + "nuclides", + python::overload_cast<>(&Component::nuclides), + Component::documentation("nuclides").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Isotopes.python.cpp b/python/src/v2.0/pops/Isotopes.python.cpp new file mode 100644 index 000000000..2d4224237 --- /dev/null +++ b/python/src/v2.0/pops/Isotopes.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Isotopes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Isotopes wrapper +void wrapIsotopes(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Isotopes; + + // create the component + python::class_ component( + module, + "Isotopes", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("isotope"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "isotope", + python::overload_cast<>(&Component::isotope), + Component::documentation("isotope").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Lepton.python.cpp b/python/src/v2.0/pops/Lepton.python.cpp new file mode 100644 index 000000000..71543dc5a --- /dev/null +++ b/python/src/v2.0/pops/Lepton.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Lepton.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Lepton wrapper +void wrapLepton(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Lepton; + + // create the component + python::class_ component( + module, + "Lepton", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("generation") = std::nullopt, + python::arg("id"), + python::arg("charge") = std::nullopt, + python::arg("decay_data") = std::nullopt, + python::arg("halflife") = std::nullopt, + python::arg("mass") = std::nullopt, + python::arg("parity") = std::nullopt, + python::arg("spin") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "generation", + &Component::generation, + Component::documentation("generation").data() + ) + .def_property_readonly( + "id", + &Component::id, + Component::documentation("id").data() + ) + .def_property_readonly( + "charge", + python::overload_cast<>(&Component::charge), + Component::documentation("charge").data() + ) + .def_property_readonly( + "decay_data", + python::overload_cast<>(&Component::decayData), + Component::documentation("decay_data").data() + ) + .def_property_readonly( + "halflife", + python::overload_cast<>(&Component::halflife), + Component::documentation("halflife").data() + ) + .def_property_readonly( + "mass", + python::overload_cast<>(&Component::mass), + Component::documentation("mass").data() + ) + .def_property_readonly( + "parity", + python::overload_cast<>(&Component::parity), + Component::documentation("parity").data() + ) + .def_property_readonly( + "spin", + python::overload_cast<>(&Component::spin), + Component::documentation("spin").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Leptons.python.cpp b/python/src/v2.0/pops/Leptons.python.cpp new file mode 100644 index 000000000..644ac0c94 --- /dev/null +++ b/python/src/v2.0/pops/Leptons.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Leptons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Leptons wrapper +void wrapLeptons(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Leptons; + + // create the component + python::class_ component( + module, + "Leptons", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("lepton"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "lepton", + python::overload_cast<>(&Component::lepton), + Component::documentation("lepton").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Mass.python.cpp b/python/src/v2.0/pops/Mass.python.cpp new file mode 100644 index 000000000..9a3337ddf --- /dev/null +++ b/python/src/v2.0/pops/Mass.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Mass.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Mass wrapper +void wrapMass(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Mass; + + // create the component + python::class_ component( + module, + "Mass", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("double") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/MetaStable.python.cpp b/python/src/v2.0/pops/MetaStable.python.cpp new file mode 100644 index 000000000..13ad8fcd3 --- /dev/null +++ b/python/src/v2.0/pops/MetaStable.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/MetaStable.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// MetaStable wrapper +void wrapMetaStable(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::MetaStable; + + // create the component + python::class_ component( + module, + "MetaStable", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Integer32 &, + const XMLName & + >(), + python::arg("id"), + python::arg("meta_stable_index"), + python::arg("pid"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "id", + &Component::id, + Component::documentation("id").data() + ) + .def_property_readonly( + "meta_stable_index", + &Component::metaStableIndex, + Component::documentation("meta_stable_index").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Nucleus.python.cpp b/python/src/v2.0/pops/Nucleus.python.cpp new file mode 100644 index 000000000..d7cb79869 --- /dev/null +++ b/python/src/v2.0/pops/Nucleus.python.cpp @@ -0,0 +1,112 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Nucleus.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Nucleus wrapper +void wrapNucleus(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Nucleus; + + // create the component + python::class_ component( + module, + "Nucleus", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Integer32 &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("id"), + python::arg("index"), + python::arg("charge") = std::nullopt, + python::arg("decay_data") = std::nullopt, + python::arg("energy") = std::nullopt, + python::arg("fission_fragment_data") = std::nullopt, + python::arg("halflife") = std::nullopt, + python::arg("parity") = std::nullopt, + python::arg("spin") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "id", + &Component::id, + Component::documentation("id").data() + ) + .def_property_readonly( + "index", + &Component::index, + Component::documentation("index").data() + ) + .def_property_readonly( + "charge", + python::overload_cast<>(&Component::charge), + Component::documentation("charge").data() + ) + .def_property_readonly( + "decay_data", + python::overload_cast<>(&Component::decayData), + Component::documentation("decay_data").data() + ) + .def_property_readonly( + "energy", + python::overload_cast<>(&Component::energy), + Component::documentation("energy").data() + ) + .def_property_readonly( + "fission_fragment_data", + python::overload_cast<>(&Component::fissionFragmentData), + Component::documentation("fission_fragment_data").data() + ) + .def_property_readonly( + "halflife", + python::overload_cast<>(&Component::halflife), + Component::documentation("halflife").data() + ) + .def_property_readonly( + "parity", + python::overload_cast<>(&Component::parity), + Component::documentation("parity").data() + ) + .def_property_readonly( + "spin", + python::overload_cast<>(&Component::spin), + Component::documentation("spin").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Nuclide.python.cpp b/python/src/v2.0/pops/Nuclide.python.cpp new file mode 100644 index 000000000..fe604313f --- /dev/null +++ b/python/src/v2.0/pops/Nuclide.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Nuclide.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Nuclide wrapper +void wrapNuclide(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Nuclide; + + // create the component + python::class_ component( + module, + "Nuclide", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("id"), + python::arg("charge") = std::nullopt, + python::arg("decay_data") = std::nullopt, + python::arg("fission_fragment_data") = std::nullopt, + python::arg("mass") = std::nullopt, + python::arg("nucleus") = std::nullopt, + python::arg("parity") = std::nullopt, + python::arg("spin") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "id", + &Component::id, + Component::documentation("id").data() + ) + .def_property_readonly( + "charge", + python::overload_cast<>(&Component::charge), + Component::documentation("charge").data() + ) + .def_property_readonly( + "decay_data", + python::overload_cast<>(&Component::decayData), + Component::documentation("decay_data").data() + ) + .def_property_readonly( + "fission_fragment_data", + python::overload_cast<>(&Component::fissionFragmentData), + Component::documentation("fission_fragment_data").data() + ) + .def_property_readonly( + "mass", + python::overload_cast<>(&Component::mass), + Component::documentation("mass").data() + ) + .def_property_readonly( + "nucleus", + python::overload_cast<>(&Component::nucleus), + Component::documentation("nucleus").data() + ) + .def_property_readonly( + "parity", + python::overload_cast<>(&Component::parity), + Component::documentation("parity").data() + ) + .def_property_readonly( + "spin", + python::overload_cast<>(&Component::spin), + Component::documentation("spin").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Nuclides.python.cpp b/python/src/v2.0/pops/Nuclides.python.cpp new file mode 100644 index 000000000..d0efa5f8e --- /dev/null +++ b/python/src/v2.0/pops/Nuclides.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Nuclides.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Nuclides wrapper +void wrapNuclides(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Nuclides; + + // create the component + python::class_ component( + module, + "Nuclides", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("nuclide"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "nuclide", + python::overload_cast<>(&Component::nuclide), + Component::documentation("nuclide").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Parity.python.cpp b/python/src/v2.0/pops/Parity.python.cpp new file mode 100644 index 000000000..82adc4a0f --- /dev/null +++ b/python/src/v2.0/pops/Parity.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Parity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Parity wrapper +void wrapParity(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Parity; + + // create the component + python::class_ component( + module, + "Parity", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("integer") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "integer", + python::overload_cast<>(&Component::integer), + Component::documentation("integer").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/PhotonEmissionProbabilities.python.cpp b/python/src/v2.0/pops/PhotonEmissionProbabilities.python.cpp new file mode 100644 index 000000000..05fe46b31 --- /dev/null +++ b/python/src/v2.0/pops/PhotonEmissionProbabilities.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/PhotonEmissionProbabilities.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// PhotonEmissionProbabilities wrapper +void wrapPhotonEmissionProbabilities(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::PhotonEmissionProbabilities; + + // create the component + python::class_ component( + module, + "PhotonEmissionProbabilities", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("shell"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "shell", + python::overload_cast<>(&Component::shell), + Component::documentation("shell").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/PoPs.python.cpp b/python/src/v2.0/pops/PoPs.python.cpp new file mode 100644 index 000000000..398704e0f --- /dev/null +++ b/python/src/v2.0/pops/PoPs.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/PoPs.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// PoPs wrapper +void wrapPoPs(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::PoPs; + + // create the component + python::class_ component( + module, + "PoPs", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("format"), + python::arg("name"), + python::arg("version"), + python::arg("aliases") = std::nullopt, + python::arg("baryons") = std::nullopt, + python::arg("chemical_elements") = std::nullopt, + python::arg("documentation") = std::nullopt, + python::arg("gauge_bosons") = std::nullopt, + python::arg("leptons") = std::nullopt, + python::arg("styles") = std::nullopt, + python::arg("unorthodoxes") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "format", + &Component::format, + Component::documentation("format").data() + ) + .def_property_readonly( + "name", + &Component::name, + Component::documentation("name").data() + ) + .def_property_readonly( + "version", + &Component::version, + Component::documentation("version").data() + ) + .def_property_readonly( + "aliases", + python::overload_cast<>(&Component::aliases), + Component::documentation("aliases").data() + ) + .def_property_readonly( + "baryons", + python::overload_cast<>(&Component::baryons), + Component::documentation("baryons").data() + ) + .def_property_readonly( + "chemical_elements", + python::overload_cast<>(&Component::chemicalElements), + Component::documentation("chemical_elements").data() + ) + .def_property_readonly( + "documentation", + python::overload_cast<>(&Component::doc), + Component::documentation("documentation").data() + ) + .def_property_readonly( + "gauge_bosons", + python::overload_cast<>(&Component::gaugeBosons), + Component::documentation("gauge_bosons").data() + ) + .def_property_readonly( + "leptons", + python::overload_cast<>(&Component::leptons), + Component::documentation("leptons").data() + ) + .def_property_readonly( + "styles", + python::overload_cast<>(&Component::styles), + Component::documentation("styles").data() + ) + .def_property_readonly( + "unorthodoxes", + python::overload_cast<>(&Component::unorthodoxes), + Component::documentation("unorthodoxes").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Probability.python.cpp b/python/src/v2.0/pops/Probability.python.cpp new file mode 100644 index 000000000..fce7fb4b1 --- /dev/null +++ b/python/src/v2.0/pops/Probability.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Probability.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Probability wrapper +void wrapProbability(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Probability; + + // create the component + python::class_ component( + module, + "Probability", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("double"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Product.python.cpp b/python/src/v2.0/pops/Product.python.cpp new file mode 100644 index 000000000..ed673aad8 --- /dev/null +++ b/python/src/v2.0/pops/Product.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Product.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Product wrapper +void wrapProduct(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Product; + + // create the component + python::class_ component( + module, + "Product", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName & + >(), + python::arg("label"), + python::arg("pid"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Products.python.cpp b/python/src/v2.0/pops/Products.python.cpp new file mode 100644 index 000000000..d7467e5c6 --- /dev/null +++ b/python/src/v2.0/pops/Products.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Products.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Products wrapper +void wrapProducts(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Products; + + // create the component + python::class_ component( + module, + "Products", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("product"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "product", + python::overload_cast<>(&Component::product), + Component::documentation("product").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Q.python.cpp b/python/src/v2.0/pops/Q.python.cpp new file mode 100644 index 000000000..7246cf770 --- /dev/null +++ b/python/src/v2.0/pops/Q.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Q.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Q wrapper +void wrapQ(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Q; + + // create the component + python::class_ component( + module, + "Q", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("double"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Shell.python.cpp b/python/src/v2.0/pops/Shell.python.cpp new file mode 100644 index 000000000..a1b97297a --- /dev/null +++ b/python/src/v2.0/pops/Shell.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Shell.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Shell wrapper +void wrapShell(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Shell; + + // create the component + python::class_ component( + module, + "Shell", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional &, + const Float64 & + >(), + python::arg("label"), + python::arg("unit") = std::nullopt, + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "unit", + [](const Component &self) { return self.unit().value(); }, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Spectra.python.cpp b/python/src/v2.0/pops/Spectra.python.cpp new file mode 100644 index 000000000..da31db827 --- /dev/null +++ b/python/src/v2.0/pops/Spectra.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Spectra.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Spectra wrapper +void wrapSpectra(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Spectra; + + // create the component + python::class_ component( + module, + "Spectra", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("spectrum"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "spectrum", + python::overload_cast<>(&Component::spectrum), + Component::documentation("spectrum").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Spectrum.python.cpp b/python/src/v2.0/pops/Spectrum.python.cpp new file mode 100644 index 000000000..6773d1bc3 --- /dev/null +++ b/python/src/v2.0/pops/Spectrum.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Spectrum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Spectrum wrapper +void wrapSpectrum(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Spectrum; + + // create the component + python::class_ component( + module, + "Spectrum", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional> & + >(), + python::arg("label"), + python::arg("pid"), + python::arg("continuum") = std::nullopt, + python::arg("discrete") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + .def_property_readonly( + "continuum", + python::overload_cast<>(&Component::continuum), + Component::documentation("continuum").data() + ) + .def_property_readonly( + "discrete", + python::overload_cast<>(&Component::discrete), + Component::documentation("discrete").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Spin.python.cpp b/python/src/v2.0/pops/Spin.python.cpp new file mode 100644 index 000000000..624d7005c --- /dev/null +++ b/python/src/v2.0/pops/Spin.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Spin.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Spin wrapper +void wrapSpin(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Spin; + + // create the component + python::class_ component( + module, + "Spin", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("fraction") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "fraction", + python::overload_cast<>(&Component::fraction), + Component::documentation("fraction").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Unorthodox.python.cpp b/python/src/v2.0/pops/Unorthodox.python.cpp new file mode 100644 index 000000000..eaa3214aa --- /dev/null +++ b/python/src/v2.0/pops/Unorthodox.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Unorthodox.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Unorthodox wrapper +void wrapUnorthodox(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Unorthodox; + + // create the component + python::class_ component( + module, + "Unorthodox", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional &, + const std::optional & + >(), + python::arg("id"), + python::arg("charge") = std::nullopt, + python::arg("mass") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "id", + &Component::id, + Component::documentation("id").data() + ) + .def_property_readonly( + "charge", + python::overload_cast<>(&Component::charge), + Component::documentation("charge").data() + ) + .def_property_readonly( + "mass", + python::overload_cast<>(&Component::mass), + Component::documentation("mass").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/pops/Unorthodoxes.python.cpp b/python/src/v2.0/pops/Unorthodoxes.python.cpp new file mode 100644 index 000000000..ca46f1c53 --- /dev/null +++ b/python/src/v2.0/pops/Unorthodoxes.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/pops/Unorthodoxes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// Unorthodoxes wrapper +void wrapUnorthodoxes(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = pops::Unorthodoxes; + + // create the component + python::class_ component( + module, + "Unorthodoxes", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("unorthodox"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unorthodox", + python::overload_cast<>(&Component::unorthodox), + Component::documentation("unorthodox").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/python/src/v2.0/processed.python.cpp b/python/src/v2.0/processed.python.cpp new file mode 100644 index 000000000..f556b0ec4 --- /dev/null +++ b/python/src/v2.0/processed.python.cpp @@ -0,0 +1,43 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// processed declarations +namespace python_processed { + void wrapAngularEnergyMC(python::module &); + void wrapEnergyAngularMC(python::module &); + void wrapMultiGroup3d(python::module &); + void wrapAvailableEnergy(python::module &); + void wrapAvailableMomentum(python::module &); + void wrapAverageProductEnergy(python::module &); + void wrapAverageProductMomentum(python::module &); +} // namespace python_processed + +// processed wrapper +void wrapProcessed(python::module &module) +{ + // create the processed submodule + python::module submodule = module.def_submodule( + "processed", + "GNDS v2.0 processed" + ); + + // wrap processed components + python_processed::wrapAngularEnergyMC(submodule); + python_processed::wrapEnergyAngularMC(submodule); + python_processed::wrapMultiGroup3d(submodule); + python_processed::wrapAvailableEnergy(submodule); + python_processed::wrapAvailableMomentum(submodule); + python_processed::wrapAverageProductEnergy(submodule); + python_processed::wrapAverageProductMomentum(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/processed/AngularEnergyMC.python.cpp b/python/src/v2.0/processed/AngularEnergyMC.python.cpp new file mode 100644 index 000000000..f352cc53a --- /dev/null +++ b/python/src/v2.0/processed/AngularEnergyMC.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/processed/AngularEnergyMC.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// AngularEnergyMC wrapper +void wrapAngularEnergyMC(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = processed::AngularEnergyMC; + + // create the component + python::class_ component( + module, + "AngularEnergyMC", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const transport::Angular &, + const transport::AngularEnergy & + >(), + python::arg("label"), + python::arg("product_frame"), + python::arg("angular"), + python::arg("angular_energy"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "angular", + python::overload_cast<>(&Component::angular), + Component::documentation("angular").data() + ) + .def_property_readonly( + "angular_energy", + python::overload_cast<>(&Component::angularEnergy), + Component::documentation("angular_energy").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/python/src/v2.0/processed/AvailableEnergy.python.cpp b/python/src/v2.0/processed/AvailableEnergy.python.cpp new file mode 100644 index 000000000..be1210306 --- /dev/null +++ b/python/src/v2.0/processed/AvailableEnergy.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/processed/AvailableEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// AvailableEnergy wrapper +void wrapAvailableEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = processed::AvailableEnergy; + + // create the component + python::class_ component( + module, + "AvailableEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("gridded1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "gridded1d", + python::overload_cast<>(&Component::gridded1d), + Component::documentation("gridded1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/python/src/v2.0/processed/AvailableMomentum.python.cpp b/python/src/v2.0/processed/AvailableMomentum.python.cpp new file mode 100644 index 000000000..43cb3ee40 --- /dev/null +++ b/python/src/v2.0/processed/AvailableMomentum.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/processed/AvailableMomentum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// AvailableMomentum wrapper +void wrapAvailableMomentum(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = processed::AvailableMomentum; + + // create the component + python::class_ component( + module, + "AvailableMomentum", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("gridded1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "gridded1d", + python::overload_cast<>(&Component::gridded1d), + Component::documentation("gridded1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/python/src/v2.0/processed/AverageProductEnergy.python.cpp b/python/src/v2.0/processed/AverageProductEnergy.python.cpp new file mode 100644 index 000000000..1b0578f8b --- /dev/null +++ b/python/src/v2.0/processed/AverageProductEnergy.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/processed/AverageProductEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// AverageProductEnergy wrapper +void wrapAverageProductEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = processed::AverageProductEnergy; + + // create the component + python::class_ component( + module, + "AverageProductEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::XYs1d &, + const std::optional & + >(), + python::arg("xys1d"), + python::arg("gridded1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "gridded1d", + python::overload_cast<>(&Component::gridded1d), + Component::documentation("gridded1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/python/src/v2.0/processed/AverageProductMomentum.python.cpp b/python/src/v2.0/processed/AverageProductMomentum.python.cpp new file mode 100644 index 000000000..391855bac --- /dev/null +++ b/python/src/v2.0/processed/AverageProductMomentum.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/processed/AverageProductMomentum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// AverageProductMomentum wrapper +void wrapAverageProductMomentum(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = processed::AverageProductMomentum; + + // create the component + python::class_ component( + module, + "AverageProductMomentum", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("gridded1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "gridded1d", + python::overload_cast<>(&Component::gridded1d), + Component::documentation("gridded1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/python/src/v2.0/processed/EnergyAngularMC.python.cpp b/python/src/v2.0/processed/EnergyAngularMC.python.cpp new file mode 100644 index 000000000..c86df1ab3 --- /dev/null +++ b/python/src/v2.0/processed/EnergyAngularMC.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/processed/EnergyAngularMC.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// EnergyAngularMC wrapper +void wrapEnergyAngularMC(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = processed::EnergyAngularMC; + + // create the component + python::class_ component( + module, + "EnergyAngularMC", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const ambiguousNamespace::Energy &, + const transport::EnergyAngular & + >(), + python::arg("label"), + python::arg("product_frame"), + python::arg("energy"), + python::arg("energy_angular"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "energy", + python::overload_cast<>(&Component::energy), + Component::documentation("energy").data() + ) + .def_property_readonly( + "energy_angular", + python::overload_cast<>(&Component::energyAngular), + Component::documentation("energy_angular").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/python/src/v2.0/processed/MultiGroup3d.python.cpp b/python/src/v2.0/processed/MultiGroup3d.python.cpp new file mode 100644 index 000000000..e0750d29b --- /dev/null +++ b/python/src/v2.0/processed/MultiGroup3d.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/processed/MultiGroup3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// MultiGroup3d wrapper +void wrapMultiGroup3d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = processed::MultiGroup3d; + + // create the component + python::class_ component( + module, + "MultiGroup3d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const containers::Gridded3d & + >(), + python::arg("label"), + python::arg("product_frame"), + python::arg("gridded3d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "gridded3d", + python::overload_cast<>(&Component::gridded3d), + Component::documentation("gridded3d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances.python.cpp b/python/src/v2.0/resonances.python.cpp new file mode 100644 index 000000000..f8520240d --- /dev/null +++ b/python/src/v2.0/resonances.python.cpp @@ -0,0 +1,79 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// resonances declarations +namespace python_resonances { + void wrapHardSphereRadius(python::module &); + void wrapResonanceParameters(python::module &); + void wrapScatteringRadius(python::module &); + void wrapBreitWigner(python::module &); + void wrapLevelSpacing(python::module &); + void wrapWidth(python::module &); + void wrapWidths(python::module &); + void wrapJ(python::module &); + void wrapJs(python::module &); + void wrapL(python::module &); + void wrapLs(python::module &); + void wrapResonanceReaction(python::module &); + void wrapResonanceReactions(python::module &); + void wrapExternalRMatrix(python::module &); + void wrapChannel(python::module &); + void wrapChannels(python::module &); + void wrapSpinGroup(python::module &); + void wrapSpinGroups(python::module &); + void wrapRMatrix(python::module &); + void wrapEnergyInterval(python::module &); + void wrapEnergyIntervals(python::module &); + void wrapResolved(python::module &); + void wrapTabulatedWidths(python::module &); + void wrapUnresolved(python::module &); + void wrapResonances(python::module &); +} // namespace python_resonances + +// resonances wrapper +void wrapResonances(python::module &module) +{ + // create the resonances submodule + python::module submodule = module.def_submodule( + "resonances", + "GNDS v2.0 resonances" + ); + + // wrap resonances components + python_resonances::wrapHardSphereRadius(submodule); + python_resonances::wrapResonanceParameters(submodule); + python_resonances::wrapScatteringRadius(submodule); + python_resonances::wrapBreitWigner(submodule); + python_resonances::wrapLevelSpacing(submodule); + python_resonances::wrapWidth(submodule); + python_resonances::wrapWidths(submodule); + python_resonances::wrapJ(submodule); + python_resonances::wrapJs(submodule); + python_resonances::wrapL(submodule); + python_resonances::wrapLs(submodule); + python_resonances::wrapResonanceReaction(submodule); + python_resonances::wrapResonanceReactions(submodule); + python_resonances::wrapExternalRMatrix(submodule); + python_resonances::wrapChannel(submodule); + python_resonances::wrapChannels(submodule); + python_resonances::wrapSpinGroup(submodule); + python_resonances::wrapSpinGroups(submodule); + python_resonances::wrapRMatrix(submodule); + python_resonances::wrapEnergyInterval(submodule); + python_resonances::wrapEnergyIntervals(submodule); + python_resonances::wrapResolved(submodule); + python_resonances::wrapTabulatedWidths(submodule); + python_resonances::wrapUnresolved(submodule); + python_resonances::wrapResonances(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/BreitWigner.python.cpp b/python/src/v2.0/resonances/BreitWigner.python.cpp new file mode 100644 index 000000000..bac9108b2 --- /dev/null +++ b/python/src/v2.0/resonances/BreitWigner.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/BreitWigner.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// BreitWigner wrapper +void wrapBreitWigner(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::BreitWigner; + + // create the component + python::class_ component( + module, + "BreitWigner", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("approximation"), + python::arg("calculate_channel_radius") = std::nullopt, + python::arg("label"), + python::arg("use_for_self_shielding_only") = std::nullopt, + python::arg("po_ps") = std::nullopt, + python::arg("hard_sphere_radius") = std::nullopt, + python::arg("resonance_parameters") = std::nullopt, + python::arg("scattering_radius") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "approximation", + &Component::approximation, + Component::documentation("approximation").data() + ) + .def_property_readonly( + "calculate_channel_radius", + [](const Component &self) { return self.calculateChannelRadius().value(); }, + Component::documentation("calculate_channel_radius").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "use_for_self_shielding_only", + [](const Component &self) { return self.useForSelfShieldingOnly().value(); }, + Component::documentation("use_for_self_shielding_only").data() + ) + .def_property_readonly( + "po_ps", + python::overload_cast<>(&Component::PoPs), + Component::documentation("po_ps").data() + ) + .def_property_readonly( + "hard_sphere_radius", + python::overload_cast<>(&Component::hardSphereRadius), + Component::documentation("hard_sphere_radius").data() + ) + .def_property_readonly( + "resonance_parameters", + python::overload_cast<>(&Component::resonanceParameters), + Component::documentation("resonance_parameters").data() + ) + .def_property_readonly( + "scattering_radius", + python::overload_cast<>(&Component::scatteringRadius), + Component::documentation("scattering_radius").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/Channel.python.cpp b/python/src/v2.0/resonances/Channel.python.cpp new file mode 100644 index 000000000..4cedf1b43 --- /dev/null +++ b/python/src/v2.0/resonances/Channel.python.cpp @@ -0,0 +1,112 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/Channel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// Channel wrapper +void wrapChannel(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::Channel; + + // create the component + python::class_ component( + module, + "Channel", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Integer32 &, + const std::optional &, + const Fraction32 &, + const Integer32 &, + const XMLName &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("l"), + python::arg("boundary_condition_value") = std::nullopt, + python::arg("channel_spin"), + python::arg("column_index"), + python::arg("label"), + python::arg("resonance_reaction"), + python::arg("external_rmatrix") = std::nullopt, + python::arg("hard_sphere_radius") = std::nullopt, + python::arg("scattering_radius") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "l", + &Component::L, + Component::documentation("l").data() + ) + .def_property_readonly( + "boundary_condition_value", + &Component::boundaryConditionValue, + Component::documentation("boundary_condition_value").data() + ) + .def_property_readonly( + "channel_spin", + &Component::channelSpin, + Component::documentation("channel_spin").data() + ) + .def_property_readonly( + "column_index", + &Component::columnIndex, + Component::documentation("column_index").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "resonance_reaction", + &Component::resonanceReaction, + Component::documentation("resonance_reaction").data() + ) + .def_property_readonly( + "external_rmatrix", + python::overload_cast<>(&Component::externalRMatrix), + Component::documentation("external_rmatrix").data() + ) + .def_property_readonly( + "hard_sphere_radius", + python::overload_cast<>(&Component::hardSphereRadius), + Component::documentation("hard_sphere_radius").data() + ) + .def_property_readonly( + "scattering_radius", + python::overload_cast<>(&Component::scatteringRadius), + Component::documentation("scattering_radius").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/Channels.python.cpp b/python/src/v2.0/resonances/Channels.python.cpp new file mode 100644 index 000000000..4f0bbacec --- /dev/null +++ b/python/src/v2.0/resonances/Channels.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/Channels.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// Channels wrapper +void wrapChannels(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::Channels; + + // create the component + python::class_ component( + module, + "Channels", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("channel"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "channel", + python::overload_cast<>(&Component::channel), + Component::documentation("channel").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/EnergyInterval.python.cpp b/python/src/v2.0/resonances/EnergyInterval.python.cpp new file mode 100644 index 000000000..66165ece1 --- /dev/null +++ b/python/src/v2.0/resonances/EnergyInterval.python.cpp @@ -0,0 +1,98 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/EnergyInterval.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// EnergyInterval wrapper +void wrapEnergyInterval(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::EnergyInterval; + using _t = std::variant< + resonances::BreitWigner, + resonances::RMatrix + >; + + // create the component + python::class_ component( + module, + "EnergyInterval", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Float64 &, + const Float64 &, + const XMLName &, + const Integer32 &, + const _t & + >(), + python::arg("domain_max"), + python::arg("domain_min"), + python::arg("domain_unit"), + python::arg("index"), + python::arg("_breit_wigner_rmatrix"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "domain_max", + &Component::domainMax, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + &Component::domainMin, + Component::documentation("domain_min").data() + ) + .def_property_readonly( + "domain_unit", + &Component::domainUnit, + Component::documentation("domain_unit").data() + ) + .def_property_readonly( + "index", + &Component::index, + Component::documentation("index").data() + ) + .def_property_readonly( + "breit_wigner", + python::overload_cast<>(&Component::BreitWigner), + Component::documentation("breit_wigner").data() + ) + .def_property_readonly( + "rmatrix", + python::overload_cast<>(&Component::RMatrix), + Component::documentation("rmatrix").data() + ) + .def_property_readonly( + "_breit_wigner_rmatrix", + python::overload_cast<>(&Component::_BreitWignerRMatrix), + Component::documentation("_breit_wigner_rmatrix").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/EnergyIntervals.python.cpp b/python/src/v2.0/resonances/EnergyIntervals.python.cpp new file mode 100644 index 000000000..d47f3e5cc --- /dev/null +++ b/python/src/v2.0/resonances/EnergyIntervals.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/EnergyIntervals.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// EnergyIntervals wrapper +void wrapEnergyIntervals(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::EnergyIntervals; + + // create the component + python::class_ component( + module, + "EnergyIntervals", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::vector & + >(), + python::arg("label"), + python::arg("energy_interval"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "energy_interval", + python::overload_cast<>(&Component::energyInterval), + Component::documentation("energy_interval").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/ExternalRMatrix.python.cpp b/python/src/v2.0/resonances/ExternalRMatrix.python.cpp new file mode 100644 index 000000000..4b155ab6a --- /dev/null +++ b/python/src/v2.0/resonances/ExternalRMatrix.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/ExternalRMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// ExternalRMatrix wrapper +void wrapExternalRMatrix(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::ExternalRMatrix; + + // create the component + python::class_ component( + module, + "ExternalRMatrix", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::vector & + >(), + python::arg("type"), + python::arg("double"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "type", + &Component::type, + Component::documentation("type").data() + ) + .def_property_readonly( + "double", + python::overload_cast<>(&Component::Double), + Component::documentation("double").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/HardSphereRadius.python.cpp b/python/src/v2.0/resonances/HardSphereRadius.python.cpp new file mode 100644 index 000000000..143ca77b9 --- /dev/null +++ b/python/src/v2.0/resonances/HardSphereRadius.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/HardSphereRadius.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// HardSphereRadius wrapper +void wrapHardSphereRadius(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::HardSphereRadius; + + // create the component + python::class_ component( + module, + "HardSphereRadius", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Constant1d & + >(), + python::arg("constant1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "constant1d", + python::overload_cast<>(&Component::constant1d), + Component::documentation("constant1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/J.python.cpp b/python/src/v2.0/resonances/J.python.cpp new file mode 100644 index 000000000..b5b43169b --- /dev/null +++ b/python/src/v2.0/resonances/J.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/J.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// J wrapper +void wrapJ(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::J; + + // create the component + python::class_ component( + module, + "J", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Fraction32 &, + const resonances::LevelSpacing &, + const resonances::Widths & + >(), + python::arg("label"), + python::arg("value"), + python::arg("level_spacing"), + python::arg("widths"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + .def_property_readonly( + "level_spacing", + python::overload_cast<>(&Component::levelSpacing), + Component::documentation("level_spacing").data() + ) + .def_property_readonly( + "widths", + python::overload_cast<>(&Component::widths), + Component::documentation("widths").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/Js.python.cpp b/python/src/v2.0/resonances/Js.python.cpp new file mode 100644 index 000000000..e8878e5d3 --- /dev/null +++ b/python/src/v2.0/resonances/Js.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/Js.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// Js wrapper +void wrapJs(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::Js; + + // create the component + python::class_ component( + module, + "Js", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("j"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "j", + python::overload_cast<>(&Component::J), + Component::documentation("j").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/L.python.cpp b/python/src/v2.0/resonances/L.python.cpp new file mode 100644 index 000000000..e7ffceeea --- /dev/null +++ b/python/src/v2.0/resonances/L.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/L.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// L wrapper +void wrapL(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::L; + + // create the component + python::class_ component( + module, + "L", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Integer32 &, + const resonances::Js & + >(), + python::arg("label"), + python::arg("value"), + python::arg("js"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + .def_property_readonly( + "js", + python::overload_cast<>(&Component::Js), + Component::documentation("js").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/LevelSpacing.python.cpp b/python/src/v2.0/resonances/LevelSpacing.python.cpp new file mode 100644 index 000000000..0856fb696 --- /dev/null +++ b/python/src/v2.0/resonances/LevelSpacing.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/LevelSpacing.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// LevelSpacing wrapper +void wrapLevelSpacing(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::LevelSpacing; + + // create the component + python::class_ component( + module, + "LevelSpacing", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("constant1d") = std::nullopt, + python::arg("regions1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "constant1d", + python::overload_cast<>(&Component::constant1d), + Component::documentation("constant1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/Ls.python.cpp b/python/src/v2.0/resonances/Ls.python.cpp new file mode 100644 index 000000000..8922da2dc --- /dev/null +++ b/python/src/v2.0/resonances/Ls.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/Ls.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// Ls wrapper +void wrapLs(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::Ls; + + // create the component + python::class_ component( + module, + "Ls", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("l"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "l", + python::overload_cast<>(&Component::L), + Component::documentation("l").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/RMatrix.python.cpp b/python/src/v2.0/resonances/RMatrix.python.cpp new file mode 100644 index 000000000..784487410 --- /dev/null +++ b/python/src/v2.0/resonances/RMatrix.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/RMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// RMatrix wrapper +void wrapRMatrix(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::RMatrix; + + // create the component + python::class_ component( + module, + "RMatrix", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const resonances::ResonanceReactions &, + const resonances::SpinGroups & + >(), + python::arg("approximation"), + python::arg("boundary_condition") = std::nullopt, + python::arg("boundary_condition_value") = std::nullopt, + python::arg("calculate_channel_radius") = std::nullopt, + python::arg("calculate_penetrability") = std::nullopt, + python::arg("label"), + python::arg("supports_angular_reconstruction") = std::nullopt, + python::arg("use_for_self_shielding_only") = std::nullopt, + python::arg("po_ps") = std::nullopt, + python::arg("resonance_reactions"), + python::arg("spin_groups"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "approximation", + &Component::approximation, + Component::documentation("approximation").data() + ) + .def_property_readonly( + "boundary_condition", + [](const Component &self) { return self.boundaryCondition().value(); }, + Component::documentation("boundary_condition").data() + ) + .def_property_readonly( + "boundary_condition_value", + &Component::boundaryConditionValue, + Component::documentation("boundary_condition_value").data() + ) + .def_property_readonly( + "calculate_channel_radius", + [](const Component &self) { return self.calculateChannelRadius().value(); }, + Component::documentation("calculate_channel_radius").data() + ) + .def_property_readonly( + "calculate_penetrability", + [](const Component &self) { return self.calculatePenetrability().value(); }, + Component::documentation("calculate_penetrability").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "supports_angular_reconstruction", + [](const Component &self) { return self.supportsAngularReconstruction().value(); }, + Component::documentation("supports_angular_reconstruction").data() + ) + .def_property_readonly( + "use_for_self_shielding_only", + [](const Component &self) { return self.useForSelfShieldingOnly().value(); }, + Component::documentation("use_for_self_shielding_only").data() + ) + .def_property_readonly( + "po_ps", + python::overload_cast<>(&Component::PoPs), + Component::documentation("po_ps").data() + ) + .def_property_readonly( + "resonance_reactions", + python::overload_cast<>(&Component::resonanceReactions), + Component::documentation("resonance_reactions").data() + ) + .def_property_readonly( + "spin_groups", + python::overload_cast<>(&Component::spinGroups), + Component::documentation("spin_groups").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/Resolved.python.cpp b/python/src/v2.0/resonances/Resolved.python.cpp new file mode 100644 index 000000000..f35d22c87 --- /dev/null +++ b/python/src/v2.0/resonances/Resolved.python.cpp @@ -0,0 +1,97 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/Resolved.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// Resolved wrapper +void wrapResolved(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::Resolved; + using _t = std::variant< + resonances::BreitWigner, + resonances::RMatrix, + resonances::EnergyIntervals + >; + + // create the component + python::class_ component( + module, + "Resolved", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Float64 &, + const Float64 &, + const XMLName &, + const _t & + >(), + python::arg("domain_max"), + python::arg("domain_min"), + python::arg("domain_unit"), + python::arg("_breit_wigner_rmatrixenergy_intervals"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "domain_max", + &Component::domainMax, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + &Component::domainMin, + Component::documentation("domain_min").data() + ) + .def_property_readonly( + "domain_unit", + &Component::domainUnit, + Component::documentation("domain_unit").data() + ) + .def_property_readonly( + "breit_wigner", + python::overload_cast<>(&Component::BreitWigner), + Component::documentation("breit_wigner").data() + ) + .def_property_readonly( + "rmatrix", + python::overload_cast<>(&Component::RMatrix), + Component::documentation("rmatrix").data() + ) + .def_property_readonly( + "energy_intervals", + python::overload_cast<>(&Component::energyIntervals), + Component::documentation("energy_intervals").data() + ) + .def_property_readonly( + "_breit_wigner_rmatrixenergy_intervals", + python::overload_cast<>(&Component::_BreitWignerRMatrixenergyIntervals), + Component::documentation("_breit_wigner_rmatrixenergy_intervals").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/ResonanceParameters.python.cpp b/python/src/v2.0/resonances/ResonanceParameters.python.cpp new file mode 100644 index 000000000..024aac8b0 --- /dev/null +++ b/python/src/v2.0/resonances/ResonanceParameters.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/ResonanceParameters.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// ResonanceParameters wrapper +void wrapResonanceParameters(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::ResonanceParameters; + + // create the component + python::class_ component( + module, + "ResonanceParameters", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Table & + >(), + python::arg("table"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "table", + python::overload_cast<>(&Component::table), + Component::documentation("table").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/ResonanceReaction.python.cpp b/python/src/v2.0/resonances/ResonanceReaction.python.cpp new file mode 100644 index 000000000..9cc2caf23 --- /dev/null +++ b/python/src/v2.0/resonances/ResonanceReaction.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/ResonanceReaction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// ResonanceReaction wrapper +void wrapResonanceReaction(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::ResonanceReaction; + + // create the component + python::class_ component( + module, + "ResonanceReaction", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const containers::Link &, + const std::optional & + >(), + python::arg("boundary_condition_value") = std::nullopt, + python::arg("ejectile"), + python::arg("eliminated") = std::nullopt, + python::arg("label"), + python::arg("q") = std::nullopt, + python::arg("hard_sphere_radius") = std::nullopt, + python::arg("link"), + python::arg("scattering_radius") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "boundary_condition_value", + &Component::boundaryConditionValue, + Component::documentation("boundary_condition_value").data() + ) + .def_property_readonly( + "ejectile", + &Component::ejectile, + Component::documentation("ejectile").data() + ) + .def_property_readonly( + "eliminated", + [](const Component &self) { return self.eliminated().value(); }, + Component::documentation("eliminated").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "q", + python::overload_cast<>(&Component::Q), + Component::documentation("q").data() + ) + .def_property_readonly( + "hard_sphere_radius", + python::overload_cast<>(&Component::hardSphereRadius), + Component::documentation("hard_sphere_radius").data() + ) + .def_property_readonly( + "link", + python::overload_cast<>(&Component::link), + Component::documentation("link").data() + ) + .def_property_readonly( + "scattering_radius", + python::overload_cast<>(&Component::scatteringRadius), + Component::documentation("scattering_radius").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/ResonanceReactions.python.cpp b/python/src/v2.0/resonances/ResonanceReactions.python.cpp new file mode 100644 index 000000000..4ecd83df7 --- /dev/null +++ b/python/src/v2.0/resonances/ResonanceReactions.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/ResonanceReactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// ResonanceReactions wrapper +void wrapResonanceReactions(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::ResonanceReactions; + + // create the component + python::class_ component( + module, + "ResonanceReactions", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("resonance_reaction"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "resonance_reaction", + python::overload_cast<>(&Component::resonanceReaction), + Component::documentation("resonance_reaction").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/Resonances.python.cpp b/python/src/v2.0/resonances/Resonances.python.cpp new file mode 100644 index 000000000..687301304 --- /dev/null +++ b/python/src/v2.0/resonances/Resonances.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/Resonances.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// Resonances wrapper +void wrapResonances(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::Resonances; + + // create the component + python::class_ component( + module, + "Resonances", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional> &, + const resonances::ScatteringRadius &, + const std::optional> & + >(), + python::arg("href") = std::nullopt, + python::arg("hard_sphere_radius") = std::nullopt, + python::arg("resolved") = std::nullopt, + python::arg("scattering_radius"), + python::arg("unresolved") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "hard_sphere_radius", + python::overload_cast<>(&Component::hardSphereRadius), + Component::documentation("hard_sphere_radius").data() + ) + .def_property_readonly( + "resolved", + python::overload_cast<>(&Component::resolved), + Component::documentation("resolved").data() + ) + .def_property_readonly( + "scattering_radius", + python::overload_cast<>(&Component::scatteringRadius), + Component::documentation("scattering_radius").data() + ) + .def_property_readonly( + "unresolved", + python::overload_cast<>(&Component::unresolved), + Component::documentation("unresolved").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/ScatteringRadius.python.cpp b/python/src/v2.0/resonances/ScatteringRadius.python.cpp new file mode 100644 index 000000000..711114000 --- /dev/null +++ b/python/src/v2.0/resonances/ScatteringRadius.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/ScatteringRadius.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// ScatteringRadius wrapper +void wrapScatteringRadius(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::ScatteringRadius; + using _t = std::variant< + containers::XYs1d, + containers::Constant1d, + containers::Regions1d + >; + + // create the component + python::class_ component( + module, + "ScatteringRadius", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_xys1dconstant1dregions1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "constant1d", + python::overload_cast<>(&Component::constant1d), + Component::documentation("constant1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + .def_property_readonly( + "_xys1dconstant1dregions1d", + python::overload_cast<>(&Component::_XYs1dconstant1dregions1d), + Component::documentation("_xys1dconstant1dregions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/SpinGroup.python.cpp b/python/src/v2.0/resonances/SpinGroup.python.cpp new file mode 100644 index 000000000..87f6145f9 --- /dev/null +++ b/python/src/v2.0/resonances/SpinGroup.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/SpinGroup.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// SpinGroup wrapper +void wrapSpinGroup(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::SpinGroup; + + // create the component + python::class_ component( + module, + "SpinGroup", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Integer32 &, + const Fraction32 &, + const resonances::Channels &, + const resonances::ResonanceParameters & + >(), + python::arg("label"), + python::arg("parity"), + python::arg("spin"), + python::arg("channels"), + python::arg("resonance_parameters"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "parity", + &Component::parity, + Component::documentation("parity").data() + ) + .def_property_readonly( + "spin", + &Component::spin, + Component::documentation("spin").data() + ) + .def_property_readonly( + "channels", + python::overload_cast<>(&Component::channels), + Component::documentation("channels").data() + ) + .def_property_readonly( + "resonance_parameters", + python::overload_cast<>(&Component::resonanceParameters), + Component::documentation("resonance_parameters").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/SpinGroups.python.cpp b/python/src/v2.0/resonances/SpinGroups.python.cpp new file mode 100644 index 000000000..20ff833e6 --- /dev/null +++ b/python/src/v2.0/resonances/SpinGroups.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/SpinGroups.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// SpinGroups wrapper +void wrapSpinGroups(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::SpinGroups; + + // create the component + python::class_ component( + module, + "SpinGroups", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("spin_group"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "spin_group", + python::overload_cast<>(&Component::spinGroup), + Component::documentation("spin_group").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/TabulatedWidths.python.cpp b/python/src/v2.0/resonances/TabulatedWidths.python.cpp new file mode 100644 index 000000000..5b4c51036 --- /dev/null +++ b/python/src/v2.0/resonances/TabulatedWidths.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/TabulatedWidths.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// TabulatedWidths wrapper +void wrapTabulatedWidths(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::TabulatedWidths; + + // create the component + python::class_ component( + module, + "TabulatedWidths", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const std::optional &, + const resonances::Ls &, + const std::optional &, + const std::optional &, + const resonances::ResonanceReactions &, + const std::optional & + >(), + python::arg("approximation"), + python::arg("label"), + python::arg("use_for_self_shielding_only") = std::nullopt, + python::arg("ls"), + python::arg("po_ps") = std::nullopt, + python::arg("hard_sphere_radius") = std::nullopt, + python::arg("resonance_reactions"), + python::arg("scattering_radius") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "approximation", + &Component::approximation, + Component::documentation("approximation").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "use_for_self_shielding_only", + [](const Component &self) { return self.useForSelfShieldingOnly().value(); }, + Component::documentation("use_for_self_shielding_only").data() + ) + .def_property_readonly( + "ls", + python::overload_cast<>(&Component::Ls), + Component::documentation("ls").data() + ) + .def_property_readonly( + "po_ps", + python::overload_cast<>(&Component::PoPs), + Component::documentation("po_ps").data() + ) + .def_property_readonly( + "hard_sphere_radius", + python::overload_cast<>(&Component::hardSphereRadius), + Component::documentation("hard_sphere_radius").data() + ) + .def_property_readonly( + "resonance_reactions", + python::overload_cast<>(&Component::resonanceReactions), + Component::documentation("resonance_reactions").data() + ) + .def_property_readonly( + "scattering_radius", + python::overload_cast<>(&Component::scatteringRadius), + Component::documentation("scattering_radius").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/Unresolved.python.cpp b/python/src/v2.0/resonances/Unresolved.python.cpp new file mode 100644 index 000000000..04c0afd0a --- /dev/null +++ b/python/src/v2.0/resonances/Unresolved.python.cpp @@ -0,0 +1,85 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/Unresolved.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// Unresolved wrapper +void wrapUnresolved(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::Unresolved; + using _t = std::variant< + resonances::TabulatedWidths + >; + + // create the component + python::class_ component( + module, + "Unresolved", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Float64 &, + const Float64 &, + const XMLName &, + const _t & + >(), + python::arg("domain_max"), + python::arg("domain_min"), + python::arg("domain_unit"), + python::arg("_tabulated_widths"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "domain_max", + &Component::domainMax, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + &Component::domainMin, + Component::documentation("domain_min").data() + ) + .def_property_readonly( + "domain_unit", + &Component::domainUnit, + Component::documentation("domain_unit").data() + ) + .def_property_readonly( + "tabulated_widths", + python::overload_cast<>(&Component::tabulatedWidths), + Component::documentation("tabulated_widths").data() + ) + .def_property_readonly( + "_tabulated_widths", + python::overload_cast<>(&Component::_tabulatedWidths), + Component::documentation("_tabulated_widths").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/Width.python.cpp b/python/src/v2.0/resonances/Width.python.cpp new file mode 100644 index 000000000..e13ecc14b --- /dev/null +++ b/python/src/v2.0/resonances/Width.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/Width.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// Width wrapper +void wrapWidth(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::Width; + + // create the component + python::class_ component( + module, + "Width", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Float64 &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("degrees_of_freedom"), + python::arg("resonance_reaction"), + python::arg("xys1d") = std::nullopt, + python::arg("constant1d") = std::nullopt, + python::arg("regions1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "degrees_of_freedom", + &Component::degreesOfFreedom, + Component::documentation("degrees_of_freedom").data() + ) + .def_property_readonly( + "resonance_reaction", + &Component::resonanceReaction, + Component::documentation("resonance_reaction").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "constant1d", + python::overload_cast<>(&Component::constant1d), + Component::documentation("constant1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/resonances/Widths.python.cpp b/python/src/v2.0/resonances/Widths.python.cpp new file mode 100644 index 000000000..600eeb8c6 --- /dev/null +++ b/python/src/v2.0/resonances/Widths.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/resonances/Widths.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// Widths wrapper +void wrapWidths(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = resonances::Widths; + + // create the component + python::class_ component( + module, + "Widths", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("width"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "width", + python::overload_cast<>(&Component::width), + Component::documentation("width").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles.python.cpp b/python/src/v2.0/styles.python.cpp new file mode 100644 index 000000000..f5c4c5579 --- /dev/null +++ b/python/src/v2.0/styles.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// styles declarations +namespace python_styles { + void wrapMonteCarlo_cdf(python::module &); + void wrapSnElasticUpScatter(python::module &); + void wrapURR_probabilityTables(python::module &); + void wrapTemperature(python::module &); + void wrapAngularDistributionReconstructed(python::module &); + void wrapAverageProductData(python::module &); + void wrapCrossSectionReconstructed(python::module &); + void wrapProjectileEnergyDomain(python::module &); + void wrapEvaluated(python::module &); + void wrapGriddedCrossSection(python::module &); + void wrapHeated(python::module &); + void wrapFlux(python::module &); + void wrapInverseSpeed(python::module &); + void wrapMultiGroup(python::module &); + void wrapTransportable(python::module &); + void wrapTransportables(python::module &); + void wrapHeatedMultiGroup(python::module &); + void wrapStyles(python::module &); + void wrapSigmaZeros(python::module &); + void wrapBondarenko(python::module &); + void wrapCoulombPlusNuclearElasticMuCutoff(python::module &); + void wrapEqualProbableBins(python::module &); + void wrapMultiBand(python::module &); + void wrapRealization(python::module &); +} // namespace python_styles + +// styles wrapper +void wrapStyles(python::module &module) +{ + // create the styles submodule + python::module submodule = module.def_submodule( + "styles", + "GNDS v2.0 styles" + ); + + // wrap styles components + python_styles::wrapMonteCarlo_cdf(submodule); + python_styles::wrapSnElasticUpScatter(submodule); + python_styles::wrapURR_probabilityTables(submodule); + python_styles::wrapTemperature(submodule); + python_styles::wrapAngularDistributionReconstructed(submodule); + python_styles::wrapAverageProductData(submodule); + python_styles::wrapCrossSectionReconstructed(submodule); + python_styles::wrapProjectileEnergyDomain(submodule); + python_styles::wrapEvaluated(submodule); + python_styles::wrapGriddedCrossSection(submodule); + python_styles::wrapHeated(submodule); + python_styles::wrapFlux(submodule); + python_styles::wrapInverseSpeed(submodule); + python_styles::wrapMultiGroup(submodule); + python_styles::wrapTransportable(submodule); + python_styles::wrapTransportables(submodule); + python_styles::wrapHeatedMultiGroup(submodule); + python_styles::wrapStyles(submodule); + python_styles::wrapSigmaZeros(submodule); + python_styles::wrapBondarenko(submodule); + python_styles::wrapCoulombPlusNuclearElasticMuCutoff(submodule); + python_styles::wrapEqualProbableBins(submodule); + python_styles::wrapMultiBand(submodule); + python_styles::wrapRealization(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/AngularDistributionReconstructed.python.cpp b/python/src/v2.0/styles/AngularDistributionReconstructed.python.cpp new file mode 100644 index 000000000..c9a3a2e8a --- /dev/null +++ b/python/src/v2.0/styles/AngularDistributionReconstructed.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/AngularDistributionReconstructed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// AngularDistributionReconstructed wrapper +void wrapAngularDistributionReconstructed(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::AngularDistributionReconstructed; + + // create the component + python::class_ component( + module, + "AngularDistributionReconstructed", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + python::arg("date"), + python::arg("derived_from") = std::nullopt, + python::arg("label"), + python::arg("documentation") = std::nullopt, + python::arg("temperature") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "documentation", + python::overload_cast<>(&Component::documentation), + Component::documentation("documentation").data() + ) + .def_property_readonly( + "temperature", + python::overload_cast<>(&Component::temperature), + Component::documentation("temperature").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/AverageProductData.python.cpp b/python/src/v2.0/styles/AverageProductData.python.cpp new file mode 100644 index 000000000..03d4b62a2 --- /dev/null +++ b/python/src/v2.0/styles/AverageProductData.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/AverageProductData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// AverageProductData wrapper +void wrapAverageProductData(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::AverageProductData; + + // create the component + python::class_ component( + module, + "AverageProductData", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const std::optional &, + const XMLName &, + const std::optional &, + const styles::Temperature & + >(), + python::arg("date"), + python::arg("derived_from") = std::nullopt, + python::arg("label"), + python::arg("documentation") = std::nullopt, + python::arg("temperature"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "documentation", + python::overload_cast<>(&Component::documentation), + Component::documentation("documentation").data() + ) + .def_property_readonly( + "temperature", + python::overload_cast<>(&Component::temperature), + Component::documentation("temperature").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/Bondarenko.python.cpp b/python/src/v2.0/styles/Bondarenko.python.cpp new file mode 100644 index 000000000..30a6fa1a8 --- /dev/null +++ b/python/src/v2.0/styles/Bondarenko.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/Bondarenko.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// Bondarenko wrapper +void wrapBondarenko(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::Bondarenko; + + // create the component + python::class_ component( + module, + "Bondarenko", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName &, + const styles::SigmaZeros & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + python::arg("sigma_zeros"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "sigma_zeros", + python::overload_cast<>(&Component::sigmaZeros), + Component::documentation("sigma_zeros").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.python.cpp b/python/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.python.cpp new file mode 100644 index 000000000..e4622931d --- /dev/null +++ b/python/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// CoulombPlusNuclearElasticMuCutoff wrapper +void wrapCoulombPlusNuclearElasticMuCutoff(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::CoulombPlusNuclearElasticMuCutoff; + + // create the component + python::class_ component( + module, + "CoulombPlusNuclearElasticMuCutoff", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName &, + const Float64 & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + python::arg("mu_cutoff"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "mu_cutoff", + &Component::muCutoff, + Component::documentation("mu_cutoff").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/CrossSectionReconstructed.python.cpp b/python/src/v2.0/styles/CrossSectionReconstructed.python.cpp new file mode 100644 index 000000000..1db6c7ac6 --- /dev/null +++ b/python/src/v2.0/styles/CrossSectionReconstructed.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/CrossSectionReconstructed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// CrossSectionReconstructed wrapper +void wrapCrossSectionReconstructed(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::CrossSectionReconstructed; + + // create the component + python::class_ component( + module, + "CrossSectionReconstructed", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + python::arg("date"), + python::arg("derived_from") = std::nullopt, + python::arg("label"), + python::arg("documentation") = std::nullopt, + python::arg("temperature") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "documentation", + python::overload_cast<>(&Component::documentation), + Component::documentation("documentation").data() + ) + .def_property_readonly( + "temperature", + python::overload_cast<>(&Component::temperature), + Component::documentation("temperature").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/EqualProbableBins.python.cpp b/python/src/v2.0/styles/EqualProbableBins.python.cpp new file mode 100644 index 000000000..df16e13e1 --- /dev/null +++ b/python/src/v2.0/styles/EqualProbableBins.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/EqualProbableBins.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// EqualProbableBins wrapper +void wrapEqualProbableBins(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::EqualProbableBins; + + // create the component + python::class_ component( + module, + "EqualProbableBins", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName &, + const Integer32 & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + python::arg("number_of_bins"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "number_of_bins", + &Component::numberOfBins, + Component::documentation("number_of_bins").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/Evaluated.python.cpp b/python/src/v2.0/styles/Evaluated.python.cpp new file mode 100644 index 000000000..5ab94ce77 --- /dev/null +++ b/python/src/v2.0/styles/Evaluated.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/Evaluated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// Evaluated wrapper +void wrapEvaluated(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::Evaluated; + + // create the component + python::class_ component( + module, + "Evaluated", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const std::optional &, + const XMLName &, + const XMLName &, + const XMLName &, + const documentation::Documentation &, + const styles::ProjectileEnergyDomain &, + const styles::Temperature & + >(), + python::arg("date"), + python::arg("derived_from") = std::nullopt, + python::arg("label"), + python::arg("library"), + python::arg("version"), + python::arg("documentation"), + python::arg("projectile_energy_domain"), + python::arg("temperature"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "library", + &Component::library, + Component::documentation("library").data() + ) + .def_property_readonly( + "version", + &Component::version, + Component::documentation("version").data() + ) + .def_property_readonly( + "documentation", + python::overload_cast<>(&Component::documentation), + Component::documentation("documentation").data() + ) + .def_property_readonly( + "projectile_energy_domain", + python::overload_cast<>(&Component::projectileEnergyDomain), + Component::documentation("projectile_energy_domain").data() + ) + .def_property_readonly( + "temperature", + python::overload_cast<>(&Component::temperature), + Component::documentation("temperature").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/Flux.python.cpp b/python/src/v2.0/styles/Flux.python.cpp new file mode 100644 index 000000000..b3ae3c56b --- /dev/null +++ b/python/src/v2.0/styles/Flux.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/Flux.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// Flux wrapper +void wrapFlux(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::Flux; + + // create the component + python::class_ component( + module, + "Flux", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const containers::XYs2d & + >(), + python::arg("label"), + python::arg("xys2d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/GriddedCrossSection.python.cpp b/python/src/v2.0/styles/GriddedCrossSection.python.cpp new file mode 100644 index 000000000..ef820b753 --- /dev/null +++ b/python/src/v2.0/styles/GriddedCrossSection.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/GriddedCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// GriddedCrossSection wrapper +void wrapGriddedCrossSection(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::GriddedCrossSection; + + // create the component + python::class_ component( + module, + "GriddedCrossSection", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName &, + const std::optional &, + const containers::Grid & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + python::arg("documentation") = std::nullopt, + python::arg("grid"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "documentation", + python::overload_cast<>(&Component::documentation), + Component::documentation("documentation").data() + ) + .def_property_readonly( + "grid", + python::overload_cast<>(&Component::grid), + Component::documentation("grid").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/Heated.python.cpp b/python/src/v2.0/styles/Heated.python.cpp new file mode 100644 index 000000000..441634058 --- /dev/null +++ b/python/src/v2.0/styles/Heated.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/Heated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// Heated wrapper +void wrapHeated(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::Heated; + + // create the component + python::class_ component( + module, + "Heated", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName &, + const std::optional &, + const styles::Temperature & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + python::arg("documentation") = std::nullopt, + python::arg("temperature"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "documentation", + python::overload_cast<>(&Component::documentation), + Component::documentation("documentation").data() + ) + .def_property_readonly( + "temperature", + python::overload_cast<>(&Component::temperature), + Component::documentation("temperature").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/HeatedMultiGroup.python.cpp b/python/src/v2.0/styles/HeatedMultiGroup.python.cpp new file mode 100644 index 000000000..697ac825d --- /dev/null +++ b/python/src/v2.0/styles/HeatedMultiGroup.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/HeatedMultiGroup.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// HeatedMultiGroup wrapper +void wrapHeatedMultiGroup(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::HeatedMultiGroup; + + // create the component + python::class_ component( + module, + "HeatedMultiGroup", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName &, + const styles::Flux &, + const styles::InverseSpeed &, + const styles::Transportables & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + python::arg("flux"), + python::arg("inverse_speed"), + python::arg("transportables"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "flux", + python::overload_cast<>(&Component::flux), + Component::documentation("flux").data() + ) + .def_property_readonly( + "inverse_speed", + python::overload_cast<>(&Component::inverseSpeed), + Component::documentation("inverse_speed").data() + ) + .def_property_readonly( + "transportables", + python::overload_cast<>(&Component::transportables), + Component::documentation("transportables").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/InverseSpeed.python.cpp b/python/src/v2.0/styles/InverseSpeed.python.cpp new file mode 100644 index 000000000..7db133cf2 --- /dev/null +++ b/python/src/v2.0/styles/InverseSpeed.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/InverseSpeed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// InverseSpeed wrapper +void wrapInverseSpeed(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::InverseSpeed; + + // create the component + python::class_ component( + module, + "InverseSpeed", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Gridded1d & + >(), + python::arg("gridded1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "gridded1d", + python::overload_cast<>(&Component::gridded1d), + Component::documentation("gridded1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/MonteCarlo_cdf.python.cpp b/python/src/v2.0/styles/MonteCarlo_cdf.python.cpp new file mode 100644 index 000000000..f0703b286 --- /dev/null +++ b/python/src/v2.0/styles/MonteCarlo_cdf.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/MonteCarlo_cdf.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// MonteCarlo_cdf wrapper +void wrapMonteCarlo_cdf(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::MonteCarlo_cdf; + + // create the component + python::class_ component( + module, + "MonteCarlo_cdf", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName &, + const std::optional & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + python::arg("documentation") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "documentation", + python::overload_cast<>(&Component::documentation), + Component::documentation("documentation").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/MultiBand.python.cpp b/python/src/v2.0/styles/MultiBand.python.cpp new file mode 100644 index 000000000..43d105fdc --- /dev/null +++ b/python/src/v2.0/styles/MultiBand.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/MultiBand.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// MultiBand wrapper +void wrapMultiBand(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::MultiBand; + + // create the component + python::class_ component( + module, + "MultiBand", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName &, + const Integer32 & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + python::arg("number_of_bands"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "number_of_bands", + &Component::numberOfBands, + Component::documentation("number_of_bands").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/MultiGroup.python.cpp b/python/src/v2.0/styles/MultiGroup.python.cpp new file mode 100644 index 000000000..e3a092d98 --- /dev/null +++ b/python/src/v2.0/styles/MultiGroup.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/MultiGroup.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// MultiGroup wrapper +void wrapMultiGroup(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::MultiGroup; + + // create the component + python::class_ component( + module, + "MultiGroup", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const containers::Grid & + >(), + python::arg("label"), + python::arg("grid"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "grid", + python::overload_cast<>(&Component::grid), + Component::documentation("grid").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/ProjectileEnergyDomain.python.cpp b/python/src/v2.0/styles/ProjectileEnergyDomain.python.cpp new file mode 100644 index 000000000..c8adcba22 --- /dev/null +++ b/python/src/v2.0/styles/ProjectileEnergyDomain.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/ProjectileEnergyDomain.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// ProjectileEnergyDomain wrapper +void wrapProjectileEnergyDomain(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::ProjectileEnergyDomain; + + // create the component + python::class_ component( + module, + "ProjectileEnergyDomain", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Float64 &, + const Float64 &, + const XMLName & + >(), + python::arg("max"), + python::arg("min"), + python::arg("unit"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "max", + &Component::max, + Component::documentation("max").data() + ) + .def_property_readonly( + "min", + &Component::min, + Component::documentation("min").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/Realization.python.cpp b/python/src/v2.0/styles/Realization.python.cpp new file mode 100644 index 000000000..10891198d --- /dev/null +++ b/python/src/v2.0/styles/Realization.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/Realization.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// Realization wrapper +void wrapRealization(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::Realization; + + // create the component + python::class_ component( + module, + "Realization", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/SigmaZeros.python.cpp b/python/src/v2.0/styles/SigmaZeros.python.cpp new file mode 100644 index 000000000..6deba6699 --- /dev/null +++ b/python/src/v2.0/styles/SigmaZeros.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/SigmaZeros.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// SigmaZeros wrapper +void wrapSigmaZeros(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::SigmaZeros; + + // create the component + python::class_ component( + module, + "SigmaZeros", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Values & + >(), + python::arg("values"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "values", + python::overload_cast<>(&Component::values), + Component::documentation("values").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/SnElasticUpScatter.python.cpp b/python/src/v2.0/styles/SnElasticUpScatter.python.cpp new file mode 100644 index 000000000..a83a391d1 --- /dev/null +++ b/python/src/v2.0/styles/SnElasticUpScatter.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/SnElasticUpScatter.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// SnElasticUpScatter wrapper +void wrapSnElasticUpScatter(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::SnElasticUpScatter; + + // create the component + python::class_ component( + module, + "SnElasticUpScatter", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName &, + const std::optional & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + python::arg("upper_calculated_group") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "upper_calculated_group", + &Component::upperCalculatedGroup, + Component::documentation("upper_calculated_group").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/Styles.python.cpp b/python/src/v2.0/styles/Styles.python.cpp new file mode 100644 index 000000000..5ff95939e --- /dev/null +++ b/python/src/v2.0/styles/Styles.python.cpp @@ -0,0 +1,119 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/Styles.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// Styles wrapper +void wrapStyles(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::Styles; + + // create the component + python::class_ component( + module, + "Styles", + 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 std::optional> &, + const std::optional> &, + const std::optional> &, + const std::optional> &, + const std::optional> & + >(), + python::arg("monte_carlo_cdf") = std::nullopt, + python::arg("sn_elastic_up_scatter") = std::nullopt, + python::arg("urr_probability_tables") = std::nullopt, + python::arg("angular_distribution_reconstructed") = std::nullopt, + python::arg("average_product_data") = std::nullopt, + python::arg("cross_section_reconstructed") = std::nullopt, + python::arg("evaluated") = std::nullopt, + python::arg("gridded_cross_section") = std::nullopt, + python::arg("heated") = std::nullopt, + python::arg("heated_multi_group") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "monte_carlo_cdf", + python::overload_cast<>(&Component::MonteCarlo_cdf), + Component::documentation("monte_carlo_cdf").data() + ) + .def_property_readonly( + "sn_elastic_up_scatter", + python::overload_cast<>(&Component::SnElasticUpScatter), + Component::documentation("sn_elastic_up_scatter").data() + ) + .def_property_readonly( + "urr_probability_tables", + python::overload_cast<>(&Component::URR_probabilityTables), + Component::documentation("urr_probability_tables").data() + ) + .def_property_readonly( + "angular_distribution_reconstructed", + python::overload_cast<>(&Component::angularDistributionReconstructed), + Component::documentation("angular_distribution_reconstructed").data() + ) + .def_property_readonly( + "average_product_data", + python::overload_cast<>(&Component::averageProductData), + Component::documentation("average_product_data").data() + ) + .def_property_readonly( + "cross_section_reconstructed", + python::overload_cast<>(&Component::crossSectionReconstructed), + Component::documentation("cross_section_reconstructed").data() + ) + .def_property_readonly( + "evaluated", + python::overload_cast<>(&Component::evaluated), + Component::documentation("evaluated").data() + ) + .def_property_readonly( + "gridded_cross_section", + python::overload_cast<>(&Component::griddedCrossSection), + Component::documentation("gridded_cross_section").data() + ) + .def_property_readonly( + "heated", + python::overload_cast<>(&Component::heated), + Component::documentation("heated").data() + ) + .def_property_readonly( + "heated_multi_group", + python::overload_cast<>(&Component::heatedMultiGroup), + Component::documentation("heated_multi_group").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/Temperature.python.cpp b/python/src/v2.0/styles/Temperature.python.cpp new file mode 100644 index 000000000..06a717973 --- /dev/null +++ b/python/src/v2.0/styles/Temperature.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/Temperature.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// Temperature wrapper +void wrapTemperature(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::Temperature; + + // create the component + python::class_ component( + module, + "Temperature", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Float64 & + >(), + python::arg("unit"), + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/Transportable.python.cpp b/python/src/v2.0/styles/Transportable.python.cpp new file mode 100644 index 000000000..24207c559 --- /dev/null +++ b/python/src/v2.0/styles/Transportable.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/Transportable.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// Transportable wrapper +void wrapTransportable(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::Transportable; + + // create the component + python::class_ component( + module, + "Transportable", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const styles::MultiGroup & + >(), + python::arg("conserve") = std::nullopt, + python::arg("label"), + python::arg("multi_group"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "conserve", + [](const Component &self) { return self.conserve().value(); }, + Component::documentation("conserve").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "multi_group", + python::overload_cast<>(&Component::multiGroup), + Component::documentation("multi_group").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/Transportables.python.cpp b/python/src/v2.0/styles/Transportables.python.cpp new file mode 100644 index 000000000..931542f2d --- /dev/null +++ b/python/src/v2.0/styles/Transportables.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/Transportables.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// Transportables wrapper +void wrapTransportables(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::Transportables; + + // create the component + python::class_ component( + module, + "Transportables", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("transportable"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "transportable", + python::overload_cast<>(&Component::transportable), + Component::documentation("transportable").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/styles/URR_probabilityTables.python.cpp b/python/src/v2.0/styles/URR_probabilityTables.python.cpp new file mode 100644 index 000000000..8a5dd6701 --- /dev/null +++ b/python/src/v2.0/styles/URR_probabilityTables.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/styles/URR_probabilityTables.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// URR_probabilityTables wrapper +void wrapURR_probabilityTables(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = styles::URR_probabilityTables; + + // create the component + python::class_ component( + module, + "URR_probabilityTables", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const XMLName &, + const XMLName & + >(), + python::arg("date"), + python::arg("derived_from"), + python::arg("label"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "date", + &Component::date, + Component::documentation("date").data() + ) + .def_property_readonly( + "derived_from", + &Component::derivedFrom, + Component::documentation("derived_from").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport.python.cpp b/python/src/v2.0/transport.python.cpp new file mode 100644 index 000000000..53bade5a8 --- /dev/null +++ b/python/src/v2.0/transport.python.cpp @@ -0,0 +1,145 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// transport declarations +namespace python_transport { + void wrapURR_probabilityTables1d(python::module &); + void wrapReference(python::module &); + void wrapFastRegion(python::module &); + void wrapResolvedRegion(python::module &); + void wrapUnresolvedRegion(python::module &); + void wrapBackground(python::module &); + void wrapResonances(python::module &); + void wrapResonancesWithBackground(python::module &); + void wrapCrossSection(python::module &); + void wrapA(python::module &); + void wrapF(python::module &); + void wrapR(python::module &); + void wrapKalbachMann(python::module &); + void wrapAngularEnergy(python::module &); + void wrapForward(python::module &); + void wrapIsotropic2d(python::module &); + void wrapAngular(python::module &); + void wrapRecoil(python::module &); + void wrapAngularTwoBody(python::module &); + void wrapBranching3d(python::module &); + void wrapEnergyAngular(python::module &); + void wrapNBodyPhaseSpace(python::module &); + void wrapU(python::module &); + void wrapDiscreteGamma(python::module &); + void wrapTheta(python::module &); + void wrapEvaporation(python::module &); + void wrapG(python::module &); + void wrapGeneralEvaporation(python::module &); + void wrapPrimaryGamma(python::module &); + void wrapWeighted(python::module &); + void wrapWeightedFunctionals(python::module &); + void wrapEnergy(python::module &); + void wrapUncorrelated(python::module &); + void wrapUnspecified(python::module &); + void wrapDistribution(python::module &); + void wrapBranching1d(python::module &); + void wrapMultiplicity(python::module &); + void wrapOutputChannel(python::module &); + void wrapAdd(python::module &); + void wrapCoherentPhoton(python::module &); + void wrapSummands(python::module &); + void wrapCrossSectionSum(python::module &); + void wrapCrossSectionSums(python::module &); + void wrapDoubleDifferentialCrossSection(python::module &); + void wrapIncoherentPhoton(python::module &); + void wrapReaction(python::module &); + void wrapIncompleteReactions(python::module &); + void wrapScatteringMatrix(python::module &); + void wrapMultiplicitySum(python::module &); + void wrapMultiplicitySums(python::module &); + void wrapOrphanProduct(python::module &); + void wrapOrphanProducts(python::module &); + void wrapPhotonEmissionProbabilities(python::module &); + void wrapProduction(python::module &); + void wrapProductions(python::module &); + void wrapReactions(python::module &); + void wrapSums(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 v2.0 transport" + ); + + // wrap transport components + python_transport::wrapURR_probabilityTables1d(submodule); + python_transport::wrapReference(submodule); + python_transport::wrapFastRegion(submodule); + python_transport::wrapResolvedRegion(submodule); + python_transport::wrapUnresolvedRegion(submodule); + python_transport::wrapBackground(submodule); + python_transport::wrapResonances(submodule); + python_transport::wrapResonancesWithBackground(submodule); + python_transport::wrapCrossSection(submodule); + python_transport::wrapA(submodule); + python_transport::wrapF(submodule); + python_transport::wrapR(submodule); + python_transport::wrapKalbachMann(submodule); + python_transport::wrapAngularEnergy(submodule); + python_transport::wrapForward(submodule); + python_transport::wrapIsotropic2d(submodule); + python_transport::wrapAngular(submodule); + python_transport::wrapRecoil(submodule); + python_transport::wrapAngularTwoBody(submodule); + python_transport::wrapBranching3d(submodule); + python_transport::wrapEnergyAngular(submodule); + python_transport::wrapNBodyPhaseSpace(submodule); + python_transport::wrapU(submodule); + python_transport::wrapDiscreteGamma(submodule); + python_transport::wrapTheta(submodule); + python_transport::wrapEvaporation(submodule); + python_transport::wrapG(submodule); + python_transport::wrapGeneralEvaporation(submodule); + python_transport::wrapPrimaryGamma(submodule); + python_transport::wrapWeighted(submodule); + python_transport::wrapWeightedFunctionals(submodule); + python_transport::wrapEnergy(submodule); + python_transport::wrapUncorrelated(submodule); + python_transport::wrapUnspecified(submodule); + python_transport::wrapDistribution(submodule); + python_transport::wrapBranching1d(submodule); + python_transport::wrapMultiplicity(submodule); + python_transport::wrapOutputChannel(submodule); + python_transport::wrapAdd(submodule); + python_transport::wrapCoherentPhoton(submodule); + python_transport::wrapSummands(submodule); + python_transport::wrapCrossSectionSum(submodule); + python_transport::wrapCrossSectionSums(submodule); + python_transport::wrapDoubleDifferentialCrossSection(submodule); + python_transport::wrapIncoherentPhoton(submodule); + python_transport::wrapReaction(submodule); + python_transport::wrapIncompleteReactions(submodule); + python_transport::wrapScatteringMatrix(submodule); + python_transport::wrapMultiplicitySum(submodule); + python_transport::wrapMultiplicitySums(submodule); + python_transport::wrapOrphanProduct(submodule); + python_transport::wrapOrphanProducts(submodule); + python_transport::wrapPhotonEmissionProbabilities(submodule); + python_transport::wrapProduction(submodule); + python_transport::wrapProductions(submodule); + python_transport::wrapReactions(submodule); + python_transport::wrapSums(submodule); + python_transport::wrapReactionSuite(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/A.python.cpp b/python/src/v2.0/transport/A.python.cpp new file mode 100644 index 000000000..60c61bd74 --- /dev/null +++ b/python/src/v2.0/transport/A.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/A.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// A wrapper +void wrapA(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::A; + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // create the component + python::class_ component( + module, + "A", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_xys2dregions2d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "regions2d", + python::overload_cast<>(&Component::regions2d), + Component::documentation("regions2d").data() + ) + .def_property_readonly( + "_xys2dregions2d", + python::overload_cast<>(&Component::_XYs2dregions2d), + Component::documentation("_xys2dregions2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Add.python.cpp b/python/src/v2.0/transport/Add.python.cpp new file mode 100644 index 000000000..1623dff81 --- /dev/null +++ b/python/src/v2.0/transport/Add.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Add.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Add wrapper +void wrapAdd(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Add; + + // create the component + python::class_ component( + module, + "Add", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("href") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Angular.python.cpp b/python/src/v2.0/transport/Angular.python.cpp new file mode 100644 index 000000000..07e7e8343 --- /dev/null +++ b/python/src/v2.0/transport/Angular.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Angular.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Angular wrapper +void wrapAngular(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Angular; + + // create the component + python::class_ component( + module, + "Angular", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("xys2d") = std::nullopt, + python::arg("forward") = std::nullopt, + python::arg("isotropic2d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "forward", + python::overload_cast<>(&Component::forward), + Component::documentation("forward").data() + ) + .def_property_readonly( + "isotropic2d", + python::overload_cast<>(&Component::isotropic2d), + Component::documentation("isotropic2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/AngularEnergy.python.cpp b/python/src/v2.0/transport/AngularEnergy.python.cpp new file mode 100644 index 000000000..f1da46bc8 --- /dev/null +++ b/python/src/v2.0/transport/AngularEnergy.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/AngularEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// AngularEnergy wrapper +void wrapAngularEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::AngularEnergy; + + // create the component + python::class_ component( + module, + "AngularEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const containers::XYs3d & + >(), + python::arg("label"), + python::arg("product_frame"), + python::arg("xys3d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "xys3d", + python::overload_cast<>(&Component::XYs3d), + Component::documentation("xys3d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/AngularTwoBody.python.cpp b/python/src/v2.0/transport/AngularTwoBody.python.cpp new file mode 100644 index 000000000..e09c8cb35 --- /dev/null +++ b/python/src/v2.0/transport/AngularTwoBody.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/AngularTwoBody.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// AngularTwoBody wrapper +void wrapAngularTwoBody(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::AngularTwoBody; + + // create the component + python::class_ component( + module, + "AngularTwoBody", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("label") = std::nullopt, + python::arg("product_frame"), + python::arg("xys2d") = std::nullopt, + python::arg("isotropic2d") = std::nullopt, + python::arg("recoil") = std::nullopt, + python::arg("regions2d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "isotropic2d", + python::overload_cast<>(&Component::isotropic2d), + Component::documentation("isotropic2d").data() + ) + .def_property_readonly( + "recoil", + python::overload_cast<>(&Component::recoil), + Component::documentation("recoil").data() + ) + .def_property_readonly( + "regions2d", + python::overload_cast<>(&Component::regions2d), + Component::documentation("regions2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Background.python.cpp b/python/src/v2.0/transport/Background.python.cpp new file mode 100644 index 000000000..2ab924517 --- /dev/null +++ b/python/src/v2.0/transport/Background.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Background.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Background wrapper +void wrapBackground(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Background; + + // create the component + python::class_ component( + module, + "Background", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("fast_region") = std::nullopt, + python::arg("resolved_region") = std::nullopt, + python::arg("unresolved_region") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "fast_region", + python::overload_cast<>(&Component::fastRegion), + Component::documentation("fast_region").data() + ) + .def_property_readonly( + "resolved_region", + python::overload_cast<>(&Component::resolvedRegion), + Component::documentation("resolved_region").data() + ) + .def_property_readonly( + "unresolved_region", + python::overload_cast<>(&Component::unresolvedRegion), + Component::documentation("unresolved_region").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Branching1d.python.cpp b/python/src/v2.0/transport/Branching1d.python.cpp new file mode 100644 index 000000000..f3c25b174 --- /dev/null +++ b/python/src/v2.0/transport/Branching1d.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Branching1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Branching1d wrapper +void wrapBranching1d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Branching1d; + + // create the component + python::class_ component( + module, + "Branching1d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName & + >(), + python::arg("label"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Branching3d.python.cpp b/python/src/v2.0/transport/Branching3d.python.cpp new file mode 100644 index 000000000..eefec1d26 --- /dev/null +++ b/python/src/v2.0/transport/Branching3d.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Branching3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Branching3d wrapper +void wrapBranching3d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Branching3d; + + // create the component + python::class_ component( + module, + "Branching3d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName & + >(), + python::arg("label"), + python::arg("product_frame"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/CoherentPhoton.python.cpp b/python/src/v2.0/transport/CoherentPhoton.python.cpp new file mode 100644 index 000000000..85f4f8cd0 --- /dev/null +++ b/python/src/v2.0/transport/CoherentPhoton.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/CoherentPhoton.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// CoherentPhoton wrapper +void wrapCoherentPhoton(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::CoherentPhoton; + + // create the component + python::class_ component( + module, + "CoherentPhoton", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/CrossSection.python.cpp b/python/src/v2.0/transport/CrossSection.python.cpp new file mode 100644 index 000000000..5e615e550 --- /dev/null +++ b/python/src/v2.0/transport/CrossSection.python.cpp @@ -0,0 +1,112 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/CrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// CrossSection wrapper +void wrapCrossSection(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::CrossSection; + using _t = std::variant< + cpTransport::CoulombPlusNuclearElastic, + transport::URR_probabilityTables1d, + containers::XYs1d, + containers::Ys1d, + containers::Gridded1d, + transport::Reference, + containers::Regions1d, + transport::ResonancesWithBackground, + tsl::ThermalNeutronScatteringLaw1d + >; + + // create the component + python::class_ component( + module, + "CrossSection", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_coulomb_plus_nuclear_elastic_urr_probability_tables1d_xys1d_ys1dgridded1dreferenceregions1dresonances_with_backgroundthermal_neutron_scattering_law1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "coulomb_plus_nuclear_elastic", + python::overload_cast<>(&Component::CoulombPlusNuclearElastic), + Component::documentation("coulomb_plus_nuclear_elastic").data() + ) + .def_property_readonly( + "urr_probability_tables1d", + python::overload_cast<>(&Component::URR_probabilityTables1d), + Component::documentation("urr_probability_tables1d").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "ys1d", + python::overload_cast<>(&Component::Ys1d), + Component::documentation("ys1d").data() + ) + .def_property_readonly( + "gridded1d", + python::overload_cast<>(&Component::gridded1d), + Component::documentation("gridded1d").data() + ) + .def_property_readonly( + "reference", + python::overload_cast<>(&Component::reference), + Component::documentation("reference").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + .def_property_readonly( + "resonances_with_background", + python::overload_cast<>(&Component::resonancesWithBackground), + Component::documentation("resonances_with_background").data() + ) + .def_property_readonly( + "thermal_neutron_scattering_law1d", + python::overload_cast<>(&Component::thermalNeutronScatteringLaw1d), + Component::documentation("thermal_neutron_scattering_law1d").data() + ) + .def_property_readonly( + "_coulomb_plus_nuclear_elastic_urr_probability_tables1d_xys1d_ys1dgridded1dreferenceregions1dresonances_with_backgroundthermal_neutron_scattering_law1d", + python::overload_cast<>(&Component::_CoulombPlusNuclearElasticURR_probabilityTables1dXYs1dYs1dgridded1dreferenceregions1dresonancesWithBackgroundthermalNeutronScatteringLaw1d), + Component::documentation("_coulomb_plus_nuclear_elastic_urr_probability_tables1d_xys1d_ys1dgridded1dreferenceregions1dresonances_with_backgroundthermal_neutron_scattering_law1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/CrossSectionSum.python.cpp b/python/src/v2.0/transport/CrossSectionSum.python.cpp new file mode 100644 index 000000000..9c854ce01 --- /dev/null +++ b/python/src/v2.0/transport/CrossSectionSum.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/CrossSectionSum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// CrossSectionSum wrapper +void wrapCrossSectionSum(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::CrossSectionSum; + + // create the component + python::class_ component( + module, + "CrossSectionSum", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const ambiguousNamespace::Q &, + const transport::CrossSection &, + const transport::Summands & + >(), + python::arg("endf_mt") = std::nullopt, + python::arg("label"), + python::arg("q"), + python::arg("cross_section"), + python::arg("summands"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "endf_mt", + &Component::ENDF_MT, + Component::documentation("endf_mt").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "q", + python::overload_cast<>(&Component::Q), + Component::documentation("q").data() + ) + .def_property_readonly( + "cross_section", + python::overload_cast<>(&Component::crossSection), + Component::documentation("cross_section").data() + ) + .def_property_readonly( + "summands", + python::overload_cast<>(&Component::summands), + Component::documentation("summands").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/CrossSectionSums.python.cpp b/python/src/v2.0/transport/CrossSectionSums.python.cpp new file mode 100644 index 000000000..e531b6ed3 --- /dev/null +++ b/python/src/v2.0/transport/CrossSectionSums.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/CrossSectionSums.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// CrossSectionSums wrapper +void wrapCrossSectionSums(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::CrossSectionSums; + + // create the component + python::class_ component( + module, + "CrossSectionSums", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("cross_section_sum") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "cross_section_sum", + python::overload_cast<>(&Component::crossSectionSum), + Component::documentation("cross_section_sum").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/DiscreteGamma.python.cpp b/python/src/v2.0/transport/DiscreteGamma.python.cpp new file mode 100644 index 000000000..145f3b5f1 --- /dev/null +++ b/python/src/v2.0/transport/DiscreteGamma.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/DiscreteGamma.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// DiscreteGamma wrapper +void wrapDiscreteGamma(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::DiscreteGamma; + + // create the component + python::class_ component( + module, + "DiscreteGamma", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("domain_max") = std::nullopt, + python::arg("domain_min") = std::nullopt, + python::arg("value") = std::nullopt, + python::arg("axes") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "domain_max", + &Component::domainMax, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + &Component::domainMin, + Component::documentation("domain_min").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + .def_property_readonly( + "axes", + python::overload_cast<>(&Component::axes), + Component::documentation("axes").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Distribution.python.cpp b/python/src/v2.0/transport/Distribution.python.cpp new file mode 100644 index 000000000..83219eb78 --- /dev/null +++ b/python/src/v2.0/transport/Distribution.python.cpp @@ -0,0 +1,148 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Distribution.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Distribution wrapper +void wrapDistribution(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Distribution; + using _t = std::variant< + cpTransport::CoulombPlusNuclearElastic, + transport::KalbachMann, + transport::AngularEnergy, + processed::AngularEnergyMC, + transport::AngularTwoBody, + transport::Branching3d, + atomic::CoherentPhotonScattering, + transport::EnergyAngular, + processed::EnergyAngularMC, + atomic::IncoherentPhotonScattering, + processed::MultiGroup3d, + transport::Reference, + tsl::ThermalNeutronScatteringLaw, + transport::Uncorrelated, + transport::Unspecified + >; + + // create the component + python::class_ component( + module, + "Distribution", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_coulomb_plus_nuclear_elastic_kalbach_mannangular_energyangular_energy_mcangular_two_bodybranching3dcoherent_photon_scatteringenergy_angularenergy_angular_mcincoherent_photon_scatteringmulti_group3dreferencethermal_neutron_scattering_lawuncorrelatedunspecified"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "coulomb_plus_nuclear_elastic", + python::overload_cast<>(&Component::CoulombPlusNuclearElastic), + Component::documentation("coulomb_plus_nuclear_elastic").data() + ) + .def_property_readonly( + "kalbach_mann", + python::overload_cast<>(&Component::KalbachMann), + Component::documentation("kalbach_mann").data() + ) + .def_property_readonly( + "angular_energy", + python::overload_cast<>(&Component::angularEnergy), + Component::documentation("angular_energy").data() + ) + .def_property_readonly( + "angular_energy_mc", + python::overload_cast<>(&Component::angularEnergyMC), + Component::documentation("angular_energy_mc").data() + ) + .def_property_readonly( + "angular_two_body", + python::overload_cast<>(&Component::angularTwoBody), + Component::documentation("angular_two_body").data() + ) + .def_property_readonly( + "branching3d", + python::overload_cast<>(&Component::branching3d), + Component::documentation("branching3d").data() + ) + .def_property_readonly( + "coherent_photon_scattering", + python::overload_cast<>(&Component::coherentPhotonScattering), + Component::documentation("coherent_photon_scattering").data() + ) + .def_property_readonly( + "energy_angular", + python::overload_cast<>(&Component::energyAngular), + Component::documentation("energy_angular").data() + ) + .def_property_readonly( + "energy_angular_mc", + python::overload_cast<>(&Component::energyAngularMC), + Component::documentation("energy_angular_mc").data() + ) + .def_property_readonly( + "incoherent_photon_scattering", + python::overload_cast<>(&Component::incoherentPhotonScattering), + Component::documentation("incoherent_photon_scattering").data() + ) + .def_property_readonly( + "multi_group3d", + python::overload_cast<>(&Component::multiGroup3d), + Component::documentation("multi_group3d").data() + ) + .def_property_readonly( + "reference", + python::overload_cast<>(&Component::reference), + Component::documentation("reference").data() + ) + .def_property_readonly( + "thermal_neutron_scattering_law", + python::overload_cast<>(&Component::thermalNeutronScatteringLaw), + Component::documentation("thermal_neutron_scattering_law").data() + ) + .def_property_readonly( + "uncorrelated", + python::overload_cast<>(&Component::uncorrelated), + Component::documentation("uncorrelated").data() + ) + .def_property_readonly( + "unspecified", + python::overload_cast<>(&Component::unspecified), + Component::documentation("unspecified").data() + ) + .def_property_readonly( + "_coulomb_plus_nuclear_elastic_kalbach_mannangular_energyangular_energy_mcangular_two_bodybranching3dcoherent_photon_scatteringenergy_angularenergy_angular_mcincoherent_photon_scatteringmulti_group3dreferencethermal_neutron_scattering_lawuncorrelatedunspecified", + python::overload_cast<>(&Component::_CoulombPlusNuclearElasticKalbachMannangularEnergyangularEnergyMCangularTwoBodybranching3dcoherentPhotonScatteringenergyAngularenergyAngularMCincoherentPhotonScatteringmultiGroup3dreferencethermalNeutronScatteringLawuncorrelatedunspecified), + Component::documentation("_coulomb_plus_nuclear_elastic_kalbach_mannangular_energyangular_energy_mcangular_two_bodybranching3dcoherent_photon_scatteringenergy_angularenergy_angular_mcincoherent_photon_scatteringmulti_group3dreferencethermal_neutron_scattering_lawuncorrelatedunspecified").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/DoubleDifferentialCrossSection.python.cpp b/python/src/v2.0/transport/DoubleDifferentialCrossSection.python.cpp new file mode 100644 index 000000000..8681a6a4b --- /dev/null +++ b/python/src/v2.0/transport/DoubleDifferentialCrossSection.python.cpp @@ -0,0 +1,112 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/DoubleDifferentialCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// DoubleDifferentialCrossSection wrapper +void wrapDoubleDifferentialCrossSection(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::DoubleDifferentialCrossSection; + + // create the component + python::class_ component( + module, + "DoubleDifferentialCrossSection", + 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 std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("coulomb_plus_nuclear_elastic") = std::nullopt, + python::arg("xys3d") = std::nullopt, + python::arg("coherent_photon_scattering") = std::nullopt, + python::arg("incoherent_photon_scattering") = std::nullopt, + python::arg("reference") = std::nullopt, + python::arg("regions3d") = std::nullopt, + python::arg("thermal_neutron_scattering_law_coherent_elastic") = std::nullopt, + python::arg("thermal_neutron_scattering_law_incoherent_elastic") = std::nullopt, + python::arg("thermal_neutron_scattering_law_incoherent_inelastic") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "coulomb_plus_nuclear_elastic", + python::overload_cast<>(&Component::CoulombPlusNuclearElastic), + Component::documentation("coulomb_plus_nuclear_elastic").data() + ) + .def_property_readonly( + "xys3d", + python::overload_cast<>(&Component::XYs3d), + Component::documentation("xys3d").data() + ) + .def_property_readonly( + "coherent_photon_scattering", + python::overload_cast<>(&Component::coherentPhotonScattering), + Component::documentation("coherent_photon_scattering").data() + ) + .def_property_readonly( + "incoherent_photon_scattering", + python::overload_cast<>(&Component::incoherentPhotonScattering), + Component::documentation("incoherent_photon_scattering").data() + ) + .def_property_readonly( + "reference", + python::overload_cast<>(&Component::reference), + Component::documentation("reference").data() + ) + .def_property_readonly( + "regions3d", + python::overload_cast<>(&Component::regions3d), + Component::documentation("regions3d").data() + ) + .def_property_readonly( + "thermal_neutron_scattering_law_coherent_elastic", + python::overload_cast<>(&Component::thermalNeutronScatteringLaw_coherentElastic), + Component::documentation("thermal_neutron_scattering_law_coherent_elastic").data() + ) + .def_property_readonly( + "thermal_neutron_scattering_law_incoherent_elastic", + python::overload_cast<>(&Component::thermalNeutronScatteringLaw_incoherentElastic), + Component::documentation("thermal_neutron_scattering_law_incoherent_elastic").data() + ) + .def_property_readonly( + "thermal_neutron_scattering_law_incoherent_inelastic", + python::overload_cast<>(&Component::thermalNeutronScatteringLaw_incoherentInelastic), + Component::documentation("thermal_neutron_scattering_law_incoherent_inelastic").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Energy.python.cpp b/python/src/v2.0/transport/Energy.python.cpp new file mode 100644 index 000000000..09b70c1fb --- /dev/null +++ b/python/src/v2.0/transport/Energy.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Energy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Energy wrapper +void wrapEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Energy; + + // create the component + python::class_ component( + module, + "Energy", + 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 std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("madland_nix") = std::nullopt, + python::arg("nbody_phase_space") = std::nullopt, + python::arg("watt") = std::nullopt, + python::arg("xys2d") = std::nullopt, + python::arg("discrete_gamma") = std::nullopt, + python::arg("evaporation") = std::nullopt, + python::arg("general_evaporation") = std::nullopt, + python::arg("primary_gamma") = std::nullopt, + python::arg("regions2d") = std::nullopt, + python::arg("simple_maxwellian_fission") = std::nullopt, + python::arg("weighted_functionals") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "madland_nix", + python::overload_cast<>(&Component::MadlandNix), + Component::documentation("madland_nix").data() + ) + .def_property_readonly( + "nbody_phase_space", + python::overload_cast<>(&Component::NBodyPhaseSpace), + Component::documentation("nbody_phase_space").data() + ) + .def_property_readonly( + "watt", + python::overload_cast<>(&Component::Watt), + Component::documentation("watt").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "discrete_gamma", + python::overload_cast<>(&Component::discreteGamma), + Component::documentation("discrete_gamma").data() + ) + .def_property_readonly( + "evaporation", + python::overload_cast<>(&Component::evaporation), + Component::documentation("evaporation").data() + ) + .def_property_readonly( + "general_evaporation", + python::overload_cast<>(&Component::generalEvaporation), + Component::documentation("general_evaporation").data() + ) + .def_property_readonly( + "primary_gamma", + python::overload_cast<>(&Component::primaryGamma), + Component::documentation("primary_gamma").data() + ) + .def_property_readonly( + "regions2d", + python::overload_cast<>(&Component::regions2d), + Component::documentation("regions2d").data() + ) + .def_property_readonly( + "simple_maxwellian_fission", + python::overload_cast<>(&Component::simpleMaxwellianFission), + Component::documentation("simple_maxwellian_fission").data() + ) + .def_property_readonly( + "weighted_functionals", + python::overload_cast<>(&Component::weightedFunctionals), + Component::documentation("weighted_functionals").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/EnergyAngular.python.cpp b/python/src/v2.0/transport/EnergyAngular.python.cpp new file mode 100644 index 000000000..d2aa88a20 --- /dev/null +++ b/python/src/v2.0/transport/EnergyAngular.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/EnergyAngular.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// EnergyAngular wrapper +void wrapEnergyAngular(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::EnergyAngular; + + // create the component + python::class_ component( + module, + "EnergyAngular", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const containers::XYs3d & + >(), + python::arg("label") = std::nullopt, + python::arg("product_frame"), + python::arg("xys3d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "xys3d", + python::overload_cast<>(&Component::XYs3d), + Component::documentation("xys3d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Evaporation.python.cpp b/python/src/v2.0/transport/Evaporation.python.cpp new file mode 100644 index 000000000..605387707 --- /dev/null +++ b/python/src/v2.0/transport/Evaporation.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Evaporation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Evaporation wrapper +void wrapEvaporation(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Evaporation; + + // create the component + python::class_ component( + module, + "Evaporation", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("u") = std::nullopt, + python::arg("theta") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "u", + python::overload_cast<>(&Component::U), + Component::documentation("u").data() + ) + .def_property_readonly( + "theta", + python::overload_cast<>(&Component::theta), + Component::documentation("theta").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/F.python.cpp b/python/src/v2.0/transport/F.python.cpp new file mode 100644 index 000000000..6307bdef5 --- /dev/null +++ b/python/src/v2.0/transport/F.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/F.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// F wrapper +void wrapF(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::F; + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // create the component + python::class_ component( + module, + "F", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_xys2dregions2d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "regions2d", + python::overload_cast<>(&Component::regions2d), + Component::documentation("regions2d").data() + ) + .def_property_readonly( + "_xys2dregions2d", + python::overload_cast<>(&Component::_XYs2dregions2d), + Component::documentation("_xys2dregions2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/FastRegion.python.cpp b/python/src/v2.0/transport/FastRegion.python.cpp new file mode 100644 index 000000000..52f50bfe5 --- /dev/null +++ b/python/src/v2.0/transport/FastRegion.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/FastRegion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// FastRegion wrapper +void wrapFastRegion(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::FastRegion; + using _t = std::variant< + containers::XYs1d, + containers::Regions1d + >; + + // create the component + python::class_ component( + module, + "FastRegion", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_xys1dregions1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + .def_property_readonly( + "_xys1dregions1d", + python::overload_cast<>(&Component::_XYs1dregions1d), + Component::documentation("_xys1dregions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Forward.python.cpp b/python/src/v2.0/transport/Forward.python.cpp new file mode 100644 index 000000000..cba675358 --- /dev/null +++ b/python/src/v2.0/transport/Forward.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Forward.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Forward wrapper +void wrapForward(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Forward; + + // create the component + python::class_ component( + module, + "Forward", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/G.python.cpp b/python/src/v2.0/transport/G.python.cpp new file mode 100644 index 000000000..f01d26ee9 --- /dev/null +++ b/python/src/v2.0/transport/G.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/G.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// G wrapper +void wrapG(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::G; + + // create the component + python::class_ component( + module, + "G", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("regions1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/GeneralEvaporation.python.cpp b/python/src/v2.0/transport/GeneralEvaporation.python.cpp new file mode 100644 index 000000000..001e45abe --- /dev/null +++ b/python/src/v2.0/transport/GeneralEvaporation.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/GeneralEvaporation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// GeneralEvaporation wrapper +void wrapGeneralEvaporation(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::GeneralEvaporation; + + // create the component + python::class_ component( + module, + "GeneralEvaporation", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("u") = std::nullopt, + python::arg("g") = std::nullopt, + python::arg("theta") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "u", + python::overload_cast<>(&Component::U), + Component::documentation("u").data() + ) + .def_property_readonly( + "g", + python::overload_cast<>(&Component::g), + Component::documentation("g").data() + ) + .def_property_readonly( + "theta", + python::overload_cast<>(&Component::theta), + Component::documentation("theta").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/IncoherentPhoton.python.cpp b/python/src/v2.0/transport/IncoherentPhoton.python.cpp new file mode 100644 index 000000000..3c34ab939 --- /dev/null +++ b/python/src/v2.0/transport/IncoherentPhoton.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/IncoherentPhoton.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// IncoherentPhoton wrapper +void wrapIncoherentPhoton(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::IncoherentPhoton; + + // create the component + python::class_ component( + module, + "IncoherentPhoton", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/IncompleteReactions.python.cpp b/python/src/v2.0/transport/IncompleteReactions.python.cpp new file mode 100644 index 000000000..e397cd3b5 --- /dev/null +++ b/python/src/v2.0/transport/IncompleteReactions.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/IncompleteReactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// IncompleteReactions wrapper +void wrapIncompleteReactions(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::IncompleteReactions; + + // create the component + python::class_ component( + module, + "IncompleteReactions", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("reaction") = std::nullopt, + 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_v2_0 diff --git a/python/src/v2.0/transport/Isotropic2d.python.cpp b/python/src/v2.0/transport/Isotropic2d.python.cpp new file mode 100644 index 000000000..63326d8f1 --- /dev/null +++ b/python/src/v2.0/transport/Isotropic2d.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Isotropic2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Isotropic2d wrapper +void wrapIsotropic2d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Isotropic2d; + + // create the component + python::class_ component( + module, + "Isotropic2d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + >(), + Component::documentation("constructor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/KalbachMann.python.cpp b/python/src/v2.0/transport/KalbachMann.python.cpp new file mode 100644 index 000000000..d141645b8 --- /dev/null +++ b/python/src/v2.0/transport/KalbachMann.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/KalbachMann.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// KalbachMann wrapper +void wrapKalbachMann(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::KalbachMann; + + // create the component + python::class_ component( + module, + "KalbachMann", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const std::optional &, + const transport::F &, + const transport::R & + >(), + python::arg("label") = std::nullopt, + python::arg("product_frame"), + python::arg("a") = std::nullopt, + python::arg("f"), + python::arg("r"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "a", + python::overload_cast<>(&Component::a), + Component::documentation("a").data() + ) + .def_property_readonly( + "f", + python::overload_cast<>(&Component::f), + Component::documentation("f").data() + ) + .def_property_readonly( + "r", + python::overload_cast<>(&Component::r), + Component::documentation("r").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Multiplicity.python.cpp b/python/src/v2.0/transport/Multiplicity.python.cpp new file mode 100644 index 000000000..53eb0807f --- /dev/null +++ b/python/src/v2.0/transport/Multiplicity.python.cpp @@ -0,0 +1,100 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Multiplicity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Multiplicity wrapper +void wrapMultiplicity(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Multiplicity; + using _t = std::variant< + containers::XYs1d, + transport::Branching1d, + containers::Constant1d, + containers::Gridded1d, + containers::Polynomial1d, + transport::Reference, + containers::Regions1d + >; + + // create the component + python::class_ component( + module, + "Multiplicity", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_xys1dbranching1dconstant1dgridded1dpolynomial1dreferenceregions1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "branching1d", + python::overload_cast<>(&Component::branching1d), + Component::documentation("branching1d").data() + ) + .def_property_readonly( + "constant1d", + python::overload_cast<>(&Component::constant1d), + Component::documentation("constant1d").data() + ) + .def_property_readonly( + "gridded1d", + python::overload_cast<>(&Component::gridded1d), + Component::documentation("gridded1d").data() + ) + .def_property_readonly( + "polynomial1d", + python::overload_cast<>(&Component::polynomial1d), + Component::documentation("polynomial1d").data() + ) + .def_property_readonly( + "reference", + python::overload_cast<>(&Component::reference), + Component::documentation("reference").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + .def_property_readonly( + "_xys1dbranching1dconstant1dgridded1dpolynomial1dreferenceregions1d", + python::overload_cast<>(&Component::_XYs1dbranching1dconstant1dgridded1dpolynomial1dreferenceregions1d), + Component::documentation("_xys1dbranching1dconstant1dgridded1dpolynomial1dreferenceregions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/MultiplicitySum.python.cpp b/python/src/v2.0/transport/MultiplicitySum.python.cpp new file mode 100644 index 000000000..9e0b388b9 --- /dev/null +++ b/python/src/v2.0/transport/MultiplicitySum.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/MultiplicitySum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// MultiplicitySum wrapper +void wrapMultiplicitySum(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::MultiplicitySum; + + // create the component + python::class_ component( + module, + "MultiplicitySum", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const transport::Multiplicity &, + const transport::Summands & + >(), + python::arg("endf_mt") = std::nullopt, + python::arg("label"), + python::arg("multiplicity"), + python::arg("summands"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "endf_mt", + &Component::ENDF_MT, + Component::documentation("endf_mt").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "multiplicity", + python::overload_cast<>(&Component::multiplicity), + Component::documentation("multiplicity").data() + ) + .def_property_readonly( + "summands", + python::overload_cast<>(&Component::summands), + Component::documentation("summands").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/MultiplicitySums.python.cpp b/python/src/v2.0/transport/MultiplicitySums.python.cpp new file mode 100644 index 000000000..8b069fddf --- /dev/null +++ b/python/src/v2.0/transport/MultiplicitySums.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/MultiplicitySums.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// MultiplicitySums wrapper +void wrapMultiplicitySums(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::MultiplicitySums; + + // create the component + python::class_ component( + module, + "MultiplicitySums", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("multiplicity_sum") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "multiplicity_sum", + python::overload_cast<>(&Component::multiplicitySum), + Component::documentation("multiplicity_sum").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/NBodyPhaseSpace.python.cpp b/python/src/v2.0/transport/NBodyPhaseSpace.python.cpp new file mode 100644 index 000000000..e0e5c4c8b --- /dev/null +++ b/python/src/v2.0/transport/NBodyPhaseSpace.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/NBodyPhaseSpace.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// NBodyPhaseSpace wrapper +void wrapNBodyPhaseSpace(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::NBodyPhaseSpace; + + // create the component + python::class_ component( + module, + "NBodyPhaseSpace", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("number_of_products") = std::nullopt, + python::arg("mass") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "number_of_products", + &Component::numberOfProducts, + Component::documentation("number_of_products").data() + ) + .def_property_readonly( + "mass", + python::overload_cast<>(&Component::mass), + Component::documentation("mass").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/OrphanProduct.python.cpp b/python/src/v2.0/transport/OrphanProduct.python.cpp new file mode 100644 index 000000000..3339c044a --- /dev/null +++ b/python/src/v2.0/transport/OrphanProduct.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/OrphanProduct.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// OrphanProduct wrapper +void wrapOrphanProduct(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::OrphanProduct; + + // create the component + python::class_ component( + module, + "OrphanProduct", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Integer32 &, + const XMLName &, + const transport::CrossSection &, + const transport::OutputChannel & + >(), + python::arg("endf_mt"), + python::arg("label"), + python::arg("cross_section"), + python::arg("output_channel"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "endf_mt", + &Component::ENDF_MT, + Component::documentation("endf_mt").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() + ) + .def_property_readonly( + "output_channel", + python::overload_cast<>(&Component::outputChannel), + Component::documentation("output_channel").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/OrphanProducts.python.cpp b/python/src/v2.0/transport/OrphanProducts.python.cpp new file mode 100644 index 000000000..04b5391cf --- /dev/null +++ b/python/src/v2.0/transport/OrphanProducts.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/OrphanProducts.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// OrphanProducts wrapper +void wrapOrphanProducts(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::OrphanProducts; + + // create the component + python::class_ component( + module, + "OrphanProducts", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("orphan_product"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "orphan_product", + python::overload_cast<>(&Component::orphanProduct), + Component::documentation("orphan_product").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/OutputChannel.python.cpp b/python/src/v2.0/transport/OutputChannel.python.cpp new file mode 100644 index 000000000..c3d8aa5e7 --- /dev/null +++ b/python/src/v2.0/transport/OutputChannel.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/OutputChannel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// OutputChannel wrapper +void wrapOutputChannel(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::OutputChannel; + + // create the component + python::class_ component( + module, + "OutputChannel", + 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 & + >(), + python::arg("genre") = std::nullopt, + python::arg("process") = std::nullopt, + python::arg("q") = std::nullopt, + python::arg("fission_fragment_data") = std::nullopt, + python::arg("products") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "genre", + &Component::genre, + Component::documentation("genre").data() + ) + .def_property_readonly( + "process", + &Component::process, + Component::documentation("process").data() + ) + .def_property_readonly( + "q", + python::overload_cast<>(&Component::Q), + Component::documentation("q").data() + ) + .def_property_readonly( + "fission_fragment_data", + python::overload_cast<>(&Component::fissionFragmentData), + Component::documentation("fission_fragment_data").data() + ) + .def_property_readonly( + "products", + python::overload_cast<>(&Component::products), + Component::documentation("products").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/PhotonEmissionProbabilities.python.cpp b/python/src/v2.0/transport/PhotonEmissionProbabilities.python.cpp new file mode 100644 index 000000000..cd51af174 --- /dev/null +++ b/python/src/v2.0/transport/PhotonEmissionProbabilities.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/PhotonEmissionProbabilities.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// PhotonEmissionProbabilities wrapper +void wrapPhotonEmissionProbabilities(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::PhotonEmissionProbabilities; + + // create the component + python::class_ component( + module, + "PhotonEmissionProbabilities", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("shell") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "shell", + python::overload_cast<>(&Component::shell), + Component::documentation("shell").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/PrimaryGamma.python.cpp b/python/src/v2.0/transport/PrimaryGamma.python.cpp new file mode 100644 index 000000000..de933e85e --- /dev/null +++ b/python/src/v2.0/transport/PrimaryGamma.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/PrimaryGamma.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// PrimaryGamma wrapper +void wrapPrimaryGamma(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::PrimaryGamma; + + // create the component + python::class_ component( + module, + "PrimaryGamma", + 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 & + >(), + python::arg("domain_max") = std::nullopt, + python::arg("domain_min") = std::nullopt, + python::arg("final_state") = std::nullopt, + python::arg("value") = std::nullopt, + python::arg("axes") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "domain_max", + &Component::domainMax, + Component::documentation("domain_max").data() + ) + .def_property_readonly( + "domain_min", + &Component::domainMin, + Component::documentation("domain_min").data() + ) + .def_property_readonly( + "final_state", + &Component::finalState, + Component::documentation("final_state").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + .def_property_readonly( + "axes", + python::overload_cast<>(&Component::axes), + Component::documentation("axes").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Production.python.cpp b/python/src/v2.0/transport/Production.python.cpp new file mode 100644 index 000000000..e25a0c975 --- /dev/null +++ b/python/src/v2.0/transport/Production.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Production.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Production wrapper +void wrapProduction(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Production; + + // create the component + python::class_ component( + module, + "Production", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("endf_mt") = std::nullopt, + python::arg("label") = std::nullopt, + python::arg("cross_section") = std::nullopt, + python::arg("output_channel") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "endf_mt", + &Component::ENDF_MT, + Component::documentation("endf_mt").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() + ) + .def_property_readonly( + "output_channel", + python::overload_cast<>(&Component::outputChannel), + Component::documentation("output_channel").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Productions.python.cpp b/python/src/v2.0/transport/Productions.python.cpp new file mode 100644 index 000000000..d1a2fc935 --- /dev/null +++ b/python/src/v2.0/transport/Productions.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Productions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Productions wrapper +void wrapProductions(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Productions; + + // create the component + python::class_ component( + module, + "Productions", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("production") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "production", + python::overload_cast<>(&Component::production), + Component::documentation("production").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/R.python.cpp b/python/src/v2.0/transport/R.python.cpp new file mode 100644 index 000000000..2e7dce263 --- /dev/null +++ b/python/src/v2.0/transport/R.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/R.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// R wrapper +void wrapR(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::R; + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // create the component + python::class_ component( + module, + "R", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_xys2dregions2d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "regions2d", + python::overload_cast<>(&Component::regions2d), + Component::documentation("regions2d").data() + ) + .def_property_readonly( + "_xys2dregions2d", + python::overload_cast<>(&Component::_XYs2dregions2d), + Component::documentation("_xys2dregions2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Reaction.python.cpp b/python/src/v2.0/transport/Reaction.python.cpp new file mode 100644 index 000000000..6414cc506 --- /dev/null +++ b/python/src/v2.0/transport/Reaction.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Reaction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Reaction wrapper +void wrapReaction(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // 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 Integer32 &, + const std::optional &, + const XMLName &, + const transport::CrossSection &, + const std::optional &, + const transport::OutputChannel & + >(), + python::arg("endf_mt"), + python::arg("fission_genre") = std::nullopt, + python::arg("label"), + python::arg("cross_section"), + python::arg("double_differential_cross_section") = std::nullopt, + python::arg("output_channel"), + 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() + ) + .def_property_readonly( + "double_differential_cross_section", + python::overload_cast<>(&Component::doubleDifferentialCrossSection), + Component::documentation("double_differential_cross_section").data() + ) + .def_property_readonly( + "output_channel", + python::overload_cast<>(&Component::outputChannel), + Component::documentation("output_channel").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/ReactionSuite.python.cpp b/python/src/v2.0/transport/ReactionSuite.python.cpp new file mode 100644 index 000000000..12ea44914 --- /dev/null +++ b/python/src/v2.0/transport/ReactionSuite.python.cpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/ReactionSuite.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// ReactionSuite wrapper +void wrapReactionSuite(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // 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 XMLName &, + const XMLName &, + const enums::Interaction &, + const XMLName &, + const enums::Frame &, + const XMLName &, + const pops::PoPs &, + 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 styles::Styles &, + const std::optional & + >(), + python::arg("evaluation"), + python::arg("format"), + python::arg("interaction"), + python::arg("projectile"), + python::arg("projectile_frame"), + python::arg("target"), + python::arg("po_ps"), + python::arg("application_data") = std::nullopt, + python::arg("external_files") = std::nullopt, + python::arg("fission_components") = std::nullopt, + python::arg("incomplete_reactions") = std::nullopt, + python::arg("orphan_products") = std::nullopt, + python::arg("productions") = std::nullopt, + python::arg("reactions") = std::nullopt, + python::arg("resonances") = std::nullopt, + python::arg("styles"), + python::arg("sums") = 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( + "po_ps", + python::overload_cast<>(&Component::PoPs), + Component::documentation("po_ps").data() + ) + .def_property_readonly( + "application_data", + python::overload_cast<>(&Component::applicationData), + Component::documentation("application_data").data() + ) + .def_property_readonly( + "external_files", + python::overload_cast<>(&Component::externalFiles), + Component::documentation("external_files").data() + ) + .def_property_readonly( + "fission_components", + python::overload_cast<>(&Component::fissionComponents), + Component::documentation("fission_components").data() + ) + .def_property_readonly( + "incomplete_reactions", + python::overload_cast<>(&Component::incompleteReactions), + Component::documentation("incomplete_reactions").data() + ) + .def_property_readonly( + "orphan_products", + python::overload_cast<>(&Component::orphanProducts), + Component::documentation("orphan_products").data() + ) + .def_property_readonly( + "productions", + python::overload_cast<>(&Component::productions), + Component::documentation("productions").data() + ) + .def_property_readonly( + "reactions", + python::overload_cast<>(&Component::reactions), + Component::documentation("reactions").data() + ) + .def_property_readonly( + "resonances", + python::overload_cast<>(&Component::resonances), + Component::documentation("resonances").data() + ) + .def_property_readonly( + "styles", + python::overload_cast<>(&Component::styles), + Component::documentation("styles").data() + ) + .def_property_readonly( + "sums", + python::overload_cast<>(&Component::sums), + Component::documentation("sums").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Reactions.python.cpp b/python/src/v2.0/transport/Reactions.python.cpp new file mode 100644 index 000000000..4dff38fd6 --- /dev/null +++ b/python/src/v2.0/transport/Reactions.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Reactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Reactions wrapper +void wrapReactions(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // 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_v2_0 diff --git a/python/src/v2.0/transport/Recoil.python.cpp b/python/src/v2.0/transport/Recoil.python.cpp new file mode 100644 index 000000000..fe73fd62e --- /dev/null +++ b/python/src/v2.0/transport/Recoil.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Recoil.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Recoil wrapper +void wrapRecoil(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Recoil; + + // create the component + python::class_ component( + module, + "Recoil", + 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_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Reference.python.cpp b/python/src/v2.0/transport/Reference.python.cpp new file mode 100644 index 000000000..bd468c137 --- /dev/null +++ b/python/src/v2.0/transport/Reference.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Reference.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Reference wrapper +void wrapReference(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Reference; + + // create the component + python::class_ component( + module, + "Reference", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("href") = std::nullopt, + python::arg("label") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/ResolvedRegion.python.cpp b/python/src/v2.0/transport/ResolvedRegion.python.cpp new file mode 100644 index 000000000..f38517951 --- /dev/null +++ b/python/src/v2.0/transport/ResolvedRegion.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/ResolvedRegion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// ResolvedRegion wrapper +void wrapResolvedRegion(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::ResolvedRegion; + using _t = std::variant< + containers::XYs1d, + containers::Regions1d + >; + + // create the component + python::class_ component( + module, + "ResolvedRegion", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_xys1dregions1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + .def_property_readonly( + "_xys1dregions1d", + python::overload_cast<>(&Component::_XYs1dregions1d), + Component::documentation("_xys1dregions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Resonances.python.cpp b/python/src/v2.0/transport/Resonances.python.cpp new file mode 100644 index 000000000..c1f2bca36 --- /dev/null +++ b/python/src/v2.0/transport/Resonances.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Resonances.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Resonances wrapper +void wrapResonances(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Resonances; + + // create the component + python::class_ component( + module, + "Resonances", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::string &, + const std::optional & + >(), + python::arg("href"), + python::arg("label") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/ResonancesWithBackground.python.cpp b/python/src/v2.0/transport/ResonancesWithBackground.python.cpp new file mode 100644 index 000000000..6c2e52104 --- /dev/null +++ b/python/src/v2.0/transport/ResonancesWithBackground.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/ResonancesWithBackground.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// ResonancesWithBackground wrapper +void wrapResonancesWithBackground(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::ResonancesWithBackground; + + // create the component + python::class_ component( + module, + "ResonancesWithBackground", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const transport::Background &, + const transport::Resonances &, + const std::optional & + >(), + python::arg("label"), + python::arg("background"), + python::arg("resonances"), + python::arg("uncertainty") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "background", + python::overload_cast<>(&Component::background), + Component::documentation("background").data() + ) + .def_property_readonly( + "resonances", + python::overload_cast<>(&Component::resonances), + Component::documentation("resonances").data() + ) + .def_property_readonly( + "uncertainty", + python::overload_cast<>(&Component::uncertainty), + Component::documentation("uncertainty").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/ScatteringMatrix.python.cpp b/python/src/v2.0/transport/ScatteringMatrix.python.cpp new file mode 100644 index 000000000..4c7139331 --- /dev/null +++ b/python/src/v2.0/transport/ScatteringMatrix.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/ScatteringMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// ScatteringMatrix wrapper +void wrapScatteringMatrix(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::ScatteringMatrix; + + // create the component + python::class_ component( + module, + "ScatteringMatrix", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const containers::Gridded3d & + >(), + python::arg("label"), + python::arg("product_frame"), + python::arg("gridded3d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "gridded3d", + python::overload_cast<>(&Component::gridded3d), + Component::documentation("gridded3d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Summands.python.cpp b/python/src/v2.0/transport/Summands.python.cpp new file mode 100644 index 000000000..4367f562a --- /dev/null +++ b/python/src/v2.0/transport/Summands.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Summands.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Summands wrapper +void wrapSummands(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Summands; + + // create the component + python::class_ component( + module, + "Summands", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional> & + >(), + python::arg("add") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "add", + python::overload_cast<>(&Component::add), + Component::documentation("add").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Sums.python.cpp b/python/src/v2.0/transport/Sums.python.cpp new file mode 100644 index 000000000..257d47462 --- /dev/null +++ b/python/src/v2.0/transport/Sums.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Sums.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Sums wrapper +void wrapSums(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Sums; + + // create the component + python::class_ component( + module, + "Sums", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const transport::CrossSectionSums &, + const std::optional & + >(), + python::arg("cross_section_sums"), + python::arg("multiplicity_sums") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "cross_section_sums", + python::overload_cast<>(&Component::crossSectionSums), + Component::documentation("cross_section_sums").data() + ) + .def_property_readonly( + "multiplicity_sums", + python::overload_cast<>(&Component::multiplicitySums), + Component::documentation("multiplicity_sums").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Theta.python.cpp b/python/src/v2.0/transport/Theta.python.cpp new file mode 100644 index 000000000..274522a39 --- /dev/null +++ b/python/src/v2.0/transport/Theta.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Theta.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Theta wrapper +void wrapTheta(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Theta; + + // create the component + python::class_ component( + module, + "Theta", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("xys1d") = std::nullopt, + python::arg("regions1d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/U.python.cpp b/python/src/v2.0/transport/U.python.cpp new file mode 100644 index 000000000..57b21127c --- /dev/null +++ b/python/src/v2.0/transport/U.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/U.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// U wrapper +void wrapU(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::U; + + // create the component + python::class_ component( + module, + "U", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("unit") = std::nullopt, + python::arg("value") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/URR_probabilityTables1d.python.cpp b/python/src/v2.0/transport/URR_probabilityTables1d.python.cpp new file mode 100644 index 000000000..bd4bc6305 --- /dev/null +++ b/python/src/v2.0/transport/URR_probabilityTables1d.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/URR_probabilityTables1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// URR_probabilityTables1d wrapper +void wrapURR_probabilityTables1d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::URR_probabilityTables1d; + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // create the component + python::class_ component( + module, + "URR_probabilityTables1d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const _t & + >(), + python::arg("label"), + python::arg("_xys2dregions2d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "regions2d", + python::overload_cast<>(&Component::regions2d), + Component::documentation("regions2d").data() + ) + .def_property_readonly( + "_xys2dregions2d", + python::overload_cast<>(&Component::_XYs2dregions2d), + Component::documentation("_xys2dregions2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Uncorrelated.python.cpp b/python/src/v2.0/transport/Uncorrelated.python.cpp new file mode 100644 index 000000000..776665628 --- /dev/null +++ b/python/src/v2.0/transport/Uncorrelated.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Uncorrelated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Uncorrelated wrapper +void wrapUncorrelated(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Uncorrelated; + + // create the component + python::class_ component( + module, + "Uncorrelated", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const transport::Angular &, + const transport::Energy & + >(), + python::arg("label") = std::nullopt, + python::arg("product_frame"), + python::arg("angular"), + python::arg("energy"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "angular", + python::overload_cast<>(&Component::angular), + Component::documentation("angular").data() + ) + .def_property_readonly( + "energy", + python::overload_cast<>(&Component::energy), + Component::documentation("energy").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/UnresolvedRegion.python.cpp b/python/src/v2.0/transport/UnresolvedRegion.python.cpp new file mode 100644 index 000000000..a8cf9ff51 --- /dev/null +++ b/python/src/v2.0/transport/UnresolvedRegion.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/UnresolvedRegion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// UnresolvedRegion wrapper +void wrapUnresolvedRegion(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::UnresolvedRegion; + using _t = std::variant< + containers::XYs1d, + containers::Regions1d + >; + + // create the component + python::class_ component( + module, + "UnresolvedRegion", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const _t & + >(), + python::arg("_xys1dregions1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "regions1d", + python::overload_cast<>(&Component::regions1d), + Component::documentation("regions1d").data() + ) + .def_property_readonly( + "_xys1dregions1d", + python::overload_cast<>(&Component::_XYs1dregions1d), + Component::documentation("_xys1dregions1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Unspecified.python.cpp b/python/src/v2.0/transport/Unspecified.python.cpp new file mode 100644 index 000000000..cbfad1442 --- /dev/null +++ b/python/src/v2.0/transport/Unspecified.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Unspecified.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Unspecified wrapper +void wrapUnspecified(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Unspecified; + + // create the component + python::class_ component( + module, + "Unspecified", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName & + >(), + python::arg("label") = std::nullopt, + python::arg("product_frame"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/Weighted.python.cpp b/python/src/v2.0/transport/Weighted.python.cpp new file mode 100644 index 000000000..342809cc7 --- /dev/null +++ b/python/src/v2.0/transport/Weighted.python.cpp @@ -0,0 +1,98 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/Weighted.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// Weighted wrapper +void wrapWeighted(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::Weighted; + + // create the component + python::class_ component( + module, + "Weighted", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const containers::XYs1d &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + python::arg("madland_nix") = std::nullopt, + python::arg("watt") = std::nullopt, + python::arg("xys1d"), + python::arg("xys2d") = std::nullopt, + python::arg("evaporation") = std::nullopt, + python::arg("general_evaporation") = std::nullopt, + python::arg("simple_maxwellian_fission") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "madland_nix", + python::overload_cast<>(&Component::MadlandNix), + Component::documentation("madland_nix").data() + ) + .def_property_readonly( + "watt", + python::overload_cast<>(&Component::Watt), + Component::documentation("watt").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + .def_property_readonly( + "xys2d", + python::overload_cast<>(&Component::XYs2d), + Component::documentation("xys2d").data() + ) + .def_property_readonly( + "evaporation", + python::overload_cast<>(&Component::evaporation), + Component::documentation("evaporation").data() + ) + .def_property_readonly( + "general_evaporation", + python::overload_cast<>(&Component::generalEvaporation), + Component::documentation("general_evaporation").data() + ) + .def_property_readonly( + "simple_maxwellian_fission", + python::overload_cast<>(&Component::simpleMaxwellianFission), + Component::documentation("simple_maxwellian_fission").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/transport/WeightedFunctionals.python.cpp b/python/src/v2.0/transport/WeightedFunctionals.python.cpp new file mode 100644 index 000000000..37993ba20 --- /dev/null +++ b/python/src/v2.0/transport/WeightedFunctionals.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/transport/WeightedFunctionals.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// WeightedFunctionals wrapper +void wrapWeightedFunctionals(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = transport::WeightedFunctionals; + + // create the component + python::class_ component( + module, + "WeightedFunctionals", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const transport::Weighted & + >(), + python::arg("weighted"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "weighted", + python::overload_cast<>(&Component::weighted), + Component::documentation("weighted").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl.python.cpp b/python/src/v2.0/tsl.python.cpp new file mode 100644 index 000000000..01ca73493 --- /dev/null +++ b/python/src/v2.0/tsl.python.cpp @@ -0,0 +1,75 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace python = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// tsl declarations +namespace python_tsl { + void wrapThermalNeutronScatteringLaw1d(python::module &); + void wrapThermalNeutronScatteringLaw(python::module &); + void wrapBraggEnergy(python::module &); + void wrapStructureFactor(python::module &); + void wrapBraggEdge(python::module &); + void wrapBraggEdges(python::module &); + void wrapS_table(python::module &); + void wrapThermalNeutronScatteringLaw_coherentElastic(python::module &); + void wrapDebyeWallerIntegral(python::module &); + void wrapBoundAtomCrossSection(python::module &); + void wrapThermalNeutronScatteringLaw_incoherentElastic(python::module &); + void wrapCoherentAtomCrossSection(python::module &); + void wrapDistinctScatteringKernel(python::module &); + void wrapE_critical(python::module &); + void wrapE_max(python::module &); + void wrapT_effective(python::module &); + void wrapSelfScatteringKernelSCTApproximation(python::module &); + void wrapPhononSpectrum(python::module &); + void wrapSelfScatteringKernelGaussianApproximation(python::module &); + void wrapSelfScatteringKernel(python::module &); + void wrapScatteringAtom(python::module &); + void wrapScatteringAtoms(python::module &); + void wrapThermalNeutronScatteringLaw_incoherentInelastic(python::module &); +} // namespace python_tsl + +// tsl wrapper +void wrapTsl(python::module &module) +{ + // create the tsl submodule + python::module submodule = module.def_submodule( + "tsl", + "GNDS v2.0 tsl" + ); + + // wrap tsl components + python_tsl::wrapThermalNeutronScatteringLaw1d(submodule); + python_tsl::wrapThermalNeutronScatteringLaw(submodule); + python_tsl::wrapBraggEnergy(submodule); + python_tsl::wrapStructureFactor(submodule); + python_tsl::wrapBraggEdge(submodule); + python_tsl::wrapBraggEdges(submodule); + python_tsl::wrapS_table(submodule); + python_tsl::wrapThermalNeutronScatteringLaw_coherentElastic(submodule); + python_tsl::wrapDebyeWallerIntegral(submodule); + python_tsl::wrapBoundAtomCrossSection(submodule); + python_tsl::wrapThermalNeutronScatteringLaw_incoherentElastic(submodule); + python_tsl::wrapCoherentAtomCrossSection(submodule); + python_tsl::wrapDistinctScatteringKernel(submodule); + python_tsl::wrapE_critical(submodule); + python_tsl::wrapE_max(submodule); + python_tsl::wrapT_effective(submodule); + python_tsl::wrapSelfScatteringKernelSCTApproximation(submodule); + python_tsl::wrapPhononSpectrum(submodule); + python_tsl::wrapSelfScatteringKernelGaussianApproximation(submodule); + python_tsl::wrapSelfScatteringKernel(submodule); + python_tsl::wrapScatteringAtom(submodule); + python_tsl::wrapScatteringAtoms(submodule); + python_tsl::wrapThermalNeutronScatteringLaw_incoherentInelastic(submodule); +}; + +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/BoundAtomCrossSection.python.cpp b/python/src/v2.0/tsl/BoundAtomCrossSection.python.cpp new file mode 100644 index 000000000..d97759f20 --- /dev/null +++ b/python/src/v2.0/tsl/BoundAtomCrossSection.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/BoundAtomCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// BoundAtomCrossSection wrapper +void wrapBoundAtomCrossSection(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::BoundAtomCrossSection; + + // create the component + python::class_ component( + module, + "BoundAtomCrossSection", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Float64 & + >(), + python::arg("unit"), + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/BraggEdge.python.cpp b/python/src/v2.0/tsl/BraggEdge.python.cpp new file mode 100644 index 000000000..47d7fcf04 --- /dev/null +++ b/python/src/v2.0/tsl/BraggEdge.python.cpp @@ -0,0 +1,70 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/BraggEdge.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// BraggEdge wrapper +void wrapBraggEdge(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::BraggEdge; + + // create the component + python::class_ component( + module, + "BraggEdge", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const tsl::BraggEnergy &, + const tsl::StructureFactor & + >(), + python::arg("label"), + python::arg("bragg_energy"), + python::arg("structure_factor"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "bragg_energy", + python::overload_cast<>(&Component::BraggEnergy), + Component::documentation("bragg_energy").data() + ) + .def_property_readonly( + "structure_factor", + python::overload_cast<>(&Component::structureFactor), + Component::documentation("structure_factor").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/BraggEdges.python.cpp b/python/src/v2.0/tsl/BraggEdges.python.cpp new file mode 100644 index 000000000..4b77ce9b9 --- /dev/null +++ b/python/src/v2.0/tsl/BraggEdges.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/BraggEdges.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// BraggEdges wrapper +void wrapBraggEdges(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::BraggEdges; + + // create the component + python::class_ component( + module, + "BraggEdges", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("bragg_edge"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "bragg_edge", + python::overload_cast<>(&Component::BraggEdge), + Component::documentation("bragg_edge").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/BraggEnergy.python.cpp b/python/src/v2.0/tsl/BraggEnergy.python.cpp new file mode 100644 index 000000000..4c7ec4669 --- /dev/null +++ b/python/src/v2.0/tsl/BraggEnergy.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/BraggEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// BraggEnergy wrapper +void wrapBraggEnergy(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::BraggEnergy; + + // create the component + python::class_ component( + module, + "BraggEnergy", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::XYs1d & + >(), + python::arg("xys1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/CoherentAtomCrossSection.python.cpp b/python/src/v2.0/tsl/CoherentAtomCrossSection.python.cpp new file mode 100644 index 000000000..6b28d2e10 --- /dev/null +++ b/python/src/v2.0/tsl/CoherentAtomCrossSection.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/CoherentAtomCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// CoherentAtomCrossSection wrapper +void wrapCoherentAtomCrossSection(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::CoherentAtomCrossSection; + + // create the component + python::class_ component( + module, + "CoherentAtomCrossSection", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const Float64 & + >(), + python::arg("unit"), + python::arg("value"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/DebyeWallerIntegral.python.cpp b/python/src/v2.0/tsl/DebyeWallerIntegral.python.cpp new file mode 100644 index 000000000..d3a243c7e --- /dev/null +++ b/python/src/v2.0/tsl/DebyeWallerIntegral.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/DebyeWallerIntegral.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// DebyeWallerIntegral wrapper +void wrapDebyeWallerIntegral(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::DebyeWallerIntegral; + + // create the component + python::class_ component( + module, + "DebyeWallerIntegral", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::XYs1d & + >(), + python::arg("xys1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/DistinctScatteringKernel.python.cpp b/python/src/v2.0/tsl/DistinctScatteringKernel.python.cpp new file mode 100644 index 000000000..9b6f5fb69 --- /dev/null +++ b/python/src/v2.0/tsl/DistinctScatteringKernel.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/DistinctScatteringKernel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// DistinctScatteringKernel wrapper +void wrapDistinctScatteringKernel(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::DistinctScatteringKernel; + + // create the component + python::class_ component( + module, + "DistinctScatteringKernel", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("gridded3d") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "gridded3d", + python::overload_cast<>(&Component::gridded3d), + Component::documentation("gridded3d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/E_critical.python.cpp b/python/src/v2.0/tsl/E_critical.python.cpp new file mode 100644 index 000000000..7fbfee12e --- /dev/null +++ b/python/src/v2.0/tsl/E_critical.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/E_critical.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// E_critical wrapper +void wrapE_critical(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::E_critical; + + // create the component + python::class_ component( + module, + "E_critical", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("unit") = std::nullopt, + python::arg("value") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/E_max.python.cpp b/python/src/v2.0/tsl/E_max.python.cpp new file mode 100644 index 000000000..06d1cf6c8 --- /dev/null +++ b/python/src/v2.0/tsl/E_max.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/E_max.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// E_max wrapper +void wrapE_max(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::E_max; + + // create the component + python::class_ component( + module, + "E_max", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional & + >(), + python::arg("unit") = std::nullopt, + python::arg("value") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "unit", + &Component::unit, + Component::documentation("unit").data() + ) + .def_property_readonly( + "value", + &Component::value, + Component::documentation("value").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/PhononSpectrum.python.cpp b/python/src/v2.0/tsl/PhononSpectrum.python.cpp new file mode 100644 index 000000000..d9c14c30c --- /dev/null +++ b/python/src/v2.0/tsl/PhononSpectrum.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/PhononSpectrum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// PhononSpectrum wrapper +void wrapPhononSpectrum(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::PhononSpectrum; + + // create the component + python::class_ component( + module, + "PhononSpectrum", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::XYs1d & + >(), + python::arg("xys1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/S_table.python.cpp b/python/src/v2.0/tsl/S_table.python.cpp new file mode 100644 index 000000000..45954234e --- /dev/null +++ b/python/src/v2.0/tsl/S_table.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/S_table.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// S_table wrapper +void wrapS_table(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::S_table; + + // create the component + python::class_ component( + module, + "S_table", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::Gridded2d & + >(), + python::arg("gridded2d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "gridded2d", + python::overload_cast<>(&Component::gridded2d), + Component::documentation("gridded2d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/ScatteringAtom.python.cpp b/python/src/v2.0/tsl/ScatteringAtom.python.cpp new file mode 100644 index 000000000..f8781527e --- /dev/null +++ b/python/src/v2.0/tsl/ScatteringAtom.python.cpp @@ -0,0 +1,119 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/ScatteringAtom.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// ScatteringAtom wrapper +void wrapScatteringAtom(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::ScatteringAtom; + + // create the component + python::class_ component( + module, + "ScatteringAtom", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const Integer32 &, + const XMLName &, + const bool &, + const tsl::BoundAtomCrossSection &, + const std::optional &, + const std::optional &, + const std::optional &, + const tsl::E_max &, + const ambiguousNamespace::Mass &, + const tsl::SelfScatteringKernel & + >(), + python::arg("number_per_molecule"), + python::arg("pid"), + python::arg("primary_scatterer"), + python::arg("bound_atom_cross_section"), + python::arg("coherent_atom_cross_section") = std::nullopt, + python::arg("distinct_scattering_kernel") = std::nullopt, + python::arg("e_critical") = std::nullopt, + python::arg("e_max"), + python::arg("mass"), + python::arg("self_scattering_kernel"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "number_per_molecule", + &Component::numberPerMolecule, + Component::documentation("number_per_molecule").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + .def_property_readonly( + "primary_scatterer", + &Component::primaryScatterer, + Component::documentation("primary_scatterer").data() + ) + .def_property_readonly( + "bound_atom_cross_section", + python::overload_cast<>(&Component::boundAtomCrossSection), + Component::documentation("bound_atom_cross_section").data() + ) + .def_property_readonly( + "coherent_atom_cross_section", + python::overload_cast<>(&Component::coherentAtomCrossSection), + Component::documentation("coherent_atom_cross_section").data() + ) + .def_property_readonly( + "distinct_scattering_kernel", + python::overload_cast<>(&Component::distinctScatteringKernel), + Component::documentation("distinct_scattering_kernel").data() + ) + .def_property_readonly( + "e_critical", + python::overload_cast<>(&Component::e_critical), + Component::documentation("e_critical").data() + ) + .def_property_readonly( + "e_max", + python::overload_cast<>(&Component::e_max), + Component::documentation("e_max").data() + ) + .def_property_readonly( + "mass", + python::overload_cast<>(&Component::mass), + Component::documentation("mass").data() + ) + .def_property_readonly( + "self_scattering_kernel", + python::overload_cast<>(&Component::selfScatteringKernel), + Component::documentation("self_scattering_kernel").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/ScatteringAtoms.python.cpp b/python/src/v2.0/tsl/ScatteringAtoms.python.cpp new file mode 100644 index 000000000..af3eeefd7 --- /dev/null +++ b/python/src/v2.0/tsl/ScatteringAtoms.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/ScatteringAtoms.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// ScatteringAtoms wrapper +void wrapScatteringAtoms(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::ScatteringAtoms; + + // create the component + python::class_ component( + module, + "ScatteringAtoms", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::vector & + >(), + python::arg("scattering_atom"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "scattering_atom", + python::overload_cast<>(&Component::scatteringAtom), + Component::documentation("scattering_atom").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/SelfScatteringKernel.python.cpp b/python/src/v2.0/tsl/SelfScatteringKernel.python.cpp new file mode 100644 index 000000000..10c15ff62 --- /dev/null +++ b/python/src/v2.0/tsl/SelfScatteringKernel.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/SelfScatteringKernel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// SelfScatteringKernel wrapper +void wrapSelfScatteringKernel(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::SelfScatteringKernel; + using _t = std::variant< + containers::Gridded3d, + tsl::SelfScatteringKernelGaussianApproximation + >; + + // create the component + python::class_ component( + module, + "SelfScatteringKernel", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const std::optional &, + const _t & + >(), + python::arg("symmetric") = std::nullopt, + python::arg("self_scattering_kernel_sctapproximation") = std::nullopt, + python::arg("_gridded3dself_scattering_kernel_gaussian_approximation"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "symmetric", + &Component::symmetric, + Component::documentation("symmetric").data() + ) + .def_property_readonly( + "self_scattering_kernel_sctapproximation", + python::overload_cast<>(&Component::selfScatteringKernelSCTApproximation), + Component::documentation("self_scattering_kernel_sctapproximation").data() + ) + .def_property_readonly( + "gridded3d", + python::overload_cast<>(&Component::gridded3d), + Component::documentation("gridded3d").data() + ) + .def_property_readonly( + "self_scattering_kernel_gaussian_approximation", + python::overload_cast<>(&Component::selfScatteringKernelGaussianApproximation), + Component::documentation("self_scattering_kernel_gaussian_approximation").data() + ) + .def_property_readonly( + "_gridded3dself_scattering_kernel_gaussian_approximation", + python::overload_cast<>(&Component::_gridded3dselfScatteringKernelGaussianApproximation), + Component::documentation("_gridded3dself_scattering_kernel_gaussian_approximation").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/SelfScatteringKernelGaussianApproximation.python.cpp b/python/src/v2.0/tsl/SelfScatteringKernelGaussianApproximation.python.cpp new file mode 100644 index 000000000..f6aead58a --- /dev/null +++ b/python/src/v2.0/tsl/SelfScatteringKernelGaussianApproximation.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/SelfScatteringKernelGaussianApproximation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// SelfScatteringKernelGaussianApproximation wrapper +void wrapSelfScatteringKernelGaussianApproximation(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::SelfScatteringKernelGaussianApproximation; + + // create the component + python::class_ component( + module, + "SelfScatteringKernelGaussianApproximation", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("phonon_spectrum") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "phonon_spectrum", + python::overload_cast<>(&Component::phononSpectrum), + Component::documentation("phonon_spectrum").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/SelfScatteringKernelSCTApproximation.python.cpp b/python/src/v2.0/tsl/SelfScatteringKernelSCTApproximation.python.cpp new file mode 100644 index 000000000..a12063e2d --- /dev/null +++ b/python/src/v2.0/tsl/SelfScatteringKernelSCTApproximation.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/SelfScatteringKernelSCTApproximation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// SelfScatteringKernelSCTApproximation wrapper +void wrapSelfScatteringKernelSCTApproximation(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::SelfScatteringKernelSCTApproximation; + + // create the component + python::class_ component( + module, + "SelfScatteringKernelSCTApproximation", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional & + >(), + python::arg("t_effective") = std::nullopt, + Component::documentation("constructor").data() + ) + .def_property_readonly( + "t_effective", + python::overload_cast<>(&Component::T_effective), + Component::documentation("t_effective").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/StructureFactor.python.cpp b/python/src/v2.0/tsl/StructureFactor.python.cpp new file mode 100644 index 000000000..df7c26894 --- /dev/null +++ b/python/src/v2.0/tsl/StructureFactor.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/StructureFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// StructureFactor wrapper +void wrapStructureFactor(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::StructureFactor; + + // create the component + python::class_ component( + module, + "StructureFactor", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::XYs1d & + >(), + python::arg("xys1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/T_effective.python.cpp b/python/src/v2.0/tsl/T_effective.python.cpp new file mode 100644 index 000000000..a39fdc9fd --- /dev/null +++ b/python/src/v2.0/tsl/T_effective.python.cpp @@ -0,0 +1,56 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/T_effective.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// T_effective wrapper +void wrapT_effective(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::T_effective; + + // create the component + python::class_ component( + module, + "T_effective", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const containers::XYs1d & + >(), + python::arg("xys1d"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "xys1d", + python::overload_cast<>(&Component::XYs1d), + Component::documentation("xys1d").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/ThermalNeutronScatteringLaw.python.cpp b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw.python.cpp new file mode 100644 index 000000000..6ad6cf54b --- /dev/null +++ b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/ThermalNeutronScatteringLaw.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// ThermalNeutronScatteringLaw wrapper +void wrapThermalNeutronScatteringLaw(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::ThermalNeutronScatteringLaw; + + // create the component + python::class_ component( + module, + "ThermalNeutronScatteringLaw", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName & + >(), + python::arg("href"), + python::arg("label"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.python.cpp b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.python.cpp new file mode 100644 index 000000000..551de2d7d --- /dev/null +++ b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.python.cpp @@ -0,0 +1,63 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/ThermalNeutronScatteringLaw1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// ThermalNeutronScatteringLaw1d wrapper +void wrapThermalNeutronScatteringLaw1d(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::ThermalNeutronScatteringLaw1d; + + // create the component + python::class_ component( + module, + "ThermalNeutronScatteringLaw1d", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName & + >(), + python::arg("href"), + python::arg("label"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "href", + &Component::href, + Component::documentation("href").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.python.cpp b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.python.cpp new file mode 100644 index 000000000..7589dd4f1 --- /dev/null +++ b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// ThermalNeutronScatteringLaw_coherentElastic wrapper +void wrapThermalNeutronScatteringLaw_coherentElastic(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::ThermalNeutronScatteringLaw_coherentElastic; + using _t = std::variant< + tsl::BraggEdges, + tsl::S_table + >; + + // create the component + python::class_ component( + module, + "ThermalNeutronScatteringLaw_coherentElastic", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const enums::Frame &, + const _t & + >(), + python::arg("label"), + python::arg("pid"), + python::arg("product_frame"), + python::arg("_bragg_edges_s_table"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "bragg_edges", + python::overload_cast<>(&Component::BraggEdges), + Component::documentation("bragg_edges").data() + ) + .def_property_readonly( + "s_table", + python::overload_cast<>(&Component::S_table), + Component::documentation("s_table").data() + ) + .def_property_readonly( + "_bragg_edges_s_table", + python::overload_cast<>(&Component::_BraggEdgesS_table), + Component::documentation("_bragg_edges_s_table").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp new file mode 100644 index 000000000..54b3b5af3 --- /dev/null +++ b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp @@ -0,0 +1,84 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// ThermalNeutronScatteringLaw_incoherentElastic wrapper +void wrapThermalNeutronScatteringLaw_incoherentElastic(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::ThermalNeutronScatteringLaw_incoherentElastic; + + // create the component + python::class_ component( + module, + "ThermalNeutronScatteringLaw_incoherentElastic", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const XMLName &, + const XMLName &, + const enums::Frame &, + const tsl::DebyeWallerIntegral &, + const tsl::BoundAtomCrossSection & + >(), + python::arg("label"), + python::arg("pid"), + python::arg("product_frame"), + python::arg("debye_waller_integral"), + python::arg("bound_atom_cross_section"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "debye_waller_integral", + python::overload_cast<>(&Component::DebyeWallerIntegral), + Component::documentation("debye_waller_integral").data() + ) + .def_property_readonly( + "bound_atom_cross_section", + python::overload_cast<>(&Component::boundAtomCrossSection), + Component::documentation("bound_atom_cross_section").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp new file mode 100644 index 000000000..01fe70507 --- /dev/null +++ b/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "GNDStk/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace python = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// ThermalNeutronScatteringLaw_incoherentInelastic wrapper +void wrapThermalNeutronScatteringLaw_incoherentInelastic(python::module &module) +{ + using namespace njoy::GNDStk; + using namespace njoy::GNDStk::v2_0; + + // type aliases + using Component = tsl::ThermalNeutronScatteringLaw_incoherentInelastic; + + // create the component + python::class_ component( + module, + "ThermalNeutronScatteringLaw_incoherentInelastic", + Component::documentation().data() + ); + + // wrap the component + component + .def( + python::init< + const std::optional &, + const XMLName &, + const XMLName &, + const XMLName &, + const enums::Frame &, + const tsl::ScatteringAtoms & + >(), + python::arg("incoherent_approximation") = std::nullopt, + python::arg("label"), + python::arg("pid"), + python::arg("primary_scatterer"), + python::arg("product_frame"), + python::arg("scattering_atoms"), + Component::documentation("constructor").data() + ) + .def_property_readonly( + "incoherent_approximation", + [](const Component &self) { return self.incoherentApproximation().value(); }, + Component::documentation("incoherent_approximation").data() + ) + .def_property_readonly( + "label", + &Component::label, + Component::documentation("label").data() + ) + .def_property_readonly( + "pid", + &Component::pid, + Component::documentation("pid").data() + ) + .def_property_readonly( + "primary_scatterer", + &Component::primaryScatterer, + Component::documentation("primary_scatterer").data() + ) + .def_property_readonly( + "product_frame", + &Component::productFrame, + Component::documentation("product_frame").data() + ) + .def_property_readonly( + "scattering_atoms", + python::overload_cast<>(&Component::scatteringAtoms), + Component::documentation("scattering_atoms").data() + ) + ; + + // add standard component definitions + addStandardComponentDefinitions< Component >( component ); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/python/test/Test_GNDStk_BoundaryCondition.py b/python/test/Test_GNDStk_BoundaryCondition.py new file mode 100644 index 000000000..7e9467ba0 --- /dev/null +++ b/python/test/Test_GNDStk_BoundaryCondition.py @@ -0,0 +1,64 @@ +# standard imports +import unittest + +# third party imports + +# local imports +from GNDStk 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_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/src/GNDStk.hpp b/src/GNDStk.hpp index c665be5ae..181dfe9ea 100644 --- a/src/GNDStk.hpp +++ b/src/GNDStk.hpp @@ -1,22 +1,35 @@ -#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" #include "Log.hpp" +#include +#include + +// OpenMP +#ifdef _OPENMP +#include +#endif -// ------------------------ +// ----------------------------------------------------------------------------- // C++ #includes -// ------------------------ +// ----------------------------------------------------------------------------- // miscellaneous #include +#include #include #include #ifdef GNDSTK_PRECISION @@ -26,6 +39,8 @@ #include #include #include +#include +#include #include #include #include @@ -48,97 +63,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" -// 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..b1ee29033 --- /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 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); } + +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) +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/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..d018a58d2 --- /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(); + } 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..b00ffac9f 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) + 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..34740c9f1 --- /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..012bdc644 --- /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 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 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 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..ae8bb8ff1 --- /dev/null +++ b/src/GNDStk/Component/src/detail-getter.hpp @@ -0,0 +1,368 @@ + +namespace detail { + +/* +Contents: + 1. compGetter(variant) + 2. compGetter (vector, Lookup exists/void) + 3. compGetter (vector, Lookup exists/TYPE) + 4. compGetter (vector, Lookup get/void) + 5. compGetter (vector, Lookup get/TYPE) + 6. compGetter(vector, Lookup) + 7. 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 +template +struct firstOrOnly { + using type = T; +}; + +// for variant +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(variant) +// Returns: const T * +// ----------------------------------------------------------------------------- + +template>> +const T *compGetter(const std::variant &var) +{ + return std::get_if(&var); +} + + +// ----------------------------------------------------------------------------- +// 2. +// compGetter(vector, Lookup exists/void, names) +// Returns: bool +// ----------------------------------------------------------------------------- + +template +bool compGetter( + const std::vector &, + const Lookup &, + const std::string &, const std::string &, const std::string & +) { + return has_field::value; +} + + +// ----------------------------------------------------------------------------- +// 3. +// compGetter(vector, Lookup exists/TYPE, names) +// Returns: bool +// ----------------------------------------------------------------------------- + +template< + class T, class EXTRACTOR, class TYPE, class CONVERTER, + class = std::enable_if_t::value> +> +bool 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 : ""; + + 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; +} + + +// ----------------------------------------------------------------------------- +// 4. +// compGetter(vector, Lookup get/void, 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; +} + + +// ----------------------------------------------------------------------------- +// 5. +// compGetter(vector, Lookup get/TYPE, 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(0)) + 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; + } +} + + +// ----------------------------------------------------------------------------- +// 6. +// 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 compGetter(compGetter(vecvar, look, nname, cname, fname)); + } catch (...) { + // context + log::member( + "compGetter {}::{}.{}({}) on vector", + nname, cname, fname, quote(look.value)); + throw; + } +} + + +// ----------------------------------------------------------------------------- +// 7. +// 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..3024c4c3e --- /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 value_type = T; +}; + +// for std::optional +template +struct isVectorOrOptionalVector>> + : public std::true_type +{ + using value_type = 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..b841b831a 100644 --- a/src/GNDStk/Component/src/detail.hpp +++ b/src/GNDStk/Component/src/detail.hpp @@ -1,789 +1,515 @@ -// 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 -) { - return (nsname == "" ? "" : nsname + "::") + clname; -} - - -// ------------------------ -// indentString -// ------------------------ - -inline void indentString( - std::ostream &os, const int level, const std::string &str = "" + const std::string &nname, // name of namespace + const std::string &cname // name of class ) { - os << std::string(GNDStk::indent * level,' ') << str; + return (nname == "" ? "" : nname + "::") + cname; } -// ------------------------ -// 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. + std::conditional_t,T,int> min, max; + if constexpr (std::is_arithmetic_v) + if (shades) { + min = max = vec[0]; // vec.size() == 0 was ruled out above + for (size_t i = 1; i < size; ++i) { + min = std::min(min,vec[i]); + max = std::max(max,vec[i]); + } + } + + // 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 -// ------------------------ - -// 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" - ); + convert_t{}(value,str); - 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 +553,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 +562,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 +574,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..355e7dc55 --- /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 + // ------------------------ + + // With no arguments. + // Relates to std::optional, not to the question of what metadata or metadata + // values the present Field might contain. (See the other has() functions for + // that.) Returns true iff either T is optional but has a value, or isn't + // optional (so that it necessarily has a value). + bool has() const + { + if constexpr (detail::isOptional) + return wrappedValue.has_value(); + return true; + } + + // With one argument. + // Forwards to operator[](const KEY &key) const, below, essentially to + // provide an alternative form of a "has" query. Instead of, for example, + // H.isotope[has(mass_number(2))] + // to inquire about whether element H's vector of isotopes has an isotope + // with a mass number of 2, we can instead write: + // H.isotope.has(mass_number(2)) + // to make exactly the same query. (The example assumes that H is of a + // class - say, Element - that contains a vector of isotopes, and that + // the Isotope class contains an integer metadatum called mass_number.) + // Note: the SFINAE is such that this function is enabled iff a call to + // operator[](Lookup) of the present class would be valid, and return bool. + template + auto has(const KEY &look) const -> std::enable_if_t< + std::is_same_v, bool + > { + return (*this)[GNDStk::has(look)]; + } + + // ------------------------ + // 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); + } + + // ------------------------ + // operator() + // ------------------------ + + // () + // Get exactly the Field-wrapped value, whatever it is (including optional) + const T &operator()() const { return wrappedValue; } // const + T &operator()() { return wrappedValue; } // non-const + + // ------------------------ + // operator[](Lookup) + // ------------------------ + + // If T == [optional] vector + + // [Lookup], including Lookup +// zzz actually the following REQUIRE (don't just include) Lookup + template< + class EXTRACTOR, class TYPE, class CONVERTER, + class TEE = T, class = detail::isVectorOrOptionalVector_t> + bool + operator[](const Lookup &look) const // const + { + return parent.getter(wrappedValue,look); + } + + template< + class EXTRACTOR, class TYPE, class CONVERTER, + class TEE = T, class = detail::isVectorOrOptionalVector_t> + bool + operator[](const Lookup &look) // non-const + { + return parent.getter(wrappedValue,look); + } + + // zzz working here + + // [Lookup], including Lookup + template< + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER, + class TEE = T, class = detail::isVectorOrOptionalVector_t, + class = std::enable_if_t< + detail::has_field::value + > + > + decltype(auto) + operator[](const Lookup &look) const // const + { + return parent.getter(wrappedValue,look); + } + + template< + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER, + class TEE = T, class = detail::isVectorOrOptionalVector_t, + class = std::enable_if_t< + detail::has_field::value + > + > + decltype(auto) + operator[](const Lookup &look) // non-const + { + return parent.getter(wrappedValue,look); + } + + // ------------------------ + // operator[](size_t) + // ------------------------ + + // If T == [optional] vector + + template> + decltype(auto) operator[](const size_t index) const // const + { + if constexpr (detail::isOptional) + return (*wrappedValue)[index]; + else + return wrappedValue[index]; + } + + template> + decltype(auto) operator[](const size_t index) // non-const + { + if constexpr (detail::isOptional) + return (*wrappedValue)[index]; + else + return wrappedValue[index]; + } + + // ------------------------ + // 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(); + } + + // ------------------------ + // Conversions + // ------------------------ + + // 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::value_type &element + ) { + return Component::setter(wrappedValue,element), *this; + } + + // operator+=(element) + // Same as add(element) + template> + Field &operator+=( + const typename detail::isVectorOrOptionalVector::value_type &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..e5d6cba66 --- /dev/null +++ b/src/GNDStk/Component/src/fieldPart.hpp @@ -0,0 +1,323 @@ + +// ----------------------------------------------------------------------------- +// FieldPart +// As with class Field, this is intentionally defined within class Component. +// ----------------------------------------------------------------------------- + +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) + { } + + // ------------------------ + // Getters: + // If WHOLE == variant + // ------------------------ + + // ptr() + // Get as PART * + template> + const PART *ptr() const + { + return whole.parent.template getter(whole()); + } + + template> + PART *ptr() + { + return whole.parent.template getter(whole()); + } + + // ref() + // Get as PART & + 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{}; + } + + template> + PART &ref() + { + return const_cast(std::as_const(*this).template ref()); + } + + // opt() + // Makes a std::optional. So, we must return by value, + // and then only the const version is needed. + template> + const std::optional opt() const + { + const PART *const p = ptr(); + return p ? std::optional{*p} : std::optional{}; + } + + // operator() + // Get as PART & + template> + const PART &operator()() const + { + try { + return ref(); + } catch (...) { + log::member("FieldPart::operator()"); + throw; + } + } + + template> + PART &operator()() + { + return const_cast(std::as_const(*this)()); + } + + // ------------------------ + // Conversions + // If WHOLE == variant + // ------------------------ + + // To PART * + template> + operator const PART *() const { return ptr(); } + + template> + operator PART *() { return ptr(); } + + // To PART & + template> + operator const PART &() const + { + try { + return ref(); + } catch (...) { + log::member("FieldPart:: conversion to variant alternative"); + throw; + } + } + + template> + operator PART &() + { + return const_cast(std::as_const(*this).operator const PART &()); + } + + // To std::optional + template> + operator std::optional() const { return opt(); } + + // ------------------------ + // has + // Similar to Field's + // ------------------------ + + /* + // todo I'm not sure that this would have a clear meaning for FieldPart. + // For Field, it means whether or not a value exists - either it's not + // optional, or is optional but has a value. Here, that meaning could be + // confused with the concept of whether or not the variant contains the + // part represented by this FieldPart. Think about this. + + // has() + bool has() const + { + if constexpr (detail::isOptional) + return wrappedValue.has_value(); + else + return true; + } + */ + + // has(key) + template + auto has(const KEY &look) const -> std::enable_if_t< + std::is_same_v, bool + > { + return (*this)[GNDStk::has(look)]; + } + + // ------------------------ + // 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{}; + } + + // [Lookup] + template< + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER, + class T = WHOLE, class = detail::isVector_t> + decltype(auto) + operator[](const Lookup &look) const // 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]; + } + } + + template< + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER, + class T = WHOLE, class = detail::isVector_t> + decltype(auto) + operator[](const Lookup &look) // non-const + { + if constexpr ( + detail::isLookupRefReturn_v> + ) { + // a reference + return const_cast(std::as_const(*this)(look)); + } else { + // bool, or by-value vector + return whole[look]; + } + } + + // If T == vector + // size() + template< + class T = WHOLE, class = detail::isVector_t> + size_t size() const + { + return whole.size(); + } + + // ------------------------ + // Setters + // Using std::optional + // ------------------------ + + // If WHOLE == variant + // replace(value) + template> + DERIVED &replace(const std::optional &opt) + { + if (opt) whole = opt.value(); + return whole.parent; + } + + // 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; + } + + // operator+=(value) + template> + DERIVED &operator+=(const std::optional &opt) + { + return add(opt); + } + + // If WHOLE == vector + // replace(Lookup,element) + template< + class KEY, class = detail::isLookupRefReturn_t, + class T = WHOLE, class = detail::isVector_t> + DERIVED &replace(const KEY &look, const std::optional &opt) + { + if (opt) whole[look] = opt.value(); + return whole.parent; + } + + // ------------------------ + // 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..c78058d18 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 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..a4cef691c 100644 --- a/src/GNDStk/Component/src/getter.hpp +++ b/src/GNDStk/Component/src/getter.hpp @@ -1,117 +1,104 @@ -// 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(variant) +// The caller must specify T // ----------------------------------------------------------------------------- // const -template // KEY: for index or label -const auto &getter( - const FIELD &field, - const KEY &key, - const std::string &fieldName -) const { - return detail::getter( - field, key, - DERIVED::namespaceName(), DERIVED::className(), fieldName - ); +template< + class T, class... Ts, class = std::enable_if_t> +> +const T *getter(const std::variant &var) const +{ + return detail::compGetter(var); } // non-const -template -auto &getter( - FIELD &field, - const KEY &key, - const std::string &fieldName -) { - return detail::getter( - field, key, - DERIVED::namespaceName(), DERIVED::className(), fieldName - ); +template< + class T, class... Ts, class = std::enable_if_t> +> +T *getter(std::variant &var) +{ + return const_cast(std::as_const(*this).template getter(var)); } // ----------------------------------------------------------------------------- -// (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. +// 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 -const RETURN *getter( - const std::variant &var, - 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( - var, - DERIVED::namespaceName(), DERIVED::className(), fieldName - ); + return detail::compGetter(vec, key, Namespace(), Class(), fieldName); } // non-const -template -RETURN *getter( - std::variant &var, - 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 const_cast( - std::as_const(*this).template - getter(std::as_const(var), fieldName) - ); + using RETURN = decltype( + std::as_const(*this).template getter(vec, key, 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..4435f031f --- /dev/null +++ b/src/GNDStk/Component/src/has.hpp @@ -0,0 +1,40 @@ + +// Note that some of these are usable in constexpr ifs. + +// constexpr, static +// 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; +} + +// constexpr, static +// 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. +template< + class EXTRACTOR, class TYPE, class CONVERTER, LookupMode GET, + class = std::enable_if_t> +static constexpr bool +has(const Lookup &) +{ + return false; +} + +// non-constexpr, non-static +// 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 &from) const +{ + return from.extractor(derived()) == from.value; +} 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..766bee044 --- /dev/null +++ b/src/GNDStk/Component/src/print.hpp @@ -0,0 +1,332 @@ + +// ----------------------------------------------------------------------------- +// 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 +std::ostream &json(std::ostream &os = std::cout, const bool decl = false) const +{ + return write(os,"json",decl) << std::endl, os; +} + +// hdf5 +std::ostream &hdf5(std::ostream &os = std::cout, const bool decl = false) const +{ + return write(os,"hdf5",decl) << std::endl, os; +} + +// 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 +std::ostream &json(const bool decl, std::ostream &os = std::cout) const +{ + return json(os,decl); +} + +// hdf5 +std::ostream &hdf5(const bool decl, std::ostream &os = std::cout) const +{ + return hdf5(os,decl); +} + +// 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..44864033b 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; @@ -187,14 +208,14 @@ SCENARIO("Testing GNDStk Component") { der << "{" " \"data\": {" - " \"attributes\": {" + " \"#metadata\": {" " \"foo\": \"12\"," " \"bar\": \"34.56\"" " }" " }" "}"; - // write & check + // print, check THEN("The result is as expected") { std::ostringstream oss; oss << der; 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..a2aa58ee0 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" + " } // label"; + const std::string expected2 = + " {\n" " foo : 56\n" " bar : 7.8\n" - " } // Derived"; + " }"; 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..a47966d75 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,70 +61,51 @@ 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... XML(*this).write(os,decl); @@ -136,10 +114,14 @@ std::ostream &write( 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{}; + 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..f3048543c 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) +explicit Tree(const XML &x) : Node("/") { try { if (!convert(x,*this)) @@ -40,7 +42,7 @@ explicit Tree(const XML &x) } // JSON -explicit Tree(const JSON &j) +explicit Tree(const JSON &j) : Node("/") { try { if (!convert(j,*this)) @@ -51,6 +53,18 @@ explicit Tree(const JSON &j) } } +// HDF5 +explicit Tree(const HDF5 &h) : Node("/") +{ + try { + if (!convert(h,*this)) + throw std::exception{}; + } catch (...) { + log::ctor("Tree(HDF5)"); + throw; + } +} + // ----------------------------------------------------------------------------- @@ -58,32 +72,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 +110,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 +127,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 +152,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 +172,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 +190,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..406a22d20 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; /* @@ -125,7 +126,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 +140,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 +150,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 +166,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 +180,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 +190,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 +206,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..3b9727c4c 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,13 +101,13 @@ 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); } // ------------------------ @@ -116,13 +117,13 @@ SCENARIO("Testing GNDStk tree read() and operator>>") { 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 +131,21 @@ 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); } } // 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 +170,76 @@ 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); + 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); } 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); + 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); } 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 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); } 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 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); } } } 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..97f480785 100644 --- a/src/GNDStk/Tree/test/write.test.cpp +++ b/src/GNDStk/Tree/test/write.test.cpp @@ -6,17 +6,16 @@ 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 = @@ -25,7 +24,7 @@ R"***(null)***"; // ----------------------------------------------------------------------------- -// 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 +33,8 @@ R"***(null)***"; // ------------------------ static const std::string string_real_tree = -R"***(: - xml: +R"***(/: + #xml: version: 1.0 encoding: UTF-8 covarianceSuite: @@ -77,8 +76,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 +110,7 @@ R"***( - -)***"; +)***"; @@ -123,7 +121,7 @@ R"***( static const std::string string_real_json = R"***({ "covarianceSuite": { - "attributes": { + "#metadata": { "evaluation": "ENDF/B-8.0", "format": "1.9", "projectile": "n", @@ -131,7 +129,7 @@ R"***({ }, "externalFiles": { "externalFile": { - "attributes": { + "#metadata": { "label": "reactions", "path": "n-069_Tm_170.xml" } @@ -139,30 +137,30 @@ 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": { + "#metadata": { "href": "$reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']/resonanceParameters/table", "label": "resonanceParameters", "nParameters": "78" @@ -171,7 +169,7 @@ R"***({ } }, "rowData": { - "attributes": { + "#metadata": { "href": "$reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']" } } @@ -179,21 +177,21 @@ R"***({ }, "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" } @@ -221,31 +219,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: \"\")") { @@ -302,44 +300,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 +347,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); } @@ -373,12 +371,16 @@ SCENARIO("Testing GNDStk tree write() and operator<<") { 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); } } 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..a8a9391cb 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,12 @@ XML(const XML &x) } } -// JSON + +// ------------------------ +// From other classes +// ------------------------ + +// From JSON explicit XML(const JSON &j) { try { @@ -34,50 +44,55 @@ explicit XML(const JSON &j) } } -// Node -explicit XML(const Node &n) +// From 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; } } -// 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..c630022ac 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); } @@ -133,7 +132,7 @@ SCENARIO("Testing GNDStk XML") { } } - // 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..375266f9e --- /dev/null +++ b/src/GNDStk/convert/src/HDF5.hpp @@ -0,0 +1,141 @@ + +// ----------------------------------------------------------------------------- +// Node ==> HDF5 +// ----------------------------------------------------------------------------- + +inline bool convert(const Node &node, HDF5 &h, const std::string &name) +{ + static const std::string context = "convert(Node,HDF5)"; + + // clear + 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; + } + + // done + return true; +} + + +// ----------------------------------------------------------------------------- +// HDF5 ==> HDF5 +// For completeness +// ----------------------------------------------------------------------------- + +inline bool convert(const HDF5 &from, HDF5 &to) +{ + // same object? + if (&to == &from) + return true; + + // clear + 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; +} + + +// ----------------------------------------------------------------------------- +// XML ==> HDF5 +// JSON ==> HDF5 +// As with our convert()s to XML, these go through temporaries. +// ----------------------------------------------------------------------------- + +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; + } +} + +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; + } +} diff --git a/src/GNDStk/convert/src/JSON.hpp b/src/GNDStk/convert/src/JSON.hpp index 20257eb03..3b99c6b20 100644 --- a/src/GNDStk/convert/src/JSON.hpp +++ b/src/GNDStk/convert/src/JSON.hpp @@ -1,78 +1,49 @@ -// ----------------------------------------------------------------------------- -// convert(*,JSON) -// That is, convert to JSON objects -// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- // Node ==> JSON // ----------------------------------------------------------------------------- inline bool convert(const Node &node, JSON &j) { + static const std::string context = "convert(Node,JSON)"; + // clear j.clear(); - // See comments for convert(Node,XML); smiilar ones apply here, except - // that JSON files don't have declaration nodes. - - 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; } @@ -81,68 +52,61 @@ inline bool convert(const Node &node, JSON &j) } - // ----------------------------------------------------------------------------- -// Tree ==> JSON +// JSON ==> JSON +// For completeness // ----------------------------------------------------------------------------- -inline bool convert(const Tree &tree, JSON &j) +inline bool convert(const JSON &from, JSON &to) { + // same object? + if (&to == &from) + return true; + + // clear + 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; +} // ----------------------------------------------------------------------------- -// 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. 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) +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; } diff --git a/src/GNDStk/convert/src/Node.hpp b/src/GNDStk/convert/src/Node.hpp new file mode 100644 index 000000000..d90a27fdc --- /dev/null +++ b/src/GNDStk/convert/src/Node.hpp @@ -0,0 +1,205 @@ + +// ----------------------------------------------------------------------------- +// 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) +{ + 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("convert(JSON,Node)"); + throw; + } +} + + + +// ----------------------------------------------------------------------------- +// 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) +{ + const bool decl = detail::getDecl(node,DECL); + + // ------------------------ + // bookkeeping + // ------------------------ + + // 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("convert(HDF5,Node)"); + throw; + } +} diff --git a/src/GNDStk/convert/src/XML.hpp b/src/GNDStk/convert/src/XML.hpp index cb3e90592..cc4025b83 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) { + static const std::string context = "convert(Node,XML)"; + // clear 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,72 @@ inline bool convert(const Tree &tree, XML &x) inline bool convert(const XML &from, XML &to) { + // same object? if (&to == &from) return true; // clear 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. 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; } } + +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; + } +} diff --git a/src/GNDStk/convert/src/detail-hdf52node.hpp b/src/GNDStk/convert/src/detail-hdf52node.hpp new file mode 100644 index 000000000..aa3b6c4ce --- /dev/null +++ b/src/GNDStk/convert/src/detail-hdf52node.hpp @@ -0,0 +1,346 @@ + +// 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; +} diff --git a/src/GNDStk/convert/src/detail-json2node.hpp b/src/GNDStk/convert/src/detail-json2node.hpp new file mode 100644 index 000000000..6ca90f16f --- /dev/null +++ b/src/GNDStk/convert/src/detail-json2node.hpp @@ -0,0 +1,170 @@ + +// 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 orderedJSON &, NODE &, const bool inferNodeName = false); + + +// ----------------------------------------------------------------------------- +// json_array +// ----------------------------------------------------------------------------- + +inline std::string json_array(const orderedJSON &array) +{ + assert(array.is_array()); + + std::ostringstream oss; + size_t count = 0; + + for (const orderedJSON &element : array) { + // separator + oss << (count++ ? " " : ""); + // array element types we use + element.is_number_integer () ? (oss << element.get()) + : element.is_number_unsigned() ? (oss << element.get()) + : element.is_number_float () ? (oss << element.get()) + : element.is_string () ? (oss << element.get()) + : // unexpected + (json2node_error("JSON array element is of unexpected type"), oss); + } + + return oss.str(); +} + + +// ----------------------------------------------------------------------------- +// json_pair +// ----------------------------------------------------------------------------- + +template +void json_pair( + const std::string &key, const orderedJSON &val, + const orderedJSON &peers, NODE &node +) { + if (val.is_null()) { + // null; nothing to do + } else if (val.is_boolean()) { + // boolean + node.add(key, val.get() ? "true" : "false"); + } else if (val.is_number_integer()) { + // number: integer + node.add(key, val.get()); + } else if (val.is_number_unsigned()) { + // number: unsigned + node.add(key, val.get()); + } else if (val.is_number_float()) { + // number: double + node.add(key, val.get()); + } else if (val.is_string()) { + // string + node.add(key, val.get()); + } else if (val.is_array()) { + // array + if (peers.size() == 0) + node.add(key, json_array(val)); // context is such that it's metadata + else { + node.add(special::data).add(special::text, json_array(val)); + for (const auto &peer : peers.items()) { + if (peer.key() == key + special::nodename) + node.name = peer.value().get(); + if (peer.key() == key + special::metadata) { + for (const auto &m : peer.value().items()) + json_pair(m.key(), m.value(), orderedJSON{}, node); + } + } + } + } else if (val.is_object()) { + // object + try { + json2node(val,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 orderedJSON &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.items()) { + const std::string &key = pair.key(); + const orderedJSON &val = pair.value(); + + 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.items()) + json_pair(m.key(), m.value(), orderedJSON{}, 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.is_object()) { + try { + json2node(val, node.add(key)); + } catch (...) { + log::function("json2node()"); + throw; + } + } else { + beginsin(key,special::data) + ? node.add(special::data ) + .add(special::text, json_array(val)) + : 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.items() + // to process "foo*" where * is either of the relevant suffixes. + } else { + // Normal key + json_pair(key, val, object, node.add(key)); + } + } // key/value pairs +} diff --git a/src/GNDStk/convert/src/detail-node2hdf5.hpp b/src/GNDStk/convert/src/detail-node2hdf5.hpp new file mode 100644 index 000000000..e09a5d53a --- /dev/null +++ b/src/GNDStk/convert/src/detail-node2hdf5.hpp @@ -0,0 +1,369 @@ + +// ----------------------------------------------------------------------------- +// 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; +} diff --git a/src/GNDStk/convert/src/detail-node2json.hpp b/src/GNDStk/convert/src/detail-node2json.hpp new file mode 100644 index 000000000..a388239e7 --- /dev/null +++ b/src/GNDStk/convert/src/detail-node2json.hpp @@ -0,0 +1,465 @@ + +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +// ------------------------ +// scalar2Value +// vector2Value +// ------------------------ + +// scalar2Value +template +void scalar2Value( + const std::string &key, const std::string &value, + orderedJSON &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. + // + // 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, + orderedJSON &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, + orderedJSON &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, orderedJSON &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, orderedJSON &json) +{ + for (const auto &meta : node.metadata) + json[meta.first] = meta.second; +} + + +// ------------------------ +// meta2json +// ------------------------ + +template +void meta2json( + const NODE &node, orderedJSON &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]) + : meta2json_plain(node, json[prefix + special::metadata]); +} + + +// ----------------------------------------------------------------------------- +// json_reduce_* +// ----------------------------------------------------------------------------- + +// ------------------------ +// json_reduce_cdata_comment +// ------------------------ + +// Simplify certain #cdata and #comment cases. +template +bool json_reduce_cdata_comment( + const NODE &node, orderedJSON &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, orderedJSON &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, orderedJSON &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, orderedJSON &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 orderedJSON, in parameter j, for metadata and children + orderedJSON &json = j[nameSuffixed]; + + // 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; +} 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/enums.hpp b/src/GNDStk/enums.hpp index 57e9f4071..c6f968733 100644 --- a/src/GNDStk/enums.hpp +++ b/src/GNDStk/enums.hpp @@ -1,12 +1,21 @@ #include "GNDStk/enums/enumeration.hpp" -// general -#include "GNDStk/enums/Encoding.hpp" +#include "GNDStk/enums/DateType.hpp" +#include "GNDStk/enums/ContributorType.hpp" +#include "GNDStk/enums/RelationType.hpp" +#include "GNDStk/enums/Parity.hpp" #include "GNDStk/enums/Frame.hpp" +#include "GNDStk/enums/Interpolation.hpp" +#include "GNDStk/enums/InterpolationQualifier.hpp" +#include "GNDStk/enums/HashAlgorithm.hpp" +#include "GNDStk/enums/DecayType.hpp" #include "GNDStk/enums/GridStyle.hpp" +#include "GNDStk/enums/BoundaryCondition.hpp" #include "GNDStk/enums/Interaction.hpp" -#include "GNDStk/enums/Interpolation.hpp" + +// general +#include "GNDStk/enums/Encoding.hpp" #include "GNDStk/enums/StorageOrder.hpp" // units-specific diff --git a/src/GNDStk/enums/BoundaryCondition.hpp b/src/GNDStk/enums/BoundaryCondition.hpp new file mode 100644 index 000000000..69e8679ed --- /dev/null +++ b/src/GNDStk/enums/BoundaryCondition.hpp @@ -0,0 +1,58 @@ +#ifndef NJOY_GNDSTK_BOUNDARYCONDITION +#define NJOY_GNDSTK_BOUNDARYCONDITION + +namespace 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 isSymbol< BoundaryCondition >( string ); + } + + /** + * @brief Template specialisation to convert BoundaryCondition to/from strings + */ + template <> + class Map< GNDStk::enums::BoundaryCondition > { + public: + + static inline const std::map< GNDStk::enums::BoundaryCondition, + const std::string > values{ + + { GNDStk::enums::BoundaryCondition::EliminateShiftFunction, "EliminateShiftFunction" }, + { GNDStk::enums::BoundaryCondition::NegativeOrbitalMomentum, "NegativeOrbitalMomentum" }, + { GNDStk::enums::BoundaryCondition::Brune, "Brune" }, + { GNDStk::enums::BoundaryCondition::Given, "Given" } + }; + + static inline const std::map< const std::string, + GNDStk::enums::BoundaryCondition > symbols{ + + { "EliminateShiftFunction", GNDStk::enums::BoundaryCondition::EliminateShiftFunction }, + { "NegativeOrbitalMomentum", GNDStk::enums::BoundaryCondition::NegativeOrbitalMomentum }, + { "Brune", GNDStk::enums::BoundaryCondition::Brune }, + { "Given", GNDStk::enums::BoundaryCondition::Given } + }; + }; + +} // namespace enums + +#endif diff --git a/src/GNDStk/enums/BoundaryCondition/test/BoundaryCondition.test.cpp b/src/GNDStk/enums/BoundaryCondition/test/BoundaryCondition.test.cpp new file mode 100644 index 000000000..bdc901621 --- /dev/null +++ b/src/GNDStk/enums/BoundaryCondition/test/BoundaryCondition.test.cpp @@ -0,0 +1,114 @@ +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDStk.hpp" + +// other includes + +// convenience typedefs +using namespace njoy::GNDStk; +using BoundaryCondition = enums::BoundaryCondition; + +SCENARIO( "BoundaryCondition" ) { + + GIVEN( "valid BoundaryCondition values and symbols" ) { + + WHEN( "toString is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "EliminateShiftFunction" + == enums::toString( BoundaryCondition::EliminateShiftFunction ) ); + CHECK( "NegativeOrbitalMomentum" + == enums::toString( BoundaryCondition::NegativeOrbitalMomentum ) ); + CHECK( "Brune" == enums::toString( BoundaryCondition::Brune ) ); + CHECK( "Given" == enums::toString( BoundaryCondition::Given ) ); + } // THEN + } // WHEN + + WHEN( "fromString is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( BoundaryCondition::EliminateShiftFunction + == enums::fromString< BoundaryCondition >( "EliminateShiftFunction" ) ); + CHECK( BoundaryCondition::NegativeOrbitalMomentum + == enums::fromString< BoundaryCondition >( "NegativeOrbitalMomentum" ) ); + CHECK( BoundaryCondition::Brune == enums::fromString< BoundaryCondition >( "Brune" ) ); + CHECK( BoundaryCondition::Given == enums::fromString< BoundaryCondition >( "Given" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( enums::fromString< 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 == enums::isBoundaryCondition( "EliminateShiftFunction" ) ); + CHECK( true == enums::isBoundaryCondition( "NegativeOrbitalMomentum" ) ); + CHECK( true == enums::isBoundaryCondition( "Brune" ) ); + CHECK( true == enums::isBoundaryCondition( "Given" ) ); + CHECK( false == enums::isBoundaryCondition( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/enums/BoundaryCondition/test/CMakeLists.txt b/src/GNDStk/enums/BoundaryCondition/test/CMakeLists.txt new file mode 100644 index 000000000..5caa71a14 --- /dev/null +++ b/src/GNDStk/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/src/GNDStk/enums/ContributorType.hpp b/src/GNDStk/enums/ContributorType.hpp new file mode 100644 index 000000000..397b2afee --- /dev/null +++ b/src/GNDStk/enums/ContributorType.hpp @@ -0,0 +1,109 @@ +#ifndef NJOY_GNDSTK_CONTRIBUTORTYPE +#define NJOY_GNDSTK_CONTRIBUTORTYPE + +namespace 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 isSymbol< ContributorType >( string ); + } + + /** + * @brief Template specialisation to convert ContributorType to/from strings + */ + template <> + class Map< GNDStk::enums::ContributorType > { + public: + + static inline const std::map< GNDStk::enums::ContributorType, + const std::string > values{ + + { GNDStk::enums::ContributorType::ContactPerson, "ContactPerson" }, + { GNDStk::enums::ContributorType::DataCollector, "DataCollector" }, + { GNDStk::enums::ContributorType::DataCurator, "DataCurator" }, + { GNDStk::enums::ContributorType::DataManager, "DataManager" }, + { GNDStk::enums::ContributorType::Distributor, "Distributor" }, + { GNDStk::enums::ContributorType::Editor, "Editor" }, + { GNDStk::enums::ContributorType::HostingInstitution, "HostingInstitution" }, + { GNDStk::enums::ContributorType::Producer, "Producer" }, + { GNDStk::enums::ContributorType::ProjectLeader, "ProjectLeader" }, + { GNDStk::enums::ContributorType::ProjectManager, "ProjectManager" }, + { GNDStk::enums::ContributorType::ProjectMember, "ProjectMember" }, + { GNDStk::enums::ContributorType::RegistrationAgency, "RegistrationAgency" }, + { GNDStk::enums::ContributorType::RegistrationAuthority, "RegistrationAuthority" }, + { GNDStk::enums::ContributorType::RelatedPerson, "RelatedPerson" }, + { GNDStk::enums::ContributorType::Researcher, "Researcher" }, + { GNDStk::enums::ContributorType::ResearchGroup, "ResearchGroup" }, + { GNDStk::enums::ContributorType::RightsHolder, "RightsHolder" }, + { GNDStk::enums::ContributorType::Sponsor, "Sponsor" }, + { GNDStk::enums::ContributorType::Supervisor, "Supervisor" }, + { GNDStk::enums::ContributorType::WorkPackageLeader, "WorkPackageLeader" }, + { GNDStk::enums::ContributorType::Other, "Other" } + }; + + static inline const std::map< const std::string, + GNDStk::enums::ContributorType > symbols{ + + { "ContactPerson", GNDStk::enums::ContributorType::ContactPerson }, + { "DataCollector", GNDStk::enums::ContributorType::DataCollector }, + { "DataCurator", GNDStk::enums::ContributorType::DataCurator }, + { "DataManager", GNDStk::enums::ContributorType::DataManager }, + { "Distributor", GNDStk::enums::ContributorType::Distributor }, + { "Editor", GNDStk::enums::ContributorType::Editor }, + { "HostingInstitution", GNDStk::enums::ContributorType::HostingInstitution }, + { "Producer", GNDStk::enums::ContributorType::Producer }, + { "ProjectLeader", GNDStk::enums::ContributorType::ProjectLeader }, + { "ProjectManager", GNDStk::enums::ContributorType::ProjectManager }, + { "ProjectMember", GNDStk::enums::ContributorType::ProjectMember }, + { "RegistrationAgency", GNDStk::enums::ContributorType::RegistrationAgency }, + { "RegistrationAuthority", GNDStk::enums::ContributorType::RegistrationAuthority }, + { "RelatedPerson", GNDStk::enums::ContributorType::RelatedPerson }, + { "Researcher", GNDStk::enums::ContributorType::Researcher }, + { "ResearchGroup", GNDStk::enums::ContributorType::ResearchGroup }, + { "RightsHolder", GNDStk::enums::ContributorType::RightsHolder }, + { "Sponsor", GNDStk::enums::ContributorType::Sponsor }, + { "Supervisor", GNDStk::enums::ContributorType::Supervisor }, + { "WorkPackageLeader", GNDStk::enums::ContributorType::WorkPackageLeader }, + { "Other", GNDStk::enums::ContributorType::Other } + }; + }; + +} // namespace enums + +#endif diff --git a/src/GNDStk/enums/ContributorType/test/CMakeLists.txt b/src/GNDStk/enums/ContributorType/test/CMakeLists.txt new file mode 100644 index 000000000..667c5f8e2 --- /dev/null +++ b/src/GNDStk/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/src/GNDStk/enums/ContributorType/test/ContributorType.test.cpp b/src/GNDStk/enums/ContributorType/test/ContributorType.test.cpp new file mode 100644 index 000000000..0586bad6e --- /dev/null +++ b/src/GNDStk/enums/ContributorType/test/ContributorType.test.cpp @@ -0,0 +1,293 @@ +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDStk.hpp" + +// other includes + +// convenience typedefs +using namespace njoy::GNDStk; +using ContributorType = enums::ContributorType; + +SCENARIO( "ContributorType" ) { + + GIVEN( "valid encoding values and symbols" ) { + + WHEN( "toString is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "ContactPerson" == enums::toString( ContributorType::ContactPerson ) ); + CHECK( "DataCollector" == enums::toString( ContributorType::DataCollector ) ); + CHECK( "DataCurator" == enums::toString( ContributorType::DataCurator ) ); + CHECK( "DataManager" == enums::toString( ContributorType::DataManager ) ); + CHECK( "Distributor" == enums::toString( ContributorType::Distributor ) ); + CHECK( "Editor" == enums::toString( ContributorType::Editor ) ); + CHECK( "HostingInstitution" == enums::toString( ContributorType::HostingInstitution ) ); + CHECK( "Producer" == enums::toString( ContributorType::Producer ) ); + CHECK( "ProjectLeader" == enums::toString( ContributorType::ProjectLeader ) ); + CHECK( "ProjectManager" == enums::toString( ContributorType::ProjectManager ) ); + CHECK( "ProjectMember" == enums::toString( ContributorType::ProjectMember ) ); + CHECK( "RegistrationAgency" == enums::toString( ContributorType::RegistrationAgency ) ); + CHECK( "RegistrationAuthority" == enums::toString( ContributorType::RegistrationAuthority ) ); + CHECK( "RelatedPerson" == enums::toString( ContributorType::RelatedPerson ) ); + CHECK( "Researcher" == enums::toString( ContributorType::Researcher ) ); + CHECK( "ResearchGroup" == enums::toString( ContributorType::ResearchGroup ) ); + CHECK( "RightsHolder" == enums::toString( ContributorType::RightsHolder ) ); + CHECK( "Sponsor" == enums::toString( ContributorType::Sponsor ) ); + CHECK( "Supervisor" == enums::toString( ContributorType::Supervisor ) ); + CHECK( "WorkPackageLeader" == enums::toString( ContributorType::WorkPackageLeader ) ); + CHECK( "Other" == enums::toString( ContributorType::Other ) ); + } // THEN + } // WHEN + + WHEN( "fromString is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( ContributorType::ContactPerson + == enums::fromString< ContributorType >( "ContactPerson" ) ); + CHECK( ContributorType::DataCollector + == enums::fromString< ContributorType >( "DataCollector" ) ); + CHECK( ContributorType::DataCurator + == enums::fromString< ContributorType >( "DataCurator" ) ); + CHECK( ContributorType::DataManager + == enums::fromString< ContributorType >( "DataManager" ) ); + CHECK( ContributorType::Distributor + == enums::fromString< ContributorType >( "Distributor" ) ); + CHECK( ContributorType::Editor + == enums::fromString< ContributorType >( "Editor" ) ); + CHECK( ContributorType::HostingInstitution + == enums::fromString< ContributorType >( "HostingInstitution" ) ); + CHECK( ContributorType::Producer + == enums::fromString< ContributorType >( "Producer" ) ); + CHECK( ContributorType::ProjectLeader + == enums::fromString< ContributorType >( "ProjectLeader" ) ); + CHECK( ContributorType::ProjectManager + == enums::fromString< ContributorType >( "ProjectManager" ) ); + CHECK( ContributorType::ProjectMember + == enums::fromString< ContributorType >( "ProjectMember" ) ); + CHECK( ContributorType::RegistrationAgency + == enums::fromString< ContributorType >( "RegistrationAgency" ) ); + CHECK( ContributorType::RegistrationAuthority + == enums::fromString< ContributorType >( "RegistrationAuthority" ) ); + CHECK( ContributorType::RelatedPerson + == enums::fromString< ContributorType >( "RelatedPerson" ) ); + CHECK( ContributorType::Researcher + == enums::fromString< ContributorType >( "Researcher" ) ); + CHECK( ContributorType::ResearchGroup + == enums::fromString< ContributorType >( "ResearchGroup" ) ); + CHECK( ContributorType::RightsHolder + == enums::fromString< ContributorType >( "RightsHolder" ) ); + CHECK( ContributorType::Sponsor + == enums::fromString< ContributorType >( "Sponsor" ) ); + CHECK( ContributorType::Supervisor + == enums::fromString< ContributorType >( "Supervisor" ) ); + CHECK( ContributorType::WorkPackageLeader + == enums::fromString< ContributorType >( "WorkPackageLeader" ) ); + CHECK( ContributorType::Other + == enums::fromString< ContributorType >( "Other" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( enums::fromString< 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 == enums::isContributorType( "ContactPerson" ) ); + CHECK( true == enums::isContributorType( "DataCollector" ) ); + CHECK( true == enums::isContributorType( "DataCurator" ) ); + CHECK( true == enums::isContributorType( "DataManager" ) ); + CHECK( true == enums::isContributorType( "Distributor" ) ); + CHECK( true == enums::isContributorType( "Editor" ) ); + CHECK( true == enums::isContributorType( "HostingInstitution" ) ); + CHECK( true == enums::isContributorType( "Producer" ) ); + CHECK( true == enums::isContributorType( "ProjectLeader" ) ); + CHECK( true == enums::isContributorType( "ProjectManager" ) ); + CHECK( true == enums::isContributorType( "ProjectMember" ) ); + CHECK( true == enums::isContributorType( "RegistrationAgency" ) ); + CHECK( true == enums::isContributorType( "RegistrationAuthority" ) ); + CHECK( true == enums::isContributorType( "RelatedPerson" ) ); + CHECK( true == enums::isContributorType( "Researcher" ) ); + CHECK( true == enums::isContributorType( "ResearchGroup" ) ); + CHECK( true == enums::isContributorType( "RightsHolder" ) ); + CHECK( true == enums::isContributorType( "Sponsor" ) ); + CHECK( true == enums::isContributorType( "Supervisor" ) ); + CHECK( true == enums::isContributorType( "WorkPackageLeader" ) ); + CHECK( true == enums::isContributorType( "Other" ) ); + CHECK( false == enums::isContributorType( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/enums/DateType.hpp b/src/GNDStk/enums/DateType.hpp new file mode 100644 index 000000000..3148a3a7b --- /dev/null +++ b/src/GNDStk/enums/DateType.hpp @@ -0,0 +1,76 @@ +#ifndef NJOY_GNDSTK_DATETYPE +#define NJOY_GNDSTK_DATETYPE + +namespace 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 isSymbol< DateType >( string ); + } + + /** + * @brief Template specialisation to convert DateType to/from strings + */ + template <> + class Map< GNDStk::enums::DateType > { + public: + + static inline const std::map< GNDStk::enums::DateType, + const std::string > values{ + + { GNDStk::enums::DateType::accepted, "accepted" }, + { GNDStk::enums::DateType::available, "available" }, + { GNDStk::enums::DateType::copyrighted, "copyrighted" }, + { GNDStk::enums::DateType::collected, "collected" }, + { GNDStk::enums::DateType::created, "created" }, + { GNDStk::enums::DateType::issued, "issued" }, + { GNDStk::enums::DateType::submitted, "submitted" }, + { GNDStk::enums::DateType::updated, "updated" }, + { GNDStk::enums::DateType::valid, "valid" }, + { GNDStk::enums::DateType::withdrawn, "withdrawn" } + }; + + static inline const std::map< const std::string, + GNDStk::enums::DateType > symbols{ + + { "accepted", GNDStk::enums::DateType::accepted }, + { "available", GNDStk::enums::DateType::available }, + { "copyrighted", GNDStk::enums::DateType::copyrighted }, + { "collected", GNDStk::enums::DateType::collected }, + { "created", GNDStk::enums::DateType::created }, + { "issued", GNDStk::enums::DateType::issued }, + { "submitted", GNDStk::enums::DateType::submitted }, + { "updated", GNDStk::enums::DateType::updated }, + { "valid", GNDStk::enums::DateType::valid }, + { "withdrawn", GNDStk::enums::DateType::withdrawn } + }; + }; + +} // namespace enums + +#endif diff --git a/src/GNDStk/enums/DateType/test/CMakeLists.txt b/src/GNDStk/enums/DateType/test/CMakeLists.txt new file mode 100644 index 000000000..4acb97625 --- /dev/null +++ b/src/GNDStk/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/src/GNDStk/enums/DateType/test/DateType.test.cpp b/src/GNDStk/enums/DateType/test/DateType.test.cpp new file mode 100644 index 000000000..3e05a1f21 --- /dev/null +++ b/src/GNDStk/enums/DateType/test/DateType.test.cpp @@ -0,0 +1,160 @@ +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDStk.hpp" + +// other includes + +// convenience typedefs +using namespace njoy::GNDStk; +using DateType = enums::DateType; + +SCENARIO( "DateType" ) { + + GIVEN( "valid encoding values and symbols" ) { + + WHEN( "toString is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "accepted" == enums::toString( DateType::accepted ) ); + CHECK( "available" == enums::toString( DateType::available ) ); + CHECK( "copyrighted" == enums::toString( DateType::copyrighted ) ); + CHECK( "collected" == enums::toString( DateType::collected ) ); + CHECK( "created" == enums::toString( DateType::created ) ); + CHECK( "issued" == enums::toString( DateType::issued ) ); + CHECK( "submitted" == enums::toString( DateType::submitted ) ); + CHECK( "updated" == enums::toString( DateType::updated ) ); + CHECK( "valid" == enums::toString( DateType::valid ) ); + CHECK( "withdrawn" == enums::toString( DateType::withdrawn ) ); + } // THEN + } // WHEN + + WHEN( "fromString is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( DateType::accepted == enums::fromString< DateType >( "accepted" ) ); + CHECK( DateType::available == enums::fromString< DateType >( "available" ) ); + CHECK( DateType::copyrighted == enums::fromString< DateType >( "copyrighted" ) ); + CHECK( DateType::collected == enums::fromString< DateType >( "collected" ) ); + CHECK( DateType::created == enums::fromString< DateType >( "created" ) ); + CHECK( DateType::issued == enums::fromString< DateType >( "issued" ) ); + CHECK( DateType::submitted == enums::fromString< DateType >( "submitted" ) ); + CHECK( DateType::updated == enums::fromString< DateType >( "updated" ) ); + CHECK( DateType::valid == enums::fromString< DateType >( "valid" ) ); + CHECK( DateType::withdrawn == enums::fromString< DateType >( "withdrawn" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( enums::fromString< 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 == enums::isDateType( "accepted" ) ); + CHECK( true == enums::isDateType( "available" ) ); + CHECK( true == enums::isDateType( "copyrighted" ) ); + CHECK( true == enums::isDateType( "collected" ) ); + CHECK( true == enums::isDateType( "created" ) ); + CHECK( true == enums::isDateType( "issued" ) ); + CHECK( true == enums::isDateType( "submitted" ) ); + CHECK( true == enums::isDateType( "updated" ) ); + CHECK( true == enums::isDateType( "valid" ) ); + CHECK( true == enums::isDateType( "withdrawn" ) ); + CHECK( false == enums::isDateType( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/enums/DecayType.hpp b/src/GNDStk/enums/DecayType.hpp new file mode 100644 index 000000000..5d24e7f67 --- /dev/null +++ b/src/GNDStk/enums/DecayType.hpp @@ -0,0 +1,82 @@ +#ifndef NJOY_GNDSTK_DECAYTYPE +#define NJOY_GNDSTK_DECAYTYPE + +namespace 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 isSymbol< DecayType >( string ); + } + + /** + * @brief Template specialisation to convert DecayType to/from strings + */ + template <> + class Map< GNDStk::enums::DecayType > { + public: + + static inline const std::map< GNDStk::enums::DecayType, + const std::string > values{ + + { GNDStk::enums::DecayType::SpontaneousFission, "SF" }, + { GNDStk::enums::DecayType::BetaMinus, "beta-" }, + { GNDStk::enums::DecayType::BetaPlus, "beta+" }, + { GNDStk::enums::DecayType::ElectronCapture, "EC" }, + { GNDStk::enums::DecayType::ElectroMagnetic, "electroMagnetic" }, + { GNDStk::enums::DecayType::IsomericTransition, "IT" }, + { GNDStk::enums::DecayType::Neutron, "n" }, + { GNDStk::enums::DecayType::Proton, "p" }, + { GNDStk::enums::DecayType::Deuteron, "d" }, + { GNDStk::enums::DecayType::Triton, "t" }, + { GNDStk::enums::DecayType::Alpha, "alpha" }, + { GNDStk::enums::DecayType::AtomicRelaxation, "atomicRelaxation" } + }; + + static inline const std::map< const std::string, + GNDStk::enums::DecayType > symbols{ + + { "SF", GNDStk::enums::DecayType::SpontaneousFission }, + { "beta-", GNDStk::enums::DecayType::BetaMinus }, + { "beta+", GNDStk::enums::DecayType::BetaPlus }, + { "EC", GNDStk::enums::DecayType::ElectronCapture }, + { "electroMagnetic", GNDStk::enums::DecayType::ElectroMagnetic }, + { "IT", GNDStk::enums::DecayType::IsomericTransition }, + { "n", GNDStk::enums::DecayType::Neutron }, + { "p", GNDStk::enums::DecayType::Proton }, + { "d", GNDStk::enums::DecayType::Deuteron }, + { "t", GNDStk::enums::DecayType::Triton }, + { "alpha", GNDStk::enums::DecayType::Alpha }, + { "atomicRelaxation", GNDStk::enums::DecayType::AtomicRelaxation } + }; + }; + +} // namespace enums + +#endif diff --git a/src/GNDStk/enums/DecayType/test/CMakeLists.txt b/src/GNDStk/enums/DecayType/test/CMakeLists.txt new file mode 100644 index 000000000..ddaba24ef --- /dev/null +++ b/src/GNDStk/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/src/GNDStk/enums/DecayType/test/DecayType.test.cpp b/src/GNDStk/enums/DecayType/test/DecayType.test.cpp new file mode 100644 index 000000000..5f2b96a26 --- /dev/null +++ b/src/GNDStk/enums/DecayType/test/DecayType.test.cpp @@ -0,0 +1,182 @@ +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDStk.hpp" + +// other includes + +// convenience typedefs +using namespace njoy::GNDStk; +using DecayType = enums::DecayType; + +SCENARIO( "DecayType" ) { + + GIVEN( "valid DecayType values and symbols" ) { + + WHEN( "toString is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "SF" == enums::toString( DecayType::SpontaneousFission ) ); + CHECK( "beta-" == enums::toString( DecayType::BetaMinus ) ); + CHECK( "beta+" == enums::toString( DecayType::BetaPlus ) ); + CHECK( "EC" == enums::toString( DecayType::ElectronCapture ) ); + CHECK( "electroMagnetic" == enums::toString( DecayType::ElectroMagnetic ) ); + CHECK( "IT" == enums::toString( DecayType::IsomericTransition ) ); + CHECK( "n" == enums::toString( DecayType::Neutron ) ); + CHECK( "p" == enums::toString( DecayType::Proton ) ); + CHECK( "d" == enums::toString( DecayType::Deuteron ) ); + CHECK( "t" == enums::toString( DecayType::Triton ) ); + CHECK( "alpha" == enums::toString( DecayType::Alpha ) ); + CHECK( "atomicRelaxation" == enums::toString( DecayType::AtomicRelaxation ) ); + } // THEN + } // WHEN + + WHEN( "fromString is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( DecayType::SpontaneousFission == enums::fromString< DecayType >( "SF" ) ); + CHECK( DecayType::BetaMinus == enums::fromString< DecayType >( "beta-" ) ); + CHECK( DecayType::BetaPlus == enums::fromString< DecayType >( "beta+" ) ); + CHECK( DecayType::ElectronCapture == enums::fromString< DecayType >( "EC" ) ); + CHECK( DecayType::ElectroMagnetic == enums::fromString< DecayType >( "electroMagnetic" ) ); + CHECK( DecayType::IsomericTransition == enums::fromString< DecayType >( "IT" ) ); + CHECK( DecayType::Neutron == enums::fromString< DecayType >( "n" ) ); + CHECK( DecayType::Proton == enums::fromString< DecayType >( "p" ) ); + CHECK( DecayType::Deuteron == enums::fromString< DecayType >( "d" ) ); + CHECK( DecayType::Triton == enums::fromString< DecayType >( "t" ) ); + CHECK( DecayType::Alpha == enums::fromString< DecayType >( "alpha" ) ); + CHECK( DecayType::AtomicRelaxation == enums::fromString< DecayType >( "atomicRelaxation" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( enums::fromString< 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 == enums::isDecayType( "SF" ) ); + CHECK( true == enums::isDecayType( "beta-" ) ); + CHECK( true == enums::isDecayType( "beta+" ) ); + CHECK( true == enums::isDecayType( "EC" ) ); + CHECK( true == enums::isDecayType( "electroMagnetic" ) ); + CHECK( true == enums::isDecayType( "IT" ) ); + CHECK( true == enums::isDecayType( "n" ) ); + CHECK( true == enums::isDecayType( "p" ) ); + CHECK( true == enums::isDecayType( "d" ) ); + CHECK( true == enums::isDecayType( "t" ) ); + CHECK( true == enums::isDecayType( "alpha" ) ); + CHECK( true == enums::isDecayType( "atomicRelaxation" ) ); + CHECK( false == enums::isDecayType( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/enums/Encoding/test/CMakeLists.txt b/src/GNDStk/enums/Encoding/test/CMakeLists.txt index ae3903471..d53b726aa 100644 --- a/src/GNDStk/enums/Encoding/test/CMakeLists.txt +++ b/src/GNDStk/enums/Encoding/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.enums.Encoding.test Encoding.test.cpp ) +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} diff --git a/src/GNDStk/enums/Encoding/test/Encoding.test.cpp b/src/GNDStk/enums/Encoding/test/Encoding.test.cpp index 3230b1b38..08ce7f8df 100644 --- a/src/GNDStk/enums/Encoding/test/Encoding.test.cpp +++ b/src/GNDStk/enums/Encoding/test/Encoding.test.cpp @@ -79,7 +79,8 @@ SCENARIO( "Encoding" ) { WHEN( "isEncoding is used" ) { - THEN( "registered encoding values return true, unregistered encoding values return false" ) { + THEN( "registered encoding values return true, " + "unregistered encoding values return false" ) { CHECK( true == enums::isEncoding( "ascii" ) ); CHECK( true == enums::isEncoding( "utf8" ) ); diff --git a/src/GNDStk/enums/Frame.hpp b/src/GNDStk/enums/Frame.hpp index 5b598e67f..7555c5523 100644 --- a/src/GNDStk/enums/Frame.hpp +++ b/src/GNDStk/enums/Frame.hpp @@ -6,9 +6,7 @@ namespace enums { /** * @class - * @brief Enumeration class giving acceptable frame values - * - * See GNDS v1.9 specifications section 3.5.3 + * @brief Enumeration class for reference frame values */ enum class Frame { diff --git a/src/GNDStk/enums/Frame/test/CMakeLists.txt b/src/GNDStk/enums/Frame/test/CMakeLists.txt index d0a39c8c2..cb6839d55 100644 --- a/src/GNDStk/enums/Frame/test/CMakeLists.txt +++ b/src/GNDStk/enums/Frame/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.enums.Frame.test Frame.test.cpp ) +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} diff --git a/src/GNDStk/enums/Frame/test/Frame.test.cpp b/src/GNDStk/enums/Frame/test/Frame.test.cpp index 2448994ff..56ce003c9 100644 --- a/src/GNDStk/enums/Frame/test/Frame.test.cpp +++ b/src/GNDStk/enums/Frame/test/Frame.test.cpp @@ -26,8 +26,10 @@ SCENARIO( "Frame" ) { THEN( "no exception is thrown when the symbol is registered" ) { - CHECK( Frame::lab == enums::fromString< Frame >( "lab" ) ); - CHECK( Frame::centerOfMass == enums::fromString< Frame >( "centerOfMass" ) ); + 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" ) { @@ -79,7 +81,8 @@ SCENARIO( "Frame" ) { WHEN( "isFrame is used" ) { - THEN( "registered frame values return true, unregistered frame values return false" ) { + THEN( "registered frame values return true, " + "unregistered frame values return false" ) { CHECK( true == enums::isFrame( "lab" ) ); CHECK( true == enums::isFrame( "centerOfMass" ) ); diff --git a/src/GNDStk/enums/GridStyle.hpp b/src/GNDStk/enums/GridStyle.hpp index 06759c324..403a5dd44 100644 --- a/src/GNDStk/enums/GridStyle.hpp +++ b/src/GNDStk/enums/GridStyle.hpp @@ -1,4 +1,3 @@ - #ifndef NJOY_GNDSTK_GRIDSTYLE #define NJOY_GNDSTK_GRIDSTYLE @@ -7,8 +6,6 @@ namespace enums { /** * @class * @brief Enumeration class giving acceptable grid style values - * - * See GNDS v1.9 specifications section 5.1.3 */ enum class GridStyle { @@ -51,8 +48,8 @@ namespace enums { static inline const std::map< const std::string, GNDStk::enums::GridStyle > symbols{ - { "none", GNDStk::enums::GridStyle::none }, - { "link", GNDStk::enums::GridStyle::link }, + { "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 } diff --git a/src/GNDStk/enums/GridStyle/test/CMakeLists.txt b/src/GNDStk/enums/GridStyle/test/CMakeLists.txt index 06092bc91..4cbffa5f3 100644 --- a/src/GNDStk/enums/GridStyle/test/CMakeLists.txt +++ b/src/GNDStk/enums/GridStyle/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.enums.GridStyle.test GridStyle.test.cpp ) +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} diff --git a/src/GNDStk/enums/GridStyle/test/GridStyle.test.cpp b/src/GNDStk/enums/GridStyle/test/GridStyle.test.cpp index d6aa8797d..8f6d5f24a 100644 --- a/src/GNDStk/enums/GridStyle/test/GridStyle.test.cpp +++ b/src/GNDStk/enums/GridStyle/test/GridStyle.test.cpp @@ -29,11 +29,16 @@ SCENARIO( "GridStyle" ) { 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" ) ); + 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" ) { diff --git a/src/GNDStk/enums/HashAlgorithm.hpp b/src/GNDStk/enums/HashAlgorithm.hpp new file mode 100644 index 000000000..98a4ec245 --- /dev/null +++ b/src/GNDStk/enums/HashAlgorithm.hpp @@ -0,0 +1,52 @@ +#ifndef NJOY_GNDSTK_HASHALGORITHM +#define NJOY_GNDSTK_HASHALGORITHM + +namespace 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 isSymbol< HashAlgorithm >( string ); + } + + /** + * @brief Template specialisation to convert HashAlgorithm to/from strings + */ + template <> + class Map< GNDStk::enums::HashAlgorithm > { + public: + + static inline const std::map< GNDStk::enums::HashAlgorithm, + const std::string > values{ + + { GNDStk::enums::HashAlgorithm::md5, "md5" }, + { GNDStk::enums::HashAlgorithm::sha1, "sha1" } + }; + + static inline const std::map< const std::string, + GNDStk::enums::HashAlgorithm > symbols{ + + { "md5", GNDStk::enums::HashAlgorithm::md5 }, + { "sha1", GNDStk::enums::HashAlgorithm::sha1 } + }; + }; + +} // namespace enums + +#endif diff --git a/src/GNDStk/enums/HashAlgorithm/test/CMakeLists.txt b/src/GNDStk/enums/HashAlgorithm/test/CMakeLists.txt new file mode 100644 index 000000000..0fd24a56b --- /dev/null +++ b/src/GNDStk/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/src/GNDStk/enums/HashAlgorithm/test/HashAlgorithm.test.cpp b/src/GNDStk/enums/HashAlgorithm/test/HashAlgorithm.test.cpp new file mode 100644 index 000000000..4c1a3ef13 --- /dev/null +++ b/src/GNDStk/enums/HashAlgorithm/test/HashAlgorithm.test.cpp @@ -0,0 +1,91 @@ +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDStk.hpp" + +// other includes + +// convenience typedefs +using namespace njoy::GNDStk; +using HashAlgorithm = enums::HashAlgorithm; + +SCENARIO( "HashAlgorithm" ) { + + GIVEN( "valid frame values and symbols" ) { + + WHEN( "toString is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "md5" == enums::toString( HashAlgorithm::md5 ) ); + CHECK( "sha1" == enums::toString( HashAlgorithm::sha1 ) ); + } // THEN + } // WHEN + + WHEN( "fromString is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( HashAlgorithm::md5 == enums::fromString< HashAlgorithm >( "md5" ) ); + CHECK( HashAlgorithm::sha1 == enums::fromString< HashAlgorithm >( "sha1" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( enums::fromString< 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 == enums::isHashAlgorithm( "md5" ) ); + CHECK( true == enums::isHashAlgorithm( "sha1" ) ); + CHECK( false == enums::isHashAlgorithm( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/enums/Interaction.hpp b/src/GNDStk/enums/Interaction.hpp index 2aa344368..106b0fcc2 100644 --- a/src/GNDStk/enums/Interaction.hpp +++ b/src/GNDStk/enums/Interaction.hpp @@ -1,4 +1,3 @@ - #ifndef NJOY_GNDSTK_INTERACTION #define NJOY_GNDSTK_INTERACTION @@ -39,17 +38,23 @@ namespace enums { 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" } + { 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 } + { "nuclear", + GNDStk::enums::Interaction::nuclear }, + { "atomic", + GNDStk::enums::Interaction::atomic }, + { "thermalNeutronScatteringLaw", + GNDStk::enums::Interaction::thermalNeutronScatteringLaw } }; }; diff --git a/src/GNDStk/enums/Interaction/test/CMakeLists.txt b/src/GNDStk/enums/Interaction/test/CMakeLists.txt index b6621fc34..419e30ed6 100644 --- a/src/GNDStk/enums/Interaction/test/CMakeLists.txt +++ b/src/GNDStk/enums/Interaction/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.enums.Interaction.test Interaction.test.cpp ) +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} diff --git a/src/GNDStk/enums/Interaction/test/Interaction.test.cpp b/src/GNDStk/enums/Interaction/test/Interaction.test.cpp index 669926ee6..bfbf14aec 100644 --- a/src/GNDStk/enums/Interaction/test/Interaction.test.cpp +++ b/src/GNDStk/enums/Interaction/test/Interaction.test.cpp @@ -17,9 +17,12 @@ SCENARIO( "Interaction" ) { 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 ) ); + CHECK( "nuclear" == + enums::toString( Interaction::nuclear ) ); + CHECK( "atomic" == + enums::toString( Interaction::atomic ) ); + CHECK( "thermalNeutronScatteringLaw" == + enums::toString( Interaction::thermalNeutronScatteringLaw ) ); } // THEN } // WHEN @@ -27,9 +30,12 @@ SCENARIO( "Interaction" ) { 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" ) ); + CHECK( Interaction::nuclear == + enums::fromString("nuclear")); + CHECK( Interaction::atomic == + enums::fromString("atomic")); + CHECK( Interaction::thermalNeutronScatteringLaw == + enums::fromString("thermalNeutronScatteringLaw")); } // THEN THEN( "an exception is thrown when the symbol is not registered" ) { @@ -87,7 +93,8 @@ SCENARIO( "Interaction" ) { WHEN( "isInteraction is used" ) { - THEN( "registered interaction values return true, unregistered interaction values return false" ) { + THEN( "registered interaction values return true, " + "unregistered interaction values return false" ) { CHECK( true == enums::isInteraction( "nuclear" ) ); CHECK( true == enums::isInteraction( "atomic" ) ); diff --git a/src/GNDStk/enums/Interpolation.hpp b/src/GNDStk/enums/Interpolation.hpp index 94281587e..762c95164 100644 --- a/src/GNDStk/enums/Interpolation.hpp +++ b/src/GNDStk/enums/Interpolation.hpp @@ -1,4 +1,3 @@ - #ifndef NJOY_GNDSTK_INTERPOLATION #define NJOY_GNDSTK_INTERPOLATION @@ -6,9 +5,7 @@ namespace enums { /** * @class - * @brief Enumeration class giving acceptable interpolation values - * - * See GNDS v1.9 specifications section 3.5.3 + * @brief Enumeration class for interpolation values */ enum class Interpolation { @@ -21,7 +18,7 @@ namespace enums { }; /** - * @brief Return whether or not a string is a valid interpolation + * @brief Return whether or not a string is a valid interpolation value * * @param[in] string the string to be verified * diff --git a/src/GNDStk/enums/Interpolation/test/CMakeLists.txt b/src/GNDStk/enums/Interpolation/test/CMakeLists.txt index 6ed8210cf..81693f9bf 100644 --- a/src/GNDStk/enums/Interpolation/test/CMakeLists.txt +++ b/src/GNDStk/enums/Interpolation/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.enums.Interpolation.test Interpolation.test.cpp ) +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} diff --git a/src/GNDStk/enums/Interpolation/test/Interpolation.test.cpp b/src/GNDStk/enums/Interpolation/test/Interpolation.test.cpp index 64a19e6ee..e34e39605 100644 --- a/src/GNDStk/enums/Interpolation/test/Interpolation.test.cpp +++ b/src/GNDStk/enums/Interpolation/test/Interpolation.test.cpp @@ -22,7 +22,8 @@ SCENARIO( "Interpolation" ) { 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 ) ); + CHECK( "charged-particle" == + enums::toString( Interpolation::chargedparticle ) ); } // THEN } // WHEN @@ -30,12 +31,18 @@ SCENARIO( "Interpolation" ) { 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" ) ); + 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" ) { @@ -53,7 +60,8 @@ SCENARIO( "Interpolation" ) { << Interpolation::linlog << ' ' << Interpolation::loglin << ' ' << Interpolation::loglog << ' ' << Interpolation::chargedparticle; - CHECK( "flat lin-lin lin-log log-lin log-log charged-particle" == out.str() ); + CHECK( "flat lin-lin lin-log log-lin log-log charged-particle" == + out.str() ); } // THEN } // WHEN @@ -110,7 +118,8 @@ SCENARIO( "Interpolation" ) { WHEN( "isInterpolation is used" ) { - THEN( "registered interpolation values return true, unregistered interpolation values return false" ) { + THEN( "registered interpolation values return true, " + "unregistered interpolation values return false" ) { CHECK( true == enums::isInterpolation( "flat" ) ); CHECK( true == enums::isInterpolation( "lin-lin" ) ); diff --git a/src/GNDStk/enums/InterpolationQualifier.hpp b/src/GNDStk/enums/InterpolationQualifier.hpp new file mode 100644 index 000000000..e7c3e0f2a --- /dev/null +++ b/src/GNDStk/enums/InterpolationQualifier.hpp @@ -0,0 +1,59 @@ +#ifndef NJOY_GNDSTK_INTERPOLATIONQUALIFIER +#define NJOY_GNDSTK_INTERPOLATIONQUALIFIER + +namespace 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 isSymbol< InterpolationQualifier >( string ); + } + + /** + * @brief Template specialisation to convert InterpolationQualifier to/from strings + */ + template <> + class Map< GNDStk::enums::InterpolationQualifier > { + public: + + static inline const std::map< GNDStk::enums::InterpolationQualifier, + const std::string > values{ + + { GNDStk::enums::InterpolationQualifier::direct, "direct" }, + { GNDStk::enums::InterpolationQualifier::unitBase, "unitBase" }, + { GNDStk::enums::InterpolationQualifier::correspondingEnergies, "correspondingEnergies" }, + { GNDStk::enums::InterpolationQualifier::correspondingPoints, "correspondingPoints" } + }; + + static inline const std::map< const std::string, + GNDStk::enums::InterpolationQualifier > symbols{ + + { "direct", GNDStk::enums::InterpolationQualifier::direct }, + { "unitBase", GNDStk::enums::InterpolationQualifier::unitBase }, + { "correspondingEnergies", GNDStk::enums::InterpolationQualifier::correspondingEnergies }, + { "correspondingPoints", GNDStk::enums::InterpolationQualifier::correspondingPoints } + }; + }; + +} // namespace enums + +#endif diff --git a/src/GNDStk/enums/InterpolationQualifier/test/CMakeLists.txt b/src/GNDStk/enums/InterpolationQualifier/test/CMakeLists.txt new file mode 100644 index 000000000..8e627bc3a --- /dev/null +++ b/src/GNDStk/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/src/GNDStk/enums/InterpolationQualifier/test/InterpolationQualifier.test.cpp b/src/GNDStk/enums/InterpolationQualifier/test/InterpolationQualifier.test.cpp new file mode 100644 index 000000000..2f681667c --- /dev/null +++ b/src/GNDStk/enums/InterpolationQualifier/test/InterpolationQualifier.test.cpp @@ -0,0 +1,118 @@ +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDStk.hpp" + +// other includes + +// convenience typedefs +using namespace njoy::GNDStk; +using InterpolationQualifier = enums::InterpolationQualifier; + +SCENARIO( "InterpolationQualifier" ) { + + GIVEN( "valid interpolation values and symbols" ) { + + WHEN( "toString is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "direct" == enums::toString( InterpolationQualifier::direct ) ); + CHECK( "unitBase" == enums::toString( InterpolationQualifier::unitBase ) ); + CHECK( "correspondingEnergies" + == enums::toString( InterpolationQualifier::correspondingEnergies ) ); + CHECK( "correspondingPoints" + == enums::toString( InterpolationQualifier::correspondingPoints ) ); + } // THEN + } // WHEN + + WHEN( "fromString is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( InterpolationQualifier::direct + == enums::fromString< InterpolationQualifier >( "direct" ) ); + CHECK( InterpolationQualifier::unitBase + == enums::fromString< InterpolationQualifier >( "unitBase" ) ); + CHECK( InterpolationQualifier::correspondingEnergies + == enums::fromString< InterpolationQualifier >( "correspondingEnergies" ) ); + CHECK( InterpolationQualifier::correspondingPoints + == enums::fromString< InterpolationQualifier >( "correspondingPoints" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( enums::fromString< 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 == enums::isInterpolationQualifier( "direct" ) ); + CHECK( true == enums::isInterpolationQualifier( "unitBase" ) ); + CHECK( true == enums::isInterpolationQualifier( "correspondingEnergies" ) ); + CHECK( true == enums::isInterpolationQualifier( "correspondingPoints" ) ); + CHECK( false == enums::isInterpolationQualifier( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/enums/Parity.hpp b/src/GNDStk/enums/Parity.hpp new file mode 100644 index 000000000..4c8e2485c --- /dev/null +++ b/src/GNDStk/enums/Parity.hpp @@ -0,0 +1,52 @@ +#ifndef NJOY_GNDSTK_PARITY +#define NJOY_GNDSTK_PARITY + +namespace 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 isSymbol< Parity >( string ); + } + + /** + * @brief Template specialisation to convert Parity to/from strings + */ + template <> + class Map< GNDStk::enums::Parity > { + public: + + static inline const std::map< GNDStk::enums::Parity, + const std::string > values{ + + { GNDStk::enums::Parity::minus, "-1" }, + { GNDStk::enums::Parity::plus, "+1" } + }; + + static inline const std::map< const std::string, + GNDStk::enums::Parity > symbols{ + + { "-1", GNDStk::enums::Parity::minus }, + { "+1", GNDStk::enums::Parity::plus } + }; + }; + +} // namespace enums + +#endif diff --git a/src/GNDStk/enums/Parity/test/CMakeLists.txt b/src/GNDStk/enums/Parity/test/CMakeLists.txt new file mode 100644 index 000000000..628eefb4e --- /dev/null +++ b/src/GNDStk/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/src/GNDStk/enums/Parity/test/Parity.test.cpp b/src/GNDStk/enums/Parity/test/Parity.test.cpp new file mode 100644 index 000000000..b12d9ae2b --- /dev/null +++ b/src/GNDStk/enums/Parity/test/Parity.test.cpp @@ -0,0 +1,91 @@ +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDStk.hpp" + +// other includes + +// convenience typedefs +using namespace njoy::GNDStk; +using Parity = enums::Parity; + +SCENARIO( "Parity" ) { + + GIVEN( "valid frame values and symbols" ) { + + WHEN( "toString is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "-1" == enums::toString( Parity::minus ) ); + CHECK( "+1" == enums::toString( Parity::plus ) ); + } // THEN + } // WHEN + + WHEN( "fromString is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( Parity::minus == enums::fromString< Parity >( "-1" ) ); + CHECK( Parity::plus == enums::fromString< Parity >( "+1" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( enums::fromString< 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 == enums::isParity( "-1" ) ); + CHECK( true == enums::isParity( "+1" ) ); + CHECK( false == enums::isParity( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/enums/RelationType.hpp b/src/GNDStk/enums/RelationType.hpp new file mode 100644 index 000000000..7b896e5cc --- /dev/null +++ b/src/GNDStk/enums/RelationType.hpp @@ -0,0 +1,148 @@ +#ifndef NJOY_GNDSTK_RELATIONTYPE +#define NJOY_GNDSTK_RELATIONTYPE + +namespace 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 isSymbol< RelationType >( string ); + } + + /** + * @brief Template specialisation to convert RelationType to/from strings + */ + template <> + class Map< GNDStk::enums::RelationType > { + public: + + static inline const std::map< GNDStk::enums::RelationType, + const std::string > values{ + + { GNDStk::enums::RelationType::IsCitedBy, "IsCitedBy" }, + { GNDStk::enums::RelationType::Cites, "Cites" }, + { GNDStk::enums::RelationType::IsSupplementTo, "IsSupplementTo" }, + { GNDStk::enums::RelationType::IsSupplementedBy, "IsSupplementedBy" }, + { GNDStk::enums::RelationType::IsContinuedBy, "IsContinuedBy" }, + { GNDStk::enums::RelationType::Continues, "Continues" }, + { GNDStk::enums::RelationType::Describes, "Describes" }, + { GNDStk::enums::RelationType::IsDescribedBy, "IsDescribedBy" }, + { GNDStk::enums::RelationType::HasMetadata, "HasMetadata" }, + { GNDStk::enums::RelationType::IsMetadataFor, "IsMetadataFor" }, + { GNDStk::enums::RelationType::HasVersion, "HasVersion" }, + { GNDStk::enums::RelationType::IsVersionOf, "IsVersionOf" }, + { GNDStk::enums::RelationType::IsNewVersionOf, "IsNewVersionOf" }, + { GNDStk::enums::RelationType::IsPreviousVersionOf, "IsPreviousVersionOf" }, + { GNDStk::enums::RelationType::IsPartOf, "IsPartOf" }, + { GNDStk::enums::RelationType::HasPart, "HasPart" }, + { GNDStk::enums::RelationType::IsPublishedIn, "IsPublishedIn" }, + { GNDStk::enums::RelationType::IsReferencedBy, "IsReferencedBy" }, + { GNDStk::enums::RelationType::References, "References" }, + { GNDStk::enums::RelationType::IsDocumentedBy, "IsDocumentedBy" }, + { GNDStk::enums::RelationType::Documents, "Documents" }, + { GNDStk::enums::RelationType::IsCompiledBy, "IsCompiledBy" }, + { GNDStk::enums::RelationType::Compiles, "Compiles" }, + { GNDStk::enums::RelationType::IsVariantFormOf, "IsVariantFormOf" }, + { GNDStk::enums::RelationType::IsOriginalFormOf, "IsOriginalFormOf" }, + { GNDStk::enums::RelationType::IsIdenticalTo, "IsIdenticalTo" }, + { GNDStk::enums::RelationType::IsReviewedBy, "IsReviewedBy" }, + { GNDStk::enums::RelationType::Reviews, "Reviews" }, + { GNDStk::enums::RelationType::IsDerivedFrom, "IsDerivedFrom" }, + { GNDStk::enums::RelationType::IsSourceOf, "IsSourceOf" }, + { GNDStk::enums::RelationType::IsRequiredBy, "IsRequiredBy" }, + { GNDStk::enums::RelationType::Requires, "Requires" }, + { GNDStk::enums::RelationType::Obsoletes, "Obsoletes" }, + { GNDStk::enums::RelationType::IsObsoletedBy, "IsObsoletedBy" } + }; + + static inline const std::map< const std::string, + GNDStk::enums::RelationType > symbols{ + + { "IsCitedBy", GNDStk::enums::RelationType::IsCitedBy }, + { "Cites", GNDStk::enums::RelationType::Cites }, + { "IsSupplementTo", GNDStk::enums::RelationType::IsSupplementTo }, + { "IsSupplementedBy", GNDStk::enums::RelationType::IsSupplementedBy }, + { "IsContinuedBy", GNDStk::enums::RelationType::IsContinuedBy }, + { "Continues", GNDStk::enums::RelationType::Continues }, + { "Describes", GNDStk::enums::RelationType::Describes }, + { "IsDescribedBy", GNDStk::enums::RelationType::IsDescribedBy }, + { "HasMetadata", GNDStk::enums::RelationType::HasMetadata }, + { "IsMetadataFor", GNDStk::enums::RelationType::IsMetadataFor }, + { "HasVersion", GNDStk::enums::RelationType::HasVersion }, + { "IsVersionOf", GNDStk::enums::RelationType::IsVersionOf }, + { "IsNewVersionOf", GNDStk::enums::RelationType::IsNewVersionOf }, + { "IsPreviousVersionOf", GNDStk::enums::RelationType::IsPreviousVersionOf }, + { "IsPartOf", GNDStk::enums::RelationType::IsPartOf }, + { "HasPart", GNDStk::enums::RelationType::HasPart }, + { "IsPublishedIn", GNDStk::enums::RelationType::IsPublishedIn }, + { "IsReferencedBy", GNDStk::enums::RelationType::IsReferencedBy }, + { "References", GNDStk::enums::RelationType::References }, + { "IsDocumentedBy", GNDStk::enums::RelationType::IsDocumentedBy }, + { "Documents", GNDStk::enums::RelationType::Documents }, + { "IsCompiledBy", GNDStk::enums::RelationType::IsCompiledBy }, + { "Compiles", GNDStk::enums::RelationType::Compiles }, + { "IsVariantFormOf", GNDStk::enums::RelationType::IsVariantFormOf }, + { "IsOriginalFormOf", GNDStk::enums::RelationType::IsOriginalFormOf }, + { "IsIdenticalTo", GNDStk::enums::RelationType::IsIdenticalTo }, + { "IsReviewedBy", GNDStk::enums::RelationType::IsReviewedBy }, + { "Reviews", GNDStk::enums::RelationType::Reviews }, + { "IsDerivedFrom", GNDStk::enums::RelationType::IsDerivedFrom }, + { "IsSourceOf", GNDStk::enums::RelationType::IsSourceOf }, + { "IsRequiredBy", GNDStk::enums::RelationType::IsRequiredBy }, + { "Requires", GNDStk::enums::RelationType::Requires }, + { "Obsoletes", GNDStk::enums::RelationType::Obsoletes }, + { "IsObsoletedBy", GNDStk::enums::RelationType::IsObsoletedBy } + }; + }; + +} // namespace enums + +#endif diff --git a/src/GNDStk/enums/RelationType/test/CMakeLists.txt b/src/GNDStk/enums/RelationType/test/CMakeLists.txt new file mode 100644 index 000000000..53897e897 --- /dev/null +++ b/src/GNDStk/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/src/GNDStk/enums/RelationType/test/RelationType.test.cpp b/src/GNDStk/enums/RelationType/test/RelationType.test.cpp new file mode 100644 index 000000000..cc8ef56b6 --- /dev/null +++ b/src/GNDStk/enums/RelationType/test/RelationType.test.cpp @@ -0,0 +1,393 @@ +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDStk.hpp" + +// other includes + +// convenience typedefs +using namespace njoy::GNDStk; +using RelationType = enums::RelationType; + +SCENARIO( "RelationType" ) { + + GIVEN( "valid encoding values and symbols" ) { + + WHEN( "toString is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "IsCitedBy" == enums::toString( RelationType::IsCitedBy ) ); + CHECK( "Cites" == enums::toString( RelationType::Cites ) ); + CHECK( "IsSupplementTo" == enums::toString( RelationType::IsSupplementTo ) ); + CHECK( "IsSupplementedBy" == enums::toString( RelationType::IsSupplementedBy ) ); + CHECK( "IsContinuedBy" == enums::toString( RelationType::IsContinuedBy ) ); + CHECK( "Continues" == enums::toString( RelationType::Continues ) ); + CHECK( "Describes" == enums::toString( RelationType::Describes ) ); + CHECK( "IsDescribedBy" == enums::toString( RelationType::IsDescribedBy ) ); + CHECK( "HasMetadata" == enums::toString( RelationType::HasMetadata ) ); + CHECK( "IsMetadataFor" == enums::toString( RelationType::IsMetadataFor ) ); + CHECK( "HasVersion" == enums::toString( RelationType::HasVersion ) ); + CHECK( "IsVersionOf" == enums::toString( RelationType::IsVersionOf ) ); + CHECK( "IsNewVersionOf" == enums::toString( RelationType::IsNewVersionOf ) ); + CHECK( "IsPreviousVersionOf" == enums::toString( RelationType::IsPreviousVersionOf ) ); + CHECK( "IsPartOf" == enums::toString( RelationType::IsPartOf ) ); + CHECK( "HasPart" == enums::toString( RelationType::HasPart ) ); + CHECK( "IsPublishedIn" == enums::toString( RelationType::IsPublishedIn ) ); + CHECK( "IsReferencedBy" == enums::toString( RelationType::IsReferencedBy ) ); + CHECK( "References" == enums::toString( RelationType::References ) ); + CHECK( "IsDocumentedBy" == enums::toString( RelationType::IsDocumentedBy ) ); + CHECK( "Documents" == enums::toString( RelationType::Documents ) ); + CHECK( "IsCompiledBy" == enums::toString( RelationType::IsCompiledBy ) ); + CHECK( "Compiles" == enums::toString( RelationType::Compiles ) ); + CHECK( "IsVariantFormOf" == enums::toString( RelationType::IsVariantFormOf ) ); + CHECK( "IsOriginalFormOf" == enums::toString( RelationType::IsOriginalFormOf ) ); + CHECK( "IsIdenticalTo" == enums::toString( RelationType::IsIdenticalTo ) ); + CHECK( "IsReviewedBy" == enums::toString( RelationType::IsReviewedBy ) ); + CHECK( "Reviews" == enums::toString( RelationType::Reviews ) ); + CHECK( "IsDerivedFrom" == enums::toString( RelationType::IsDerivedFrom ) ); + CHECK( "IsSourceOf" == enums::toString( RelationType::IsSourceOf ) ); + CHECK( "IsRequiredBy" == enums::toString( RelationType::IsRequiredBy ) ); + CHECK( "Requires" == enums::toString( RelationType::Requires ) ); + CHECK( "Obsoletes" == enums::toString( RelationType::Obsoletes ) ); + CHECK( "IsObsoletedBy" == enums::toString( RelationType::IsObsoletedBy ) ); + } // THEN + } // WHEN + + WHEN( "fromString is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( RelationType::IsCitedBy == enums::fromString< RelationType >( "IsCitedBy" ) ); + CHECK( RelationType::Cites == enums::fromString< RelationType >( "Cites" ) ); + CHECK( RelationType::IsSupplementTo == enums::fromString< RelationType >( "IsSupplementTo" ) ); + CHECK( RelationType::IsSupplementedBy == enums::fromString< RelationType >( "IsSupplementedBy" ) ); + CHECK( RelationType::IsContinuedBy == enums::fromString< RelationType >( "IsContinuedBy" ) ); + CHECK( RelationType::Continues == enums::fromString< RelationType >( "Continues" ) ); + CHECK( RelationType::Describes == enums::fromString< RelationType >( "Describes" ) ); + CHECK( RelationType::IsDescribedBy == enums::fromString< RelationType >( "IsDescribedBy" ) ); + CHECK( RelationType::HasMetadata == enums::fromString< RelationType >( "HasMetadata" ) ); + CHECK( RelationType::IsMetadataFor == enums::fromString< RelationType >( "IsMetadataFor" ) ); + CHECK( RelationType::HasVersion == enums::fromString< RelationType >( "HasVersion" ) ); + CHECK( RelationType::IsVersionOf == enums::fromString< RelationType >( "IsVersionOf" ) ); + CHECK( RelationType::IsNewVersionOf == enums::fromString< RelationType >( "IsNewVersionOf" ) ); + CHECK( RelationType::IsPreviousVersionOf == enums::fromString< RelationType >( "IsPreviousVersionOf" ) ); + CHECK( RelationType::IsPartOf == enums::fromString< RelationType >( "IsPartOf" ) ); + CHECK( RelationType::HasPart == enums::fromString< RelationType >( "HasPart" ) ); + CHECK( RelationType::IsPublishedIn == enums::fromString< RelationType >( "IsPublishedIn" ) ); + CHECK( RelationType::IsReferencedBy == enums::fromString< RelationType >( "IsReferencedBy" ) ); + CHECK( RelationType::References == enums::fromString< RelationType >( "References" ) ); + CHECK( RelationType::IsDocumentedBy == enums::fromString< RelationType >( "IsDocumentedBy" ) ); + CHECK( RelationType::Documents == enums::fromString< RelationType >( "Documents" ) ); + CHECK( RelationType::IsCompiledBy == enums::fromString< RelationType >( "IsCompiledBy" ) ); + CHECK( RelationType::Compiles == enums::fromString< RelationType >( "Compiles" ) ); + CHECK( RelationType::IsVariantFormOf == enums::fromString< RelationType >( "IsVariantFormOf" ) ); + CHECK( RelationType::IsOriginalFormOf == enums::fromString< RelationType >( "IsOriginalFormOf" ) ); + CHECK( RelationType::IsIdenticalTo == enums::fromString< RelationType >( "IsIdenticalTo" ) ); + CHECK( RelationType::IsReviewedBy == enums::fromString< RelationType >( "IsReviewedBy" ) ); + CHECK( RelationType::Reviews == enums::fromString< RelationType >( "Reviews" ) ); + CHECK( RelationType::IsDerivedFrom == enums::fromString< RelationType >( "IsDerivedFrom" ) ); + CHECK( RelationType::IsSourceOf == enums::fromString< RelationType >( "IsSourceOf" ) ); + CHECK( RelationType::IsRequiredBy == enums::fromString< RelationType >( "IsRequiredBy" ) ); + CHECK( RelationType::Requires == enums::fromString< RelationType >( "Requires" ) ); + CHECK( RelationType::Obsoletes == enums::fromString< RelationType >( "Obsoletes" ) ); + CHECK( RelationType::IsObsoletedBy == enums::fromString< RelationType >( "IsObsoletedBy" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( enums::fromString< 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 == enums::isRelationType( "IsCitedBy" ) ); + CHECK( true == enums::isRelationType( "Cites" ) ); + CHECK( true == enums::isRelationType( "IsSupplementTo" ) ); + CHECK( true == enums::isRelationType( "IsSupplementedBy" ) ); + CHECK( true == enums::isRelationType( "IsContinuedBy" ) ); + CHECK( true == enums::isRelationType( "Continues" ) ); + CHECK( true == enums::isRelationType( "Describes" ) ); + CHECK( true == enums::isRelationType( "IsDescribedBy" ) ); + CHECK( true == enums::isRelationType( "HasMetadata" ) ); + CHECK( true == enums::isRelationType( "IsMetadataFor" ) ); + CHECK( true == enums::isRelationType( "HasVersion" ) ); + CHECK( true == enums::isRelationType( "IsVersionOf" ) ); + CHECK( true == enums::isRelationType( "IsNewVersionOf" ) ); + CHECK( true == enums::isRelationType( "IsPreviousVersionOf" ) ); + CHECK( true == enums::isRelationType( "IsPartOf" ) ); + CHECK( true == enums::isRelationType( "HasPart" ) ); + CHECK( true == enums::isRelationType( "IsPublishedIn" ) ); + CHECK( true == enums::isRelationType( "IsReferencedBy" ) ); + CHECK( true == enums::isRelationType( "References" ) ); + CHECK( true == enums::isRelationType( "IsDocumentedBy" ) ); + CHECK( true == enums::isRelationType( "Documents" ) ); + CHECK( true == enums::isRelationType( "IsCompiledBy" ) ); + CHECK( true == enums::isRelationType( "Compiles" ) ); + CHECK( true == enums::isRelationType( "IsVariantFormOf" ) ); + CHECK( true == enums::isRelationType( "IsOriginalFormOf" ) ); + CHECK( true == enums::isRelationType( "IsIdenticalTo" ) ); + CHECK( true == enums::isRelationType( "IsReviewedBy" ) ); + CHECK( true == enums::isRelationType( "Reviews" ) ); + CHECK( true == enums::isRelationType( "IsDerivedFrom" ) ); + CHECK( true == enums::isRelationType( "IsSourceOf" ) ); + CHECK( true == enums::isRelationType( "IsRequiredBy" ) ); + CHECK( true == enums::isRelationType( "Requires" ) ); + CHECK( true == enums::isRelationType( "Obsoletes" ) ); + CHECK( true == enums::isRelationType( "IsObsoletedBy" ) ); + CHECK( false == enums::isRelationType( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/enums/StorageOrder/test/CMakeLists.txt b/src/GNDStk/enums/StorageOrder/test/CMakeLists.txt index 11a4ec4d4..99671e9a1 100644 --- a/src/GNDStk/enums/StorageOrder/test/CMakeLists.txt +++ b/src/GNDStk/enums/StorageOrder/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.enums.StorageOrder.test StorageOrder.test.cpp ) +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} diff --git a/src/GNDStk/enums/StorageOrder/test/StorageOrder.test.cpp b/src/GNDStk/enums/StorageOrder/test/StorageOrder.test.cpp index cea39c96e..be7770dbb 100644 --- a/src/GNDStk/enums/StorageOrder/test/StorageOrder.test.cpp +++ b/src/GNDStk/enums/StorageOrder/test/StorageOrder.test.cpp @@ -26,8 +26,10 @@ SCENARIO( "StorageOrder" ) { THEN( "no exception is thrown when the symbol is registered" ) { - CHECK( StorageOrder::rowMajor == enums::fromString< StorageOrder >( "rowMajor" ) ); - CHECK( StorageOrder::columnMajor == enums::fromString< StorageOrder >( "columnMajor" ) ); + 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" ) { @@ -79,7 +81,8 @@ SCENARIO( "StorageOrder" ) { WHEN( "isStorageOrder is used" ) { - THEN( "registered storage order values return true, unregistered storage order values return false" ) { + THEN( "registered storage order values return true, " + "unregistered storage order values return false" ) { CHECK( true == enums::isStorageOrder( "rowMajor" ) ); CHECK( true == enums::isStorageOrder( "columnMajor" ) ); diff --git a/src/GNDStk/enums/units/Energy/test/CMakeLists.txt b/src/GNDStk/enums/units/Energy/test/CMakeLists.txt index e7c60b6a1..3a3ac710b 100644 --- a/src/GNDStk/enums/units/Energy/test/CMakeLists.txt +++ b/src/GNDStk/enums/units/Energy/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.enums.units.Energy.test Energy.test.cpp ) +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} diff --git a/src/GNDStk/enums/units/Length/test/CMakeLists.txt b/src/GNDStk/enums/units/Length/test/CMakeLists.txt index d2f2a7ef7..e23e70b1a 100644 --- a/src/GNDStk/enums/units/Length/test/CMakeLists.txt +++ b/src/GNDStk/enums/units/Length/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.enums.units.Length.test Length.test.cpp ) +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} 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..8bddddcbf 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; @@ -133,8 +138,9 @@ class Precision { // 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 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..171b70a68 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 @@ -81,10 +87,10 @@ 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(); \ } \ @@ -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 { 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..069ed6cb3 --- /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 + GNDSTK_MAKE_META(int, A); + GNDSTK_MAKE_META(int, ENDF_MT); + + // double + GNDSTK_MAKE_META(double, format); + + // string + GNDSTK_MAKE_META(std::string, encoding); + GNDSTK_MAKE_META(std::string, evaluation); + GNDSTK_MAKE_META(std::string, id); + GNDSTK_MAKE_META(std::string, label); + GNDSTK_MAKE_META(std::string, projectile); + GNDSTK_MAKE_META(std::string, projectileFrame); + GNDSTK_MAKE_META(std::string, symbol); + GNDSTK_MAKE_META(std::string, target); + GNDSTK_MAKE_META(std::string, unit); + 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 + GNDSTK_MAKE_CHILD(void, axes, one); + GNDSTK_MAKE_CHILD(void, axis, many); + GNDSTK_MAKE_CHILD(void, chemicalElements, one); + GNDSTK_MAKE_CHILD(void, chemicalElement, many); + GNDSTK_MAKE_CHILD(void, isotopes, one); + GNDSTK_MAKE_CHILD(void, isotope, many); + GNDSTK_MAKE_CHILD(void, nuclides, one); + GNDSTK_MAKE_CHILD(void, reactions, one); + GNDSTK_MAKE_CHILD(void, reaction, many); + GNDSTK_MAKE_CHILD(void, crossSection, one); + GNDSTK_MAKE_CHILD(void, styles, one); + GNDSTK_MAKE_CHILD(void, temperature, one); + inline const njoy::GNDStk::Child + xml(njoy::GNDStk::special::xml); + GNDSTK_MAKE_CHILD(void, evaluated, many); + 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..55bfb20af 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,11 +34,17 @@ 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); } @@ -49,8 +55,8 @@ inline void convert(const std::pair &p, std::ostream &os) 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 */ \ @@ -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 { 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..f6777a0a1 100644 --- a/src/GNDStk/utility.hpp +++ b/src/GNDStk/utility.hpp @@ -3,6 +3,11 @@ // Miscellaneous variables, enums, etc. // ----------------------------------------------------------------------------- +#ifdef SIMPLE_JSON +#else +using orderedJSON = nlohmann::ordered_json; +#endif + // indent // Number of spaces of indentation you want, in the output of certain types inline int indent = 3; @@ -16,17 +21,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 +39,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 +78,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 +96,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 +114,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 +155,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 +220,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 +239,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 +249,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 +259,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 +267,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 +281,110 @@ 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); +// 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 & = ""); -// Tree to {Tree,XML,JSON} -bool convert(const Tree &, Tree &); -bool convert(const Tree &, XML &); -bool convert(const Tree &, JSON &); - -// 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 &); bool convert(const XML &, JSON &); +bool convert(const XML &, HDF5 &); -// JSON to {Node,Tree,XML,JSON} -bool convert(const JSON &, Node &, const bool); -bool convert(const JSON &, Tree &); +// JSON ==> {Node,XML,JSON,HDF5} +bool convert(const JSON &, Node &, const bool & = detail::default_bool); bool convert(const JSON &, XML &); bool convert(const JSON &, JSON &); +bool convert(const JSON &, HDF5 &); +// HDF5 ==> {Node,XML,JSON,HDF5} +bool convert(const HDF5 &, Node &, const bool & = detail::default_bool); +bool convert(const HDF5 &, XML &); +bool convert(const HDF5 &, JSON &); +bool convert(const HDF5 &, HDF5 &); // ----------------------------------------------------------------------------- // 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 +394,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 +415,6 @@ inline bool nocasecmp(const std::string &one, const std::string &two) } - // ----------------------------------------------------------------------------- // Re: file extensions // ----------------------------------------------------------------------------- @@ -424,36 +445,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 +502,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 +528,153 @@ inline bool eq_hdf5(const std::string &str) namespace detail { -// ------------------------ -// isVariant -// ------------------------ - +// is_void_v template -class isVariant { -public: - static constexpr bool value = false; -}; +inline constexpr bool is_void_v = std::is_same_v; -template -class isVariant> { -public: - static constexpr bool value = true; -}; - -// ------------------------ -// 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/standards/gnds-2.0-alpha/.gitignore b/standards/gnds-2.0-alpha/.gitignore new file mode 100644 index 000000000..10c8c13a9 --- /dev/null +++ b/standards/gnds-2.0-alpha/.gitignore @@ -0,0 +1,21 @@ + +m +j +p +v +stub.cpp +deps +files +*.o +out +[123]* +notes +print.* +out.* +dup +add.hh +GNDStk +a.out +c.cc +l +l.[12] diff --git a/standards/gnds-2.0-alpha/1.cpp b/standards/gnds-2.0-alpha/1.cpp new file mode 100644 index 000000000..4f71e77c5 --- /dev/null +++ b/standards/gnds-2.0-alpha/1.cpp @@ -0,0 +1,44 @@ + +#include "alpha/v2.0.hpp" +using namespace alpha; +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/standards/gnds-2.0-alpha/2.cpp b/standards/gnds-2.0-alpha/2.cpp new file mode 100644 index 000000000..e87ed538f --- /dev/null +++ b/standards/gnds-2.0-alpha/2.cpp @@ -0,0 +1,49 @@ + +#include "alpha/v2.0.hpp" +using namespace alpha; +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/standards/gnds-2.0-alpha/all.json b/standards/gnds-2.0-alpha/all.json new file mode 100644 index 000000000..2a3d0a53b --- /dev/null +++ b/standards/gnds-2.0-alpha/all.json @@ -0,0 +1,16 @@ +{ + "//": "For now, our alpha version of GNDS v2.0", + + "Project": "alpha", + "Version": "v2.0", + + "JSONFiles": [ + "top.json", + "general.json", + "reduced.json", + "g2d.json", + "g3d.json" + ], + + "Changes": "changes.json" +} diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0.h new file mode 100644 index 000000000..755561645 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0 +#define C_INTERFACE_ALPHA_V2_0 + +#include "GNDStk.h" + +#ifdef __cplusplus + // For C++ + #include "alpha/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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g2d/Array.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g2d/Array.cpp new file mode 100644 index 000000000..8a9b0ae30 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g2d/Array.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/g2d/Array.hpp" +#include "Array.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g2d/Array.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g2d/Array.h new file mode 100644 index 000000000..87f1b4605 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_G2D_ARRAY +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g2d/Array/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g2d/Array/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g2d/Array/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g2d/Array/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Array.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Array.cpp new file mode 100644 index 000000000..ffec49a85 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Array.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/g3d/Array.hpp" +#include "Array.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Array.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Array.h new file mode 100644 index 000000000..e39116d85 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_G3D_ARRAY +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Array/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Array/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Array/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Array/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Lengths.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Lengths.cpp new file mode 100644 index 000000000..a203dca6c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Lengths.cpp @@ -0,0 +1,270 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/g3d/Lengths.hpp" +#include "Lengths.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Lengths.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Lengths.h new file mode 100644 index 000000000..96f46e989 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_G3D_LENGTHS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Lengths +LengthsDefault(); + +// --- Create, general, const +extern_c Handle2ConstLengths +LengthsCreateConst( + const char *const valueType, + const char *const label +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Lengths/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Lengths/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Lengths/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Lengths/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Starts.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Starts.cpp new file mode 100644 index 000000000..25ec7230d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Starts.cpp @@ -0,0 +1,270 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/g3d/Starts.hpp" +#include "Starts.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Starts.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Starts.h new file mode 100644 index 000000000..0a8cd924e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_G3D_STARTS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Starts +StartsDefault(); + +// --- Create, general, const +extern_c Handle2ConstStarts +StartsCreateConst( + const char *const valueType, + const char *const label +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Starts/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Starts/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Starts/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/g3d/Starts/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Add.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Add.cpp new file mode 100644 index 000000000..f03cb03a5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Add.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Add.hpp" +#include "Add.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Add.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Add.h new file mode 100644 index 000000000..655157652 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ADD +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Add +AddDefault(); + +// --- Create, general, const +extern_c Handle2ConstAdd +AddCreateConst( + const char *const href +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Add/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Add/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Add/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Add/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Alias.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Alias.cpp new file mode 100644 index 000000000..9a9d3f448 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Alias.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Alias.hpp" +#include "Alias.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Alias.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Alias.h new file mode 100644 index 000000000..1cfdd5b22 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ALIAS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Alias +AliasDefault(); + +// --- Create, general, const +extern_c Handle2ConstAlias +AliasCreateConst( + const char *const id, + const char *const pid +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Alias/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Alias/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Alias/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Alias/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases.cpp new file mode 100644 index 000000000..08d3fb242 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases.cpp @@ -0,0 +1,511 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Aliases.hpp" +#include "Aliases.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases.h new file mode 100644 index 000000000..090853af6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases.h @@ -0,0 +1,362 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_ALIASES +#define C_INTERFACE_ALPHA_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 +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 +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Aliases/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Angular.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Angular.cpp new file mode 100644 index 000000000..946d9e17f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Angular.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Angular.hpp" +#include "Angular.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Angular.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Angular.h new file mode 100644 index 000000000..03e217b53 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ANGULAR +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Angular +AngularDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngular +AngularCreateConst( + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Angular/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Angular/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Angular/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Angular/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularEnergy.cpp new file mode 100644 index 000000000..9ceb043e4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularEnergy.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/AngularEnergy.hpp" +#include "AngularEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularEnergy.h new file mode 100644 index 000000000..f7ac7ae34 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ANGULARENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2AngularEnergy +AngularEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngularEnergy +AngularEnergyCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularTwoBody.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularTwoBody.cpp new file mode 100644 index 000000000..6a5dc1044 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularTwoBody.cpp @@ -0,0 +1,380 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/AngularTwoBody.hpp" +#include "AngularTwoBody.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularTwoBody.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularTwoBody.h new file mode 100644 index 000000000..f4112ef26 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ANGULARTWOBODY +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularTwoBody/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularTwoBody/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularTwoBody/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AngularTwoBody/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ApplicationData.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ApplicationData.cpp new file mode 100644 index 000000000..5cc83f060 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ApplicationData.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ApplicationData.hpp" +#include "ApplicationData.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ApplicationData.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ApplicationData.h new file mode 100644 index 000000000..43faf70fd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_APPLICATIONDATA +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ApplicationData +ApplicationDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstApplicationData +ApplicationDataCreateConst( + ConstHandle2ConstInstitution institution +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ApplicationData/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ApplicationData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ApplicationData/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ApplicationData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Array.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Array.cpp new file mode 100644 index 000000000..82f2887b0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Array.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Array.hpp" +#include "Array.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Array.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Array.h new file mode 100644 index 000000000..f63c42399 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ARRAY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Array +ArrayDefault(); + +// --- Create, general, const +extern_c Handle2ConstArray +ArrayCreateConst( + const char *const shape, + const char *const compression, + ConstHandle2ConstValues values +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Array/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Array/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Array/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Array/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Atomic.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Atomic.cpp new file mode 100644 index 000000000..c5773a350 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Atomic.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Atomic.hpp" +#include "Atomic.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Atomic.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Atomic.h new file mode 100644 index 000000000..58788c1a7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ATOMIC +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Atomic +AtomicDefault(); + +// --- Create, general, const +extern_c Handle2ConstAtomic +AtomicCreateConst( + ConstHandle2ConstConfigurations configurations +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Atomic/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Atomic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Atomic/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Atomic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Author.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Author.cpp new file mode 100644 index 000000000..d945715b7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Author.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Author.hpp" +#include "Author.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Author.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Author.h new file mode 100644 index 000000000..ab061afb8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_AUTHOR +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Author +AuthorDefault(); + +// --- Create, general, const +extern_c Handle2ConstAuthor +AuthorCreateConst( + const char *const name +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Author/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Author/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Author/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Author/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors.cpp new file mode 100644 index 000000000..3a1b1e9f7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Authors.hpp" +#include "Authors.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors.h new file mode 100644 index 000000000..e71b85ae8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_AUTHORS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Authors +AuthorsDefault(); + +// --- Create, general, const +extern_c Handle2ConstAuthors +AuthorsCreateConst( + ConstHandle2Author *const author, const size_t authorSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Authors/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies.cpp new file mode 100644 index 000000000..e165f9b45 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/AverageEnergies.hpp" +#include "AverageEnergies.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies.h new file mode 100644 index 000000000..ca82b70ac --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies.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. +// +// 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_ALPHA_V2_0_GENERAL_AVERAGEENERGIES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2AverageEnergies +AverageEnergiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageEnergies +AverageEnergiesCreateConst( + ConstHandle2AverageEnergy *const averageEnergy, const size_t averageEnergySize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergies/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergy.cpp new file mode 100644 index 000000000..349babc8e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergy.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/AverageEnergy.hpp" +#include "AverageEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergy.h new file mode 100644 index 000000000..579eef08c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_AVERAGEENERGY +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageParameterCovariance.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageParameterCovariance.cpp new file mode 100644 index 000000000..25865b0df --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageParameterCovariance.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/AverageParameterCovariance.hpp" +#include "AverageParameterCovariance.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageParameterCovariance.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageParameterCovariance.h new file mode 100644 index 000000000..cb19a3a90 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_AVERAGEPARAMETERCOVARIANCE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageParameterCovariance/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageParameterCovariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageParameterCovariance/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageParameterCovariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageProductEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageProductEnergy.cpp new file mode 100644 index 000000000..c30a8550a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageProductEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/AverageProductEnergy.hpp" +#include "AverageProductEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageProductEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageProductEnergy.h new file mode 100644 index 000000000..50d063eb0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_AVERAGEPRODUCTENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2AverageProductEnergy +AverageProductEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageProductEnergy +AverageProductEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageProductEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageProductEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageProductEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/AverageProductEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes.cpp new file mode 100644 index 000000000..6b452f45b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes.cpp @@ -0,0 +1,646 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Axes.hpp" +#include "Axes.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes.h new file mode 100644 index 000000000..f366960e3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes.h @@ -0,0 +1,449 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_AXES +#define C_INTERFACE_ALPHA_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 +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 +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axis.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axis.cpp new file mode 100644 index 000000000..c68e2cbaf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axis.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Axis.hpp" +#include "Axis.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 "v2.0/general/Axis/src/custom.cpp" diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axis.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axis.h new file mode 100644 index 000000000..7dd5ed378 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_AXIS +#define C_INTERFACE_ALPHA_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 +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 "v2.0/general/Axis/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axis/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axis/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axis/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Axis/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Background.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Background.cpp new file mode 100644 index 000000000..345175a01 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Background.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Background.hpp" +#include "Background.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Background.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Background.h new file mode 100644 index 000000000..683b6a46a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_BACKGROUND +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Background +BackgroundDefault(); + +// --- Create, general, const +extern_c Handle2ConstBackground +BackgroundCreateConst( + ConstHandle2ConstResolvedRegion resolvedRegion, + ConstHandle2ConstFastRegion fastRegion, + ConstHandle2ConstUnresolvedRegion unresolvedRegion +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Background/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Background/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Background/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Background/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryon.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryon.cpp new file mode 100644 index 000000000..3ecb0b2da --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryon.cpp @@ -0,0 +1,431 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Baryon.hpp" +#include "Baryon.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryon.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryon.h new file mode 100644 index 000000000..719ec1792 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_BARYON +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryon/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryon/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryon/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryon/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons.cpp new file mode 100644 index 000000000..34bc70630 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Baryons.hpp" +#include "Baryons.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons.h new file mode 100644 index 000000000..84cb96fc6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_BARYONS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Baryons +BaryonsDefault(); + +// --- Create, general, const +extern_c Handle2ConstBaryons +BaryonsCreateConst( + ConstHandle2Baryon *const baryon, const size_t baryonSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Baryons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BindingEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BindingEnergy.cpp new file mode 100644 index 000000000..f15504b2c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BindingEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/BindingEnergy.hpp" +#include "BindingEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BindingEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BindingEnergy.h new file mode 100644 index 000000000..1047e2f6d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_BINDINGENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2BindingEnergy +BindingEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBindingEnergy +BindingEnergyCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BindingEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BindingEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BindingEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BindingEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Body.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Body.cpp new file mode 100644 index 000000000..e36c01bc2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Body.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Body.hpp" +#include "Body.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +Handle2Body +BodyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBody +BodyCreateConst() +{ + ConstHandle2Body handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Body.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Body.h new file mode 100644 index 000000000..bbab07ca0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_BODY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Body +BodyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBody +BodyCreateConst(); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Body/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Body/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Body/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Body/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BoundAtomCrossSection.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BoundAtomCrossSection.cpp new file mode 100644 index 000000000..a04b7eea3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BoundAtomCrossSection.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/BoundAtomCrossSection.hpp" +#include "BoundAtomCrossSection.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BoundAtomCrossSection.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BoundAtomCrossSection.h new file mode 100644 index 000000000..eec8b2e32 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_BOUNDATOMCROSSSECTION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2BoundAtomCrossSection +BoundAtomCrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstBoundAtomCrossSection +BoundAtomCrossSectionCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BoundAtomCrossSection/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BoundAtomCrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BoundAtomCrossSection/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BoundAtomCrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching1d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching1d.cpp new file mode 100644 index 000000000..37a18c604 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching1d.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Branching1d.hpp" +#include "Branching1d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching1d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching1d.h new file mode 100644 index 000000000..df83b489e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_BRANCHING1D +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Branching1d +Branching1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstBranching1d +Branching1dCreateConst( + const char *const label +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching1d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching1d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching3d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching3d.cpp new file mode 100644 index 000000000..8c9df01a2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching3d.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Branching3d.hpp" +#include "Branching3d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching3d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching3d.h new file mode 100644 index 000000000..a7b78169d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_BRANCHING3D +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Branching3d +Branching3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstBranching3d +Branching3dCreateConst( + const char *const label, + const char *const productFrame +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching3d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching3d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Branching3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BreitWigner.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BreitWigner.cpp new file mode 100644 index 000000000..259fe2267 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BreitWigner.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/BreitWigner.hpp" +#include "BreitWigner.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BreitWigner.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BreitWigner.h new file mode 100644 index 000000000..fcef5a4e2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_BREITWIGNER +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BreitWigner/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BreitWigner/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BreitWigner/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/BreitWigner/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channel.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channel.cpp new file mode 100644 index 000000000..cc5adafb9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channel.cpp @@ -0,0 +1,399 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Channel.hpp" +#include "Channel.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channel.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channel.h new file mode 100644 index 000000000..25908138d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CHANNEL +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channel/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channel/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels.cpp new file mode 100644 index 000000000..78552ec13 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels.cpp @@ -0,0 +1,437 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Channels.hpp" +#include "Channels.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels.h new file mode 100644 index 000000000..ec5e7a0ae --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels.h @@ -0,0 +1,322 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_CHANNELS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Channels +ChannelsDefault(); + +// --- Create, general, const +extern_c Handle2ConstChannels +ChannelsCreateConst( + ConstHandle2Channel *const channel, const size_t channelSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Channels/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Charge.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Charge.cpp new file mode 100644 index 000000000..fdcd0630a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Charge.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Charge.hpp" +#include "Charge.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Charge.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Charge.h new file mode 100644 index 000000000..63a0c6aa3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CHARGE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Charge +ChargeDefault(); + +// --- Create, general, const +extern_c Handle2ConstCharge +ChargeCreateConst( + ConstHandle2ConstInteger integer +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Charge/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Charge/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Charge/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Charge/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElement.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElement.cpp new file mode 100644 index 000000000..f7cef4faf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElement.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ChemicalElement.hpp" +#include "ChemicalElement.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElement.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElement.h new file mode 100644 index 000000000..53ce27622 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CHEMICALELEMENT +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElement/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElement/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElement/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElement/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements.cpp new file mode 100644 index 000000000..2e2abf6f4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ChemicalElements.hpp" +#include "ChemicalElements.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements.h new file mode 100644 index 000000000..b4e84759d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements.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. +// +// 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_ALPHA_V2_0_GENERAL_CHEMICALELEMENTS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ChemicalElements +ChemicalElementsDefault(); + +// --- Create, general, const +extern_c Handle2ConstChemicalElements +ChemicalElementsCreateConst( + ConstHandle2ChemicalElement *const chemicalElement, const size_t chemicalElementSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ChemicalElements/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoherentPhotonScattering.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoherentPhotonScattering.cpp new file mode 100644 index 000000000..ae25d7567 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoherentPhotonScattering.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/CoherentPhotonScattering.hpp" +#include "CoherentPhotonScattering.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoherentPhotonScattering.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoherentPhotonScattering.h new file mode 100644 index 000000000..73aeadcdf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_COHERENTPHOTONSCATTERING +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoherentPhotonScattering/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoherentPhotonScattering/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoherentPhotonScattering/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoherentPhotonScattering/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Column.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Column.cpp new file mode 100644 index 000000000..281e97f38 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Column.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Column.hpp" +#include "Column.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Column.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Column.h new file mode 100644 index 000000000..7e658e98a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_COLUMN +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Column +ColumnDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumn +ColumnCreateConst( + const int index, + const char *const name, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Column/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Column/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Column/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Column/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnData.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnData.cpp new file mode 100644 index 000000000..53b4abd1d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnData.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ColumnData.hpp" +#include "ColumnData.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnData.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnData.h new file mode 100644 index 000000000..7fe5aaaaa --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_COLUMNDATA +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ColumnData +ColumnDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumnData +ColumnDataCreateConst( + const char *const ENDF_MFMT, + const char *const href, + ConstHandle2ConstSlices slices +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnData/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnData/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders.cpp new file mode 100644 index 000000000..a85ac3d9a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ColumnHeaders.hpp" +#include "ColumnHeaders.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders.h new file mode 100644 index 000000000..266eaf5c4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders.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. +// +// 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_ALPHA_V2_0_GENERAL_COLUMNHEADERS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ColumnHeaders +ColumnHeadersDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumnHeaders +ColumnHeadersCreateConst( + ConstHandle2Column *const column, const size_t columnSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ColumnHeaders/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configuration.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configuration.cpp new file mode 100644 index 000000000..75f6b2fdc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configuration.cpp @@ -0,0 +1,325 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Configuration.hpp" +#include "Configuration.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configuration.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configuration.h new file mode 100644 index 000000000..6dc678a79 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CONFIGURATION +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configuration/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configuration/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configuration/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configuration/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations.cpp new file mode 100644 index 000000000..e4944d936 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Configurations.hpp" +#include "Configurations.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations.h new file mode 100644 index 000000000..7e9e0a86d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_CONFIGURATIONS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Configurations +ConfigurationsDefault(); + +// --- Create, general, const +extern_c Handle2ConstConfigurations +ConfigurationsCreateConst( + ConstHandle2Configuration *const configuration, const size_t configurationSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Configurations/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Constant1d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Constant1d.cpp new file mode 100644 index 000000000..42f11ffa3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Constant1d.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Constant1d.hpp" +#include "Constant1d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Constant1d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Constant1d.h new file mode 100644 index 000000000..4c2ec7840 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CONSTANT1D +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Constant1d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Constant1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Constant1d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Constant1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Continuum.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Continuum.cpp new file mode 100644 index 000000000..e5f4de3a2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Continuum.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Continuum.hpp" +#include "Continuum.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Continuum.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Continuum.h new file mode 100644 index 000000000..2147e75b7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CONTINUUM +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Continuum +ContinuumDefault(); + +// --- Create, general, const +extern_c Handle2ConstContinuum +ContinuumCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Continuum/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Continuum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Continuum/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Continuum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Conversion.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Conversion.cpp new file mode 100644 index 000000000..ea1b6fe33 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Conversion.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Conversion.hpp" +#include "Conversion.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Conversion.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Conversion.h new file mode 100644 index 000000000..3d6f55502 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CONVERSION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Conversion +ConversionDefault(); + +// --- Create, general, const +extern_c Handle2ConstConversion +ConversionCreateConst( + const char *const flags, + const char *const href +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Conversion/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Conversion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Conversion/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Conversion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoulombPlusNuclearElastic.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoulombPlusNuclearElastic.cpp new file mode 100644 index 000000000..58b5c4db0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoulombPlusNuclearElastic.cpp @@ -0,0 +1,442 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "CoulombPlusNuclearElastic.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoulombPlusNuclearElastic.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoulombPlusNuclearElastic.h new file mode 100644 index 000000000..267669614 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_COULOMBPLUSNUCLEARELASTIC +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoulombPlusNuclearElastic/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoulombPlusNuclearElastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoulombPlusNuclearElastic/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CoulombPlusNuclearElastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Covariance.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Covariance.cpp new file mode 100644 index 000000000..4d7279e1c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Covariance.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Covariance.hpp" +#include "Covariance.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Covariance.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Covariance.h new file mode 100644 index 000000000..a51b40518 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_COVARIANCE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Covariance +CovarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovariance +CovarianceCreateConst( + const char *const label, + const char *const href, + ConstHandle2ConstArray array +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Covariance/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Covariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Covariance/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Covariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceMatrix.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceMatrix.cpp new file mode 100644 index 000000000..8cfdc79c1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceMatrix.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/CovarianceMatrix.hpp" +#include "CovarianceMatrix.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceMatrix.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceMatrix.h new file mode 100644 index 000000000..43376f510 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_COVARIANCEMATRIX +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceMatrix/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceMatrix/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSection.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSection.cpp new file mode 100644 index 000000000..9ec45cda6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSection.cpp @@ -0,0 +1,423 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/CovarianceSection.hpp" +#include "CovarianceSection.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSection.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSection.h new file mode 100644 index 000000000..ad54ce856 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_COVARIANCESECTION +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSection/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSection/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections.cpp new file mode 100644 index 000000000..7c000d2e5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/CovarianceSections.hpp" +#include "CovarianceSections.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections.h new file mode 100644 index 000000000..7afb92963 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_COVARIANCESECTIONS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2CovarianceSections +CovarianceSectionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceSections +CovarianceSectionsCreateConst( + ConstHandle2CovarianceSection *const covarianceSection, const size_t covarianceSectionSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CovarianceSections/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSection.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSection.cpp new file mode 100644 index 000000000..4e47ea23b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSection.cpp @@ -0,0 +1,396 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/CrossSection.hpp" +#include "CrossSection.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSection.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSection.h new file mode 100644 index 000000000..5947fcb39 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CROSSSECTION +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSection/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSection/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionReconstructed.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionReconstructed.cpp new file mode 100644 index 000000000..3f9ed80db --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionReconstructed.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/CrossSectionReconstructed.hpp" +#include "CrossSectionReconstructed.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionReconstructed.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionReconstructed.h new file mode 100644 index 000000000..5b69cdcb8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CROSSSECTIONRECONSTRUCTED +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionReconstructed/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionReconstructed/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionReconstructed/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionReconstructed/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSum.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSum.cpp new file mode 100644 index 000000000..064c373e5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSum.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/CrossSectionSum.hpp" +#include "CrossSectionSum.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSum.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSum.h new file mode 100644 index 000000000..91262f633 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_CROSSSECTIONSUM +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSum/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSum/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums.cpp new file mode 100644 index 000000000..b3880a49a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/CrossSectionSums.hpp" +#include "CrossSectionSums.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums.h new file mode 100644 index 000000000..8510e4749 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_CROSSSECTIONSUMS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2CrossSectionSums +CrossSectionSumsDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSectionSums +CrossSectionSumsCreateConst( + ConstHandle2CrossSectionSum *const crossSectionSum, const size_t crossSectionSumSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/CrossSectionSums/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Data.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Data.cpp new file mode 100644 index 000000000..87dffcc00 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Data.cpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Data.hpp" +#include "Data.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +Handle2Data +DataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstData +DataCreateConst() +{ + ConstHandle2Data handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Data.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Data.h new file mode 100644 index 000000000..06f426eff --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DATA +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Data +DataDefault(); + +// --- Create, general, const +extern_c Handle2ConstData +DataCreateConst(); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Data/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Data/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Data/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Data/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Date.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Date.cpp new file mode 100644 index 000000000..642f537cd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Date.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Date.hpp" +#include "Date.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Date.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Date.h new file mode 100644 index 000000000..b5bd78c76 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DATE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Date +DateDefault(); + +// --- Create, general, const +extern_c Handle2ConstDate +DateCreateConst( + const char *const value, + const char *const dateType +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Date/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Date/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Date/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Date/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates.cpp new file mode 100644 index 000000000..2396e7f1a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Dates.hpp" +#include "Dates.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates.h new file mode 100644 index 000000000..67308073b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_DATES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Dates +DatesDefault(); + +// --- Create, general, const +extern_c Handle2ConstDates +DatesCreateConst( + ConstHandle2Date *const date, const size_t dateSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Dates/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DebyeWallerIntegral.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DebyeWallerIntegral.cpp new file mode 100644 index 000000000..1bae8c63c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DebyeWallerIntegral.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DebyeWallerIntegral.hpp" +#include "DebyeWallerIntegral.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DebyeWallerIntegral.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DebyeWallerIntegral.h new file mode 100644 index 000000000..602e29f45 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DEBYEWALLERINTEGRAL +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DebyeWallerIntegral +DebyeWallerIntegralDefault(); + +// --- Create, general, const +extern_c Handle2ConstDebyeWallerIntegral +DebyeWallerIntegralCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DebyeWallerIntegral/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DebyeWallerIntegral/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DebyeWallerIntegral/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DebyeWallerIntegral/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Decay.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Decay.cpp new file mode 100644 index 000000000..5c97f383c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Decay.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Decay.hpp" +#include "Decay.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Decay.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Decay.h new file mode 100644 index 000000000..69ed10cef --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DECAY +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Decay/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Decay/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Decay/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Decay/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayData.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayData.cpp new file mode 100644 index 000000000..62f890ffc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayData.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DecayData.hpp" +#include "DecayData.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayData.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayData.h new file mode 100644 index 000000000..5df9079f6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DECAYDATA +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DecayData +DecayDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayData +DecayDataCreateConst( + ConstHandle2ConstDecayModes decayModes, + ConstHandle2ConstAverageEnergies averageEnergies +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayData/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayData/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayMode.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayMode.cpp new file mode 100644 index 000000000..0d28f8b25 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayMode.cpp @@ -0,0 +1,423 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DecayMode.hpp" +#include "DecayMode.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayMode.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayMode.h new file mode 100644 index 000000000..df14dc6bc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DECAYMODE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayMode/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayMode/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayMode/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayMode/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes.cpp new file mode 100644 index 000000000..bee43b4fb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DecayModes.hpp" +#include "DecayModes.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes.h new file mode 100644 index 000000000..2ab3c800d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_DECAYMODES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DecayModes +DecayModesDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayModes +DecayModesCreateConst( + ConstHandle2DecayMode *const decayMode, const size_t decayModeSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayModes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath.cpp new file mode 100644 index 000000000..faec35b39 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DecayPath.hpp" +#include "DecayPath.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath.h new file mode 100644 index 000000000..9fb8db595 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath.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. +// +// 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_ALPHA_V2_0_GENERAL_DECAYPATH +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DecayPath +DecayPathDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayPath +DecayPathCreateConst( + ConstHandle2Decay *const decay, const size_t decaySize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DecayPath/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedBetaEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedBetaEnergy.cpp new file mode 100644 index 000000000..d2ec362cb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedBetaEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DelayedBetaEnergy.hpp" +#include "DelayedBetaEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedBetaEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedBetaEnergy.h new file mode 100644 index 000000000..2a9595694 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DELAYEDBETAENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DelayedBetaEnergy +DelayedBetaEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedBetaEnergy +DelayedBetaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedBetaEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedBetaEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedBetaEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedBetaEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedGammaEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedGammaEnergy.cpp new file mode 100644 index 000000000..3da7563dc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedGammaEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DelayedGammaEnergy.hpp" +#include "DelayedGammaEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedGammaEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedGammaEnergy.h new file mode 100644 index 000000000..8fedfab81 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DELAYEDGAMMAENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DelayedGammaEnergy +DelayedGammaEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedGammaEnergy +DelayedGammaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedGammaEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedGammaEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedGammaEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedGammaEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutron.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutron.cpp new file mode 100644 index 000000000..96a46faaf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutron.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DelayedNeutron.hpp" +#include "DelayedNeutron.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutron.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutron.h new file mode 100644 index 000000000..c65c66759 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DELAYEDNEUTRON +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DelayedNeutron +DelayedNeutronDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedNeutron +DelayedNeutronCreateConst( + const char *const label, + ConstHandle2ConstRate rate, + ConstHandle2ConstProduct product +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutron/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutron/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutron/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutron/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutronKE.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutronKE.cpp new file mode 100644 index 000000000..6efa3b506 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutronKE.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DelayedNeutronKE.hpp" +#include "DelayedNeutronKE.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutronKE.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutronKE.h new file mode 100644 index 000000000..ae0d02671 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DELAYEDNEUTRONKE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DelayedNeutronKE +DelayedNeutronKEDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedNeutronKE +DelayedNeutronKECreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutronKE/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutronKE/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutronKE/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutronKE/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons.cpp new file mode 100644 index 000000000..2eb0decf8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DelayedNeutrons.hpp" +#include "DelayedNeutrons.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons.h new file mode 100644 index 000000000..a42ff40de --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_DELAYEDNEUTRONS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DelayedNeutrons +DelayedNeutronsDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedNeutrons +DelayedNeutronsCreateConst( + ConstHandle2DelayedNeutron *const delayedNeutron, const size_t delayedNeutronSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DelayedNeutrons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Discrete.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Discrete.cpp new file mode 100644 index 000000000..935b0503a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Discrete.cpp @@ -0,0 +1,345 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Discrete.hpp" +#include "Discrete.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Discrete.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Discrete.h new file mode 100644 index 000000000..86e5f8681 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DISCRETE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Discrete/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Discrete/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Discrete/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Discrete/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DiscreteGamma.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DiscreteGamma.cpp new file mode 100644 index 000000000..c4a3749fe --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DiscreteGamma.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DiscreteGamma.hpp" +#include "DiscreteGamma.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DiscreteGamma.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DiscreteGamma.h new file mode 100644 index 000000000..90c6820ab --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DISCRETEGAMMA +#define C_INTERFACE_ALPHA_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 +extern_c Handle2DiscreteGamma +DiscreteGammaDefault(); + +// --- Create, general, const +extern_c Handle2ConstDiscreteGamma +DiscreteGammaCreateConst( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DiscreteGamma/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DiscreteGamma/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DiscreteGamma/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DiscreteGamma/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Distribution.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Distribution.cpp new file mode 100644 index 000000000..b5efc93f6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Distribution.cpp @@ -0,0 +1,611 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Distribution.hpp" +#include "Distribution.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Distribution.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Distribution.h new file mode 100644 index 000000000..eac068dd2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DISTRIBUTION +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Distribution/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Distribution/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Distribution/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Distribution/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Documentation.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Documentation.cpp new file mode 100644 index 000000000..7419e3d00 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Documentation.cpp @@ -0,0 +1,353 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Documentation.hpp" +#include "Documentation.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Documentation.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Documentation.h new file mode 100644 index 000000000..da73852e4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DOCUMENTATION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Documentation +DocumentationDefault(); + +// --- Create, general, const +extern_c Handle2ConstDocumentation +DocumentationCreateConst( + ConstHandle2ConstAuthors authors, + ConstHandle2ConstDates dates, + ConstHandle2ConstTitle title, + ConstHandle2ConstBody body, + ConstHandle2ConstEndfCompatible endfCompatible +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Documentation/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Documentation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Documentation/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Documentation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Double.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Double.cpp new file mode 100644 index 000000000..c15538be1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Double.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Double.hpp" +#include "Double.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Double.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Double.h new file mode 100644 index 000000000..d86cd7504 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DOUBLE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Double/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Double/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Double/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Double/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DoubleDifferentialCrossSection.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DoubleDifferentialCrossSection.cpp new file mode 100644 index 000000000..8be8bb5f8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DoubleDifferentialCrossSection.cpp @@ -0,0 +1,396 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/DoubleDifferentialCrossSection.hpp" +#include "DoubleDifferentialCrossSection.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DoubleDifferentialCrossSection.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DoubleDifferentialCrossSection.h new file mode 100644 index 000000000..e3b3a748b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_DOUBLEDIFFERENTIALCROSSSECTION +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DoubleDifferentialCrossSection/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DoubleDifferentialCrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DoubleDifferentialCrossSection/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/DoubleDifferentialCrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFH.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFH.cpp new file mode 100644 index 000000000..6a03e7350 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFH.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/EFH.hpp" +#include "EFH.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFH.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFH.h new file mode 100644 index 000000000..8c55af1be --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_EFH +#define C_INTERFACE_ALPHA_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 +extern_c Handle2EFH +EFHDefault(); + +// --- Create, general, const +extern_c Handle2ConstEFH +EFHCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFH/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFH/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFH/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFH/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFL.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFL.cpp new file mode 100644 index 000000000..95b36fc68 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFL.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/EFL.hpp" +#include "EFL.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFL.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFL.h new file mode 100644 index 000000000..e36fbdb9e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_EFL +#define C_INTERFACE_ALPHA_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 +extern_c Handle2EFL +EFLDefault(); + +// --- Create, general, const +extern_c Handle2ConstEFL +EFLCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFL/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFL/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFL/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EFL/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags.cpp new file mode 100644 index 000000000..5bf3aaceb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ENDFconversionFlags.hpp" +#include "ENDFconversionFlags.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags.h new file mode 100644 index 000000000..21431b60b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags.h @@ -0,0 +1,275 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_ENDFCONVERSIONFLAGS +#define C_INTERFACE_ALPHA_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 +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 +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ENDFconversionFlags/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_critical.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_critical.cpp new file mode 100644 index 000000000..273ad78c6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_critical.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/E_critical.hpp" +#include "E_critical.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_critical.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_critical.h new file mode 100644 index 000000000..0e9f2bc75 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_E_CRITICAL +#define C_INTERFACE_ALPHA_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 +extern_c Handle2E_critical +E_criticalDefault(); + +// --- Create, general, const +extern_c Handle2ConstE_critical +E_criticalCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_critical/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_critical/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_critical/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_critical/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_max.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_max.cpp new file mode 100644 index 000000000..d10810ba7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_max.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/E_max.hpp" +#include "E_max.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_max.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_max.h new file mode 100644 index 000000000..bd8a8135c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_E_MAX +#define C_INTERFACE_ALPHA_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 +extern_c Handle2E_max +E_maxDefault(); + +// --- Create, general, const +extern_c Handle2ConstE_max +E_maxCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_max/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_max/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_max/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/E_max/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTime.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTime.cpp new file mode 100644 index 000000000..d7c290fc8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTime.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ElapsedTime.hpp" +#include "ElapsedTime.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTime.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTime.h new file mode 100644 index 000000000..9e92835bd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ELAPSEDTIME +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ElapsedTime +ElapsedTimeDefault(); + +// --- Create, general, const +extern_c Handle2ConstElapsedTime +ElapsedTimeCreateConst( + const char *const label, + ConstHandle2ConstTime time, + ConstHandle2ConstYields yields, + ConstHandle2ConstIncidentEnergies incidentEnergies +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTime/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTime/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTime/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTime/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes.cpp new file mode 100644 index 000000000..6495798eb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ElapsedTimes.hpp" +#include "ElapsedTimes.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes.h new file mode 100644 index 000000000..94844912c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_ELAPSEDTIMES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ElapsedTimes +ElapsedTimesDefault(); + +// --- Create, general, const +extern_c Handle2ConstElapsedTimes +ElapsedTimesCreateConst( + ConstHandle2ElapsedTime *const elapsedTime, const size_t elapsedTimeSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ElapsedTimes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EndfCompatible.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EndfCompatible.cpp new file mode 100644 index 000000000..2c7552008 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EndfCompatible.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/EndfCompatible.hpp" +#include "EndfCompatible.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +Handle2EndfCompatible +EndfCompatibleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEndfCompatible +EndfCompatibleCreateConst() +{ + ConstHandle2EndfCompatible handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EndfCompatible.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EndfCompatible.h new file mode 100644 index 000000000..fe2391fd6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ENDFCOMPATIBLE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2EndfCompatible +EndfCompatibleDefault(); + +// --- Create, general, const +extern_c Handle2ConstEndfCompatible +EndfCompatibleCreateConst(); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EndfCompatible/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EndfCompatible/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EndfCompatible/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EndfCompatible/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Energy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Energy.cpp new file mode 100644 index 000000000..0e363b819 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Energy.cpp @@ -0,0 +1,681 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Energy.hpp" +#include "Energy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Energy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Energy.h new file mode 100644 index 000000000..4f1a9eda1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ENERGY +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Energy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Energy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Energy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Energy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EnergyAngular.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EnergyAngular.cpp new file mode 100644 index 000000000..93da18226 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EnergyAngular.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/EnergyAngular.hpp" +#include "EnergyAngular.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EnergyAngular.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EnergyAngular.h new file mode 100644 index 000000000..fe738a7a4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ENERGYANGULAR +#define C_INTERFACE_ALPHA_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 +extern_c Handle2EnergyAngular +EnergyAngularDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergyAngular +EnergyAngularCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EnergyAngular/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EnergyAngular/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EnergyAngular/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/EnergyAngular/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaluated.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaluated.cpp new file mode 100644 index 000000000..a9a89fe32 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaluated.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Evaluated.hpp" +#include "Evaluated.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaluated.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaluated.h new file mode 100644 index 000000000..891212af1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_EVALUATED +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaluated/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaluated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaluated/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaluated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaporation.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaporation.cpp new file mode 100644 index 000000000..79e72e79d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaporation.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Evaporation.hpp" +#include "Evaporation.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaporation.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaporation.h new file mode 100644 index 000000000..08840fc0d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_EVAPORATION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Evaporation +EvaporationDefault(); + +// --- Create, general, const +extern_c Handle2ConstEvaporation +EvaporationCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaporation/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaporation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaporation/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Evaporation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFile.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFile.cpp new file mode 100644 index 000000000..a1796a88e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFile.cpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ExternalFile.hpp" +#include "ExternalFile.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFile.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFile.h new file mode 100644 index 000000000..d73c61c26 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_EXTERNALFILE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFile/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFile/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFile/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFile/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles.cpp new file mode 100644 index 000000000..1eefcca85 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ExternalFiles.hpp" +#include "ExternalFiles.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles.h new file mode 100644 index 000000000..e19cd31b4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles.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. +// +// 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_ALPHA_V2_0_GENERAL_EXTERNALFILES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ExternalFiles +ExternalFilesDefault(); + +// --- Create, general, const +extern_c Handle2ConstExternalFiles +ExternalFilesCreateConst( + ConstHandle2ExternalFile *const externalFile, const size_t externalFileSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ExternalFiles/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/F.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/F.cpp new file mode 100644 index 000000000..a0f056314 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/F.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/F.hpp" +#include "F.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/F.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/F.h new file mode 100644 index 000000000..3bd5bae45 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_F +#define C_INTERFACE_ALPHA_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 +extern_c Handle2F +FDefault(); + +// --- Create, general, const +extern_c Handle2ConstF +FCreateConst( + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/F/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/F/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/F/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/F/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FastRegion.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FastRegion.cpp new file mode 100644 index 000000000..c7af93b8c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FastRegion.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/FastRegion.hpp" +#include "FastRegion.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FastRegion.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FastRegion.h new file mode 100644 index 000000000..9fd94780f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_FASTREGION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2FastRegion +FastRegionDefault(); + +// --- Create, general, const +extern_c Handle2ConstFastRegion +FastRegionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FastRegion/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FastRegion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FastRegion/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FastRegion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponent.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponent.cpp new file mode 100644 index 000000000..0636b4f66 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponent.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/FissionComponent.hpp" +#include "FissionComponent.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponent.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponent.h new file mode 100644 index 000000000..006c09cc2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_FISSIONCOMPONENT +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponent/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponent/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponent/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponent/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents.cpp new file mode 100644 index 000000000..2ed514090 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/FissionComponents.hpp" +#include "FissionComponents.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents.h new file mode 100644 index 000000000..ff4fc8830 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents.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. +// +// 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_ALPHA_V2_0_GENERAL_FISSIONCOMPONENTS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2FissionComponents +FissionComponentsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionComponents +FissionComponentsCreateConst( + ConstHandle2FissionComponent *const fissionComponent, const size_t fissionComponentSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionComponents/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyRelease.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyRelease.cpp new file mode 100644 index 000000000..2b08bc764 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyRelease.cpp @@ -0,0 +1,560 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/FissionEnergyRelease.hpp" +#include "FissionEnergyRelease.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyRelease.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyRelease.h new file mode 100644 index 000000000..5f2391cf0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_FISSIONENERGYRELEASE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyRelease/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyRelease/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyRelease/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyRelease/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases.cpp new file mode 100644 index 000000000..fed5cab18 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/FissionEnergyReleases.hpp" +#include "FissionEnergyReleases.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases.h new file mode 100644 index 000000000..b173c46cc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_FISSIONENERGYRELEASES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2FissionEnergyReleases +FissionEnergyReleasesDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionEnergyReleases +FissionEnergyReleasesCreateConst( + ConstHandle2FissionEnergyRelease *const fissionEnergyRelease, const size_t fissionEnergyReleaseSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FissionEnergyReleases/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FormFactor.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FormFactor.cpp new file mode 100644 index 000000000..b3c21f9c9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FormFactor.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/FormFactor.hpp" +#include "FormFactor.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FormFactor.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FormFactor.h new file mode 100644 index 000000000..d0f0d1097 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_FORMFACTOR +#define C_INTERFACE_ALPHA_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 +extern_c Handle2FormFactor +FormFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstFormFactor +FormFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FormFactor/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FormFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FormFactor/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FormFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Fraction.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Fraction.cpp new file mode 100644 index 000000000..ec6641717 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Fraction.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Fraction.hpp" +#include "Fraction.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Fraction.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Fraction.h new file mode 100644 index 000000000..8523f5280 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_FRACTION +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Fraction/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Fraction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Fraction/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Fraction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FreeGasApproximation.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FreeGasApproximation.cpp new file mode 100644 index 000000000..bafc5d5c9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FreeGasApproximation.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/FreeGasApproximation.hpp" +#include "FreeGasApproximation.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +Handle2FreeGasApproximation +FreeGasApproximationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFreeGasApproximation +FreeGasApproximationCreateConst() +{ + ConstHandle2FreeGasApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FreeGasApproximation.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FreeGasApproximation.h new file mode 100644 index 000000000..78e120422 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_FREEGASAPPROXIMATION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2FreeGasApproximation +FreeGasApproximationDefault(); + +// --- Create, general, const +extern_c Handle2ConstFreeGasApproximation +FreeGasApproximationCreateConst(); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FreeGasApproximation/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FreeGasApproximation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FreeGasApproximation/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/FreeGasApproximation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds.cpp new file mode 100644 index 000000000..57afe18cd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds.cpp @@ -0,0 +1,675 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Function1ds.hpp" +#include "Function1ds.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds.h new file mode 100644 index 000000000..0499f6097 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds.h @@ -0,0 +1,460 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_FUNCTION1DS +#define C_INTERFACE_ALPHA_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 +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 +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function1ds/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds.cpp new file mode 100644 index 000000000..6c35558b8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Function2ds.hpp" +#include "Function2ds.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds.h new file mode 100644 index 000000000..93392e933 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds.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. +// +// 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_ALPHA_V2_0_GENERAL_FUNCTION2DS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Function2ds +Function2dsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFunction2ds +Function2dsCreateConst( + ConstHandle2XYs2d *const XYs2d, const size_t XYs2dSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Function2ds/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/G.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/G.cpp new file mode 100644 index 000000000..0d602015f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/G.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/G.hpp" +#include "G.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/G.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/G.h new file mode 100644 index 000000000..2fc3885d2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_G +#define C_INTERFACE_ALPHA_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 +extern_c Handle2G +GDefault(); + +// --- Create, general, const +extern_c Handle2ConstG +GCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/G/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/G/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/G/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/G/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBoson.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBoson.cpp new file mode 100644 index 000000000..4af69e745 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBoson.cpp @@ -0,0 +1,388 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/GaugeBoson.hpp" +#include "GaugeBoson.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBoson.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBoson.h new file mode 100644 index 000000000..76364e998 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_GAUGEBOSON +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBoson/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBoson/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBoson/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBoson/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons.cpp new file mode 100644 index 000000000..29e1aae9b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/GaugeBosons.hpp" +#include "GaugeBosons.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons.h new file mode 100644 index 000000000..e00c1c2ee --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_GAUGEBOSONS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2GaugeBosons +GaugeBosonsDefault(); + +// --- Create, general, const +extern_c Handle2ConstGaugeBosons +GaugeBosonsCreateConst( + ConstHandle2GaugeBoson *const gaugeBoson, const size_t gaugeBosonSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GaugeBosons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GeneralEvaporation.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GeneralEvaporation.cpp new file mode 100644 index 000000000..7e1c8ce84 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GeneralEvaporation.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/GeneralEvaporation.hpp" +#include "GeneralEvaporation.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GeneralEvaporation.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GeneralEvaporation.h new file mode 100644 index 000000000..c0c7de95d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_GENERALEVAPORATION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2GeneralEvaporation +GeneralEvaporationDefault(); + +// --- Create, general, const +extern_c Handle2ConstGeneralEvaporation +GeneralEvaporationCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta, + ConstHandle2ConstG g +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GeneralEvaporation/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GeneralEvaporation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GeneralEvaporation/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/GeneralEvaporation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Grid.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Grid.cpp new file mode 100644 index 000000000..154e9bc97 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Grid.cpp @@ -0,0 +1,399 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Grid.hpp" +#include "Grid.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Grid.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Grid.h new file mode 100644 index 000000000..1282a2531 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_GRID +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Grid/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Grid/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Grid/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Grid/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded2d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded2d.cpp new file mode 100644 index 000000000..e828a269e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded2d.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Gridded2d.hpp" +#include "Gridded2d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded2d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded2d.h new file mode 100644 index 000000000..3a5ede8ad --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_GRIDDED2D +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Gridded2d +Gridded2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstGridded2d +Gridded2dCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded2d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded2d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded3d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded3d.cpp new file mode 100644 index 000000000..38464d354 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded3d.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Gridded3d.hpp" +#include "Gridded3d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded3d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded3d.h new file mode 100644 index 000000000..9f26884fd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_GRIDDED3D +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Gridded3d +Gridded3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstGridded3d +Gridded3dCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded3d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded3d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Gridded3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Halflife.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Halflife.cpp new file mode 100644 index 000000000..447f0b715 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Halflife.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Halflife.hpp" +#include "Halflife.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Halflife.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Halflife.h new file mode 100644 index 000000000..8715919df --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_HALFLIFE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Halflife +HalflifeDefault(); + +// --- Create, general, const +extern_c Handle2ConstHalflife +HalflifeCreateConst( + ConstHandle2ConstString string, + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Halflife/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Halflife/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Halflife/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Halflife/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/HardSphereRadius.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/HardSphereRadius.cpp new file mode 100644 index 000000000..f69390a4e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/HardSphereRadius.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/HardSphereRadius.hpp" +#include "HardSphereRadius.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/HardSphereRadius.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/HardSphereRadius.h new file mode 100644 index 000000000..918e2cc96 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_HARDSPHERERADIUS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2HardSphereRadius +HardSphereRadiusDefault(); + +// --- Create, general, const +extern_c Handle2ConstHardSphereRadius +HardSphereRadiusCreateConst( + ConstHandle2ConstConstant1d constant1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/HardSphereRadius/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/HardSphereRadius/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/HardSphereRadius/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/HardSphereRadius/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryAnomalousFactor.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryAnomalousFactor.cpp new file mode 100644 index 000000000..285f88412 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryAnomalousFactor.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ImaginaryAnomalousFactor.hpp" +#include "ImaginaryAnomalousFactor.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryAnomalousFactor.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryAnomalousFactor.h new file mode 100644 index 000000000..c076c676c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_IMAGINARYANOMALOUSFACTOR +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ImaginaryAnomalousFactor +ImaginaryAnomalousFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstImaginaryAnomalousFactor +ImaginaryAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryAnomalousFactor/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryAnomalousFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryAnomalousFactor/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryAnomalousFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryInterferenceTerm.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryInterferenceTerm.cpp new file mode 100644 index 000000000..b5586a804 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryInterferenceTerm.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ImaginaryInterferenceTerm.hpp" +#include "ImaginaryInterferenceTerm.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryInterferenceTerm.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryInterferenceTerm.h new file mode 100644 index 000000000..7f6deef0d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_IMAGINARYINTERFERENCETERM +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ImaginaryInterferenceTerm +ImaginaryInterferenceTermDefault(); + +// --- Create, general, const +extern_c Handle2ConstImaginaryInterferenceTerm +ImaginaryInterferenceTermCreateConst( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryInterferenceTerm/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryInterferenceTerm/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryInterferenceTerm/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ImaginaryInterferenceTerm/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies.cpp new file mode 100644 index 000000000..6b6c38725 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/IncidentEnergies.hpp" +#include "IncidentEnergies.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies.h new file mode 100644 index 000000000..bdac12b4f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_INCIDENTENERGIES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2IncidentEnergies +IncidentEnergiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncidentEnergies +IncidentEnergiesCreateConst( + ConstHandle2IncidentEnergy *const incidentEnergy, const size_t incidentEnergySize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergies/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergy.cpp new file mode 100644 index 000000000..45499d9e3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergy.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/IncidentEnergy.hpp" +#include "IncidentEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergy.h new file mode 100644 index 000000000..71bda2fd0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_INCIDENTENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2IncidentEnergy +IncidentEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncidentEnergy +IncidentEnergyCreateConst( + const char *const label, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstYields yields +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncidentEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncoherentPhotonScattering.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncoherentPhotonScattering.cpp new file mode 100644 index 000000000..13a39e1b0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncoherentPhotonScattering.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/IncoherentPhotonScattering.hpp" +#include "IncoherentPhotonScattering.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncoherentPhotonScattering.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncoherentPhotonScattering.h new file mode 100644 index 000000000..171ae522d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_INCOHERENTPHOTONSCATTERING +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncoherentPhotonScattering/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncoherentPhotonScattering/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncoherentPhotonScattering/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncoherentPhotonScattering/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions.cpp new file mode 100644 index 000000000..71e436de1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/IncompleteReactions.hpp" +#include "IncompleteReactions.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions.h new file mode 100644 index 000000000..319acc1e1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions.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. +// +// 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_ALPHA_V2_0_GENERAL_INCOMPLETEREACTIONS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2IncompleteReactions +IncompleteReactionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncompleteReactions +IncompleteReactionsCreateConst( + ConstHandle2Reaction *const reaction, const size_t reactionSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/IncompleteReactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Institution.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Institution.cpp new file mode 100644 index 000000000..1e94579c5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Institution.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Institution.hpp" +#include "Institution.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Institution.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Institution.h new file mode 100644 index 000000000..31485612c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_INSTITUTION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Institution +InstitutionDefault(); + +// --- Create, general, const +extern_c Handle2ConstInstitution +InstitutionCreateConst( + const char *const label, + ConstHandle2ConstENDFconversionFlags ENDFconversionFlags +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Institution/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Institution/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Institution/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Institution/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Integer.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Integer.cpp new file mode 100644 index 000000000..ab1ed9711 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Integer.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Integer.hpp" +#include "Integer.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Integer.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Integer.h new file mode 100644 index 000000000..b3b58a79f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_INTEGER +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Integer +IntegerDefault(); + +// --- Create, general, const +extern_c Handle2ConstInteger +IntegerCreateConst( + const char *const label, + const int value, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Integer/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Integer/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Integer/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Integer/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Intensity.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Intensity.cpp new file mode 100644 index 000000000..44a2c4e47 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Intensity.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Intensity.hpp" +#include "Intensity.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Intensity.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Intensity.h new file mode 100644 index 000000000..ae0b2e42f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_INTENSITY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Intensity +IntensityDefault(); + +// --- Create, general, const +extern_c Handle2ConstIntensity +IntensityCreateConst( + const double value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Intensity/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Intensity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Intensity/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Intensity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients.cpp new file mode 100644 index 000000000..af12a4315 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/InternalConversionCoefficients.hpp" +#include "InternalConversionCoefficients.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients.h new file mode 100644 index 000000000..160125e03 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_INTERNALCONVERSIONCOEFFICIENTS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2InternalConversionCoefficients +InternalConversionCoefficientsDefault(); + +// --- Create, general, const +extern_c Handle2ConstInternalConversionCoefficients +InternalConversionCoefficientsCreateConst( + ConstHandle2Shell *const shell, const size_t shellSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/InternalConversionCoefficients/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotope.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotope.cpp new file mode 100644 index 000000000..8c8f0c1e7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotope.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Isotope.hpp" +#include "Isotope.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotope.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotope.h new file mode 100644 index 000000000..455ec1fb6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ISOTOPE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Isotope +IsotopeDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotope +IsotopeCreateConst( + const char *const symbol, + const int A, + ConstHandle2ConstNuclides nuclides +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotope/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotope/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotope/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotope/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes.cpp new file mode 100644 index 000000000..38b8897f2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Isotopes.hpp" +#include "Isotopes.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes.h new file mode 100644 index 000000000..44375112c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_ISOTOPES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Isotopes +IsotopesDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotopes +IsotopesCreateConst( + ConstHandle2Isotope *const isotope, const size_t isotopeSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotopes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotropic2d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotropic2d.cpp new file mode 100644 index 000000000..000e9890f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotropic2d.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Isotropic2d.hpp" +#include "Isotropic2d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +Handle2Isotropic2d +Isotropic2dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIsotropic2d +Isotropic2dCreateConst() +{ + ConstHandle2Isotropic2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotropic2d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotropic2d.h new file mode 100644 index 000000000..342e0634c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ISOTROPIC2D +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Isotropic2d +Isotropic2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotropic2d +Isotropic2dCreateConst(); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotropic2d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotropic2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotropic2d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Isotropic2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/J.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/J.cpp new file mode 100644 index 000000000..a0d86233b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/J.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/J.hpp" +#include "J.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/J.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/J.h new file mode 100644 index 000000000..05f6dec72 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_J +#define C_INTERFACE_ALPHA_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 +extern_c Handle2J +JDefault(); + +// --- Create, general, const +extern_c Handle2ConstJ +JCreateConst( + const char *const label, + const int value, + ConstHandle2ConstLevelSpacing levelSpacing, + ConstHandle2ConstWidths widths +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/J/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/J/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/J/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/J/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js.cpp new file mode 100644 index 000000000..d7e9d6f08 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Js.hpp" +#include "Js.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js.h new file mode 100644 index 000000000..10a63dba4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_JS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Js +JsDefault(); + +// --- Create, general, const +extern_c Handle2ConstJs +JsCreateConst( + ConstHandle2J *const J, const size_t JSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Js/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/KalbachMann.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/KalbachMann.cpp new file mode 100644 index 000000000..274d6b795 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/KalbachMann.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/KalbachMann.hpp" +#include "KalbachMann.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/KalbachMann.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/KalbachMann.h new file mode 100644 index 000000000..3fcbba3f6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_KALBACHMANN +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/KalbachMann/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/KalbachMann/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/KalbachMann/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/KalbachMann/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/L.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/L.cpp new file mode 100644 index 000000000..1f3cfba0e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/L.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/L.hpp" +#include "L.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/L.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/L.h new file mode 100644 index 000000000..619d65a94 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_L +#define C_INTERFACE_ALPHA_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 +extern_c Handle2L +LDefault(); + +// --- Create, general, const +extern_c Handle2ConstL +LCreateConst( + const char *const label, + const int value, + ConstHandle2ConstJs Js +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/L/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/L/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/L/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/L/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Legendre.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Legendre.cpp new file mode 100644 index 000000000..fdf442a6b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Legendre.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Legendre.hpp" +#include "Legendre.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Legendre.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Legendre.h new file mode 100644 index 000000000..370e8328b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_LEGENDRE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Legendre +LegendreDefault(); + +// --- Create, general, const +extern_c Handle2ConstLegendre +LegendreCreateConst( + const double outerDomainValue, + ConstHandle2ConstValues values +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Legendre/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Legendre/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Legendre/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Legendre/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Lepton.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Lepton.cpp new file mode 100644 index 000000000..67a82a2d6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Lepton.cpp @@ -0,0 +1,423 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Lepton.hpp" +#include "Lepton.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Lepton.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Lepton.h new file mode 100644 index 000000000..396980d0d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_LEPTON +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Lepton/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Lepton/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Lepton/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Lepton/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons.cpp new file mode 100644 index 000000000..49c814fd8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Leptons.hpp" +#include "Leptons.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons.h new file mode 100644 index 000000000..8bd356d94 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_LEPTONS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Leptons +LeptonsDefault(); + +// --- Create, general, const +extern_c Handle2ConstLeptons +LeptonsCreateConst( + ConstHandle2Lepton *const lepton, const size_t leptonSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Leptons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/LevelSpacing.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/LevelSpacing.cpp new file mode 100644 index 000000000..ec5e8fded --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/LevelSpacing.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/LevelSpacing.hpp" +#include "LevelSpacing.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/LevelSpacing.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/LevelSpacing.h new file mode 100644 index 000000000..7447dc152 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_LEVELSPACING +#define C_INTERFACE_ALPHA_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 +extern_c Handle2LevelSpacing +LevelSpacingDefault(); + +// --- Create, general, const +extern_c Handle2ConstLevelSpacing +LevelSpacingCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstConstant1d constant1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/LevelSpacing/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/LevelSpacing/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/LevelSpacing/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/LevelSpacing/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Link.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Link.cpp new file mode 100644 index 000000000..238adb8dc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Link.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Link.hpp" +#include "Link.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 "v2.0/general/Link/src/custom.cpp" diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Link.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Link.h new file mode 100644 index 000000000..7e966304b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_LINK +#define C_INTERFACE_ALPHA_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 +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 "v2.0/general/Link/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Link/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Link/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Link/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Link/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances.cpp new file mode 100644 index 000000000..14fe57ab6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ListOfCovariances.hpp" +#include "ListOfCovariances.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances.h new file mode 100644 index 000000000..e9093d40b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_LISTOFCOVARIANCES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ListOfCovariances +ListOfCovariancesDefault(); + +// --- Create, general, const +extern_c Handle2ConstListOfCovariances +ListOfCovariancesCreateConst( + ConstHandle2Covariance *const covariance, const size_t covarianceSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ListOfCovariances/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls.cpp new file mode 100644 index 000000000..480c1406a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Ls.hpp" +#include "Ls.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls.h new file mode 100644 index 000000000..d4216207e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_LS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Ls +LsDefault(); + +// --- Create, general, const +extern_c Handle2ConstLs +LsCreateConst( + ConstHandle2L *const L, const size_t LSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Ls/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MadlandNix.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MadlandNix.cpp new file mode 100644 index 000000000..0abae17ca --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MadlandNix.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/MadlandNix.hpp" +#include "MadlandNix.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MadlandNix.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MadlandNix.h new file mode 100644 index 000000000..306cbb534 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_MADLANDNIX +#define C_INTERFACE_ALPHA_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 +extern_c Handle2MadlandNix +MadlandNixDefault(); + +// --- Create, general, const +extern_c Handle2ConstMadlandNix +MadlandNixCreateConst( + ConstHandle2ConstEFL EFL, + ConstHandle2ConstEFH EFH, + ConstHandle2ConstT_M T_M +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MadlandNix/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MadlandNix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MadlandNix/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MadlandNix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mass.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mass.cpp new file mode 100644 index 000000000..30c3e3e9e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mass.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Mass.hpp" +#include "Mass.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mass.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mass.h new file mode 100644 index 000000000..d462404f4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_MASS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Mass +MassDefault(); + +// --- Create, general, const +extern_c Handle2ConstMass +MassCreateConst( + const double value, + const char *const unit, + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mass/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mass/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mass/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mass/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MetaStable.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MetaStable.cpp new file mode 100644 index 000000000..31bd629d6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MetaStable.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/MetaStable.hpp" +#include "MetaStable.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MetaStable.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MetaStable.h new file mode 100644 index 000000000..582f64bdb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_METASTABLE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2MetaStable +MetaStableDefault(); + +// --- Create, general, const +extern_c Handle2ConstMetaStable +MetaStableCreateConst( + const char *const id, + const char *const pid, + const int metaStableIndex +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MetaStable/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MetaStable/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MetaStable/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MetaStable/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed.cpp new file mode 100644 index 000000000..77f307b30 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed.cpp @@ -0,0 +1,679 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Mixed.hpp" +#include "Mixed.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed.h new file mode 100644 index 000000000..02fc2183f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed.h @@ -0,0 +1,464 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_MIXED +#define C_INTERFACE_ALPHA_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 +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 +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Mixed/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Multiplicity.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Multiplicity.cpp new file mode 100644 index 000000000..4bf235274 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Multiplicity.cpp @@ -0,0 +1,482 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Multiplicity.hpp" +#include "Multiplicity.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Multiplicity.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Multiplicity.h new file mode 100644 index 000000000..263665230 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_MULTIPLICITY +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Multiplicity/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Multiplicity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Multiplicity/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Multiplicity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySum.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySum.cpp new file mode 100644 index 000000000..06a27a1cd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySum.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/MultiplicitySum.hpp" +#include "MultiplicitySum.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySum.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySum.h new file mode 100644 index 000000000..64e5be1a4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_MULTIPLICITYSUM +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySum/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySum/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums.cpp new file mode 100644 index 000000000..94858f44e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/MultiplicitySums.hpp" +#include "MultiplicitySums.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums.h new file mode 100644 index 000000000..01b1aefa5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_MULTIPLICITYSUMS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2MultiplicitySums +MultiplicitySumsDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiplicitySums +MultiplicitySumsCreateConst( + ConstHandle2MultiplicitySum *const multiplicitySum, const size_t multiplicitySumSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/MultiplicitySums/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NBodyPhaseSpace.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NBodyPhaseSpace.cpp new file mode 100644 index 000000000..caa469059 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NBodyPhaseSpace.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/NBodyPhaseSpace.hpp" +#include "NBodyPhaseSpace.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NBodyPhaseSpace.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NBodyPhaseSpace.h new file mode 100644 index 000000000..e8b9e8d93 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_NBODYPHASESPACE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2NBodyPhaseSpace +NBodyPhaseSpaceDefault(); + +// --- Create, general, const +extern_c Handle2ConstNBodyPhaseSpace +NBodyPhaseSpaceCreateConst( + const int numberOfProducts, + ConstHandle2ConstMass mass +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NBodyPhaseSpace/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NBodyPhaseSpace/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NBodyPhaseSpace/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NBodyPhaseSpace/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NeutrinoEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NeutrinoEnergy.cpp new file mode 100644 index 000000000..7e164be1a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NeutrinoEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/NeutrinoEnergy.hpp" +#include "NeutrinoEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NeutrinoEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NeutrinoEnergy.h new file mode 100644 index 000000000..16836b42e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_NEUTRINOENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2NeutrinoEnergy +NeutrinoEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstNeutrinoEnergy +NeutrinoEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NeutrinoEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NeutrinoEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NeutrinoEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NeutrinoEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NonNeutrinoEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NonNeutrinoEnergy.cpp new file mode 100644 index 000000000..d6a24b36a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NonNeutrinoEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/NonNeutrinoEnergy.hpp" +#include "NonNeutrinoEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NonNeutrinoEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NonNeutrinoEnergy.h new file mode 100644 index 000000000..a568c9a4c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_NONNEUTRINOENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2NonNeutrinoEnergy +NonNeutrinoEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstNonNeutrinoEnergy +NonNeutrinoEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NonNeutrinoEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NonNeutrinoEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NonNeutrinoEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NonNeutrinoEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearAmplitudeExpansion.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearAmplitudeExpansion.cpp new file mode 100644 index 000000000..947f706d5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearAmplitudeExpansion.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/NuclearAmplitudeExpansion.hpp" +#include "NuclearAmplitudeExpansion.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearAmplitudeExpansion.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearAmplitudeExpansion.h new file mode 100644 index 000000000..6dccea542 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_NUCLEARAMPLITUDEEXPANSION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2NuclearAmplitudeExpansion +NuclearAmplitudeExpansionDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclearAmplitudeExpansion +NuclearAmplitudeExpansionCreateConst( + ConstHandle2ConstNuclearTerm nuclearTerm, + ConstHandle2ConstRealInterferenceTerm realInterferenceTerm, + ConstHandle2ConstImaginaryInterferenceTerm imaginaryInterferenceTerm +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearAmplitudeExpansion/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearAmplitudeExpansion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearAmplitudeExpansion/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearAmplitudeExpansion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearPlusInterference.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearPlusInterference.cpp new file mode 100644 index 000000000..0fb336172 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearPlusInterference.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/NuclearPlusInterference.hpp" +#include "NuclearPlusInterference.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearPlusInterference.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearPlusInterference.h new file mode 100644 index 000000000..d08aebea2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_NUCLEARPLUSINTERFERENCE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2NuclearPlusInterference +NuclearPlusInterferenceDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclearPlusInterference +NuclearPlusInterferenceCreateConst( + const double muCutoff, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstDistribution distribution +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearPlusInterference/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearPlusInterference/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearPlusInterference/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearPlusInterference/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearTerm.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearTerm.cpp new file mode 100644 index 000000000..031e95baf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearTerm.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/NuclearTerm.hpp" +#include "NuclearTerm.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearTerm.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearTerm.h new file mode 100644 index 000000000..83ec85ee8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_NUCLEARTERM +#define C_INTERFACE_ALPHA_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 +extern_c Handle2NuclearTerm +NuclearTermDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclearTerm +NuclearTermCreateConst( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearTerm/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearTerm/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearTerm/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/NuclearTerm/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nucleus.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nucleus.cpp new file mode 100644 index 000000000..8591793e9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nucleus.cpp @@ -0,0 +1,509 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Nucleus.hpp" +#include "Nucleus.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nucleus.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nucleus.h new file mode 100644 index 000000000..2de9e5ffc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_NUCLEUS +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nucleus/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nucleus/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nucleus/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nucleus/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclide.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclide.cpp new file mode 100644 index 000000000..2dd5bb6ea --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclide.cpp @@ -0,0 +1,388 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Nuclide.hpp" +#include "Nuclide.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclide.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclide.h new file mode 100644 index 000000000..8e9d29189 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_NUCLIDE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclide/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclide/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclide/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclide/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides.cpp new file mode 100644 index 000000000..09ec89182 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Nuclides.hpp" +#include "Nuclides.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides.h new file mode 100644 index 000000000..87f75d177 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_NUCLIDES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Nuclides +NuclidesDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclides +NuclidesCreateConst( + ConstHandle2Nuclide *const nuclide, const size_t nuclideSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Nuclides/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProduct.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProduct.cpp new file mode 100644 index 000000000..7ac55b263 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProduct.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/OrphanProduct.hpp" +#include "OrphanProduct.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProduct.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProduct.h new file mode 100644 index 000000000..3c109523d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ORPHANPRODUCT +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProduct/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProduct/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProduct/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProduct/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts.cpp new file mode 100644 index 000000000..3b4d2748b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/OrphanProducts.hpp" +#include "OrphanProducts.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts.h new file mode 100644 index 000000000..fc3d85911 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_ORPHANPRODUCTS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2OrphanProducts +OrphanProductsDefault(); + +// --- Create, general, const +extern_c Handle2ConstOrphanProducts +OrphanProductsCreateConst( + ConstHandle2OrphanProduct *const orphanProduct, const size_t orphanProductSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OrphanProducts/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OutputChannel.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OutputChannel.cpp new file mode 100644 index 000000000..135e6214c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OutputChannel.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/OutputChannel.hpp" +#include "OutputChannel.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OutputChannel.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OutputChannel.h new file mode 100644 index 000000000..a78fb3842 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_OUTPUTCHANNEL +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OutputChannel/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OutputChannel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OutputChannel/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/OutputChannel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariance.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariance.cpp new file mode 100644 index 000000000..9ef2208aa --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariance.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ParameterCovariance.hpp" +#include "ParameterCovariance.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariance.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariance.h new file mode 100644 index 000000000..92aa6630c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PARAMETERCOVARIANCE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ParameterCovariance +ParameterCovarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameterCovariance +ParameterCovarianceCreateConst( + const char *const label, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariance/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariance/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovarianceMatrix.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovarianceMatrix.cpp new file mode 100644 index 000000000..1f44d71dd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovarianceMatrix.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ParameterCovarianceMatrix.hpp" +#include "ParameterCovarianceMatrix.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovarianceMatrix.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovarianceMatrix.h new file mode 100644 index 000000000..d3c60bb8c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PARAMETERCOVARIANCEMATRIX +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovarianceMatrix/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovarianceMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovarianceMatrix/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovarianceMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances.cpp new file mode 100644 index 000000000..597ff9f7c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances.cpp @@ -0,0 +1,421 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ParameterCovariances.hpp" +#include "ParameterCovariances.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances.h new file mode 100644 index 000000000..709f66920 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances.h @@ -0,0 +1,304 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_PARAMETERCOVARIANCES +#define C_INTERFACE_ALPHA_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 +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 +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterCovariances/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterLink.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterLink.cpp new file mode 100644 index 000000000..1fd6cd150 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterLink.cpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ParameterLink.hpp" +#include "ParameterLink.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterLink.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterLink.h new file mode 100644 index 000000000..0b40de101 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PARAMETERLINK +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterLink/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterLink/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterLink/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ParameterLink/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters.cpp new file mode 100644 index 000000000..4f0400d3a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Parameters.hpp" +#include "Parameters.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters.h new file mode 100644 index 000000000..a9f9d763e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters.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. +// +// 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_ALPHA_V2_0_GENERAL_PARAMETERS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Parameters +ParametersDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameters +ParametersCreateConst( + ConstHandle2ParameterLink *const parameterLink, const size_t parameterLinkSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parameters/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parity.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parity.cpp new file mode 100644 index 000000000..0ccc18481 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parity.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Parity.hpp" +#include "Parity.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parity.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parity.h new file mode 100644 index 000000000..c01772cdc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PARITY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Parity +ParityDefault(); + +// --- Create, general, const +extern_c Handle2ConstParity +ParityCreateConst( + ConstHandle2ConstInteger integer +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parity/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parity/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Parity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PhotonEmissionProbabilities.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PhotonEmissionProbabilities.cpp new file mode 100644 index 000000000..f485b24bd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PhotonEmissionProbabilities.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/PhotonEmissionProbabilities.hpp" +#include "PhotonEmissionProbabilities.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PhotonEmissionProbabilities.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PhotonEmissionProbabilities.h new file mode 100644 index 000000000..3b0a0dad9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PHOTONEMISSIONPROBABILITIES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreateConst( + ConstHandle2ConstShell shell +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PhotonEmissionProbabilities/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PhotonEmissionProbabilities/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PhotonEmissionProbabilities/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PhotonEmissionProbabilities/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Polynomial1d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Polynomial1d.cpp new file mode 100644 index 000000000..1ddf400db --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Polynomial1d.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Polynomial1d.hpp" +#include "Polynomial1d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Polynomial1d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Polynomial1d.h new file mode 100644 index 000000000..e68a479d0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_POLYNOMIAL1D +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Polynomial1d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Polynomial1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Polynomial1d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Polynomial1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PositronEmissionIntensity.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PositronEmissionIntensity.cpp new file mode 100644 index 000000000..36d81100b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PositronEmissionIntensity.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/PositronEmissionIntensity.hpp" +#include "PositronEmissionIntensity.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PositronEmissionIntensity.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PositronEmissionIntensity.h new file mode 100644 index 000000000..c190e1092 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_POSITRONEMISSIONINTENSITY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2PositronEmissionIntensity +PositronEmissionIntensityDefault(); + +// --- Create, general, const +extern_c Handle2ConstPositronEmissionIntensity +PositronEmissionIntensityCreateConst( + const double value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PositronEmissionIntensity/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PositronEmissionIntensity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PositronEmissionIntensity/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PositronEmissionIntensity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PrimaryGamma.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PrimaryGamma.cpp new file mode 100644 index 000000000..16e218d94 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PrimaryGamma.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/PrimaryGamma.hpp" +#include "PrimaryGamma.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PrimaryGamma.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PrimaryGamma.h new file mode 100644 index 000000000..9b585c229 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PRIMARYGAMMA +#define C_INTERFACE_ALPHA_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 +extern_c Handle2PrimaryGamma +PrimaryGammaDefault(); + +// --- Create, general, const +extern_c Handle2ConstPrimaryGamma +PrimaryGammaCreateConst( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PrimaryGamma/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PrimaryGamma/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PrimaryGamma/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PrimaryGamma/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Probability.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Probability.cpp new file mode 100644 index 000000000..6c6250ca6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Probability.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Probability.hpp" +#include "Probability.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Probability.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Probability.h new file mode 100644 index 000000000..909d9ba77 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PROBABILITY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Probability +ProbabilityDefault(); + +// --- Create, general, const +extern_c Handle2ConstProbability +ProbabilityCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Probability/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Probability/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Probability/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Probability/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Product.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Product.cpp new file mode 100644 index 000000000..aa5b2ac94 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Product.cpp @@ -0,0 +1,380 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Product.hpp" +#include "Product.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Product.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Product.h new file mode 100644 index 000000000..102c08073 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PRODUCT +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Product/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Product/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Product/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Product/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYield.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYield.cpp new file mode 100644 index 000000000..573523392 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYield.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ProductYield.hpp" +#include "ProductYield.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYield.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYield.h new file mode 100644 index 000000000..07d37bd54 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PRODUCTYIELD +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ProductYield +ProductYieldDefault(); + +// --- Create, general, const +extern_c Handle2ConstProductYield +ProductYieldCreateConst( + const char *const label, + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstElapsedTimes elapsedTimes +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYield/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYield/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYield/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYield/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields.cpp new file mode 100644 index 000000000..948164eea --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ProductYields.hpp" +#include "ProductYields.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields.h new file mode 100644 index 000000000..ebf8f1fa0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_PRODUCTYIELDS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ProductYields +ProductYieldsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProductYields +ProductYieldsCreateConst( + ConstHandle2ProductYield *const productYield, const size_t productYieldSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProductYields/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Production.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Production.cpp new file mode 100644 index 000000000..55462d45d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Production.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Production.hpp" +#include "Production.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Production.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Production.h new file mode 100644 index 000000000..c9c6aab76 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PRODUCTION +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Production/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Production/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Production/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Production/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions.cpp new file mode 100644 index 000000000..fb948eff8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Productions.hpp" +#include "Productions.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions.h new file mode 100644 index 000000000..da970ce0c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_PRODUCTIONS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Productions +ProductionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProductions +ProductionsCreateConst( + ConstHandle2Production *const production, const size_t productionSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Productions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products.cpp new file mode 100644 index 000000000..b8415c5f6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Products.hpp" +#include "Products.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products.h new file mode 100644 index 000000000..99fef20d4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_PRODUCTS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Products +ProductsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProducts +ProductsCreateConst( + ConstHandle2Product *const product, const size_t productSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Products/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProjectileEnergyDomain.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProjectileEnergyDomain.cpp new file mode 100644 index 000000000..1bc0ff3d5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProjectileEnergyDomain.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ProjectileEnergyDomain.hpp" +#include "ProjectileEnergyDomain.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProjectileEnergyDomain.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProjectileEnergyDomain.h new file mode 100644 index 000000000..293233575 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PROJECTILEENERGYDOMAIN +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ProjectileEnergyDomain +ProjectileEnergyDomainDefault(); + +// --- Create, general, const +extern_c Handle2ConstProjectileEnergyDomain +ProjectileEnergyDomainCreateConst( + const double min, + const double max, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProjectileEnergyDomain/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProjectileEnergyDomain/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProjectileEnergyDomain/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ProjectileEnergyDomain/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptGammaEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptGammaEnergy.cpp new file mode 100644 index 000000000..5b2f9d1b4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptGammaEnergy.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/PromptGammaEnergy.hpp" +#include "PromptGammaEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptGammaEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptGammaEnergy.h new file mode 100644 index 000000000..a4997da21 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PROMPTGAMMAENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2PromptGammaEnergy +PromptGammaEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstPromptGammaEnergy +PromptGammaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptGammaEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptGammaEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptGammaEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptGammaEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptNeutronKE.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptNeutronKE.cpp new file mode 100644 index 000000000..a999ddf62 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptNeutronKE.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/PromptNeutronKE.hpp" +#include "PromptNeutronKE.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptNeutronKE.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptNeutronKE.h new file mode 100644 index 000000000..6f57a1c53 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PROMPTNEUTRONKE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2PromptNeutronKE +PromptNeutronKEDefault(); + +// --- Create, general, const +extern_c Handle2ConstPromptNeutronKE +PromptNeutronKECreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptNeutronKE/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptNeutronKE/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptNeutronKE/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptNeutronKE/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptProductKE.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptProductKE.cpp new file mode 100644 index 000000000..e0aaef73a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptProductKE.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/PromptProductKE.hpp" +#include "PromptProductKE.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptProductKE.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptProductKE.h new file mode 100644 index 000000000..69f669080 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_PROMPTPRODUCTKE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2PromptProductKE +PromptProductKEDefault(); + +// --- Create, general, const +extern_c Handle2ConstPromptProductKE +PromptProductKECreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptProductKE/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptProductKE/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptProductKE/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/PromptProductKE/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Q.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Q.cpp new file mode 100644 index 000000000..37b5ede05 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Q.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Q.hpp" +#include "Q.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Q.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Q.h new file mode 100644 index 000000000..f223cca2a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_Q +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Q +QDefault(); + +// --- Create, general, const +extern_c Handle2ConstQ +QCreateConst( + ConstHandle2ConstDouble Double, + ConstHandle2ConstConstant1d constant1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Q/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Q/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Q/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Q/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/R.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/R.cpp new file mode 100644 index 000000000..a3b352948 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/R.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/R.hpp" +#include "R.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/R.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/R.h new file mode 100644 index 000000000..6ea0266a6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_R +#define C_INTERFACE_ALPHA_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 +extern_c Handle2R +RDefault(); + +// --- Create, general, const +extern_c Handle2ConstR +RCreateConst( + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/R/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/R/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/R/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/R/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RMatrix.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RMatrix.cpp new file mode 100644 index 000000000..3872acf46 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RMatrix.cpp @@ -0,0 +1,442 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/RMatrix.hpp" +#include "RMatrix.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RMatrix.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RMatrix.h new file mode 100644 index 000000000..f35686736 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RMATRIX +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RMatrix/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RMatrix/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Rate.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Rate.cpp new file mode 100644 index 000000000..80eb37426 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Rate.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Rate.hpp" +#include "Rate.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Rate.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Rate.h new file mode 100644 index 000000000..9890ce3a5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RATE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Rate +RateDefault(); + +// --- Create, general, const +extern_c Handle2ConstRate +RateCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Rate/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Rate/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Rate/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Rate/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reaction.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reaction.cpp new file mode 100644 index 000000000..5c00cd409 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reaction.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Reaction.hpp" +#include "Reaction.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reaction.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reaction.h new file mode 100644 index 000000000..47ca13701 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_REACTION +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reaction/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reaction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reaction/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reaction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reactions.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reactions.cpp new file mode 100644 index 000000000..46cdf2e83 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reactions.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Reactions.hpp" +#include "Reactions.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 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); +} + +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Reactions/src/custom.cpp" diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reactions.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reactions.h new file mode 100644 index 000000000..917e45377 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/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_ALPHA_V2_0_GENERAL_REACTIONS +#define C_INTERFACE_ALPHA_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 +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 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 +); + +// +++ 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 +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Reactions/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reactions/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reactions/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealAnomalousFactor.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealAnomalousFactor.cpp new file mode 100644 index 000000000..24a4bf379 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealAnomalousFactor.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/RealAnomalousFactor.hpp" +#include "RealAnomalousFactor.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealAnomalousFactor.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealAnomalousFactor.h new file mode 100644 index 000000000..29c08d233 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_REALANOMALOUSFACTOR +#define C_INTERFACE_ALPHA_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 +extern_c Handle2RealAnomalousFactor +RealAnomalousFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstRealAnomalousFactor +RealAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealAnomalousFactor/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealAnomalousFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealAnomalousFactor/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealAnomalousFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealInterferenceTerm.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealInterferenceTerm.cpp new file mode 100644 index 000000000..35fa56953 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealInterferenceTerm.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/RealInterferenceTerm.hpp" +#include "RealInterferenceTerm.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealInterferenceTerm.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealInterferenceTerm.h new file mode 100644 index 000000000..8c635222c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_REALINTERFERENCETERM +#define C_INTERFACE_ALPHA_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 +extern_c Handle2RealInterferenceTerm +RealInterferenceTermDefault(); + +// --- Create, general, const +extern_c Handle2ConstRealInterferenceTerm +RealInterferenceTermCreateConst( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealInterferenceTerm/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealInterferenceTerm/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealInterferenceTerm/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RealInterferenceTerm/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Recoil.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Recoil.cpp new file mode 100644 index 000000000..60c403f0c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Recoil.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Recoil.hpp" +#include "Recoil.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Recoil.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Recoil.h new file mode 100644 index 000000000..9dca7d860 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RECOIL +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Recoil +RecoilDefault(); + +// --- Create, general, const +extern_c Handle2ConstRecoil +RecoilCreateConst( + const char *const href +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Recoil/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Recoil/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Recoil/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Recoil/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reference.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reference.cpp new file mode 100644 index 000000000..10528dc24 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reference.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Reference.hpp" +#include "Reference.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reference.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reference.h new file mode 100644 index 000000000..b6d5cca8c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_REFERENCE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Reference +ReferenceDefault(); + +// --- Create, general, const +extern_c Handle2ConstReference +ReferenceCreateConst( + const char *const label, + const char *const href +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reference/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reference/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reference/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Reference/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions1d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions1d.cpp new file mode 100644 index 000000000..eead76ec5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions1d.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Regions1d.hpp" +#include "Regions1d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions1d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions1d.h new file mode 100644 index 000000000..1cbedf188 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_REGIONS1D +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions1d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions1d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions2d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions2d.cpp new file mode 100644 index 000000000..32a6082d1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions2d.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Regions2d.hpp" +#include "Regions2d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions2d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions2d.h new file mode 100644 index 000000000..2d68a07cd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_REGIONS2D +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Regions2d +Regions2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstRegions2d +Regions2dCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions2d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions2d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Regions2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resolved.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resolved.cpp new file mode 100644 index 000000000..78ca431f5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resolved.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Resolved.hpp" +#include "Resolved.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resolved.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resolved.h new file mode 100644 index 000000000..821d26192 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RESOLVED +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resolved/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resolved/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resolved/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resolved/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResolvedRegion.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResolvedRegion.cpp new file mode 100644 index 000000000..7ba450ea1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResolvedRegion.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ResolvedRegion.hpp" +#include "ResolvedRegion.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResolvedRegion.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResolvedRegion.h new file mode 100644 index 000000000..07d99bf0f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RESOLVEDREGION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ResolvedRegion +ResolvedRegionDefault(); + +// --- Create, general, const +extern_c Handle2ConstResolvedRegion +ResolvedRegionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResolvedRegion/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResolvedRegion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResolvedRegion/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResolvedRegion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceParameters.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceParameters.cpp new file mode 100644 index 000000000..906df0822 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceParameters.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ResonanceParameters.hpp" +#include "ResonanceParameters.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceParameters.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceParameters.h new file mode 100644 index 000000000..7dbc54a9e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RESONANCEPARAMETERS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ResonanceParameters +ResonanceParametersDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonanceParameters +ResonanceParametersCreateConst( + ConstHandle2ConstTable table +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceParameters/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceParameters/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceParameters/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceParameters/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReaction.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReaction.cpp new file mode 100644 index 000000000..bd7f780c0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReaction.cpp @@ -0,0 +1,415 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ResonanceReaction.hpp" +#include "ResonanceReaction.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReaction.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReaction.h new file mode 100644 index 000000000..a56544cff --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RESONANCEREACTION +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReaction/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReaction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReaction/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReaction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions.cpp new file mode 100644 index 000000000..35ed860bd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ResonanceReactions.hpp" +#include "ResonanceReactions.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions.h new file mode 100644 index 000000000..b17af1bc2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions.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. +// +// 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_ALPHA_V2_0_GENERAL_RESONANCEREACTIONS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ResonanceReactions +ResonanceReactionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonanceReactions +ResonanceReactionsCreateConst( + ConstHandle2ResonanceReaction *const resonanceReaction, const size_t resonanceReactionSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonanceReactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resonances.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resonances.cpp new file mode 100644 index 000000000..95767e6cd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resonances.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Resonances.hpp" +#include "Resonances.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resonances.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resonances.h new file mode 100644 index 000000000..e0b9de67e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RESONANCES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Resonances +ResonancesDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonances +ResonancesCreateConst( + const char *const href, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstResolved resolved, + ConstHandle2ConstUnresolved unresolved +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resonances/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resonances/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resonances/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Resonances/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonancesWithBackground.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonancesWithBackground.cpp new file mode 100644 index 000000000..b1ccc25e4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonancesWithBackground.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ResonancesWithBackground.hpp" +#include "ResonancesWithBackground.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonancesWithBackground.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonancesWithBackground.h new file mode 100644 index 000000000..7b9913610 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RESONANCESWITHBACKGROUND +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ResonancesWithBackground +ResonancesWithBackgroundDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonancesWithBackground +ResonancesWithBackgroundCreateConst( + const char *const label, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstBackground background, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonancesWithBackground/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonancesWithBackground/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonancesWithBackground/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ResonancesWithBackground/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RowData.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RowData.cpp new file mode 100644 index 000000000..427585fbc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RowData.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/RowData.hpp" +#include "RowData.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RowData.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RowData.h new file mode 100644 index 000000000..57fb1d0c1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_ROWDATA +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RowData/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RowData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RowData/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RowData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RutherfordScattering.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RutherfordScattering.cpp new file mode 100644 index 000000000..6a6f04127 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RutherfordScattering.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/RutherfordScattering.hpp" +#include "RutherfordScattering.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +Handle2RutherfordScattering +RutherfordScatteringDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRutherfordScattering +RutherfordScatteringCreateConst() +{ + ConstHandle2RutherfordScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RutherfordScattering.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RutherfordScattering.h new file mode 100644 index 000000000..d00e0d07f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_RUTHERFORDSCATTERING +#define C_INTERFACE_ALPHA_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 +extern_c Handle2RutherfordScattering +RutherfordScatteringDefault(); + +// --- Create, general, const +extern_c Handle2ConstRutherfordScattering +RutherfordScatteringCreateConst(); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RutherfordScattering/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RutherfordScattering/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RutherfordScattering/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/RutherfordScattering/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SCTApproximation.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SCTApproximation.cpp new file mode 100644 index 000000000..e9ffca067 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SCTApproximation.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/SCTApproximation.hpp" +#include "SCTApproximation.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +Handle2SCTApproximation +SCTApproximationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSCTApproximation +SCTApproximationCreateConst() +{ + ConstHandle2SCTApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SCTApproximation.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SCTApproximation.h new file mode 100644 index 000000000..d5c8654a3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SCTAPPROXIMATION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2SCTApproximation +SCTApproximationDefault(); + +// --- Create, general, const +extern_c Handle2ConstSCTApproximation +SCTApproximationCreateConst(); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SCTApproximation/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SCTApproximation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SCTApproximation/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SCTApproximation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/S_table.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/S_table.cpp new file mode 100644 index 000000000..b15cb923d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/S_table.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/S_table.hpp" +#include "S_table.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/S_table.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/S_table.h new file mode 100644 index 000000000..e1a5de35f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_S_TABLE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2S_table +S_tableDefault(); + +// --- Create, general, const +extern_c Handle2ConstS_table +S_tableCreateConst( + ConstHandle2ConstGridded2d gridded2d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/S_table/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/S_table/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/S_table/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/S_table/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtom.cpp new file mode 100644 index 000000000..8f807b6b9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtom.cpp @@ -0,0 +1,501 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ScatteringAtom.hpp" +#include "ScatteringAtom.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtom.h new file mode 100644 index 000000000..27d4e9f94 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SCATTERINGATOM +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtom/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtom/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtom/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtom/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms.cpp new file mode 100644 index 000000000..aeda22f10 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ScatteringAtoms.hpp" +#include "ScatteringAtoms.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms.h new file mode 100644 index 000000000..ea0d5b2d3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms.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. +// +// 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_ALPHA_V2_0_GENERAL_SCATTERINGATOMS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ScatteringAtoms +ScatteringAtomsDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringAtoms +ScatteringAtomsCreateConst( + ConstHandle2ScatteringAtom *const scatteringAtom, const size_t scatteringAtomSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringAtoms/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringFactor.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringFactor.cpp new file mode 100644 index 000000000..514013c7c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringFactor.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ScatteringFactor.hpp" +#include "ScatteringFactor.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringFactor.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringFactor.h new file mode 100644 index 000000000..57f02a7ea --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SCATTERINGFACTOR +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ScatteringFactor +ScatteringFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringFactor +ScatteringFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringFactor/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringFactor/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringRadius.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringRadius.cpp new file mode 100644 index 000000000..01da839ec --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringRadius.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ScatteringRadius.hpp" +#include "ScatteringRadius.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringRadius.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringRadius.h new file mode 100644 index 000000000..610f927bd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SCATTERINGRADIUS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ScatteringRadius +ScatteringRadiusDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringRadius +ScatteringRadiusCreateConst( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringRadius/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringRadius/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringRadius/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ScatteringRadius/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SelfScatteringKernel.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SelfScatteringKernel.cpp new file mode 100644 index 000000000..3bba97328 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SelfScatteringKernel.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/SelfScatteringKernel.hpp" +#include "SelfScatteringKernel.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SelfScatteringKernel.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SelfScatteringKernel.h new file mode 100644 index 000000000..af5d09451 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SELFSCATTERINGKERNEL +#define C_INTERFACE_ALPHA_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 +extern_c Handle2SelfScatteringKernel +SelfScatteringKernelDefault(); + +// --- Create, general, const +extern_c Handle2ConstSelfScatteringKernel +SelfScatteringKernelCreateConst( + const bool symmetric, + ConstHandle2ConstGridded3d gridded3d, + ConstHandle2ConstSCTApproximation SCTApproximation, + ConstHandle2ConstFreeGasApproximation freeGasApproximation +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SelfScatteringKernel/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SelfScatteringKernel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SelfScatteringKernel/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SelfScatteringKernel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Shell.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Shell.cpp new file mode 100644 index 000000000..6c1b63335 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Shell.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Shell.hpp" +#include "Shell.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Shell.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Shell.h new file mode 100644 index 000000000..ea0b878fd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SHELL +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Shell +ShellDefault(); + +// --- Create, general, const +extern_c Handle2ConstShell +ShellCreateConst( + const char *const label, + const double value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Shell/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Shell/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Shell/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Shell/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ShortRangeSelfScalingVariance.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ShortRangeSelfScalingVariance.cpp new file mode 100644 index 000000000..d27a9b4ff --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ShortRangeSelfScalingVariance.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ShortRangeSelfScalingVariance.hpp" +#include "ShortRangeSelfScalingVariance.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ShortRangeSelfScalingVariance.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ShortRangeSelfScalingVariance.h new file mode 100644 index 000000000..8d6aae3ef --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SHORTRANGESELFSCALINGVARIANCE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ShortRangeSelfScalingVariance/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ShortRangeSelfScalingVariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ShortRangeSelfScalingVariance/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ShortRangeSelfScalingVariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SimpleMaxwellianFission.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SimpleMaxwellianFission.cpp new file mode 100644 index 000000000..8bc529b57 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SimpleMaxwellianFission.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/SimpleMaxwellianFission.hpp" +#include "SimpleMaxwellianFission.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SimpleMaxwellianFission.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SimpleMaxwellianFission.h new file mode 100644 index 000000000..5cc57ef31 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SIMPLEMAXWELLIANFISSION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2SimpleMaxwellianFission +SimpleMaxwellianFissionDefault(); + +// --- Create, general, const +extern_c Handle2ConstSimpleMaxwellianFission +SimpleMaxwellianFissionCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SimpleMaxwellianFission/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SimpleMaxwellianFission/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SimpleMaxwellianFission/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SimpleMaxwellianFission/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slice.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slice.cpp new file mode 100644 index 000000000..67f89279c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slice.cpp @@ -0,0 +1,312 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Slice.hpp" +#include "Slice.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slice.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slice.h new file mode 100644 index 000000000..9aae478b4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SLICE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slice/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slice/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slice/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slice/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices.cpp new file mode 100644 index 000000000..1d8407c80 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices.cpp @@ -0,0 +1,437 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Slices.hpp" +#include "Slices.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices.h new file mode 100644 index 000000000..586731ae1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices.h @@ -0,0 +1,322 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_SLICES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Slices +SlicesDefault(); + +// --- Create, general, const +extern_c Handle2ConstSlices +SlicesCreateConst( + ConstHandle2Slice *const slice, const size_t sliceSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Slices/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra.cpp new file mode 100644 index 000000000..e769befae --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Spectra.hpp" +#include "Spectra.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra.h new file mode 100644 index 000000000..62a069083 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_SPECTRA +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Spectra +SpectraDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpectra +SpectraCreateConst( + ConstHandle2Spectrum *const spectrum, const size_t spectrumSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectra/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum.cpp new file mode 100644 index 000000000..363a541f1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum.cpp @@ -0,0 +1,370 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Spectrum.hpp" +#include "Spectrum.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum.h new file mode 100644 index 000000000..af78a5b5b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum.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. +// +// 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_ALPHA_V2_0_GENERAL_SPECTRUM +#define C_INTERFACE_ALPHA_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 +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 +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spectrum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spin.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spin.cpp new file mode 100644 index 000000000..3a7c2390c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spin.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Spin.hpp" +#include "Spin.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spin.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spin.h new file mode 100644 index 000000000..e08bc3b65 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SPIN +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Spin +SpinDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpin +SpinCreateConst( + ConstHandle2ConstFraction fraction +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spin/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spin/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spin/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Spin/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroup.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroup.cpp new file mode 100644 index 000000000..d80681c7e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroup.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/SpinGroup.hpp" +#include "SpinGroup.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroup.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroup.h new file mode 100644 index 000000000..213b06400 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SPINGROUP +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroup/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroup/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroup/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroup/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups.cpp new file mode 100644 index 000000000..d29af25a6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/SpinGroups.hpp" +#include "SpinGroups.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups.h new file mode 100644 index 000000000..912b25ee4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups.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. +// +// 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_ALPHA_V2_0_GENERAL_SPINGROUPS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2SpinGroups +SpinGroupsDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpinGroups +SpinGroupsCreateConst( + ConstHandle2SpinGroup *const spinGroup, const size_t spinGroupSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/SpinGroups/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Standard.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Standard.cpp new file mode 100644 index 000000000..10a41346b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Standard.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Standard.hpp" +#include "Standard.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Standard.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Standard.h new file mode 100644 index 000000000..1e6db4fb4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_STANDARD +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Standard +StandardDefault(); + +// --- Create, general, const +extern_c Handle2ConstStandard +StandardCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Standard/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Standard/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Standard/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Standard/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/String.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/String.cpp new file mode 100644 index 000000000..c2c1468ef --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/String.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/String.hpp" +#include "String.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/String.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/String.h new file mode 100644 index 000000000..f801028d8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_STRING +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/String/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/String/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/String/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/String/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Styles.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Styles.cpp new file mode 100644 index 000000000..ccc817b29 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Styles.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Styles.hpp" +#include "Styles.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Styles.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Styles.h new file mode 100644 index 000000000..b9294b171 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_STYLES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Styles +StylesDefault(); + +// --- Create, general, const +extern_c Handle2ConstStyles +StylesCreateConst( + ConstHandle2ConstEvaluated evaluated, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Styles/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Styles/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Styles/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Styles/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum.cpp new file mode 100644 index 000000000..7c318b197 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum.cpp @@ -0,0 +1,487 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Sum.hpp" +#include "Sum.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum.h new file mode 100644 index 000000000..edfae9976 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum.h @@ -0,0 +1,344 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_SUM +#define C_INTERFACE_ALPHA_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 +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 +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summand.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summand.cpp new file mode 100644 index 000000000..05b3d405b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summand.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Summand.hpp" +#include "Summand.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summand.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summand.h new file mode 100644 index 000000000..1daeb5e6d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SUMMAND +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summand/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summand/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summand/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summand/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands.cpp new file mode 100644 index 000000000..ad22c98e0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Summands.hpp" +#include "Summands.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands.h new file mode 100644 index 000000000..148e08ed8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_SUMMANDS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Summands +SummandsDefault(); + +// --- Create, general, const +extern_c Handle2ConstSummands +SummandsCreateConst( + ConstHandle2Add *const add, const size_t addSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Summands/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sums.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sums.cpp new file mode 100644 index 000000000..cbd570e87 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sums.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Sums.hpp" +#include "Sums.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sums.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sums.h new file mode 100644 index 000000000..f637056f0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_SUMS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Sums +SumsDefault(); + +// --- Create, general, const +extern_c Handle2ConstSums +SumsCreateConst( + ConstHandle2ConstCrossSectionSums crossSectionSums, + ConstHandle2ConstMultiplicitySums multiplicitySums +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sums/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sums/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sums/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Sums/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_M.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_M.cpp new file mode 100644 index 000000000..e917d581f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_M.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/T_M.hpp" +#include "T_M.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_M.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_M.h new file mode 100644 index 000000000..ce0728fbb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_T_M +#define C_INTERFACE_ALPHA_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 +extern_c Handle2T_M +T_MDefault(); + +// --- Create, general, const +extern_c Handle2ConstT_M +T_MCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_M/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_M/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_M/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_M/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_effective.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_effective.cpp new file mode 100644 index 000000000..ae3250629 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_effective.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/T_effective.hpp" +#include "T_effective.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_effective.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_effective.h new file mode 100644 index 000000000..7f6cf3b72 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_T_EFFECTIVE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2T_effective +T_effectiveDefault(); + +// --- Create, general, const +extern_c Handle2ConstT_effective +T_effectiveCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_effective/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_effective/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_effective/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/T_effective/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Table.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Table.cpp new file mode 100644 index 000000000..3f00d13a9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Table.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Table.hpp" +#include "Table.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Table.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Table.h new file mode 100644 index 000000000..ae42854c9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_TABLE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Table +TableDefault(); + +// --- Create, general, const +extern_c Handle2ConstTable +TableCreateConst( + const int rows, + const int columns, + ConstHandle2ConstColumnHeaders columnHeaders, + ConstHandle2ConstData data +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Table/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Table/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Table/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Table/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TabulatedWidths.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TabulatedWidths.cpp new file mode 100644 index 000000000..a4a29b7d3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TabulatedWidths.cpp @@ -0,0 +1,415 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/TabulatedWidths.hpp" +#include "TabulatedWidths.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TabulatedWidths.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TabulatedWidths.h new file mode 100644 index 000000000..d49648459 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_TABULATEDWIDTHS +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TabulatedWidths/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TabulatedWidths/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TabulatedWidths/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TabulatedWidths/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Temperature.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Temperature.cpp new file mode 100644 index 000000000..a0b471825 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Temperature.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Temperature.hpp" +#include "Temperature.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Temperature.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Temperature.h new file mode 100644 index 000000000..e4ceb4e58 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_TEMPERATURE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Temperature +TemperatureDefault(); + +// --- Create, general, const +extern_c Handle2ConstTemperature +TemperatureCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Temperature/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Temperature/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Temperature/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Temperature/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw.cpp new file mode 100644 index 000000000..1ececeb5a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "ThermalNeutronScatteringLaw.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw.h new file mode 100644 index 000000000..a2c3c1db5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ThermalNeutronScatteringLaw +ThermalNeutronScatteringLawDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw +ThermalNeutronScatteringLawCreateConst( + const char *const label, + const char *const href +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.cpp new file mode 100644 index 000000000..ad7f4d402 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw1d.hpp" +#include "ThermalNeutronScatteringLaw1d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.h new file mode 100644 index 000000000..3857e53ca --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW1D +#define C_INTERFACE_ALPHA_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 +extern_c Handle2ThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dCreateConst( + const char *const label, + const char *const href +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.cpp new file mode 100644 index 000000000..d0e680a82 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "ThermalNeutronScatteringLaw_coherentElastic.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.h new file mode 100644 index 000000000..aa6235a93 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.cpp new file mode 100644 index 000000000..c0622b372 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "ThermalNeutronScatteringLaw_incoherentElastic.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.h new file mode 100644 index 000000000..93e870443 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.cpp new file mode 100644 index 000000000..9aa700f78 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.cpp @@ -0,0 +1,356 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" +#include "ThermalNeutronScatteringLaw_incoherentInelastic.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.h new file mode 100644 index 000000000..15e3a8817 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Theta.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Theta.cpp new file mode 100644 index 000000000..9fad56a98 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Theta.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Theta.hpp" +#include "Theta.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Theta.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Theta.h new file mode 100644 index 000000000..14fa3773e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_THETA +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Theta +ThetaDefault(); + +// --- Create, general, const +extern_c Handle2ConstTheta +ThetaCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Theta/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Theta/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Theta/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Theta/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Time.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Time.cpp new file mode 100644 index 000000000..1fe2b0bf3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Time.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Time.hpp" +#include "Time.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Time.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Time.h new file mode 100644 index 000000000..c8982a692 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_TIME +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Time +TimeDefault(); + +// --- Create, general, const +extern_c Handle2ConstTime +TimeCreateConst( + ConstHandle2ConstDouble Double, + ConstHandle2ConstString string +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Time/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Time/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Time/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Time/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Title.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Title.cpp new file mode 100644 index 000000000..08f175ca0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Title.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Title.hpp" +#include "Title.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +Handle2Title +TitleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTitle +TitleCreateConst() +{ + ConstHandle2Title handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Title.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Title.h new file mode 100644 index 000000000..0b2a04003 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_TITLE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Title +TitleDefault(); + +// --- Create, general, const +extern_c Handle2ConstTitle +TitleCreateConst(); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Title/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Title/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Title/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Title/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TotalEnergy.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TotalEnergy.cpp new file mode 100644 index 000000000..bcb99d037 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TotalEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/TotalEnergy.hpp" +#include "TotalEnergy.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TotalEnergy.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TotalEnergy.h new file mode 100644 index 000000000..dd5a235b1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_TOTALENERGY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2TotalEnergy +TotalEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstTotalEnergy +TotalEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TotalEnergy/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TotalEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TotalEnergy/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/TotalEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/U.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/U.cpp new file mode 100644 index 000000000..4c89b9acb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/U.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/U.hpp" +#include "U.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/U.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/U.h new file mode 100644 index 000000000..b7a068c97 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_U +#define C_INTERFACE_ALPHA_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 +extern_c Handle2U +UDefault(); + +// --- Create, general, const +extern_c Handle2ConstU +UCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/U/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/U/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/U/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/U/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncertainty.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncertainty.cpp new file mode 100644 index 000000000..070345f3c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncertainty.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Uncertainty.hpp" +#include "Uncertainty.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncertainty.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncertainty.h new file mode 100644 index 000000000..93dec2183 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_UNCERTAINTY +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Uncertainty +UncertaintyDefault(); + +// --- Create, general, const +extern_c Handle2ConstUncertainty +UncertaintyCreateConst( + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstStandard standard, + ConstHandle2ConstListOfCovariances listOfCovariances, + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncertainty/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncertainty/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncertainty/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncertainty/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncorrelated.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncorrelated.cpp new file mode 100644 index 000000000..e2441724c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncorrelated.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Uncorrelated.hpp" +#include "Uncorrelated.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncorrelated.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncorrelated.h new file mode 100644 index 000000000..e5f94e468 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_UNCORRELATED +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncorrelated/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncorrelated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncorrelated/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Uncorrelated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodox.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodox.cpp new file mode 100644 index 000000000..2ca282720 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodox.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Unorthodox.hpp" +#include "Unorthodox.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodox.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodox.h new file mode 100644 index 000000000..a70870723 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_UNORTHODOX +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Unorthodox +UnorthodoxDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnorthodox +UnorthodoxCreateConst( + const char *const id, + ConstHandle2ConstMass mass +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodox/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodox/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodox/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodox/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes.cpp new file mode 100644 index 000000000..0fcee4275 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Unorthodoxes.hpp" +#include "Unorthodoxes.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes.h new file mode 100644 index 000000000..b53dd1b30 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_GENERAL_UNORTHODOXES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Unorthodoxes +UnorthodoxesDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnorthodoxes +UnorthodoxesCreateConst( + ConstHandle2Unorthodox *const unorthodox, const size_t unorthodoxSize +); + +// +++ Create, general +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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unorthodoxes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unresolved.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unresolved.cpp new file mode 100644 index 000000000..2e0fa37a1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unresolved.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Unresolved.hpp" +#include "Unresolved.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unresolved.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unresolved.h new file mode 100644 index 000000000..d6a2b82c2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_UNRESOLVED +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unresolved/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unresolved/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unresolved/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unresolved/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/UnresolvedRegion.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/UnresolvedRegion.cpp new file mode 100644 index 000000000..78581e25f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/UnresolvedRegion.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/UnresolvedRegion.hpp" +#include "UnresolvedRegion.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/UnresolvedRegion.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/UnresolvedRegion.h new file mode 100644 index 000000000..88481f5b1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_UNRESOLVEDREGION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2UnresolvedRegion +UnresolvedRegionDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnresolvedRegion +UnresolvedRegionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/UnresolvedRegion/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/UnresolvedRegion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/UnresolvedRegion/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/UnresolvedRegion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unspecified.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unspecified.cpp new file mode 100644 index 000000000..e51d7952d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unspecified.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Unspecified.hpp" +#include "Unspecified.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unspecified.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unspecified.h new file mode 100644 index 000000000..839bee2bf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_UNSPECIFIED +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Unspecified +UnspecifiedDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnspecified +UnspecifiedCreateConst( + const char *const label, + const char *const productFrame +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unspecified/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unspecified/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unspecified/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Unspecified/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Values.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Values.cpp new file mode 100644 index 000000000..13d29a2e0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Values.cpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Values.hpp" +#include "Values.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +Handle2Values +ValuesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstValues +ValuesCreateConst() +{ + ConstHandle2Values handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Values.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Values.h new file mode 100644 index 000000000..a95229765 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_VALUES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Values +ValuesDefault(); + +// --- Create, general, const +extern_c Handle2ConstValues +ValuesCreateConst(); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Values/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Values/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Values/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Values/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Weighted.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Weighted.cpp new file mode 100644 index 000000000..cc56697b4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Weighted.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Weighted.hpp" +#include "Weighted.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Weighted.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Weighted.h new file mode 100644 index 000000000..232f2330f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_WEIGHTED +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Weighted +WeightedDefault(); + +// --- Create, general, const +extern_c Handle2ConstWeighted +WeightedCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstEvaporation evaporation +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Weighted/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Weighted/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Weighted/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Weighted/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/WeightedFunctionals.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/WeightedFunctionals.cpp new file mode 100644 index 000000000..9c05606ba --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/WeightedFunctionals.cpp @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/WeightedFunctionals.hpp" +#include "WeightedFunctionals.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/WeightedFunctionals.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/WeightedFunctionals.h new file mode 100644 index 000000000..874490712 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_WEIGHTEDFUNCTIONALS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2WeightedFunctionals +WeightedFunctionalsDefault(); + +// --- Create, general, const +extern_c Handle2ConstWeightedFunctionals +WeightedFunctionalsCreateConst( + ConstHandle2Weighted *const weighted, const size_t weightedSize +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/WeightedFunctionals/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/WeightedFunctionals/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/WeightedFunctionals/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/WeightedFunctionals/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Width.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Width.cpp new file mode 100644 index 000000000..bcdc20d86 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Width.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Width.hpp" +#include "Width.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Width.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Width.h new file mode 100644 index 000000000..4fe72834e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_WIDTH +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Width/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Width/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Width/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Width/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths.cpp new file mode 100644 index 000000000..32a90c849 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Widths.hpp" +#include "Widths.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths.h new file mode 100644 index 000000000..25dcf3494 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths.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. +// +// 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_ALPHA_V2_0_GENERAL_WIDTHS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Widths +WidthsDefault(); + +// --- Create, general, const +extern_c Handle2ConstWidths +WidthsCreateConst( + ConstHandle2Width *const width, const size_t widthSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Widths/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs1d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs1d.cpp new file mode 100644 index 000000000..9967ed90f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs1d.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "XYs1d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs1d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs1d.h new file mode 100644 index 000000000..1a0bc6028 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_XYS1D +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs1d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs1d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs2d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs2d.cpp new file mode 100644 index 000000000..4d7adc724 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs2d.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/XYs2d.hpp" +#include "XYs2d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs2d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs2d.h new file mode 100644 index 000000000..b20fd05d5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_XYS2D +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs2d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs2d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs3d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs3d.cpp new file mode 100644 index 000000000..81a1de79b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs3d.cpp @@ -0,0 +1,290 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/XYs3d.hpp" +#include "XYs3d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs3d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs3d.h new file mode 100644 index 000000000..203b02f9f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_XYS3D +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs3d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs3d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/XYs3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Yields.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Yields.cpp new file mode 100644 index 000000000..61d09c1e0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Yields.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/general/Yields.hpp" +#include "Yields.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Yields.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Yields.h new file mode 100644 index 000000000..8427f1264 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_GENERAL_YIELDS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Yields +YieldsDefault(); + +// --- Create, general, const +extern_c Handle2ConstYields +YieldsCreateConst( + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Yields/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Yields/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Yields/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/general/Yields/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/CrossSection.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/CrossSection.cpp new file mode 100644 index 000000000..5c88c364a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/CrossSection.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/reduced/CrossSection.hpp" +#include "CrossSection.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/CrossSection.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/CrossSection.h new file mode 100644 index 000000000..b58b30ae7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_REDUCED_CROSSSECTION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2CrossSection +CrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSection +CrossSectionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstReference reference +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/CrossSection/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/CrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/CrossSection/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/CrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Distribution.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Distribution.cpp new file mode 100644 index 000000000..78acbff35 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Distribution.cpp @@ -0,0 +1,353 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/reduced/Distribution.hpp" +#include "Distribution.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Distribution.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Distribution.h new file mode 100644 index 000000000..dfc19b1cd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_REDUCED_DISTRIBUTION +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Distribution +DistributionDefault(); + +// --- Create, general, const +extern_c Handle2ConstDistribution +DistributionCreateConst( + ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw, + ConstHandle2ConstUncorrelated uncorrelated, + ConstHandle2ConstUnspecified unspecified, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstBranching3d branching3d +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Distribution/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Distribution/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Distribution/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Distribution/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Double.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Double.cpp new file mode 100644 index 000000000..479ffa2ba --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Double.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/reduced/Double.hpp" +#include "Double.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Double.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Double.h new file mode 100644 index 000000000..bb0807c57 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_REDUCED_DOUBLE +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Double +DoubleDefault(); + +// --- Create, general, const +extern_c Handle2ConstDouble +DoubleCreateConst( + const double value +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Double/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Double/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Double/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Double/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds.cpp new file mode 100644 index 000000000..fc139ecd6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds.cpp @@ -0,0 +1,511 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/reduced/Function1ds.hpp" +#include "Function1ds.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds.h new file mode 100644 index 000000000..dbeacd822 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds.h @@ -0,0 +1,362 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_REDUCED_FUNCTION1DS +#define C_INTERFACE_ALPHA_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 +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 +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Function1ds/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides.cpp new file mode 100644 index 000000000..219ff56aa --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides.cpp @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/reduced/Nuclides.hpp" +#include "Nuclides.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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 +NuclidesStd::stringsClear(ConstHandle2Nuclides self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"Std::stringsClear", self); +} + +// Get size +size_t +NuclidesStd::stringsSize(ConstHandle2ConstNuclides self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"Std::stringsSize", self); +} + +// Get value +// By index \in [0,size) +std::string +NuclidesStd::stringsGet(ConstHandle2ConstNuclides self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"Std::stringsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NuclidesStd::stringsSet(ConstHandle2Nuclides self, const size_t index, const std::string value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"Std::stringsSet", self, index, value); +} + +// Get pointer to existing values, const +const std::string * +NuclidesStd::stringsGetArrayConst(ConstHandle2ConstNuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"Std::stringsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +std::string * +NuclidesStd::stringsGetArray(ConstHandle2Nuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"Std::stringsGetArray", self); +} + +// Set completely new values and size +void +NuclidesStd::stringsSetArray(ConstHandle2Nuclides self, const std::string *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"Std::stringsSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides.h new file mode 100644 index 000000000..3ed4aab9f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides.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. +// +// 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_ALPHA_V2_0_REDUCED_NUCLIDES +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Nuclides +NuclidesDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclides +NuclidesCreateConst( + const char *const href +); + +// +++ Create, general +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 +NuclidesStd::stringsClear(ConstHandle2Nuclides self); + +// +++ Get size +extern_c size_t +NuclidesStd::stringsSize(ConstHandle2ConstNuclides self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c std::string +NuclidesStd::stringsGet(ConstHandle2ConstNuclides self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NuclidesStd::stringsSet(ConstHandle2Nuclides self, const size_t index, const std::string value); + +// --- Get pointer to existing values, const +extern_c const std::string * +NuclidesStd::stringsGetArrayConst(ConstHandle2ConstNuclides self); + +// +++ Get pointer to existing values, non-const +extern_c std::string * +NuclidesStd::stringsGetArray(ConstHandle2Nuclides self); + +// +++ Set completely new values and size +extern_c void +NuclidesStd::stringsSetArray(ConstHandle2Nuclides self, const std::string *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Nuclides/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/OutputChannel.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/OutputChannel.cpp new file mode 100644 index 000000000..912fca748 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/OutputChannel.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/reduced/OutputChannel.hpp" +#include "OutputChannel.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/OutputChannel.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/OutputChannel.h new file mode 100644 index 000000000..8680eaee6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_REDUCED_OUTPUTCHANNEL +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/OutputChannel/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/OutputChannel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/OutputChannel/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/OutputChannel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Polynomial1d.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Polynomial1d.cpp new file mode 100644 index 000000000..798587711 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Polynomial1d.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/reduced/Polynomial1d.hpp" +#include "Polynomial1d.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Polynomial1d.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Polynomial1d.h new file mode 100644 index 000000000..fa3f24e3f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_REDUCED_POLYNOMIAL1D +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Polynomial1d +Polynomial1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstPolynomial1d +Polynomial1dCreateConst( + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Polynomial1d/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Polynomial1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Polynomial1d/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Polynomial1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Product.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Product.cpp new file mode 100644 index 000000000..a93f1c2dd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Product.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/reduced/Product.hpp" +#include "Product.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Product.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Product.h new file mode 100644 index 000000000..8fad57471 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_REDUCED_PRODUCT +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Product/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Product/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Product/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Product/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products.cpp new file mode 100644 index 000000000..041b9f455 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/reduced/Products.hpp" +#include "Products.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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); +} + +// 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); +} + +// 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products.h new file mode 100644 index 000000000..2f3f13165 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_ALPHA_V2_0_REDUCED_PRODUCTS +#define C_INTERFACE_ALPHA_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 +extern_c Handle2Products +ProductsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProducts +ProductsCreateConst( + ConstHandle2Product *const product, const size_t productSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/reduced/Products/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/CovarianceSuite.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/CovarianceSuite.cpp new file mode 100644 index 000000000..2e9dfbe77 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/CovarianceSuite.cpp @@ -0,0 +1,485 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/top/CovarianceSuite.hpp" +#include "CovarianceSuite.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/CovarianceSuite.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/CovarianceSuite.h new file mode 100644 index 000000000..7786cd1e4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_TOP_COVARIANCESUITE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/CovarianceSuite/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/CovarianceSuite/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/CovarianceSuite/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/CovarianceSuite/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/FissionFragmentData.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/FissionFragmentData.cpp new file mode 100644 index 000000000..da6b17ed3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/FissionFragmentData.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/top/FissionFragmentData.hpp" +#include "FissionFragmentData.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/FissionFragmentData.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/FissionFragmentData.h new file mode 100644 index 000000000..e1606302a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_TOP_FISSIONFRAGMENTDATA +#define C_INTERFACE_ALPHA_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 +extern_c Handle2FissionFragmentData +FissionFragmentDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionFragmentData +FissionFragmentDataCreateConst( + ConstHandle2ConstProductYields productYields, + ConstHandle2ConstDelayedNeutrons delayedNeutrons, + ConstHandle2ConstFissionEnergyReleases fissionEnergyReleases +); + +// +++ Create, general +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/FissionFragmentData/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/FissionFragmentData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/FissionFragmentData/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/FissionFragmentData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/PoPs.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/PoPs.cpp new file mode 100644 index 000000000..92bea6476 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/PoPs.cpp @@ -0,0 +1,544 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/top/PoPs.hpp" +#include "PoPs.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/PoPs.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/PoPs.h new file mode 100644 index 000000000..0f2eeffe5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_TOP_POPS +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/PoPs/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/PoPs/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/PoPs/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/PoPs/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/ReactionSuite.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/ReactionSuite.cpp new file mode 100644 index 000000000..4a5717382 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/ReactionSuite.cpp @@ -0,0 +1,821 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "alpha/v2.0/top/ReactionSuite.hpp" +#include "ReactionSuite.h" + +using namespace njoy::GNDStk; +using namespace alpha::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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/ReactionSuite.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/ReactionSuite.h new file mode 100644 index 000000000..5074aafb9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/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_ALPHA_V2_0_TOP_REACTIONSUITE +#define C_INTERFACE_ALPHA_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 +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 +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/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/ReactionSuite/src/custom.cpp b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/ReactionSuite/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/ReactionSuite/src/custom.h b/standards/gnds-2.0-alpha/alpha/c/src/v2.0/top/ReactionSuite/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g2d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g2d.python.cpp new file mode 100644 index 000000000..5196573e5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g2d.python.cpp @@ -0,0 +1,31 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// g2d declarations +namespace python_g2d { + void wrapArray(py::module &); +} // namespace python_g2d + +// wrapper for g2d +void wrapG2d(py::module &module) +{ + // create the g2d submodule + py::module submodule = module.def_submodule( + "g2d", + "alpha v2.0 g2d" + ); + + // wrap g2d components + python_g2d::wrapArray(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g2d/Array.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g2d/Array.python.cpp new file mode 100644 index 000000000..24195ab8d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g2d/Array.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/g2d/Array.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_g2d { + +// wrapper for g2d::Array +void wrapArray(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = g2d::Array; + + // create the Python object + py::class_ object( + module, "Array", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const std::optional &, + const general::Values & + >(), + py::arg("shape"), + py::arg("compression") = std::nullopt, + py::arg("symmetry") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d.python.cpp new file mode 100644 index 000000000..13bcb1911 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d.python.cpp @@ -0,0 +1,35 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// g3d declarations +namespace python_g3d { + void wrapStarts(py::module &); + void wrapLengths(py::module &); + void wrapArray(py::module &); +} // namespace python_g3d + +// wrapper for g3d +void wrapG3d(py::module &module) +{ + // create the g3d submodule + py::module submodule = module.def_submodule( + "g3d", + "alpha v2.0 g3d" + ); + + // wrap g3d components + python_g3d::wrapStarts(submodule); + python_g3d::wrapLengths(submodule); + python_g3d::wrapArray(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Array.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Array.python.cpp new file mode 100644 index 000000000..c129dacbd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Array.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/g3d/Array.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_g3d { + +// wrapper for g3d::Array +void wrapArray(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = g3d::Array; + + // create the Python object + py::class_ object( + module, "Array", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const general::Values & + >(), + py::arg("shape"), + py::arg("compression") = std::nullopt, + py::arg("symmetry") = std::nullopt, + py::arg("starts") = std::nullopt, + py::arg("lengths") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Lengths.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Lengths.python.cpp new file mode 100644 index 000000000..ad3b01be9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Lengths.python.cpp @@ -0,0 +1,101 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/g3d/Lengths.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_g3d { + +// wrapper for g3d::Lengths +void wrapLengths(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = g3d::Lengths; + + // create the Python object + py::class_ object( + module, "Lengths", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string & + >(), + py::arg("value_type"), + py::arg("label"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Starts.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Starts.python.cpp new file mode 100644 index 000000000..7f10c3dd2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/g3d/Starts.python.cpp @@ -0,0 +1,101 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/g3d/Starts.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_g3d { + +// wrapper for g3d::Starts +void wrapStarts(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = g3d::Starts; + + // create the Python object + py::class_ object( + module, "Starts", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string & + >(), + py::arg("value_type"), + py::arg("label"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general.python.cpp new file mode 100644 index 000000000..9939a1945 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general.python.cpp @@ -0,0 +1,515 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// general declarations +namespace python_general { + void wrapAuthor(py::module &); + void wrapAuthors(py::module &); + void wrapDate(py::module &); + void wrapDates(py::module &); + void wrapTitle(py::module &); + void wrapBody(py::module &); + void wrapEndfCompatible(py::module &); + void wrapDocumentation(py::module &); + void wrapTemperature(py::module &); + void wrapProjectileEnergyDomain(py::module &); + void wrapEvaluated(py::module &); + void wrapCrossSectionReconstructed(py::module &); + void wrapStyles(py::module &); + void wrapAlias(py::module &); + void wrapMetaStable(py::module &); + void wrapAliases(py::module &); + void wrapValues(py::module &); + void wrapArray(py::module &); + void wrapCovariance(py::module &); + void wrapStandard(py::module &); + void wrapListOfCovariances(py::module &); + void wrapAxis(py::module &); + void wrapLink(py::module &); + void wrapGrid(py::module &); + void wrapAxes(py::module &); + void wrapUncertainty(py::module &); + void wrapDouble(py::module &); + void wrapMass(py::module &); + void wrapFraction(py::module &); + void wrapSpin(py::module &); + void wrapInteger(py::module &); + void wrapParity(py::module &); + void wrapCharge(py::module &); + void wrapString(py::module &); + void wrapHalflife(py::module &); + void wrapProbability(py::module &); + void wrapConstant1d(py::module &); + void wrapXYs1d(py::module &); + void wrapLegendre(py::module &); + void wrapRegions1d(py::module &); + void wrapPolynomial1d(py::module &); + void wrapReference(py::module &); + void wrapBranching1d(py::module &); + void wrapBranching3d(py::module &); + void wrapUnspecified(py::module &); + void wrapMultiplicity(py::module &); + void wrapThermalNeutronScatteringLaw(py::module &); + void wrapIsotropic2d(py::module &); + void wrapFunction1ds(py::module &); + void wrapXYs2d(py::module &); + void wrapAngular(py::module &); + void wrapNBodyPhaseSpace(py::module &); + void wrapPrimaryGamma(py::module &); + void wrapDiscreteGamma(py::module &); + void wrapU(py::module &); + void wrapTheta(py::module &); + void wrapG(py::module &); + void wrapGeneralEvaporation(py::module &); + void wrapEvaporation(py::module &); + void wrapWeighted(py::module &); + void wrapWeightedFunctionals(py::module &); + void wrapSimpleMaxwellianFission(py::module &); + void wrapEFL(py::module &); + void wrapEFH(py::module &); + void wrapT_M(py::module &); + void wrapMadlandNix(py::module &); + void wrapEnergy(py::module &); + void wrapUncorrelated(py::module &); + void wrapFunction2ds(py::module &); + void wrapRegions2d(py::module &); + void wrapRecoil(py::module &); + void wrapAngularTwoBody(py::module &); + void wrapXYs3d(py::module &); + void wrapEnergyAngular(py::module &); + void wrapF(py::module &); + void wrapR(py::module &); + void wrapKalbachMann(py::module &); + void wrapAngularEnergy(py::module &); + void wrapRutherfordScattering(py::module &); + void wrapNuclearTerm(py::module &); + void wrapRealInterferenceTerm(py::module &); + void wrapImaginaryInterferenceTerm(py::module &); + void wrapNuclearAmplitudeExpansion(py::module &); + void wrapNuclearPlusInterference(py::module &); + void wrapCoulombPlusNuclearElastic(py::module &); + void wrapFormFactor(py::module &); + void wrapRealAnomalousFactor(py::module &); + void wrapImaginaryAnomalousFactor(py::module &); + void wrapCoherentPhotonScattering(py::module &); + void wrapScatteringFactor(py::module &); + void wrapIncoherentPhotonScattering(py::module &); + void wrapDistribution(py::module &); + void wrapQ(py::module &); + void wrapAverageProductEnergy(py::module &); + void wrapProduct(py::module &); + void wrapProducts(py::module &); + void wrapDecay(py::module &); + void wrapDecayPath(py::module &); + void wrapShell(py::module &); + void wrapPhotonEmissionProbabilities(py::module &); + void wrapIntensity(py::module &); + void wrapInternalConversionCoefficients(py::module &); + void wrapPositronEmissionIntensity(py::module &); + void wrapDiscrete(py::module &); + void wrapContinuum(py::module &); + void wrapSpectrum(py::module &); + void wrapSpectra(py::module &); + void wrapDecayMode(py::module &); + void wrapDecayModes(py::module &); + void wrapAverageEnergy(py::module &); + void wrapAverageEnergies(py::module &); + void wrapDecayData(py::module &); + void wrapBaryon(py::module &); + void wrapBaryons(py::module &); + void wrapBindingEnergy(py::module &); + void wrapConfiguration(py::module &); + void wrapConfigurations(py::module &); + void wrapAtomic(py::module &); + void wrapNucleus(py::module &); + void wrapTime(py::module &); + void wrapYields(py::module &); + void wrapIncidentEnergy(py::module &); + void wrapIncidentEnergies(py::module &); + void wrapElapsedTime(py::module &); + void wrapElapsedTimes(py::module &); + void wrapProductYield(py::module &); + void wrapProductYields(py::module &); + void wrapRate(py::module &); + void wrapDelayedNeutron(py::module &); + void wrapDelayedNeutrons(py::module &); + void wrapPromptProductKE(py::module &); + void wrapPromptNeutronKE(py::module &); + void wrapDelayedNeutronKE(py::module &); + void wrapPromptGammaEnergy(py::module &); + void wrapDelayedGammaEnergy(py::module &); + void wrapDelayedBetaEnergy(py::module &); + void wrapNeutrinoEnergy(py::module &); + void wrapNonNeutrinoEnergy(py::module &); + void wrapTotalEnergy(py::module &); + void wrapFissionEnergyRelease(py::module &); + void wrapFissionEnergyReleases(py::module &); + void wrapNuclide(py::module &); + void wrapNuclides(py::module &); + void wrapIsotope(py::module &); + void wrapIsotopes(py::module &); + void wrapChemicalElement(py::module &); + void wrapChemicalElements(py::module &); + void wrapUnorthodox(py::module &); + void wrapUnorthodoxes(py::module &); + void wrapGaugeBoson(py::module &); + void wrapGaugeBosons(py::module &); + void wrapLepton(py::module &); + void wrapLeptons(py::module &); + void wrapScatteringRadius(py::module &); + void wrapColumn(py::module &); + void wrapColumnHeaders(py::module &); + void wrapData(py::module &); + void wrapTable(py::module &); + void wrapResonanceParameters(py::module &); + void wrapBreitWigner(py::module &); + void wrapHardSphereRadius(py::module &); + void wrapResonanceReaction(py::module &); + void wrapResonanceReactions(py::module &); + void wrapChannel(py::module &); + void wrapChannels(py::module &); + void wrapSpinGroup(py::module &); + void wrapSpinGroups(py::module &); + void wrapRMatrix(py::module &); + void wrapResolved(py::module &); + void wrapLevelSpacing(py::module &); + void wrapWidth(py::module &); + void wrapWidths(py::module &); + void wrapJ(py::module &); + void wrapJs(py::module &); + void wrapL(py::module &); + void wrapLs(py::module &); + void wrapTabulatedWidths(py::module &); + void wrapUnresolved(py::module &); + void wrapResonances(py::module &); + void wrapResolvedRegion(py::module &); + void wrapFastRegion(py::module &); + void wrapUnresolvedRegion(py::module &); + void wrapBackground(py::module &); + void wrapResonancesWithBackground(py::module &); + void wrapThermalNeutronScatteringLaw1d(py::module &); + void wrapCrossSection(py::module &); + void wrapOutputChannel(py::module &); + void wrapGridded2d(py::module &); + void wrapS_table(py::module &); + void wrapThermalNeutronScatteringLaw_coherentElastic(py::module &); + void wrapBoundAtomCrossSection(py::module &); + void wrapDebyeWallerIntegral(py::module &); + void wrapThermalNeutronScatteringLaw_incoherentElastic(py::module &); + void wrapE_critical(py::module &); + void wrapE_max(py::module &); + void wrapGridded3d(py::module &); + void wrapSCTApproximation(py::module &); + void wrapFreeGasApproximation(py::module &); + void wrapSelfScatteringKernel(py::module &); + void wrapT_effective(py::module &); + void wrapScatteringAtom(py::module &); + void wrapScatteringAtoms(py::module &); + void wrapThermalNeutronScatteringLaw_incoherentInelastic(py::module &); + void wrapDoubleDifferentialCrossSection(py::module &); + void wrapReaction(py::module &); + void wrapReactions(py::module &); + void wrapConversion(py::module &); + void wrapENDFconversionFlags(py::module &); + void wrapInstitution(py::module &); + void wrapApplicationData(py::module &); + void wrapExternalFile(py::module &); + void wrapExternalFiles(py::module &); + void wrapAdd(py::module &); + void wrapSummands(py::module &); + void wrapCrossSectionSum(py::module &); + void wrapCrossSectionSums(py::module &); + void wrapMultiplicitySum(py::module &); + void wrapMultiplicitySums(py::module &); + void wrapSums(py::module &); + void wrapProduction(py::module &); + void wrapProductions(py::module &); + void wrapFissionComponent(py::module &); + void wrapFissionComponents(py::module &); + void wrapOrphanProduct(py::module &); + void wrapOrphanProducts(py::module &); + void wrapIncompleteReactions(py::module &); + void wrapSlice(py::module &); + void wrapSlices(py::module &); + void wrapRowData(py::module &); + void wrapColumnData(py::module &); + void wrapCovarianceMatrix(py::module &); + void wrapSummand(py::module &); + void wrapSum(py::module &); + void wrapShortRangeSelfScalingVariance(py::module &); + void wrapMixed(py::module &); + void wrapCovarianceSection(py::module &); + void wrapCovarianceSections(py::module &); + void wrapParameterLink(py::module &); + void wrapParameters(py::module &); + void wrapParameterCovarianceMatrix(py::module &); + void wrapParameterCovariance(py::module &); + void wrapAverageParameterCovariance(py::module &); + void wrapParameterCovariances(py::module &); +} // namespace python_general + +// wrapper for general +void wrapGeneral(py::module &module) +{ + // create the general submodule + py::module submodule = module.def_submodule( + "general", + "alpha v2.0 general" + ); + + // wrap general components + 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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Add.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Add.python.cpp new file mode 100644 index 000000000..bb66f681a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Add.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Add.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Add +void wrapAdd(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Add; + + // create the Python object + py::class_ object( + module, "Add", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Alias.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Alias.python.cpp new file mode 100644 index 000000000..dc44aac4c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Alias.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Alias.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Alias +void wrapAlias(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Alias; + + // create the Python object + py::class_ object( + module, "Alias", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("id") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Aliases.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Aliases.python.cpp new file mode 100644 index 000000000..dadae5d88 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Aliases.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Aliases.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Aliases +void wrapAliases(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Aliases; + + // create the Python object + py::class_ object( + module, "Aliases", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> &, + const std::optional> & + >(), + py::arg("alias") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Angular.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Angular.python.cpp new file mode 100644 index 000000000..ad85486fb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Angular.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Angular.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Angular +void wrapAngular(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Angular; + + // create the Python object + py::class_ object( + module, "Angular", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("isotropic2d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AngularEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AngularEnergy.python.cpp new file mode 100644 index 000000000..25bc0080e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AngularEnergy.python.cpp @@ -0,0 +1,122 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/AngularEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AngularEnergy +void wrapAngularEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::AngularEnergy; + + // create the Python object + py::class_ object( + module, "AngularEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const general::XYs3d & + >(), + py::arg("label"), + py::arg("product_frame"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AngularTwoBody.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AngularTwoBody.python.cpp new file mode 100644 index 000000000..0cf54f82c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AngularTwoBody.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/AngularTwoBody.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AngularTwoBody +void wrapAngularTwoBody(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::AngularTwoBody; + + // create the Python object + py::class_ object( + module, "AngularTwoBody", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("product_frame"), + py::arg("xys2d") = std::nullopt, + py::arg("regions2d") = std::nullopt, + py::arg("recoil") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ApplicationData.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ApplicationData.python.cpp new file mode 100644 index 000000000..53d738984 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ApplicationData.python.cpp @@ -0,0 +1,90 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ApplicationData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ApplicationData +void wrapApplicationData(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ApplicationData; + + // create the Python object + py::class_ object( + module, "ApplicationData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Institution & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Array.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Array.python.cpp new file mode 100644 index 000000000..28a620f99 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Array.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Array.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Array +void wrapArray(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Array; + + // create the Python object + py::class_ object( + module, "Array", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const general::Values & + >(), + py::arg("shape"), + py::arg("compression") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Atomic.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Atomic.python.cpp new file mode 100644 index 000000000..e354e323f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Atomic.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Atomic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Atomic +void wrapAtomic(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Atomic; + + // create the Python object + py::class_ object( + module, "Atomic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Configurations & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Author.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Author.python.cpp new file mode 100644 index 000000000..9360f540b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Author.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Author.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Author +void wrapAuthor(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Author; + + // create the Python object + py::class_ object( + module, "Author", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Authors.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Authors.python.cpp new file mode 100644 index 000000000..da0dbc3e4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Authors.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Authors.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Authors +void wrapAuthors(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Authors; + + // create the Python object + py::class_ object( + module, "Authors", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageEnergies.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageEnergies.python.cpp new file mode 100644 index 000000000..acfd9738f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageEnergies.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/AverageEnergies.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AverageEnergies +void wrapAverageEnergies(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::AverageEnergies; + + // create the Python object + py::class_ object( + module, "AverageEnergies", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageEnergy.python.cpp new file mode 100644 index 000000000..23c538ddd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageEnergy.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/AverageEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AverageEnergy +void wrapAverageEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::AverageEnergy; + + // create the Python object + py::class_ object( + module, "AverageEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const double &, + const std::string &, + const std::optional & + >(), + py::arg("label"), + py::arg("value"), + py::arg("unit"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageParameterCovariance.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageParameterCovariance.python.cpp new file mode 100644 index 000000000..fe72137d3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageParameterCovariance.python.cpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/AverageParameterCovariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AverageParameterCovariance +void wrapAverageParameterCovariance(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::AverageParameterCovariance; + + // create the Python object + py::class_ object( + module, "AverageParameterCovariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const general::CovarianceMatrix &, + const general::RowData &, + const std::optional & + >(), + py::arg("label"), + py::arg("cross_term") = std::nullopt, + py::arg("covariance_matrix"), + py::arg("row_data"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageProductEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageProductEnergy.python.cpp new file mode 100644 index 000000000..d2905e5a8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/AverageProductEnergy.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/AverageProductEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AverageProductEnergy +void wrapAverageProductEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::AverageProductEnergy; + + // create the Python object + py::class_ object( + module, "AverageProductEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Axes.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Axes.python.cpp new file mode 100644 index 000000000..0d598ebf3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Axes.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Axes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Axes +void wrapAxes(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Axes; + + // create the Python object + py::class_ object( + module, "Axes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector &, + const std::optional> & + >(), + py::arg("axis"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Axis.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Axis.python.cpp new file mode 100644 index 000000000..f7f33765f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Axis.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Axis.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Axis +void wrapAxis(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Axis; + + // create the Python object + py::class_ object( + module, "Axis", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const int &, + const std::string &, + const std::string & + >(), + py::arg("index"), + py::arg("label"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Background.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Background.python.cpp new file mode 100644 index 000000000..b31ab8efe --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Background.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Background.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Background +void wrapBackground(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Background; + + // create the Python object + py::class_ object( + module, "Background", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const general::FastRegion &, + const std::optional & + >(), + py::arg("resolved_region") = std::nullopt, + py::arg("fast_region"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Baryon.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Baryon.python.cpp new file mode 100644 index 000000000..7af3a153f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Baryon.python.cpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Baryon.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Baryon +void wrapBaryon(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Baryon; + + // create the Python object + py::class_ object( + module, "Baryon", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const general::Mass &, + const general::Spin &, + const general::Parity &, + const general::Charge &, + const general::Halflife &, + const std::optional & + >(), + py::arg("id"), + py::arg("mass"), + py::arg("spin"), + py::arg("parity"), + py::arg("charge"), + py::arg("halflife"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Baryons.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Baryons.python.cpp new file mode 100644 index 000000000..16b574427 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Baryons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Baryons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Baryons +void wrapBaryons(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Baryons; + + // create the Python object + py::class_ object( + module, "Baryons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BindingEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BindingEnergy.python.cpp new file mode 100644 index 000000000..d7faf3b55 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BindingEnergy.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/BindingEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::BindingEnergy +void wrapBindingEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::BindingEnergy; + + // create the Python object + py::class_ object( + module, "BindingEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Double & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Body.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Body.python.cpp new file mode 100644 index 000000000..b0a9f1e89 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Body.python.cpp @@ -0,0 +1,60 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Body.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Body +void wrapBody(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Body; + + // create the Python object + py::class_ object( + module, "Body", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BoundAtomCrossSection.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BoundAtomCrossSection.python.cpp new file mode 100644 index 000000000..3bcce44fa --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BoundAtomCrossSection.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/BoundAtomCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::BoundAtomCrossSection +void wrapBoundAtomCrossSection(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::BoundAtomCrossSection; + + // create the Python object + py::class_ object( + module, "BoundAtomCrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const std::string & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Branching1d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Branching1d.python.cpp new file mode 100644 index 000000000..300e11be5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Branching1d.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Branching1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Branching1d +void wrapBranching1d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Branching1d; + + // create the Python object + py::class_ object( + module, "Branching1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Branching3d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Branching3d.python.cpp new file mode 100644 index 000000000..e9545cde6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Branching3d.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Branching3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Branching3d +void wrapBranching3d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Branching3d; + + // create the Python object + py::class_ object( + module, "Branching3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string & + >(), + py::arg("label"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BreitWigner.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BreitWigner.python.cpp new file mode 100644 index 000000000..53451cd85 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/BreitWigner.python.cpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/BreitWigner.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::BreitWigner +void wrapBreitWigner(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::BreitWigner; + + // create the Python object + py::class_ object( + module, "BreitWigner", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::optional &, + const general::ResonanceParameters &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("approximation"), + py::arg("calculate_channel_radius") = std::nullopt, + py::arg("resonance_parameters"), + py::arg("po_ps") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Channel.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Channel.python.cpp new file mode 100644 index 000000000..67ec012d1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Channel.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Channel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Channel +void wrapChannel(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Channel; + + // create the Python object + py::class_ object( + module, "Channel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const int &, + const int &, + const int &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("resonance_reaction"), + py::arg("l"), + py::arg("channel_spin"), + py::arg("column_index"), + py::arg("scattering_radius") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Channels.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Channels.python.cpp new file mode 100644 index 000000000..c87267fee --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Channels.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Channels.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Channels +void wrapChannels(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Channels; + + // create the Python object + py::class_ object( + module, "Channels", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Charge.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Charge.python.cpp new file mode 100644 index 000000000..f3ce3e382 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Charge.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Charge.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Charge +void wrapCharge(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Charge; + + // create the Python object + py::class_ object( + module, "Charge", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Integer & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ChemicalElement.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ChemicalElement.python.cpp new file mode 100644 index 000000000..8ecc38e30 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ChemicalElement.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ChemicalElement.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ChemicalElement +void wrapChemicalElement(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ChemicalElement; + + // create the Python object + py::class_ object( + module, "ChemicalElement", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const std::string &, + const std::optional &, + const std::optional & + >(), + py::arg("symbol"), + py::arg("z"), + py::arg("name"), + py::arg("atomic") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ChemicalElements.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ChemicalElements.python.cpp new file mode 100644 index 000000000..cf2334060 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ChemicalElements.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ChemicalElements.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ChemicalElements +void wrapChemicalElements(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ChemicalElements; + + // create the Python object + py::class_ object( + module, "ChemicalElements", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CoherentPhotonScattering.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CoherentPhotonScattering.python.cpp new file mode 100644 index 000000000..a9e7b7cda --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CoherentPhotonScattering.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/CoherentPhotonScattering.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CoherentPhotonScattering +void wrapCoherentPhotonScattering(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::CoherentPhotonScattering; + + // create the Python object + py::class_ object( + module, "CoherentPhotonScattering", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("href") = std::nullopt, + py::arg("pid") = std::nullopt, + py::arg("product_frame") = std::nullopt, + py::arg("form_factor") = std::nullopt, + py::arg("real_anomalous_factor") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Column.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Column.python.cpp new file mode 100644 index 000000000..1c64fe944 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Column.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Column.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Column +void wrapColumn(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Column; + + // create the Python object + py::class_ object( + module, "Column", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const int &, + const std::string &, + const std::string & + >(), + py::arg("index"), + py::arg("name"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ColumnData.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ColumnData.python.cpp new file mode 100644 index 000000000..20a456195 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ColumnData.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ColumnData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ColumnData +void wrapColumnData(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ColumnData; + + // create the Python object + py::class_ object( + module, "ColumnData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::string &, + const std::optional & + >(), + py::arg("endf_mfmt") = std::nullopt, + py::arg("href"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ColumnHeaders.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ColumnHeaders.python.cpp new file mode 100644 index 000000000..14349d559 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ColumnHeaders.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ColumnHeaders.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ColumnHeaders +void wrapColumnHeaders(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ColumnHeaders; + + // create the Python object + py::class_ object( + module, "ColumnHeaders", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Configuration.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Configuration.python.cpp new file mode 100644 index 000000000..9e9fd1bbe --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Configuration.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Configuration.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Configuration +void wrapConfiguration(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Configuration; + + // create the Python object + py::class_ object( + module, "Configuration", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const double &, + const general::BindingEnergy &, + const std::vector & + >(), + py::arg("subshell"), + py::arg("electron_number"), + py::arg("binding_energy"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Configurations.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Configurations.python.cpp new file mode 100644 index 000000000..f9464fa8a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Configurations.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Configurations.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Configurations +void wrapConfigurations(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Configurations; + + // create the Python object + py::class_ object( + module, "Configurations", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Constant1d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Constant1d.python.cpp new file mode 100644 index 000000000..8978e9030 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Constant1d.python.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Constant1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Constant1d +void wrapConstant1d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Constant1d; + + // create the Python object + py::class_ object( + module, "Constant1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const double &, + const double &, + const double &, + const general::Axes & + >(), + py::arg("label") = std::nullopt, + py::arg("value"), + py::arg("domain_min"), + py::arg("domain_max"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Continuum.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Continuum.python.cpp new file mode 100644 index 000000000..31e0922a1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Continuum.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Continuum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Continuum +void wrapContinuum(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Continuum; + + // create the Python object + py::class_ object( + module, "Continuum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Conversion.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Conversion.python.cpp new file mode 100644 index 000000000..4778ddf3a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Conversion.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Conversion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Conversion +void wrapConversion(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Conversion; + + // create the Python object + py::class_ object( + module, "Conversion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string & + >(), + py::arg("flags"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CoulombPlusNuclearElastic.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CoulombPlusNuclearElastic.python.cpp new file mode 100644 index 000000000..e0a52c782 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CoulombPlusNuclearElastic.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CoulombPlusNuclearElastic +void wrapCoulombPlusNuclearElastic(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::CoulombPlusNuclearElastic; + + // create the Python object + py::class_ object( + module, "CoulombPlusNuclearElastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("label"), + py::arg("href") = std::nullopt, + py::arg("pid") = std::nullopt, + py::arg("product_frame") = std::nullopt, + py::arg("identical_particles") = std::nullopt, + py::arg("rutherford_scattering") = std::nullopt, + py::arg("nuclear_amplitude_expansion") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Covariance.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Covariance.python.cpp new file mode 100644 index 000000000..b0df957c0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Covariance.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Covariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Covariance +void wrapCovariance(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Covariance; + + // create the Python object + py::class_ object( + module, "Covariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("href") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceMatrix.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceMatrix.python.cpp new file mode 100644 index 000000000..1af7f9294 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceMatrix.python.cpp @@ -0,0 +1,180 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/CovarianceMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CovarianceMatrix +void wrapCovarianceMatrix(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::CovarianceMatrix; + + // create the Python object + py::class_ object( + module, "CovarianceMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::optional &, + const general::Gridded2d & + >(), + py::arg("label"), + py::arg("type"), + py::arg("product_frame") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceSection.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceSection.python.cpp new file mode 100644 index 000000000..19051e354 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceSection.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/CovarianceSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CovarianceSection +void wrapCovarianceSection(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::CovarianceSection; + + // create the Python object + py::class_ object( + module, "CovarianceSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const general::RowData &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("cross_term") = std::nullopt, + py::arg("row_data"), + py::arg("column_data") = std::nullopt, + py::arg("covariance_matrix") = std::nullopt, + py::arg("mixed") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceSections.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceSections.python.cpp new file mode 100644 index 000000000..42a874bfb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CovarianceSections.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/CovarianceSections.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CovarianceSections +void wrapCovarianceSections(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::CovarianceSections; + + // create the Python object + py::class_ object( + module, "CovarianceSections", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSection.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSection.python.cpp new file mode 100644 index 000000000..0927f61f1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSection.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/CrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CrossSection +void wrapCrossSection(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::CrossSection; + + // create the Python object + py::class_ object( + module, "CrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::arg("regions1d") = std::nullopt, + py::arg("reference") = std::nullopt, + py::arg("resonances_with_background") = std::nullopt, + py::arg("coulomb_plus_nuclear_elastic") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionReconstructed.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionReconstructed.python.cpp new file mode 100644 index 000000000..f9a07c8e4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionReconstructed.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/CrossSectionReconstructed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CrossSectionReconstructed +void wrapCrossSectionReconstructed(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::CrossSectionReconstructed; + + // create the Python object + py::class_ object( + module, "CrossSectionReconstructed", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string & + >(), + py::arg("label"), + py::arg("derived_from"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionSum.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionSum.python.cpp new file mode 100644 index 000000000..1716d19ac --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionSum.python.cpp @@ -0,0 +1,252 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/CrossSectionSum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CrossSectionSum +void wrapCrossSectionSum(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::CrossSectionSum; + + // create the Python object + py::class_ object( + module, "CrossSectionSum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const general::Summands &, + const general::Q &, + const general::CrossSection & + >(), + py::arg("label"), + py::arg("endf_mt"), + py::arg("summands"), + py::arg("q"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionSums.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionSums.python.cpp new file mode 100644 index 000000000..f8561c04c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/CrossSectionSums.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/CrossSectionSums.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CrossSectionSums +void wrapCrossSectionSums(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::CrossSectionSums; + + // create the Python object + py::class_ object( + module, "CrossSectionSums", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Data.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Data.python.cpp new file mode 100644 index 000000000..244195928 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Data.python.cpp @@ -0,0 +1,69 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Data.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Data +void wrapData(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Data; + + // create the Python object + py::class_ object( + module, "Data", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Date.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Date.python.cpp new file mode 100644 index 000000000..86f9742f2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Date.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Date.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Date +void wrapDate(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Date; + + // create the Python object + py::class_ object( + module, "Date", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Dates.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Dates.python.cpp new file mode 100644 index 000000000..46d3728ae --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Dates.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Dates.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Dates +void wrapDates(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Dates; + + // create the Python object + py::class_ object( + module, "Dates", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DebyeWallerIntegral.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DebyeWallerIntegral.python.cpp new file mode 100644 index 000000000..b6f210440 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DebyeWallerIntegral.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DebyeWallerIntegral.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DebyeWallerIntegral +void wrapDebyeWallerIntegral(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DebyeWallerIntegral; + + // create the Python object + py::class_ object( + module, "DebyeWallerIntegral", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Decay.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Decay.python.cpp new file mode 100644 index 000000000..bdb85798c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Decay.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Decay.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Decay +void wrapDecay(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Decay; + + // create the Python object + py::class_ object( + module, "Decay", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const int &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("index"), + py::arg("mode") = std::nullopt, + py::arg("complete") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayData.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayData.python.cpp new file mode 100644 index 000000000..90a373a36 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayData.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DecayData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DecayData +void wrapDecayData(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DecayData; + + // create the Python object + py::class_ object( + module, "DecayData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::DecayModes &, + const std::optional & + >(), + py::arg("decay_modes"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayMode.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayMode.python.cpp new file mode 100644 index 000000000..88ac7cbbe --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayMode.python.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DecayMode.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DecayMode +void wrapDecayMode(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DecayMode; + + // create the Python object + py::class_ object( + module, "DecayMode", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const general::Probability &, + const general::DecayPath &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("mode") = std::nullopt, + py::arg("probability"), + py::arg("decay_path"), + py::arg("photon_emission_probabilities") = std::nullopt, + py::arg("q") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayModes.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayModes.python.cpp new file mode 100644 index 000000000..45f18eea2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayModes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DecayModes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DecayModes +void wrapDecayModes(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DecayModes; + + // create the Python object + py::class_ object( + module, "DecayModes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayPath.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayPath.python.cpp new file mode 100644 index 000000000..98095a79a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DecayPath.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DecayPath.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DecayPath +void wrapDecayPath(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DecayPath; + + // create the Python object + py::class_ object( + module, "DecayPath", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedBetaEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedBetaEnergy.python.cpp new file mode 100644 index 000000000..f2b2bbd21 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedBetaEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DelayedBetaEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedBetaEnergy +void wrapDelayedBetaEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DelayedBetaEnergy; + + // create the Python object + py::class_ object( + module, "DelayedBetaEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Polynomial1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedGammaEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedGammaEnergy.python.cpp new file mode 100644 index 000000000..9d81e240f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedGammaEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DelayedGammaEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedGammaEnergy +void wrapDelayedGammaEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DelayedGammaEnergy; + + // create the Python object + py::class_ object( + module, "DelayedGammaEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Polynomial1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutron.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutron.python.cpp new file mode 100644 index 000000000..5fe77c2ae --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutron.python.cpp @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DelayedNeutron.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedNeutron +void wrapDelayedNeutron(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DelayedNeutron; + + // create the Python object + py::class_ object( + module, "DelayedNeutron", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const general::Rate &, + const reduced::Product & + >(), + py::arg("label"), + py::arg("rate"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutronKE.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutronKE.python.cpp new file mode 100644 index 000000000..4560f52d1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutronKE.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DelayedNeutronKE.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedNeutronKE +void wrapDelayedNeutronKE(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DelayedNeutronKE; + + // create the Python object + py::class_ object( + module, "DelayedNeutronKE", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("polynomial1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutrons.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutrons.python.cpp new file mode 100644 index 000000000..14d57eca7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DelayedNeutrons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DelayedNeutrons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedNeutrons +void wrapDelayedNeutrons(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DelayedNeutrons; + + // create the Python object + py::class_ object( + module, "DelayedNeutrons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Discrete.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Discrete.python.cpp new file mode 100644 index 000000000..3c0292528 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Discrete.python.cpp @@ -0,0 +1,266 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Discrete.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Discrete +void wrapDiscrete(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Discrete; + + // create the Python object + py::class_ object( + module, "Discrete", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const general::Intensity &, + const general::Energy &, + const std::optional &, + const std::optional & + >(), + py::arg("type") = std::nullopt, + py::arg("intensity"), + py::arg("energy"), + py::arg("internal_conversion_coefficients") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DiscreteGamma.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DiscreteGamma.python.cpp new file mode 100644 index 000000000..4232036eb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DiscreteGamma.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DiscreteGamma.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DiscreteGamma +void wrapDiscreteGamma(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DiscreteGamma; + + // create the Python object + py::class_ object( + module, "DiscreteGamma", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const double &, + const double &, + const general::Axes & + >(), + py::arg("value"), + py::arg("domain_min"), + py::arg("domain_max"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Distribution.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Distribution.python.cpp new file mode 100644 index 000000000..5088cea89 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Distribution.python.cpp @@ -0,0 +1,222 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Distribution.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Distribution +void wrapDistribution(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Distribution; + + // create the Python object + py::class_ object( + module, "Distribution", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("thermal_neutron_scattering_law") = std::nullopt, + py::arg("uncorrelated") = std::nullopt, + py::arg("unspecified") = std::nullopt, + py::arg("branching3d") = std::nullopt, + py::arg("angular_two_body") = std::nullopt, + py::arg("energy_angular") = std::nullopt, + py::arg("kalbach_mann") = std::nullopt, + py::arg("angular_energy") = std::nullopt, + py::arg("coulomb_plus_nuclear_elastic") = std::nullopt, + py::arg("coherent_photon_scattering") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Documentation.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Documentation.python.cpp new file mode 100644 index 000000000..fa8a72ce8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Documentation.python.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Documentation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Documentation +void wrapDocumentation(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Documentation; + + // create the Python object + py::class_ object( + module, "Documentation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Authors &, + const general::Dates &, + const general::Title &, + const general::Body &, + const std::optional & + >(), + py::arg("authors"), + py::arg("dates"), + py::arg("title"), + py::arg("body"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Double.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Double.python.cpp new file mode 100644 index 000000000..eb04b0c06 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Double.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Double.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Double +void wrapDouble(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Double; + + // create the Python object + py::class_ object( + module, "Double", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const double &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("value"), + py::arg("unit") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DoubleDifferentialCrossSection.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DoubleDifferentialCrossSection.python.cpp new file mode 100644 index 000000000..6a98c484b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/DoubleDifferentialCrossSection.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/DoubleDifferentialCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DoubleDifferentialCrossSection +void wrapDoubleDifferentialCrossSection(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::DoubleDifferentialCrossSection; + + // create the Python object + py::class_ object( + module, "DoubleDifferentialCrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("coulomb_plus_nuclear_elastic") = std::nullopt, + py::arg("coherent_photon_scattering") = std::nullopt, + py::arg("incoherent_photon_scattering") = std::nullopt, + py::arg("thermal_neutron_scattering_law_coherent_elastic") = std::nullopt, + py::arg("thermal_neutron_scattering_law_incoherent_elastic") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EFH.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EFH.python.cpp new file mode 100644 index 000000000..d2f35f2e1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EFH.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/EFH.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::EFH +void wrapEFH(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::EFH; + + // create the Python object + py::class_ object( + module, "EFH", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const std::string & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EFL.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EFL.python.cpp new file mode 100644 index 000000000..8d7e974e7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EFL.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/EFL.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::EFL +void wrapEFL(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::EFL; + + // create the Python object + py::class_ object( + module, "EFL", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const std::string & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ENDFconversionFlags.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ENDFconversionFlags.python.cpp new file mode 100644 index 000000000..7b10e3485 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ENDFconversionFlags.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ENDFconversionFlags.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ENDFconversionFlags +void wrapENDFconversionFlags(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ENDFconversionFlags; + + // create the Python object + py::class_ object( + module, "ENDFconversionFlags", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::vector & + >(), + py::arg("flags") = std::nullopt, + py::arg("href") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/E_critical.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/E_critical.python.cpp new file mode 100644 index 000000000..fb254c80c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/E_critical.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/E_critical.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::E_critical +void wrapE_critical(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::E_critical; + + // create the Python object + py::class_ object( + module, "E_critical", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const std::string & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/E_max.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/E_max.python.cpp new file mode 100644 index 000000000..2c56a6dbb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/E_max.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/E_max.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::E_max +void wrapE_max(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::E_max; + + // create the Python object + py::class_ object( + module, "E_max", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const std::string & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ElapsedTime.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ElapsedTime.python.cpp new file mode 100644 index 000000000..71dc1c14c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ElapsedTime.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ElapsedTime.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ElapsedTime +void wrapElapsedTime(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ElapsedTime; + + // create the Python object + py::class_ object( + module, "ElapsedTime", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const general::Time &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("time"), + py::arg("yields") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ElapsedTimes.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ElapsedTimes.python.cpp new file mode 100644 index 000000000..ec368c318 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ElapsedTimes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ElapsedTimes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ElapsedTimes +void wrapElapsedTimes(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ElapsedTimes; + + // create the Python object + py::class_ object( + module, "ElapsedTimes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EndfCompatible.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EndfCompatible.python.cpp new file mode 100644 index 000000000..0eaa943b2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EndfCompatible.python.cpp @@ -0,0 +1,60 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/EndfCompatible.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::EndfCompatible +void wrapEndfCompatible(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::EndfCompatible; + + // create the Python object + py::class_ object( + module, "EndfCompatible", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Energy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Energy.python.cpp new file mode 100644 index 000000000..04801966e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Energy.python.cpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Energy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Energy +void wrapEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Energy; + + // create the Python object + py::class_ object( + module, "Energy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("value") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("double") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("nbody_phase_space") = std::nullopt, + py::arg("primary_gamma") = std::nullopt, + py::arg("discrete_gamma") = std::nullopt, + py::arg("xys2d") = std::nullopt, + py::arg("general_evaporation") = std::nullopt, + py::arg("evaporation") = std::nullopt, + py::arg("weighted_functionals") = std::nullopt, + py::arg("simple_maxwellian_fission") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EnergyAngular.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EnergyAngular.python.cpp new file mode 100644 index 000000000..c9d71c707 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/EnergyAngular.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/EnergyAngular.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::EnergyAngular +void wrapEnergyAngular(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::EnergyAngular; + + // create the Python object + py::class_ object( + module, "EnergyAngular", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::optional & + >(), + py::arg("label"), + py::arg("product_frame"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Evaluated.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Evaluated.python.cpp new file mode 100644 index 000000000..0fda52cad --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Evaluated.python.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Evaluated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Evaluated +void wrapEvaluated(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Evaluated; + + // create the Python object + py::class_ object( + module, "Evaluated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const general::Documentation &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("date"), + py::arg("library"), + py::arg("version"), + py::arg("documentation"), + py::arg("temperature") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Evaporation.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Evaporation.python.cpp new file mode 100644 index 000000000..309681144 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Evaporation.python.cpp @@ -0,0 +1,106 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Evaporation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Evaporation +void wrapEvaporation(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Evaporation; + + // create the Python object + py::class_ object( + module, "Evaporation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::U &, + const general::Theta & + >(), + py::arg("u"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ExternalFile.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ExternalFile.python.cpp new file mode 100644 index 000000000..523bca5fb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ExternalFile.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ExternalFile.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ExternalFile +void wrapExternalFile(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ExternalFile; + + // create the Python object + py::class_ object( + module, "ExternalFile", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("path"), + py::arg("checksum") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ExternalFiles.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ExternalFiles.python.cpp new file mode 100644 index 000000000..25d4e1bf6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ExternalFiles.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ExternalFiles.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ExternalFiles +void wrapExternalFiles(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ExternalFiles; + + // create the Python object + py::class_ object( + module, "ExternalFiles", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/F.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/F.python.cpp new file mode 100644 index 000000000..e5c46711f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/F.python.cpp @@ -0,0 +1,146 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/F.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::F +void wrapF(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::F; + + // create the Python object + py::class_ object( + module, "F", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs2d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FastRegion.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FastRegion.python.cpp new file mode 100644 index 000000000..24b7095e6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FastRegion.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/FastRegion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FastRegion +void wrapFastRegion(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::FastRegion; + + // create the Python object + py::class_ object( + module, "FastRegion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionComponent.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionComponent.python.cpp new file mode 100644 index 000000000..2fb9b2e24 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionComponent.python.cpp @@ -0,0 +1,280 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/FissionComponent.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FissionComponent +void wrapFissionComponent(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::FissionComponent; + + // create the Python object + py::class_ object( + module, "FissionComponent", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const std::string &, + const general::CrossSection &, + const general::OutputChannel & + >(), + py::arg("label"), + py::arg("endf_mt"), + py::arg("fission_genre"), + py::arg("cross_section"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionComponents.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionComponents.python.cpp new file mode 100644 index 000000000..0f99045d4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionComponents.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/FissionComponents.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FissionComponents +void wrapFissionComponents(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::FissionComponents; + + // create the Python object + py::class_ object( + module, "FissionComponents", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionEnergyRelease.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionEnergyRelease.python.cpp new file mode 100644 index 000000000..71b43e6a7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionEnergyRelease.python.cpp @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/FissionEnergyRelease.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FissionEnergyRelease +void wrapFissionEnergyRelease(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::FissionEnergyRelease; + + // create the Python object + py::class_ object( + module, "FissionEnergyRelease", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("label"), + py::arg("prompt_product_ke"), + py::arg("prompt_neutron_ke"), + py::arg("delayed_neutron_ke"), + py::arg("prompt_gamma_energy"), + py::arg("delayed_gamma_energy"), + py::arg("delayed_beta_energy"), + py::arg("neutrino_energy"), + py::arg("non_neutrino_energy"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionEnergyReleases.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionEnergyReleases.python.cpp new file mode 100644 index 000000000..a779f7d87 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FissionEnergyReleases.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/FissionEnergyReleases.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FissionEnergyReleases +void wrapFissionEnergyReleases(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::FissionEnergyReleases; + + // create the Python object + py::class_ object( + module, "FissionEnergyReleases", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FormFactor.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FormFactor.python.cpp new file mode 100644 index 000000000..dea17a90d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FormFactor.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/FormFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FormFactor +void wrapFormFactor(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::FormFactor; + + // create the Python object + py::class_ object( + module, "FormFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Fraction.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Fraction.python.cpp new file mode 100644 index 000000000..31a5afe56 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Fraction.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Fraction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Fraction +void wrapFraction(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Fraction; + + // create the Python object + py::class_ object( + module, "Fraction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string & + >(), + py::arg("label"), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FreeGasApproximation.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FreeGasApproximation.python.cpp new file mode 100644 index 000000000..3ba1b0c54 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/FreeGasApproximation.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/FreeGasApproximation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FreeGasApproximation +void wrapFreeGasApproximation(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::FreeGasApproximation; + + // create the Python object + py::class_ object( + module, "FreeGasApproximation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Function1ds.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Function1ds.python.cpp new file mode 100644 index 000000000..ae6339106 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Function1ds.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Function1ds.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Function1ds +void wrapFunction1ds(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Function1ds; + + // create the Python object + py::class_ object( + module, "Function1ds", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector &, + const std::optional> &, + const std::optional> & + >(), + py::arg("legendre"), + py::arg("xys1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Function2ds.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Function2ds.python.cpp new file mode 100644 index 000000000..ad4df9f94 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Function2ds.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Function2ds.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Function2ds +void wrapFunction2ds(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Function2ds; + + // create the Python object + py::class_ object( + module, "Function2ds", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/G.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/G.python.cpp new file mode 100644 index 000000000..43181afe0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/G.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/G.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::G +void wrapG(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::G; + + // create the Python object + py::class_ object( + module, "G", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GaugeBoson.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GaugeBoson.python.cpp new file mode 100644 index 000000000..efe096f4f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GaugeBoson.python.cpp @@ -0,0 +1,170 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/GaugeBoson.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::GaugeBoson +void wrapGaugeBoson(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::GaugeBoson; + + // create the Python object + py::class_ object( + module, "GaugeBoson", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const general::Mass &, + const general::Spin &, + const general::Parity &, + const general::Charge &, + const general::Halflife & + >(), + py::arg("id"), + py::arg("mass"), + py::arg("spin"), + py::arg("parity"), + py::arg("charge"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GaugeBosons.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GaugeBosons.python.cpp new file mode 100644 index 000000000..0949acc2f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GaugeBosons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/GaugeBosons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::GaugeBosons +void wrapGaugeBosons(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::GaugeBosons; + + // create the Python object + py::class_ object( + module, "GaugeBosons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GeneralEvaporation.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GeneralEvaporation.python.cpp new file mode 100644 index 000000000..eba790944 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/GeneralEvaporation.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/GeneralEvaporation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::GeneralEvaporation +void wrapGeneralEvaporation(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::GeneralEvaporation; + + // create the Python object + py::class_ object( + module, "GeneralEvaporation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::U &, + const general::Theta &, + const general::G & + >(), + py::arg("u"), + py::arg("theta"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Grid.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Grid.python.cpp new file mode 100644 index 000000000..ddbab8391 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Grid.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Grid.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Grid +void wrapGrid(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Grid; + + // create the Python object + py::class_ object( + module, "Grid", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const int &, + const std::string &, + const std::string &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("index"), + py::arg("label"), + py::arg("unit"), + py::arg("style"), + py::arg("interpolation") = std::nullopt, + py::arg("link") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Gridded2d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Gridded2d.python.cpp new file mode 100644 index 000000000..74b408d50 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Gridded2d.python.cpp @@ -0,0 +1,106 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Gridded2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Gridded2d +void wrapGridded2d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Gridded2d; + + // create the Python object + py::class_ object( + module, "Gridded2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Axes &, + const g2d::Array & + >(), + py::arg("axes"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Gridded3d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Gridded3d.python.cpp new file mode 100644 index 000000000..a559a87fa --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Gridded3d.python.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Gridded3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Gridded3d +void wrapGridded3d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Gridded3d; + + // create the Python object + py::class_ object( + module, "Gridded3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Axes &, + const g3d::Array & + >(), + py::arg("axes"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Halflife.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Halflife.python.cpp new file mode 100644 index 000000000..27753569d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Halflife.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Halflife.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Halflife +void wrapHalflife(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Halflife; + + // create the Python object + py::class_ object( + module, "Halflife", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("string") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/HardSphereRadius.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/HardSphereRadius.python.cpp new file mode 100644 index 000000000..c145091c3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/HardSphereRadius.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/HardSphereRadius.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::HardSphereRadius +void wrapHardSphereRadius(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::HardSphereRadius; + + // create the Python object + py::class_ object( + module, "HardSphereRadius", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Constant1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ImaginaryAnomalousFactor.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ImaginaryAnomalousFactor.python.cpp new file mode 100644 index 000000000..ed626b4d6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ImaginaryAnomalousFactor.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ImaginaryAnomalousFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ImaginaryAnomalousFactor +void wrapImaginaryAnomalousFactor(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ImaginaryAnomalousFactor; + + // create the Python object + py::class_ object( + module, "ImaginaryAnomalousFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ImaginaryInterferenceTerm.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ImaginaryInterferenceTerm.python.cpp new file mode 100644 index 000000000..bb5be37e8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ImaginaryInterferenceTerm.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ImaginaryInterferenceTerm.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ImaginaryInterferenceTerm +void wrapImaginaryInterferenceTerm(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ImaginaryInterferenceTerm; + + // create the Python object + py::class_ object( + module, "ImaginaryInterferenceTerm", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("regions2d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncidentEnergies.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncidentEnergies.python.cpp new file mode 100644 index 000000000..5b2103718 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncidentEnergies.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/IncidentEnergies.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::IncidentEnergies +void wrapIncidentEnergies(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::IncidentEnergies; + + // create the Python object + py::class_ object( + module, "IncidentEnergies", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncidentEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncidentEnergy.python.cpp new file mode 100644 index 000000000..5dcafdc83 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncidentEnergy.python.cpp @@ -0,0 +1,262 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/IncidentEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::IncidentEnergy +void wrapIncidentEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::IncidentEnergy; + + // create the Python object + py::class_ object( + module, "IncidentEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const general::Energy &, + const general::Yields & + >(), + py::arg("label"), + py::arg("energy"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncoherentPhotonScattering.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncoherentPhotonScattering.python.cpp new file mode 100644 index 000000000..f520d8308 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncoherentPhotonScattering.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/IncoherentPhotonScattering.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::IncoherentPhotonScattering +void wrapIncoherentPhotonScattering(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::IncoherentPhotonScattering; + + // create the Python object + py::class_ object( + module, "IncoherentPhotonScattering", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("href") = std::nullopt, + py::arg("pid") = std::nullopt, + py::arg("product_frame") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncompleteReactions.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncompleteReactions.python.cpp new file mode 100644 index 000000000..84c94f00a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/IncompleteReactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/IncompleteReactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::IncompleteReactions +void wrapIncompleteReactions(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::IncompleteReactions; + + // create the Python object + py::class_ object( + module, "IncompleteReactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Institution.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Institution.python.cpp new file mode 100644 index 000000000..26e702e1e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Institution.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Institution.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Institution +void wrapInstitution(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Institution; + + // create the Python object + py::class_ object( + module, "Institution", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const general::ENDFconversionFlags & + >(), + py::arg("label") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Integer.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Integer.python.cpp new file mode 100644 index 000000000..19348e787 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Integer.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Integer.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Integer +void wrapInteger(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Integer; + + // create the Python object + py::class_ object( + module, "Integer", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const std::optional & + >(), + py::arg("label"), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Intensity.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Intensity.python.cpp new file mode 100644 index 000000000..d111c8e95 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Intensity.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Intensity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Intensity +void wrapIntensity(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Intensity; + + // create the Python object + py::class_ object( + module, "Intensity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const std::optional & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/InternalConversionCoefficients.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/InternalConversionCoefficients.python.cpp new file mode 100644 index 000000000..e28a43288 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/InternalConversionCoefficients.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/InternalConversionCoefficients.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::InternalConversionCoefficients +void wrapInternalConversionCoefficients(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::InternalConversionCoefficients; + + // create the Python object + py::class_ object( + module, "InternalConversionCoefficients", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotope.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotope.python.cpp new file mode 100644 index 000000000..cf6ac4dc0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotope.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Isotope.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Isotope +void wrapIsotope(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Isotope; + + // create the Python object + py::class_ object( + module, "Isotope", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const general::Nuclides & + >(), + py::arg("symbol"), + py::arg("a"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotopes.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotopes.python.cpp new file mode 100644 index 000000000..34629b2f5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotopes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Isotopes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Isotopes +void wrapIsotopes(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Isotopes; + + // create the Python object + py::class_ object( + module, "Isotopes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotropic2d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotropic2d.python.cpp new file mode 100644 index 000000000..bdd6036ba --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Isotropic2d.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Isotropic2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Isotropic2d +void wrapIsotropic2d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Isotropic2d; + + // create the Python object + py::class_ object( + module, "Isotropic2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/J.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/J.python.cpp new file mode 100644 index 000000000..c3c5e614d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/J.python.cpp @@ -0,0 +1,124 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/J.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::J +void wrapJ(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::J; + + // create the Python object + py::class_ object( + module, "J", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const general::LevelSpacing &, + const general::Widths & + >(), + py::arg("label"), + py::arg("value"), + py::arg("level_spacing"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Js.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Js.python.cpp new file mode 100644 index 000000000..d46b33676 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Js.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Js.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Js +void wrapJs(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Js; + + // create the Python object + py::class_ object( + module, "Js", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/KalbachMann.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/KalbachMann.python.cpp new file mode 100644 index 000000000..2fd3629d1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/KalbachMann.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/KalbachMann.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::KalbachMann +void wrapKalbachMann(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::KalbachMann; + + // create the Python object + py::class_ object( + module, "KalbachMann", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("product_frame"), + py::arg("f") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/L.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/L.python.cpp new file mode 100644 index 000000000..7f876ae3d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/L.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/L.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::L +void wrapL(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::L; + + // create the Python object + py::class_ object( + module, "L", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const general::Js & + >(), + py::arg("label"), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Legendre.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Legendre.python.cpp new file mode 100644 index 000000000..950c3d542 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Legendre.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Legendre.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Legendre +void wrapLegendre(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Legendre; + + // create the Python object + py::class_ object( + module, "Legendre", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const general::Values & + >(), + py::arg("outer_domain_value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Lepton.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Lepton.python.cpp new file mode 100644 index 000000000..e16aaa4b3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Lepton.python.cpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Lepton.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Lepton +void wrapLepton(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Lepton; + + // create the Python object + py::class_ object( + module, "Lepton", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const general::Mass &, + const general::Spin &, + const general::Parity &, + const general::Charge &, + const general::Halflife & + >(), + py::arg("id"), + py::arg("generation"), + py::arg("mass"), + py::arg("spin"), + py::arg("parity"), + py::arg("charge"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Leptons.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Leptons.python.cpp new file mode 100644 index 000000000..8ae6d7c4d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Leptons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Leptons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Leptons +void wrapLeptons(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Leptons; + + // create the Python object + py::class_ object( + module, "Leptons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/LevelSpacing.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/LevelSpacing.python.cpp new file mode 100644 index 000000000..0b4e464a1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/LevelSpacing.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/LevelSpacing.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::LevelSpacing +void wrapLevelSpacing(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::LevelSpacing; + + // create the Python object + py::class_ object( + module, "LevelSpacing", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Link.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Link.python.cpp new file mode 100644 index 000000000..bad114e28 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Link.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Link.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Link +void wrapLink(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Link; + + // create the Python object + py::class_ object( + module, "Link", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ListOfCovariances.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ListOfCovariances.python.cpp new file mode 100644 index 000000000..28590a80f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ListOfCovariances.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ListOfCovariances.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ListOfCovariances +void wrapListOfCovariances(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ListOfCovariances; + + // create the Python object + py::class_ object( + module, "ListOfCovariances", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Ls.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Ls.python.cpp new file mode 100644 index 000000000..8526f7b35 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Ls.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Ls.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Ls +void wrapLs(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Ls; + + // create the Python object + py::class_ object( + module, "Ls", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MadlandNix.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MadlandNix.python.cpp new file mode 100644 index 000000000..f65952cd5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MadlandNix.python.cpp @@ -0,0 +1,150 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/MadlandNix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::MadlandNix +void wrapMadlandNix(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::MadlandNix; + + // create the Python object + py::class_ object( + module, "MadlandNix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::EFL &, + const general::EFH &, + const general::T_M & + >(), + py::arg("efl"), + py::arg("efh"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Mass.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Mass.python.cpp new file mode 100644 index 000000000..eca5f59dc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Mass.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Mass.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Mass +void wrapMass(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Mass; + + // create the Python object + py::class_ object( + module, "Mass", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("value") = std::nullopt, + py::arg("unit") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MetaStable.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MetaStable.python.cpp new file mode 100644 index 000000000..ee6d64472 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MetaStable.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/MetaStable.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::MetaStable +void wrapMetaStable(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::MetaStable; + + // create the Python object + py::class_ object( + module, "MetaStable", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const int & + >(), + py::arg("id"), + py::arg("pid"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Mixed.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Mixed.python.cpp new file mode 100644 index 000000000..7fed9e4d8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Mixed.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Mixed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Mixed +void wrapMixed(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Mixed; + + // create the Python object + py::class_ object( + module, "Mixed", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::vector &, + const std::optional> &, + const std::optional & + >(), + py::arg("label"), + py::arg("covariance_matrix"), + py::arg("sum") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Multiplicity.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Multiplicity.python.cpp new file mode 100644 index 000000000..9308c2de6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Multiplicity.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Multiplicity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Multiplicity +void wrapMultiplicity(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Multiplicity; + + // create the Python object + py::class_ object( + module, "Multiplicity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("constant1d") = std::nullopt, + py::arg("xys1d") = std::nullopt, + py::arg("regions1d") = std::nullopt, + py::arg("polynomial1d") = std::nullopt, + py::arg("reference") = std::nullopt, + py::arg("branching1d") = std::nullopt, + py::arg("branching3d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MultiplicitySum.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MultiplicitySum.python.cpp new file mode 100644 index 000000000..2eab43961 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MultiplicitySum.python.cpp @@ -0,0 +1,236 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/MultiplicitySum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::MultiplicitySum +void wrapMultiplicitySum(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::MultiplicitySum; + + // create the Python object + py::class_ object( + module, "MultiplicitySum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const general::Multiplicity &, + const general::Summands & + >(), + py::arg("label"), + py::arg("endf_mt"), + py::arg("multiplicity"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MultiplicitySums.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MultiplicitySums.python.cpp new file mode 100644 index 000000000..ee233c96d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/MultiplicitySums.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/MultiplicitySums.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::MultiplicitySums +void wrapMultiplicitySums(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::MultiplicitySums; + + // create the Python object + py::class_ object( + module, "MultiplicitySums", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NBodyPhaseSpace.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NBodyPhaseSpace.python.cpp new file mode 100644 index 000000000..9628a3286 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NBodyPhaseSpace.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/NBodyPhaseSpace.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NBodyPhaseSpace +void wrapNBodyPhaseSpace(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::NBodyPhaseSpace; + + // create the Python object + py::class_ object( + module, "NBodyPhaseSpace", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const int &, + const general::Mass & + >(), + py::arg("number_of_products"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NeutrinoEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NeutrinoEnergy.python.cpp new file mode 100644 index 000000000..0f2ab566f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NeutrinoEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/NeutrinoEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NeutrinoEnergy +void wrapNeutrinoEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::NeutrinoEnergy; + + // create the Python object + py::class_ object( + module, "NeutrinoEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Polynomial1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NonNeutrinoEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NonNeutrinoEnergy.python.cpp new file mode 100644 index 000000000..440458430 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NonNeutrinoEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/NonNeutrinoEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NonNeutrinoEnergy +void wrapNonNeutrinoEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::NonNeutrinoEnergy; + + // create the Python object + py::class_ object( + module, "NonNeutrinoEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Polynomial1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearAmplitudeExpansion.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearAmplitudeExpansion.python.cpp new file mode 100644 index 000000000..fe72bd298 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearAmplitudeExpansion.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/NuclearAmplitudeExpansion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NuclearAmplitudeExpansion +void wrapNuclearAmplitudeExpansion(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::NuclearAmplitudeExpansion; + + // create the Python object + py::class_ object( + module, "NuclearAmplitudeExpansion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::NuclearTerm &, + const general::RealInterferenceTerm &, + const general::ImaginaryInterferenceTerm & + >(), + py::arg("nuclear_term"), + py::arg("real_interference_term"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearPlusInterference.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearPlusInterference.python.cpp new file mode 100644 index 000000000..b6a0cee46 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearPlusInterference.python.cpp @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/NuclearPlusInterference.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NuclearPlusInterference +void wrapNuclearPlusInterference(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::NuclearPlusInterference; + + // create the Python object + py::class_ object( + module, "NuclearPlusInterference", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const reduced::CrossSection &, + const reduced::Distribution & + >(), + py::arg("mu_cutoff"), + py::arg("cross_section"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearTerm.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearTerm.python.cpp new file mode 100644 index 000000000..c2a153aff --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/NuclearTerm.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/NuclearTerm.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NuclearTerm +void wrapNuclearTerm(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::NuclearTerm; + + // create the Python object + py::class_ object( + module, "NuclearTerm", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("regions2d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nucleus.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nucleus.python.cpp new file mode 100644 index 000000000..40f789dc7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nucleus.python.cpp @@ -0,0 +1,316 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Nucleus.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Nucleus +void wrapNucleus(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Nucleus; + + // create the Python object + py::class_ object( + module, "Nucleus", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("id"), + py::arg("index"), + py::arg("mass") = std::nullopt, + py::arg("spin") = std::nullopt, + py::arg("parity") = std::nullopt, + py::arg("charge"), + py::arg("halflife") = std::nullopt, + py::arg("energy"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nuclide.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nuclide.python.cpp new file mode 100644 index 000000000..e919d5e8e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nuclide.python.cpp @@ -0,0 +1,324 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Nuclide.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Nuclide +void wrapNuclide(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Nuclide; + + // create the Python object + py::class_ object( + module, "Nuclide", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const general::Charge &, + const general::Nucleus &, + const std::optional &, + const std::optional & + >(), + py::arg("id"), + py::arg("mass") = std::nullopt, + py::arg("charge"), + py::arg("nucleus"), + py::arg("decay_data") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nuclides.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nuclides.python.cpp new file mode 100644 index 000000000..c8381d124 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Nuclides.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Nuclides.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Nuclides +void wrapNuclides(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Nuclides; + + // create the Python object + py::class_ object( + module, "Nuclides", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OrphanProduct.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OrphanProduct.python.cpp new file mode 100644 index 000000000..3ab27acd9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OrphanProduct.python.cpp @@ -0,0 +1,264 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/OrphanProduct.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::OrphanProduct +void wrapOrphanProduct(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::OrphanProduct; + + // create the Python object + py::class_ object( + module, "OrphanProduct", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const general::CrossSection &, + const general::OutputChannel & + >(), + py::arg("label"), + py::arg("endf_mt"), + py::arg("cross_section"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OrphanProducts.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OrphanProducts.python.cpp new file mode 100644 index 000000000..8f56244f5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OrphanProducts.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/OrphanProducts.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::OrphanProducts +void wrapOrphanProducts(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::OrphanProducts; + + // create the Python object + py::class_ object( + module, "OrphanProducts", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OutputChannel.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OutputChannel.python.cpp new file mode 100644 index 000000000..b2c6507e2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/OutputChannel.python.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/OutputChannel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::OutputChannel +void wrapOutputChannel(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::OutputChannel; + + // create the Python object + py::class_ object( + module, "OutputChannel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const general::Q &, + const std::optional &, + const std::optional & + >(), + py::arg("genre"), + py::arg("process") = std::nullopt, + py::arg("q"), + py::arg("products") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovariance.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovariance.python.cpp new file mode 100644 index 000000000..4789f4260 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovariance.python.cpp @@ -0,0 +1,192 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ParameterCovariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ParameterCovariance +void wrapParameterCovariance(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ParameterCovariance; + + // create the Python object + py::class_ object( + module, "ParameterCovariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const general::RowData &, + const general::ParameterCovarianceMatrix & + >(), + py::arg("label"), + py::arg("row_data"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovarianceMatrix.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovarianceMatrix.python.cpp new file mode 100644 index 000000000..83f1b68c7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovarianceMatrix.python.cpp @@ -0,0 +1,166 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ParameterCovarianceMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ParameterCovarianceMatrix +void wrapParameterCovarianceMatrix(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ParameterCovarianceMatrix; + + // create the Python object + py::class_ object( + module, "ParameterCovarianceMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const g3d::Array &, + const general::Parameters & + >(), + py::arg("label"), + py::arg("type"), + py::arg("array"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovariances.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovariances.python.cpp new file mode 100644 index 000000000..1d51312ae --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterCovariances.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ParameterCovariances.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ParameterCovariances +void wrapParameterCovariances(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ParameterCovariances; + + // create the Python object + py::class_ object( + module, "ParameterCovariances", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector &, + const std::optional> & + >(), + py::arg("parameter_covariance"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterLink.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterLink.python.cpp new file mode 100644 index 000000000..bb158194f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ParameterLink.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ParameterLink.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ParameterLink +void wrapParameterLink(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ParameterLink; + + // create the Python object + py::class_ object( + module, "ParameterLink", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("href"), + py::arg("n_parameters") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Parameters.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Parameters.python.cpp new file mode 100644 index 000000000..66a74c382 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Parameters.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Parameters.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Parameters +void wrapParameters(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Parameters; + + // create the Python object + py::class_ object( + module, "Parameters", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Parity.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Parity.python.cpp new file mode 100644 index 000000000..df537e12f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Parity.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Parity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Parity +void wrapParity(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Parity; + + // create the Python object + py::class_ object( + module, "Parity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Integer & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PhotonEmissionProbabilities.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PhotonEmissionProbabilities.python.cpp new file mode 100644 index 000000000..1b348e4e6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PhotonEmissionProbabilities.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/PhotonEmissionProbabilities.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PhotonEmissionProbabilities +void wrapPhotonEmissionProbabilities(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::PhotonEmissionProbabilities; + + // create the Python object + py::class_ object( + module, "PhotonEmissionProbabilities", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Shell & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Polynomial1d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Polynomial1d.python.cpp new file mode 100644 index 000000000..3e26fc4b7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Polynomial1d.python.cpp @@ -0,0 +1,170 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Polynomial1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Polynomial1d +void wrapPolynomial1d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Polynomial1d; + + // create the Python object + py::class_ object( + module, "Polynomial1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const double &, + const double &, + const general::Axes &, + const general::Values &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("domain_min"), + py::arg("domain_max"), + py::arg("axes"), + py::arg("values"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PositronEmissionIntensity.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PositronEmissionIntensity.python.cpp new file mode 100644 index 000000000..d0e695b8a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PositronEmissionIntensity.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/PositronEmissionIntensity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PositronEmissionIntensity +void wrapPositronEmissionIntensity(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::PositronEmissionIntensity; + + // create the Python object + py::class_ object( + module, "PositronEmissionIntensity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const std::optional & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PrimaryGamma.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PrimaryGamma.python.cpp new file mode 100644 index 000000000..7717ec174 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PrimaryGamma.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/PrimaryGamma.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PrimaryGamma +void wrapPrimaryGamma(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::PrimaryGamma; + + // create the Python object + py::class_ object( + module, "PrimaryGamma", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const double &, + const double &, + const general::Axes & + >(), + py::arg("value"), + py::arg("domain_min"), + py::arg("domain_max"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Probability.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Probability.python.cpp new file mode 100644 index 000000000..7a9df41e9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Probability.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Probability.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Probability +void wrapProbability(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Probability; + + // create the Python object + py::class_ object( + module, "Probability", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Double & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Product.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Product.python.cpp new file mode 100644 index 000000000..8382b9ea2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Product.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Product.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Product +void wrapProduct(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Product; + + // create the Python object + py::class_ object( + module, "Product", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("pid"), + py::arg("multiplicity") = std::nullopt, + py::arg("distribution") = std::nullopt, + py::arg("output_channel") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProductYield.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProductYield.python.cpp new file mode 100644 index 000000000..20161a7f2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProductYield.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ProductYield.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ProductYield +void wrapProductYield(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ProductYield; + + // create the Python object + py::class_ object( + module, "ProductYield", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const general::ElapsedTimes & + >(), + py::arg("label") = std::nullopt, + py::arg("nuclides") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProductYields.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProductYields.python.cpp new file mode 100644 index 000000000..222eac783 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProductYields.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ProductYields.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ProductYields +void wrapProductYields(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ProductYields; + + // create the Python object + py::class_ object( + module, "ProductYields", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Production.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Production.python.cpp new file mode 100644 index 000000000..dbe57f206 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Production.python.cpp @@ -0,0 +1,264 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Production.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Production +void wrapProduction(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Production; + + // create the Python object + py::class_ object( + module, "Production", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const general::CrossSection &, + const general::OutputChannel & + >(), + py::arg("label"), + py::arg("endf_mt"), + py::arg("cross_section"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Productions.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Productions.python.cpp new file mode 100644 index 000000000..7ce5e1ac0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Productions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Productions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Productions +void wrapProductions(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Productions; + + // create the Python object + py::class_ object( + module, "Productions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Products.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Products.python.cpp new file mode 100644 index 000000000..ac4ce2794 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Products.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Products.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Products +void wrapProducts(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Products; + + // create the Python object + py::class_ object( + module, "Products", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProjectileEnergyDomain.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProjectileEnergyDomain.python.cpp new file mode 100644 index 000000000..800811dc1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ProjectileEnergyDomain.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ProjectileEnergyDomain.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ProjectileEnergyDomain +void wrapProjectileEnergyDomain(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ProjectileEnergyDomain; + + // create the Python object + py::class_ object( + module, "ProjectileEnergyDomain", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const double &, + const std::string & + >(), + py::arg("min"), + py::arg("max"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptGammaEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptGammaEnergy.python.cpp new file mode 100644 index 000000000..f9a7da15a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptGammaEnergy.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/PromptGammaEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PromptGammaEnergy +void wrapPromptGammaEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::PromptGammaEnergy; + + // create the Python object + py::class_ object( + module, "PromptGammaEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("polynomial1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptNeutronKE.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptNeutronKE.python.cpp new file mode 100644 index 000000000..7324be82a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptNeutronKE.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/PromptNeutronKE.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PromptNeutronKE +void wrapPromptNeutronKE(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::PromptNeutronKE; + + // create the Python object + py::class_ object( + module, "PromptNeutronKE", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("polynomial1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptProductKE.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptProductKE.python.cpp new file mode 100644 index 000000000..fc5c0d0a6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/PromptProductKE.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/PromptProductKE.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PromptProductKE +void wrapPromptProductKE(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::PromptProductKE; + + // create the Python object + py::class_ object( + module, "PromptProductKE", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("polynomial1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Q.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Q.python.cpp new file mode 100644 index 000000000..227d6c1c6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Q.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Q.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Q +void wrapQ(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Q; + + // create the Python object + py::class_ object( + module, "Q", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("double") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/R.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/R.python.cpp new file mode 100644 index 000000000..80eb8cb81 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/R.python.cpp @@ -0,0 +1,146 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/R.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::R +void wrapR(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::R; + + // create the Python object + py::class_ object( + module, "R", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs2d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RMatrix.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RMatrix.python.cpp new file mode 100644 index 000000000..d37bc9efd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RMatrix.python.cpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/RMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RMatrix +void wrapRMatrix(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::RMatrix; + + // create the Python object + py::class_ object( + module, "RMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("label"), + py::arg("approximation"), + py::arg("boundary_condition"), + py::arg("calculate_channel_radius") = std::nullopt, + py::arg("supports_angular_reconstruction") = std::nullopt, + py::arg("po_ps") = std::nullopt, + py::arg("resonance_reactions"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Rate.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Rate.python.cpp new file mode 100644 index 000000000..b52007879 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Rate.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Rate.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Rate +void wrapRate(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Rate; + + // create the Python object + py::class_ object( + module, "Rate", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Double & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reaction.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reaction.python.cpp new file mode 100644 index 000000000..51c93e8df --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reaction.python.cpp @@ -0,0 +1,282 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Reaction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Reaction +void wrapReaction(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Reaction; + + // create the Python object + py::class_ object( + module, "Reaction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const std::optional &, + const general::CrossSection &, + const general::OutputChannel &, + const std::optional & + >(), + py::arg("label"), + py::arg("endf_mt"), + py::arg("fission_genre") = std::nullopt, + py::arg("cross_section"), + py::arg("output_channel"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reactions.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reactions.python.cpp new file mode 100644 index 000000000..9d4ec7008 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Reactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Reactions +void wrapReactions(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Reactions; + + // create the Python object + py::class_ object( + module, "Reactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RealAnomalousFactor.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RealAnomalousFactor.python.cpp new file mode 100644 index 000000000..6dcef48a9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RealAnomalousFactor.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/RealAnomalousFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RealAnomalousFactor +void wrapRealAnomalousFactor(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::RealAnomalousFactor; + + // create the Python object + py::class_ object( + module, "RealAnomalousFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RealInterferenceTerm.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RealInterferenceTerm.python.cpp new file mode 100644 index 000000000..7a9aebf3a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RealInterferenceTerm.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/RealInterferenceTerm.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RealInterferenceTerm +void wrapRealInterferenceTerm(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::RealInterferenceTerm; + + // create the Python object + py::class_ object( + module, "RealInterferenceTerm", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("regions2d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Recoil.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Recoil.python.cpp new file mode 100644 index 000000000..fd25848e1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Recoil.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Recoil.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Recoil +void wrapRecoil(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Recoil; + + // create the Python object + py::class_ object( + module, "Recoil", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reference.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reference.python.cpp new file mode 100644 index 000000000..cb71be103 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Reference.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Reference.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Reference +void wrapReference(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Reference; + + // create the Python object + py::class_ object( + module, "Reference", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string & + >(), + py::arg("label"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Regions1d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Regions1d.python.cpp new file mode 100644 index 000000000..bbe422a56 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Regions1d.python.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Regions1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Regions1d +void wrapRegions1d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Regions1d; + + // create the Python object + py::class_ object( + module, "Regions1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const reduced::Function1ds & + >(), + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Regions2d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Regions2d.python.cpp new file mode 100644 index 000000000..826a218ba --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Regions2d.python.cpp @@ -0,0 +1,136 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Regions2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Regions2d +void wrapRegions2d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Regions2d; + + // create the Python object + py::class_ object( + module, "Regions2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Axes &, + const general::Function2ds &, + const std::optional & + >(), + py::arg("axes"), + py::arg("function2ds"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Resolved.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Resolved.python.cpp new file mode 100644 index 000000000..641376fa6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Resolved.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Resolved.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Resolved +void wrapResolved(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Resolved; + + // create the Python object + py::class_ object( + module, "Resolved", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const double &, + const std::string &, + const std::optional &, + const std::optional & + >(), + py::arg("domain_min"), + py::arg("domain_max"), + py::arg("domain_unit"), + py::arg("breit_wigner") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResolvedRegion.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResolvedRegion.python.cpp new file mode 100644 index 000000000..0d555d0f0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResolvedRegion.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ResolvedRegion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResolvedRegion +void wrapResolvedRegion(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ResolvedRegion; + + // create the Python object + py::class_ object( + module, "ResolvedRegion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceParameters.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceParameters.python.cpp new file mode 100644 index 000000000..f8b4958dd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceParameters.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ResonanceParameters.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResonanceParameters +void wrapResonanceParameters(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ResonanceParameters; + + // create the Python object + py::class_ object( + module, "ResonanceParameters", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Table & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceReaction.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceReaction.python.cpp new file mode 100644 index 000000000..8f49eda7c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceReaction.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ResonanceReaction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResonanceReaction +void wrapResonanceReaction(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ResonanceReaction; + + // create the Python object + py::class_ object( + module, "ResonanceReaction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const std::optional &, + const general::Link &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("ejectile") = std::nullopt, + py::arg("eliminated") = std::nullopt, + py::arg("link"), + py::arg("hard_sphere_radius") = std::nullopt, + py::arg("q") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceReactions.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceReactions.python.cpp new file mode 100644 index 000000000..84d4c3cb4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonanceReactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ResonanceReactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResonanceReactions +void wrapResonanceReactions(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ResonanceReactions; + + // create the Python object + py::class_ object( + module, "ResonanceReactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Resonances.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Resonances.python.cpp new file mode 100644 index 000000000..1cc494117 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Resonances.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Resonances.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Resonances +void wrapResonances(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Resonances; + + // create the Python object + py::class_ object( + module, "Resonances", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("href") = std::nullopt, + py::arg("scattering_radius") = std::nullopt, + py::arg("resolved") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonancesWithBackground.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonancesWithBackground.python.cpp new file mode 100644 index 000000000..7e19b5beb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ResonancesWithBackground.python.cpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ResonancesWithBackground.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResonancesWithBackground +void wrapResonancesWithBackground(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ResonancesWithBackground; + + // create the Python object + py::class_ object( + module, "ResonancesWithBackground", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const general::Resonances &, + const general::Background &, + const std::optional & + >(), + py::arg("label"), + py::arg("resonances"), + py::arg("background"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RowData.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RowData.python.cpp new file mode 100644 index 000000000..0c8440bb5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RowData.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/RowData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RowData +void wrapRowData(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::RowData; + + // create the Python object + py::class_ object( + module, "RowData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::string &, + const std::optional & + >(), + py::arg("endf_mfmt") = std::nullopt, + py::arg("dimension") = std::nullopt, + py::arg("href"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RutherfordScattering.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RutherfordScattering.python.cpp new file mode 100644 index 000000000..e42980ad0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/RutherfordScattering.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/RutherfordScattering.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RutherfordScattering +void wrapRutherfordScattering(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::RutherfordScattering; + + // create the Python object + py::class_ object( + module, "RutherfordScattering", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SCTApproximation.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SCTApproximation.python.cpp new file mode 100644 index 000000000..23054d737 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SCTApproximation.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/SCTApproximation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SCTApproximation +void wrapSCTApproximation(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::SCTApproximation; + + // create the Python object + py::class_ object( + module, "SCTApproximation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/S_table.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/S_table.python.cpp new file mode 100644 index 000000000..95f805d9c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/S_table.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/S_table.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::S_table +void wrapS_table(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::S_table; + + // create the Python object + py::class_ object( + module, "S_table", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Gridded2d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringAtom.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringAtom.python.cpp new file mode 100644 index 000000000..1e8b966b0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringAtom.python.cpp @@ -0,0 +1,246 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ScatteringAtom.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ScatteringAtom +void wrapScatteringAtom(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ScatteringAtom; + + // create the Python object + py::class_ object( + module, "ScatteringAtom", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("pid"), + py::arg("number_per_molecule"), + py::arg("primary_scatterer") = std::nullopt, + py::arg("mass"), + py::arg("e_critical") = std::nullopt, + py::arg("e_max"), + py::arg("bound_atom_cross_section"), + py::arg("self_scattering_kernel"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringAtoms.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringAtoms.python.cpp new file mode 100644 index 000000000..866cd00a7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringAtoms.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ScatteringAtoms.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ScatteringAtoms +void wrapScatteringAtoms(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ScatteringAtoms; + + // create the Python object + py::class_ object( + module, "ScatteringAtoms", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringFactor.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringFactor.python.cpp new file mode 100644 index 000000000..7a3409be0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringFactor.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ScatteringFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ScatteringFactor +void wrapScatteringFactor(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ScatteringFactor; + + // create the Python object + py::class_ object( + module, "ScatteringFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringRadius.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringRadius.python.cpp new file mode 100644 index 000000000..09f4a03e4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ScatteringRadius.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ScatteringRadius.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ScatteringRadius +void wrapScatteringRadius(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ScatteringRadius; + + // create the Python object + py::class_ object( + module, "ScatteringRadius", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("constant1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SelfScatteringKernel.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SelfScatteringKernel.python.cpp new file mode 100644 index 000000000..b2f4c8584 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SelfScatteringKernel.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/SelfScatteringKernel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SelfScatteringKernel +void wrapSelfScatteringKernel(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::SelfScatteringKernel; + + // create the Python object + py::class_ object( + module, "SelfScatteringKernel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("symmetric") = std::nullopt, + py::arg("gridded3d") = std::nullopt, + py::arg("sctapproximation") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Shell.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Shell.python.cpp new file mode 100644 index 000000000..11a623ed9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Shell.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Shell.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Shell +void wrapShell(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Shell; + + // create the Python object + py::class_ object( + module, "Shell", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const double &, + const std::optional & + >(), + py::arg("label"), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ShortRangeSelfScalingVariance.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ShortRangeSelfScalingVariance.python.cpp new file mode 100644 index 000000000..f184fb7d0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ShortRangeSelfScalingVariance.python.cpp @@ -0,0 +1,180 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ShortRangeSelfScalingVariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ShortRangeSelfScalingVariance +void wrapShortRangeSelfScalingVariance(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ShortRangeSelfScalingVariance; + + // create the Python object + py::class_ object( + module, "ShortRangeSelfScalingVariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string &, + const general::Gridded2d & + >(), + py::arg("label"), + py::arg("type"), + py::arg("dependence_on_processed_group_width"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SimpleMaxwellianFission.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SimpleMaxwellianFission.python.cpp new file mode 100644 index 000000000..fe2ced572 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SimpleMaxwellianFission.python.cpp @@ -0,0 +1,106 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/SimpleMaxwellianFission.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SimpleMaxwellianFission +void wrapSimpleMaxwellianFission(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::SimpleMaxwellianFission; + + // create the Python object + py::class_ object( + module, "SimpleMaxwellianFission", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::U &, + const general::Theta & + >(), + py::arg("u"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Slice.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Slice.python.cpp new file mode 100644 index 000000000..34bf75c2c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Slice.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Slice.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Slice +void wrapSlice(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Slice; + + // create the Python object + py::class_ object( + module, "Slice", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const int &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("dimension"), + py::arg("domain_value") = std::nullopt, + py::arg("domain_min") = std::nullopt, + py::arg("domain_max") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Slices.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Slices.python.cpp new file mode 100644 index 000000000..6d9331b42 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Slices.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Slices.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Slices +void wrapSlices(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Slices; + + // create the Python object + py::class_ object( + module, "Slices", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spectra.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spectra.python.cpp new file mode 100644 index 000000000..23c1f0436 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spectra.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Spectra.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Spectra +void wrapSpectra(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Spectra; + + // create the Python object + py::class_ object( + module, "Spectra", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spectrum.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spectrum.python.cpp new file mode 100644 index 000000000..55a2a64d0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spectrum.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Spectrum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Spectrum +void wrapSpectrum(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Spectrum; + + // create the Python object + py::class_ object( + module, "Spectrum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::vector &, + const std::optional & + >(), + py::arg("label"), + py::arg("pid"), + py::arg("discrete"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spin.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spin.python.cpp new file mode 100644 index 000000000..8a225f73e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Spin.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Spin.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Spin +void wrapSpin(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Spin; + + // create the Python object + py::class_ object( + module, "Spin", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Fraction & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SpinGroup.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SpinGroup.python.cpp new file mode 100644 index 000000000..4b5713f88 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SpinGroup.python.cpp @@ -0,0 +1,182 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/SpinGroup.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SpinGroup +void wrapSpinGroup(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::SpinGroup; + + // create the Python object + py::class_ object( + module, "SpinGroup", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const int &, + const general::Channels &, + const general::ResonanceParameters & + >(), + py::arg("label"), + py::arg("spin"), + py::arg("parity"), + py::arg("channels"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SpinGroups.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SpinGroups.python.cpp new file mode 100644 index 000000000..1f5731e06 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/SpinGroups.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/SpinGroups.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SpinGroups +void wrapSpinGroups(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::SpinGroups; + + // create the Python object + py::class_ object( + module, "SpinGroups", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Standard.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Standard.python.cpp new file mode 100644 index 000000000..04589bfdc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Standard.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Standard.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Standard +void wrapStandard(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Standard; + + // create the Python object + py::class_ object( + module, "Standard", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const reduced::Double & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/String.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/String.python.cpp new file mode 100644 index 000000000..2e661a1a7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/String.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/String.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::String +void wrapString(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::String; + + // create the Python object + py::class_ object( + module, "String", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string & + >(), + py::arg("label"), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Styles.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Styles.python.cpp new file mode 100644 index 000000000..756e1d43a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Styles.python.cpp @@ -0,0 +1,190 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Styles.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Styles +void wrapStyles(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Styles; + + // create the Python object + py::class_ object( + module, "Styles", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Evaluated &, + const std::optional & + >(), + py::arg("evaluated"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Sum.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Sum.python.cpp new file mode 100644 index 000000000..78fb7480e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Sum.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Sum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Sum +void wrapSum(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Sum; + + // create the Python object + py::class_ object( + module, "Sum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::vector & + >(), + py::arg("label") = std::nullopt, + py::arg("domain_min") = std::nullopt, + py::arg("domain_max") = std::nullopt, + py::arg("domain_unit") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Summand.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Summand.python.cpp new file mode 100644 index 000000000..7f2480269 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Summand.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Summand.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Summand +void wrapSummand(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Summand; + + // create the Python object + py::class_ object( + module, "Summand", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("endf_mfmt") = std::nullopt, + py::arg("coefficient") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Summands.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Summands.python.cpp new file mode 100644 index 000000000..c1392e5d1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Summands.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Summands.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Summands +void wrapSummands(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Summands; + + // create the Python object + py::class_ object( + module, "Summands", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Sums.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Sums.python.cpp new file mode 100644 index 000000000..95e3e7ebb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Sums.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Sums.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Sums +void wrapSums(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Sums; + + // create the Python object + py::class_ object( + module, "Sums", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("cross_section_sums") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/T_M.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/T_M.python.cpp new file mode 100644 index 000000000..74d7407fd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/T_M.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/T_M.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::T_M +void wrapT_M(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::T_M; + + // create the Python object + py::class_ object( + module, "T_M", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/T_effective.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/T_effective.python.cpp new file mode 100644 index 000000000..489edb5a7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/T_effective.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/T_effective.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::T_effective +void wrapT_effective(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::T_effective; + + // create the Python object + py::class_ object( + module, "T_effective", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Table.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Table.python.cpp new file mode 100644 index 000000000..bb4b2a5ad --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Table.python.cpp @@ -0,0 +1,124 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Table.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Table +void wrapTable(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Table; + + // create the Python object + py::class_ object( + module, "Table", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const int &, + const int &, + const general::ColumnHeaders &, + const general::Data & + >(), + py::arg("rows"), + py::arg("columns"), + py::arg("column_headers"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/TabulatedWidths.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/TabulatedWidths.python.cpp new file mode 100644 index 000000000..751b30865 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/TabulatedWidths.python.cpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/TabulatedWidths.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::TabulatedWidths +void wrapTabulatedWidths(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::TabulatedWidths; + + // create the Python object + py::class_ object( + module, "TabulatedWidths", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::optional &, + const general::ResonanceReactions &, + const general::Ls &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("approximation"), + py::arg("use_for_self_shielding_only") = std::nullopt, + py::arg("resonance_reactions"), + py::arg("ls"), + py::arg("po_ps") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Temperature.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Temperature.python.cpp new file mode 100644 index 000000000..24da3285e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Temperature.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Temperature.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Temperature +void wrapTemperature(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Temperature; + + // create the Python object + py::class_ object( + module, "Temperature", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const std::string & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw.python.cpp new file mode 100644 index 000000000..4480ad73b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw +void wrapThermalNeutronScatteringLaw(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string & + >(), + py::arg("label"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp new file mode 100644 index 000000000..02ad61c02 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw1d +void wrapThermalNeutronScatteringLaw1d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw1d; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string & + >(), + py::arg("label"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp new file mode 100644 index 000000000..24bb0feb8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp @@ -0,0 +1,152 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw_coherentElastic +void wrapThermalNeutronScatteringLaw_coherentElastic(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw_coherentElastic; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw_coherentElastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string &, + const general::S_table & + >(), + py::arg("label"), + py::arg("pid"), + py::arg("product_frame"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp new file mode 100644 index 000000000..358c624f7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp @@ -0,0 +1,182 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw_incoherentElastic +void wrapThermalNeutronScatteringLaw_incoherentElastic(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw_incoherentElastic; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw_incoherentElastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string &, + const general::BoundAtomCrossSection &, + const general::DebyeWallerIntegral & + >(), + py::arg("label"), + py::arg("pid"), + py::arg("product_frame"), + py::arg("bound_atom_cross_section"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp new file mode 100644 index 000000000..8094c0005 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp @@ -0,0 +1,156 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw_incoherentInelastic +void wrapThermalNeutronScatteringLaw_incoherentInelastic(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw_incoherentInelastic; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw_incoherentInelastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const std::optional &, + const general::ScatteringAtoms & + >(), + py::arg("label"), + py::arg("pid"), + py::arg("product_frame"), + py::arg("primary_scatterer"), + py::arg("calculated_at_thermal") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Theta.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Theta.python.cpp new file mode 100644 index 000000000..65c87ea0b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Theta.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Theta.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Theta +void wrapTheta(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Theta; + + // create the Python object + py::class_ object( + module, "Theta", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Time.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Time.python.cpp new file mode 100644 index 000000000..41a77763b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Time.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Time.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Time +void wrapTime(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Time; + + // create the Python object + py::class_ object( + module, "Time", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("double") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Title.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Title.python.cpp new file mode 100644 index 000000000..7946912d1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Title.python.cpp @@ -0,0 +1,60 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Title.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Title +void wrapTitle(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Title; + + // create the Python object + py::class_ object( + module, "Title", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/TotalEnergy.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/TotalEnergy.python.cpp new file mode 100644 index 000000000..3ec477a45 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/TotalEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/TotalEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::TotalEnergy +void wrapTotalEnergy(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::TotalEnergy; + + // create the Python object + py::class_ object( + module, "TotalEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::Polynomial1d & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/U.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/U.python.cpp new file mode 100644 index 000000000..995119055 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/U.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/U.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::U +void wrapU(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::U; + + // create the Python object + py::class_ object( + module, "U", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const std::string & + >(), + py::arg("value"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Uncertainty.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Uncertainty.python.cpp new file mode 100644 index 000000000..ff7190f01 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Uncertainty.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Uncertainty.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Uncertainty +void wrapUncertainty(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Uncertainty; + + // create the Python object + py::class_ object( + module, "Uncertainty", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("covariance") = std::nullopt, + py::arg("standard") = std::nullopt, + py::arg("list_of_covariances") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Uncorrelated.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Uncorrelated.python.cpp new file mode 100644 index 000000000..3dbf61c2a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Uncorrelated.python.cpp @@ -0,0 +1,250 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Uncorrelated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Uncorrelated +void wrapUncorrelated(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Uncorrelated; + + // create the Python object + py::class_ object( + module, "Uncorrelated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const general::Angular &, + const general::Energy & + >(), + py::arg("label"), + py::arg("product_frame"), + py::arg("angular"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unorthodox.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unorthodox.python.cpp new file mode 100644 index 000000000..9513db94a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unorthodox.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Unorthodox.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Unorthodox +void wrapUnorthodox(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Unorthodox; + + // create the Python object + py::class_ object( + module, "Unorthodox", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const general::Mass & + >(), + py::arg("id"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unorthodoxes.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unorthodoxes.python.cpp new file mode 100644 index 000000000..7160295d3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unorthodoxes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Unorthodoxes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Unorthodoxes +void wrapUnorthodoxes(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Unorthodoxes; + + // create the Python object + py::class_ object( + module, "Unorthodoxes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unresolved.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unresolved.python.cpp new file mode 100644 index 000000000..e13af3aa2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unresolved.python.cpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Unresolved.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Unresolved +void wrapUnresolved(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Unresolved; + + // create the Python object + py::class_ object( + module, "Unresolved", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const double &, + const std::string &, + const general::TabulatedWidths & + >(), + py::arg("domain_min"), + py::arg("domain_max"), + py::arg("domain_unit"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/UnresolvedRegion.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/UnresolvedRegion.python.cpp new file mode 100644 index 000000000..f2a659a88 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/UnresolvedRegion.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/UnresolvedRegion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::UnresolvedRegion +void wrapUnresolvedRegion(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::UnresolvedRegion; + + // create the Python object + py::class_ object( + module, "UnresolvedRegion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unspecified.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unspecified.python.cpp new file mode 100644 index 000000000..8582cf2bd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Unspecified.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Unspecified.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Unspecified +void wrapUnspecified(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Unspecified; + + // create the Python object + py::class_ object( + module, "Unspecified", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional & + >(), + py::arg("label"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Values.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Values.python.cpp new file mode 100644 index 000000000..fd6584b25 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Values.python.cpp @@ -0,0 +1,69 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Values.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Values +void wrapValues(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Values; + + // create the Python object + py::class_ object( + module, "Values", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Weighted.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Weighted.python.cpp new file mode 100644 index 000000000..008111a1c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Weighted.python.cpp @@ -0,0 +1,162 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Weighted.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Weighted +void wrapWeighted(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Weighted; + + // create the Python object + py::class_ object( + module, "Weighted", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const general::XYs1d &, + const general::Evaporation & + >(), + py::arg("xys1d"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/WeightedFunctionals.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/WeightedFunctionals.python.cpp new file mode 100644 index 000000000..7535c37af --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/WeightedFunctionals.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/WeightedFunctionals.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::WeightedFunctionals +void wrapWeightedFunctionals(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::WeightedFunctionals; + + // create the Python object + py::class_ object( + module, "WeightedFunctionals", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Width.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Width.python.cpp new file mode 100644 index 000000000..de8401158 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Width.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Width.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Width +void wrapWidth(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Width; + + // create the Python object + py::class_ object( + module, "Width", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const int &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("resonance_reaction"), + py::arg("degrees_of_freedom"), + py::arg("xys1d") = std::nullopt, + py::arg("constant1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Widths.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Widths.python.cpp new file mode 100644 index 000000000..7ecf61388 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Widths.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Widths.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Widths +void wrapWidths(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Widths; + + // create the Python object + py::class_ object( + module, "Widths", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs1d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs1d.python.cpp new file mode 100644 index 000000000..c738a62f8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs1d.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/XYs1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::XYs1d +void wrapXYs1d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::XYs1d; + + // create the Python object + py::class_ object( + module, "XYs1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const general::Values &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("index") = std::nullopt, + py::arg("interpolation") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::arg("values"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs2d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs2d.python.cpp new file mode 100644 index 000000000..f228eaa7f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs2d.python.cpp @@ -0,0 +1,200 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/XYs2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::XYs2d +void wrapXYs2d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::XYs2d; + + // create the Python object + py::class_ object( + module, "XYs2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const general::Function1ds &, + const std::optional & + >(), + py::arg("index") = std::nullopt, + py::arg("interpolation") = std::nullopt, + py::arg("interpolation_qualifier") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::arg("function1ds"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs3d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs3d.python.cpp new file mode 100644 index 000000000..4cc0f0486 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/XYs3d.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/XYs3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::XYs3d +void wrapXYs3d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::XYs3d; + + // create the Python object + py::class_ object( + module, "XYs3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::vector & + >(), + py::arg("interpolation_qualifier") = std::nullopt, + py::arg("axes") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Yields.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Yields.python.cpp new file mode 100644 index 000000000..986a74e1f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/general/Yields.python.cpp @@ -0,0 +1,136 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/general/Yields.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Yields +void wrapYields(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = general::Yields; + + // create the Python object + py::class_ object( + module, "Yields", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const reduced::Nuclides &, + const general::Values &, + const general::Uncertainty & + >(), + py::arg("nuclides"), + py::arg("values"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced.python.cpp new file mode 100644 index 000000000..cf5137085 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced.python.cpp @@ -0,0 +1,47 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// reduced declarations +namespace python_reduced { + void wrapDouble(py::module &); + void wrapPolynomial1d(py::module &); + void wrapFunction1ds(py::module &); + void wrapCrossSection(py::module &); + void wrapDistribution(py::module &); + void wrapProduct(py::module &); + void wrapProducts(py::module &); + void wrapOutputChannel(py::module &); + void wrapNuclides(py::module &); +} // namespace python_reduced + +// wrapper for reduced +void wrapReduced(py::module &module) +{ + // create the reduced submodule + py::module submodule = module.def_submodule( + "reduced", + "alpha v2.0 reduced" + ); + + // wrap reduced components + 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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/CrossSection.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/CrossSection.python.cpp new file mode 100644 index 000000000..934d26fab --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/CrossSection.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/reduced/CrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::CrossSection +void wrapCrossSection(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = reduced::CrossSection; + + // create the Python object + py::class_ object( + module, "CrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::arg("regions1d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Distribution.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Distribution.python.cpp new file mode 100644 index 000000000..7eb953c20 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Distribution.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/reduced/Distribution.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Distribution +void wrapDistribution(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = reduced::Distribution; + + // create the Python object + py::class_ object( + module, "Distribution", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("thermal_neutron_scattering_law") = std::nullopt, + py::arg("uncorrelated") = std::nullopt, + py::arg("unspecified") = std::nullopt, + py::arg("xys2d") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Double.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Double.python.cpp new file mode 100644 index 000000000..117375304 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Double.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/reduced/Double.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Double +void wrapDouble(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = reduced::Double; + + // create the Python object + py::class_ object( + module, "Double", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Function1ds.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Function1ds.python.cpp new file mode 100644 index 000000000..6a88e36e5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Function1ds.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/reduced/Function1ds.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Function1ds +void wrapFunction1ds(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = reduced::Function1ds; + + // create the Python object + py::class_ object( + module, "Function1ds", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector &, + const std::optional> & + >(), + py::arg("legendre"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Nuclides.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Nuclides.python.cpp new file mode 100644 index 000000000..c70ae5192 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Nuclides.python.cpp @@ -0,0 +1,85 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/reduced/Nuclides.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Nuclides +void wrapNuclides(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = reduced::Nuclides; + + // create the Python object + py::class_ object( + module, "Nuclides", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("href") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/OutputChannel.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/OutputChannel.python.cpp new file mode 100644 index 000000000..defd9dc4e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/OutputChannel.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/reduced/OutputChannel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::OutputChannel +void wrapOutputChannel(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = reduced::OutputChannel; + + // create the Python object + py::class_ object( + module, "OutputChannel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::optional &, + const general::Q &, + const std::optional & + >(), + py::arg("genre"), + py::arg("process") = std::nullopt, + py::arg("q"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Polynomial1d.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Polynomial1d.python.cpp new file mode 100644 index 000000000..1d6b17418 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Polynomial1d.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/reduced/Polynomial1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Polynomial1d +void wrapPolynomial1d(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = reduced::Polynomial1d; + + // create the Python object + py::class_ object( + module, "Polynomial1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const double &, + const double &, + const general::Axes &, + const general::Values & + >(), + py::arg("domain_min"), + py::arg("domain_max"), + py::arg("axes"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Product.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Product.python.cpp new file mode 100644 index 000000000..72a9f2836 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Product.python.cpp @@ -0,0 +1,236 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/reduced/Product.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Product +void wrapProduct(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = reduced::Product; + + // create the Python object + py::class_ object( + module, "Product", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const general::Multiplicity &, + const reduced::Distribution & + >(), + py::arg("label"), + py::arg("pid"), + py::arg("multiplicity"), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Products.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Products.python.cpp new file mode 100644 index 000000000..04fcfe659 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/reduced/Products.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/reduced/Products.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Products +void wrapProducts(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = reduced::Products; + + // create the Python object + py::class_ object( + module, "Products", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top.python.cpp new file mode 100644 index 000000000..6472099a1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// top declarations +namespace python_top { + void wrapFissionFragmentData(py::module &); + void wrapPoPs(py::module &); + void wrapReactionSuite(py::module &); + void wrapCovarianceSuite(py::module &); +} // namespace python_top + +// wrapper for top +void wrapTop(py::module &module) +{ + // create the top submodule + py::module submodule = module.def_submodule( + "top", + "alpha v2.0 top" + ); + + // wrap top components + python_top::wrapFissionFragmentData(submodule); + python_top::wrapPoPs(submodule); + python_top::wrapReactionSuite(submodule); + python_top::wrapCovarianceSuite(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/CovarianceSuite.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/CovarianceSuite.python.cpp new file mode 100644 index 000000000..f295d1bfd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/CovarianceSuite.python.cpp @@ -0,0 +1,260 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/top/CovarianceSuite.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_top { + +// wrapper for top::CovarianceSuite +void wrapCovarianceSuite(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = top::CovarianceSuite; + + // create the Python object + py::class_ object( + module, "CovarianceSuite", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("projectile"), + py::arg("target"), + py::arg("evaluation"), + py::arg("interaction"), + py::arg("format"), + py::arg("external_files") = std::nullopt, + py::arg("styles"), + py::arg("covariance_sections") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/FissionFragmentData.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/FissionFragmentData.python.cpp new file mode 100644 index 000000000..faaeb5782 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/FissionFragmentData.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/top/FissionFragmentData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_top { + +// wrapper for top::FissionFragmentData +void wrapFissionFragmentData(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = top::FissionFragmentData; + + // create the Python object + py::class_ object( + module, "FissionFragmentData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("product_yields") = std::nullopt, + py::arg("delayed_neutrons") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/PoPs.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/PoPs.python.cpp new file mode 100644 index 000000000..a2f8f08e5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/PoPs.python.cpp @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/top/PoPs.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_top { + +// wrapper for top::PoPs +void wrapPoPs(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = top::PoPs; + + // create the Python object + py::class_ object( + module, "PoPs", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("name"), + py::arg("version"), + py::arg("format"), + py::arg("aliases") = std::nullopt, + py::arg("baryons") = std::nullopt, + py::arg("chemical_elements") = std::nullopt, + py::arg("styles") = std::nullopt, + py::arg("unorthodoxes") = std::nullopt, + py::arg("gauge_bosons") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/ReactionSuite.python.cpp b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/ReactionSuite.python.cpp new file mode 100644 index 000000000..2cc317011 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/python/src/v2.0/top/ReactionSuite.python.cpp @@ -0,0 +1,444 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "alpha/v2.0/top/ReactionSuite.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_top { + +// wrapper for top::ReactionSuite +void wrapReactionSuite(py::module &module) +{ + using namespace alpha; + using namespace alpha::v2_0; + + // type aliases + using cppCLASS = top::ReactionSuite; + + // create the Python object + py::class_ object( + module, "ReactionSuite", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("projectile"), + py::arg("target"), + py::arg("evaluation"), + py::arg("format"), + py::arg("projectile_frame"), + py::arg("interaction"), + py::arg("styles"), + py::arg("po_ps"), + py::arg("reactions"), + py::arg("application_data") = std::nullopt, + py::arg("external_files") = std::nullopt, + py::arg("resonances") = std::nullopt, + py::arg("sums") = std::nullopt, + py::arg("productions") = std::nullopt, + py::arg("fission_components") = std::nullopt, + py::arg("orphan_products") = std::nullopt, + py::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 diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0.hpp new file mode 100644 index 000000000..062583bc8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0.hpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0 +#define ALPHA_V2_0 + +#include "alpha/v2.0/general/Add.hpp" +#include "alpha/v2.0/general/Alias.hpp" +#include "alpha/v2.0/general/Aliases.hpp" +#include "alpha/v2.0/general/Angular.hpp" +#include "alpha/v2.0/general/AngularEnergy.hpp" +#include "alpha/v2.0/general/AngularTwoBody.hpp" +#include "alpha/v2.0/general/ApplicationData.hpp" + +#include "alpha/v2.0/g2d/Array.hpp" + +#include "alpha/v2.0/g3d/Array.hpp" + +#include "alpha/v2.0/general/Array.hpp" +#include "alpha/v2.0/general/Atomic.hpp" +#include "alpha/v2.0/general/Author.hpp" +#include "alpha/v2.0/general/Authors.hpp" +#include "alpha/v2.0/general/AverageEnergies.hpp" +#include "alpha/v2.0/general/AverageEnergy.hpp" +#include "alpha/v2.0/general/AverageParameterCovariance.hpp" +#include "alpha/v2.0/general/AverageProductEnergy.hpp" +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/general/Axis.hpp" +#include "alpha/v2.0/general/Background.hpp" +#include "alpha/v2.0/general/Baryon.hpp" +#include "alpha/v2.0/general/Baryons.hpp" +#include "alpha/v2.0/general/BindingEnergy.hpp" +#include "alpha/v2.0/general/Body.hpp" +#include "alpha/v2.0/general/BoundAtomCrossSection.hpp" +#include "alpha/v2.0/general/Branching1d.hpp" +#include "alpha/v2.0/general/Branching3d.hpp" +#include "alpha/v2.0/general/BreitWigner.hpp" +#include "alpha/v2.0/general/Channel.hpp" +#include "alpha/v2.0/general/Channels.hpp" +#include "alpha/v2.0/general/Charge.hpp" +#include "alpha/v2.0/general/ChemicalElement.hpp" +#include "alpha/v2.0/general/ChemicalElements.hpp" +#include "alpha/v2.0/general/CoherentPhotonScattering.hpp" +#include "alpha/v2.0/general/Column.hpp" +#include "alpha/v2.0/general/ColumnData.hpp" +#include "alpha/v2.0/general/ColumnHeaders.hpp" +#include "alpha/v2.0/general/Configuration.hpp" +#include "alpha/v2.0/general/Configurations.hpp" +#include "alpha/v2.0/general/Constant1d.hpp" +#include "alpha/v2.0/general/Continuum.hpp" +#include "alpha/v2.0/general/Conversion.hpp" +#include "alpha/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "alpha/v2.0/general/Covariance.hpp" +#include "alpha/v2.0/general/CovarianceMatrix.hpp" +#include "alpha/v2.0/general/CovarianceSection.hpp" +#include "alpha/v2.0/general/CovarianceSections.hpp" + +#include "alpha/v2.0/top/CovarianceSuite.hpp" + +#include "alpha/v2.0/general/CrossSection.hpp" + +#include "alpha/v2.0/reduced/CrossSection.hpp" + +#include "alpha/v2.0/general/CrossSectionReconstructed.hpp" +#include "alpha/v2.0/general/CrossSectionSum.hpp" +#include "alpha/v2.0/general/CrossSectionSums.hpp" +#include "alpha/v2.0/general/Data.hpp" +#include "alpha/v2.0/general/Date.hpp" +#include "alpha/v2.0/general/Dates.hpp" +#include "alpha/v2.0/general/DebyeWallerIntegral.hpp" +#include "alpha/v2.0/general/Decay.hpp" +#include "alpha/v2.0/general/DecayData.hpp" +#include "alpha/v2.0/general/DecayMode.hpp" +#include "alpha/v2.0/general/DecayModes.hpp" +#include "alpha/v2.0/general/DecayPath.hpp" +#include "alpha/v2.0/general/DelayedBetaEnergy.hpp" +#include "alpha/v2.0/general/DelayedGammaEnergy.hpp" +#include "alpha/v2.0/general/DelayedNeutron.hpp" +#include "alpha/v2.0/general/DelayedNeutronKE.hpp" +#include "alpha/v2.0/general/DelayedNeutrons.hpp" +#include "alpha/v2.0/general/Discrete.hpp" +#include "alpha/v2.0/general/DiscreteGamma.hpp" +#include "alpha/v2.0/general/Distribution.hpp" + +#include "alpha/v2.0/reduced/Distribution.hpp" + +#include "alpha/v2.0/general/Documentation.hpp" +#include "alpha/v2.0/general/Double.hpp" + +#include "alpha/v2.0/reduced/Double.hpp" + +#include "alpha/v2.0/general/DoubleDifferentialCrossSection.hpp" +#include "alpha/v2.0/general/EFH.hpp" +#include "alpha/v2.0/general/EFL.hpp" +#include "alpha/v2.0/general/ENDFconversionFlags.hpp" +#include "alpha/v2.0/general/E_critical.hpp" +#include "alpha/v2.0/general/E_max.hpp" +#include "alpha/v2.0/general/ElapsedTime.hpp" +#include "alpha/v2.0/general/ElapsedTimes.hpp" +#include "alpha/v2.0/general/EndfCompatible.hpp" +#include "alpha/v2.0/general/Energy.hpp" +#include "alpha/v2.0/general/EnergyAngular.hpp" +#include "alpha/v2.0/general/Evaluated.hpp" +#include "alpha/v2.0/general/Evaporation.hpp" +#include "alpha/v2.0/general/ExternalFile.hpp" +#include "alpha/v2.0/general/ExternalFiles.hpp" +#include "alpha/v2.0/general/F.hpp" +#include "alpha/v2.0/general/FastRegion.hpp" +#include "alpha/v2.0/general/FissionComponent.hpp" +#include "alpha/v2.0/general/FissionComponents.hpp" +#include "alpha/v2.0/general/FissionEnergyRelease.hpp" +#include "alpha/v2.0/general/FissionEnergyReleases.hpp" + +#include "alpha/v2.0/top/FissionFragmentData.hpp" + +#include "alpha/v2.0/general/FormFactor.hpp" +#include "alpha/v2.0/general/Fraction.hpp" +#include "alpha/v2.0/general/FreeGasApproximation.hpp" +#include "alpha/v2.0/general/Function1ds.hpp" + +#include "alpha/v2.0/reduced/Function1ds.hpp" + +#include "alpha/v2.0/general/Function2ds.hpp" +#include "alpha/v2.0/general/G.hpp" +#include "alpha/v2.0/general/GaugeBoson.hpp" +#include "alpha/v2.0/general/GaugeBosons.hpp" +#include "alpha/v2.0/general/GeneralEvaporation.hpp" +#include "alpha/v2.0/general/Grid.hpp" +#include "alpha/v2.0/general/Gridded2d.hpp" +#include "alpha/v2.0/general/Gridded3d.hpp" +#include "alpha/v2.0/general/Halflife.hpp" +#include "alpha/v2.0/general/HardSphereRadius.hpp" +#include "alpha/v2.0/general/ImaginaryAnomalousFactor.hpp" +#include "alpha/v2.0/general/ImaginaryInterferenceTerm.hpp" +#include "alpha/v2.0/general/IncidentEnergies.hpp" +#include "alpha/v2.0/general/IncidentEnergy.hpp" +#include "alpha/v2.0/general/IncoherentPhotonScattering.hpp" +#include "alpha/v2.0/general/IncompleteReactions.hpp" +#include "alpha/v2.0/general/Institution.hpp" +#include "alpha/v2.0/general/Integer.hpp" +#include "alpha/v2.0/general/Intensity.hpp" +#include "alpha/v2.0/general/InternalConversionCoefficients.hpp" +#include "alpha/v2.0/general/Isotope.hpp" +#include "alpha/v2.0/general/Isotopes.hpp" +#include "alpha/v2.0/general/Isotropic2d.hpp" +#include "alpha/v2.0/general/J.hpp" +#include "alpha/v2.0/general/Js.hpp" +#include "alpha/v2.0/general/KalbachMann.hpp" +#include "alpha/v2.0/general/L.hpp" +#include "alpha/v2.0/general/Legendre.hpp" + +#include "alpha/v2.0/g3d/Lengths.hpp" + +#include "alpha/v2.0/general/Lepton.hpp" +#include "alpha/v2.0/general/Leptons.hpp" +#include "alpha/v2.0/general/LevelSpacing.hpp" +#include "alpha/v2.0/general/Link.hpp" +#include "alpha/v2.0/general/ListOfCovariances.hpp" +#include "alpha/v2.0/general/Ls.hpp" +#include "alpha/v2.0/general/MadlandNix.hpp" +#include "alpha/v2.0/general/Mass.hpp" +#include "alpha/v2.0/general/MetaStable.hpp" +#include "alpha/v2.0/general/Mixed.hpp" +#include "alpha/v2.0/general/Multiplicity.hpp" +#include "alpha/v2.0/general/MultiplicitySum.hpp" +#include "alpha/v2.0/general/MultiplicitySums.hpp" +#include "alpha/v2.0/general/NBodyPhaseSpace.hpp" +#include "alpha/v2.0/general/NeutrinoEnergy.hpp" +#include "alpha/v2.0/general/NonNeutrinoEnergy.hpp" +#include "alpha/v2.0/general/NuclearAmplitudeExpansion.hpp" +#include "alpha/v2.0/general/NuclearPlusInterference.hpp" +#include "alpha/v2.0/general/NuclearTerm.hpp" +#include "alpha/v2.0/general/Nucleus.hpp" +#include "alpha/v2.0/general/Nuclide.hpp" +#include "alpha/v2.0/general/Nuclides.hpp" + +#include "alpha/v2.0/reduced/Nuclides.hpp" + +#include "alpha/v2.0/general/OrphanProduct.hpp" +#include "alpha/v2.0/general/OrphanProducts.hpp" +#include "alpha/v2.0/general/OutputChannel.hpp" + +#include "alpha/v2.0/reduced/OutputChannel.hpp" + +#include "alpha/v2.0/general/ParameterCovariance.hpp" +#include "alpha/v2.0/general/ParameterCovarianceMatrix.hpp" +#include "alpha/v2.0/general/ParameterCovariances.hpp" +#include "alpha/v2.0/general/ParameterLink.hpp" +#include "alpha/v2.0/general/Parameters.hpp" +#include "alpha/v2.0/general/Parity.hpp" +#include "alpha/v2.0/general/PhotonEmissionProbabilities.hpp" + +#include "alpha/v2.0/top/PoPs.hpp" + +#include "alpha/v2.0/general/Polynomial1d.hpp" + +#include "alpha/v2.0/reduced/Polynomial1d.hpp" + +#include "alpha/v2.0/general/PositronEmissionIntensity.hpp" +#include "alpha/v2.0/general/PrimaryGamma.hpp" +#include "alpha/v2.0/general/Probability.hpp" +#include "alpha/v2.0/general/Product.hpp" + +#include "alpha/v2.0/reduced/Product.hpp" + +#include "alpha/v2.0/general/ProductYield.hpp" +#include "alpha/v2.0/general/ProductYields.hpp" +#include "alpha/v2.0/general/Production.hpp" +#include "alpha/v2.0/general/Productions.hpp" +#include "alpha/v2.0/general/Products.hpp" + +#include "alpha/v2.0/reduced/Products.hpp" + +#include "alpha/v2.0/general/ProjectileEnergyDomain.hpp" +#include "alpha/v2.0/general/PromptGammaEnergy.hpp" +#include "alpha/v2.0/general/PromptNeutronKE.hpp" +#include "alpha/v2.0/general/PromptProductKE.hpp" +#include "alpha/v2.0/general/Q.hpp" +#include "alpha/v2.0/general/R.hpp" +#include "alpha/v2.0/general/RMatrix.hpp" +#include "alpha/v2.0/general/Rate.hpp" +#include "alpha/v2.0/general/Reaction.hpp" + +#include "alpha/v2.0/top/ReactionSuite.hpp" + +#include "alpha/v2.0/general/Reactions.hpp" +#include "alpha/v2.0/general/RealAnomalousFactor.hpp" +#include "alpha/v2.0/general/RealInterferenceTerm.hpp" +#include "alpha/v2.0/general/Recoil.hpp" +#include "alpha/v2.0/general/Reference.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" +#include "alpha/v2.0/general/Regions2d.hpp" +#include "alpha/v2.0/general/Resolved.hpp" +#include "alpha/v2.0/general/ResolvedRegion.hpp" +#include "alpha/v2.0/general/ResonanceParameters.hpp" +#include "alpha/v2.0/general/ResonanceReaction.hpp" +#include "alpha/v2.0/general/ResonanceReactions.hpp" +#include "alpha/v2.0/general/Resonances.hpp" +#include "alpha/v2.0/general/ResonancesWithBackground.hpp" +#include "alpha/v2.0/general/RowData.hpp" +#include "alpha/v2.0/general/RutherfordScattering.hpp" +#include "alpha/v2.0/general/SCTApproximation.hpp" +#include "alpha/v2.0/general/S_table.hpp" +#include "alpha/v2.0/general/ScatteringAtom.hpp" +#include "alpha/v2.0/general/ScatteringAtoms.hpp" +#include "alpha/v2.0/general/ScatteringFactor.hpp" +#include "alpha/v2.0/general/ScatteringRadius.hpp" +#include "alpha/v2.0/general/SelfScatteringKernel.hpp" +#include "alpha/v2.0/general/Shell.hpp" +#include "alpha/v2.0/general/ShortRangeSelfScalingVariance.hpp" +#include "alpha/v2.0/general/SimpleMaxwellianFission.hpp" +#include "alpha/v2.0/general/Slice.hpp" +#include "alpha/v2.0/general/Slices.hpp" +#include "alpha/v2.0/general/Spectra.hpp" +#include "alpha/v2.0/general/Spectrum.hpp" +#include "alpha/v2.0/general/Spin.hpp" +#include "alpha/v2.0/general/SpinGroup.hpp" +#include "alpha/v2.0/general/SpinGroups.hpp" +#include "alpha/v2.0/general/Standard.hpp" + +#include "alpha/v2.0/g3d/Starts.hpp" + +#include "alpha/v2.0/general/String.hpp" +#include "alpha/v2.0/general/Styles.hpp" +#include "alpha/v2.0/general/Sum.hpp" +#include "alpha/v2.0/general/Summand.hpp" +#include "alpha/v2.0/general/Summands.hpp" +#include "alpha/v2.0/general/Sums.hpp" +#include "alpha/v2.0/general/T_M.hpp" +#include "alpha/v2.0/general/T_effective.hpp" +#include "alpha/v2.0/general/Table.hpp" +#include "alpha/v2.0/general/TabulatedWidths.hpp" +#include "alpha/v2.0/general/Temperature.hpp" +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw1d.hpp" +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" +#include "alpha/v2.0/general/Theta.hpp" +#include "alpha/v2.0/general/Time.hpp" +#include "alpha/v2.0/general/Title.hpp" +#include "alpha/v2.0/general/TotalEnergy.hpp" +#include "alpha/v2.0/general/U.hpp" +#include "alpha/v2.0/general/Uncertainty.hpp" +#include "alpha/v2.0/general/Uncorrelated.hpp" +#include "alpha/v2.0/general/Unorthodox.hpp" +#include "alpha/v2.0/general/Unorthodoxes.hpp" +#include "alpha/v2.0/general/Unresolved.hpp" +#include "alpha/v2.0/general/UnresolvedRegion.hpp" +#include "alpha/v2.0/general/Unspecified.hpp" +#include "alpha/v2.0/general/Values.hpp" +#include "alpha/v2.0/general/Weighted.hpp" +#include "alpha/v2.0/general/WeightedFunctionals.hpp" +#include "alpha/v2.0/general/Width.hpp" +#include "alpha/v2.0/general/Widths.hpp" +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/XYs2d.hpp" +#include "alpha/v2.0/general/XYs3d.hpp" +#include "alpha/v2.0/general/Yields.hpp" + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g2d/Array.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g2d/Array.hpp new file mode 100644 index 000000000..4d9b50aa5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g2d/Array.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_G2D_ARRAY +#define ALPHA_V2_0_G2D_ARRAY + +#include "alpha/v2.0/general/Values.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shape, \ + this->compression, \ + this->symmetry, \ + this->values \ + ) + + // default + Array() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Array( + const wrapper + &shape, + const wrapper> + &compression = {}, + const wrapper> + &symmetry = {}, + const wrapper + &values = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + shape(this,shape), + compression(this,compression), + symmetry(this,symmetry), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Array(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Array(const Array &other) : + 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) : + 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 "alpha/v2.0/g2d/Array/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Array + +} // namespace g2d +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g2d/Array/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g2d/Array/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g2d/Array/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Array.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Array.hpp new file mode 100644 index 000000000..01f338e64 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Array.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_G3D_ARRAY +#define ALPHA_V2_0_G3D_ARRAY + +#include "alpha/v2.0/g3d/Starts.hpp" +#include "alpha/v2.0/g3d/Lengths.hpp" +#include "alpha/v2.0/general/Values.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shape, \ + this->compression, \ + this->symmetry, \ + this->starts, \ + this->lengths, \ + this->values \ + ) + + // default + Array() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Array(const Array &other) : + 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) : + 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 "alpha/v2.0/g3d/Array/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Array + +} // namespace g3d +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Array/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Array/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Array/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Lengths.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Lengths.hpp new file mode 100644 index 000000000..b643281b3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Lengths.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_G3D_LENGTHS +#define ALPHA_V2_0_G3D_LENGTHS + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->valueType, \ + this->label, \ + static_cast(*this) \ + ) + + // default + Lengths() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Lengths( + const wrapper + &valueType, + const wrapper + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + valueType(this,valueType), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Lengths(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Lengths(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Lengths(const Lengths &other) : + 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) : + 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 "alpha/v2.0/g3d/Lengths/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Lengths + +} // namespace g3d +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Lengths/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Lengths/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Lengths/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Starts.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Starts.hpp new file mode 100644 index 000000000..574a52116 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Starts.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_G3D_STARTS +#define ALPHA_V2_0_G3D_STARTS + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->valueType, \ + this->label, \ + static_cast(*this) \ + ) + + // default + Starts() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Starts( + const wrapper + &valueType, + const wrapper + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + valueType(this,valueType), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Starts(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Starts(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Starts(const Starts &other) : + 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) : + 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 "alpha/v2.0/g3d/Starts/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Starts + +} // namespace g3d +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Starts/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Starts/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/g3d/Starts/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Add.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Add.hpp new file mode 100644 index 000000000..08589da1b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Add.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ADD +#define ALPHA_V2_0_GENERAL_ADD + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Add() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Add( + const wrapper + &href + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Add(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Add(const Add &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Add(Add &&other) : + 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 "alpha/v2.0/general/Add/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Add + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Add/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Add/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Add/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Alias.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Alias.hpp new file mode 100644 index 000000000..d9e439c16 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Alias.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ALIAS +#define ALPHA_V2_0_GENERAL_ALIAS + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->pid \ + ) + + // default + Alias() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Alias( + const wrapper> + &id, + const wrapper> + &pid = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + pid(this,pid) + { + Component::finish(); + } + + // from node + explicit Alias(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Alias(const Alias &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + pid(this,other.pid) + { + Component::finish(other); + } + + // move + Alias(Alias &&other) : + 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 "alpha/v2.0/general/Alias/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Alias + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Alias/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Alias/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Alias/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Aliases.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Aliases.hpp new file mode 100644 index 000000000..629d3bef5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Aliases.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ALIASES +#define ALPHA_V2_0_GENERAL_ALIASES + +#include "alpha/v2.0/general/Alias.hpp" +#include "alpha/v2.0/general/MetaStable.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->alias, \ + this->metaStable \ + ) + + // default + Aliases() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Aliases( + const wrapper>> + &alias, + const wrapper>> + &metaStable = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + alias(this,alias), + metaStable(this,metaStable) + { + Component::finish(); + } + + // from node + explicit Aliases(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Aliases(const Aliases &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + alias(this,other.alias), + metaStable(this,other.metaStable) + { + Component::finish(other); + } + + // move + Aliases(Aliases &&other) : + 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 "alpha/v2.0/general/Aliases/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Aliases + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Aliases/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Aliases/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Aliases/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Angular.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Angular.hpp new file mode 100644 index 000000000..febf8cdd7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Angular.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ANGULAR +#define ALPHA_V2_0_GENERAL_ANGULAR + +#include "alpha/v2.0/general/Isotropic2d.hpp" +#include "alpha/v2.0/general/XYs2d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->isotropic2d, \ + this->XYs2d \ + ) + + // default + Angular() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Angular( + const wrapper> + &isotropic2d, + const wrapper> + &XYs2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + isotropic2d(this,isotropic2d), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit Angular(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Angular(const Angular &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + isotropic2d(this,other.isotropic2d), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + Angular(Angular &&other) : + 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 "alpha/v2.0/general/Angular/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Angular + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Angular/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Angular/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Angular/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularEnergy.hpp new file mode 100644 index 000000000..616d8ec9e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularEnergy.hpp @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ANGULARENERGY +#define ALPHA_V2_0_GENERAL_ANGULARENERGY + +#include "alpha/v2.0/general/XYs3d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs3d(),axes); + GNDSTK_SHORTCUT(XYs3d(),function2ds); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->XYs3d \ + ) + + // default + AngularEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AngularEnergy( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper + &XYs3d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + XYs3d(this,XYs3d) + { + Component::finish(); + } + + // from node + explicit AngularEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AngularEnergy(const AngularEnergy &other) : + 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) : + 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 "alpha/v2.0/general/AngularEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AngularEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularTwoBody.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularTwoBody.hpp new file mode 100644 index 000000000..3b190ac85 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularTwoBody.hpp @@ -0,0 +1,256 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ANGULARTWOBODY +#define ALPHA_V2_0_GENERAL_ANGULARTWOBODY + +#include "alpha/v2.0/general/XYs2d.hpp" +#include "alpha/v2.0/general/Regions2d.hpp" +#include "alpha/v2.0/general/Recoil.hpp" +#include "alpha/v2.0/general/Isotropic2d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->XYs2d, \ + this->regions2d, \ + this->recoil, \ + this->isotropic2d \ + ) + + // default + AngularTwoBody() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AngularTwoBody(const AngularTwoBody &other) : + 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) : + 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 "alpha/v2.0/general/AngularTwoBody/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AngularTwoBody + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularTwoBody/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularTwoBody/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AngularTwoBody/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ApplicationData.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ApplicationData.hpp new file mode 100644 index 000000000..fa99ff778 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ApplicationData.hpp @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_APPLICATIONDATA +#define ALPHA_V2_0_GENERAL_APPLICATIONDATA + +#include "alpha/v2.0/general/Institution.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(institution(),ENDFconversionFlags); + GNDSTK_SHORTCUT(institution().ENDFconversionFlags(),conversion); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->institution \ + ) + + // default + ApplicationData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ApplicationData( + const wrapper + &institution + ) : + GNDSTK_COMPONENT(BlockData{}), + institution(this,institution) + { + Component::finish(); + } + + // from node + explicit ApplicationData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ApplicationData(const ApplicationData &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + institution(this,other.institution) + { + Component::finish(other); + } + + // move + ApplicationData(ApplicationData &&other) : + 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 "alpha/v2.0/general/ApplicationData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ApplicationData + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ApplicationData/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ApplicationData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ApplicationData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Array.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Array.hpp new file mode 100644 index 000000000..0face97dd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Array.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ARRAY +#define ALPHA_V2_0_GENERAL_ARRAY + +#include "alpha/v2.0/general/Values.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shape, \ + this->compression, \ + this->values \ + ) + + // default + Array() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Array( + const wrapper + &shape, + const wrapper> + &compression = {}, + const wrapper + &values = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + shape(this,shape), + compression(this,compression), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Array(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Array(const Array &other) : + 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) : + 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 "alpha/v2.0/general/Array/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Array + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Array/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Array/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Array/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Atomic.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Atomic.hpp new file mode 100644 index 000000000..fdbff6a96 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Atomic.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ATOMIC +#define ALPHA_V2_0_GENERAL_ATOMIC + +#include "alpha/v2.0/general/Configurations.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(configurations(),configuration); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->configurations \ + ) + + // default + Atomic() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Atomic( + const wrapper + &configurations + ) : + GNDSTK_COMPONENT(BlockData{}), + configurations(this,configurations) + { + Component::finish(); + } + + // from node + explicit Atomic(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Atomic(const Atomic &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + configurations(this,other.configurations) + { + Component::finish(other); + } + + // move + Atomic(Atomic &&other) : + 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 "alpha/v2.0/general/Atomic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Atomic + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Atomic/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Atomic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Atomic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Author.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Author.hpp new file mode 100644 index 000000000..4f0d71bda --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Author.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_AUTHOR +#define ALPHA_V2_0_GENERAL_AUTHOR + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name \ + ) + + // default + Author() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Author( + const wrapper + &name + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name) + { + Component::finish(); + } + + // from node + explicit Author(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Author(const Author &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name) + { + Component::finish(other); + } + + // move + Author(Author &&other) : + 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 "alpha/v2.0/general/Author/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Author + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Author/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Author/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Author/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Authors.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Authors.hpp new file mode 100644 index 000000000..798f09615 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Authors.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_AUTHORS +#define ALPHA_V2_0_GENERAL_AUTHORS + +#include "alpha/v2.0/general/Author.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->author \ + ) + + // default + Authors() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Authors( + const wrapper> + &author + ) : + GNDSTK_COMPONENT(BlockData{}), + author(this,author) + { + Component::finish(); + } + + // from node + explicit Authors(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Authors(const Authors &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + author(this,other.author) + { + Component::finish(other); + } + + // move + Authors(Authors &&other) : + 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 "alpha/v2.0/general/Authors/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Authors + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Authors/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Authors/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Authors/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergies.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergies.hpp new file mode 100644 index 000000000..5bfb32687 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergies.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_AVERAGEENERGIES +#define ALPHA_V2_0_GENERAL_AVERAGEENERGIES + +#include "alpha/v2.0/general/AverageEnergy.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->averageEnergy \ + ) + + // default + AverageEnergies() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageEnergies( + const wrapper> + &averageEnergy + ) : + GNDSTK_COMPONENT(BlockData{}), + averageEnergy(this,averageEnergy) + { + Component::finish(); + } + + // from node + explicit AverageEnergies(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageEnergies(const AverageEnergies &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + averageEnergy(this,other.averageEnergy) + { + Component::finish(other); + } + + // move + AverageEnergies(AverageEnergies &&other) : + 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 "alpha/v2.0/general/AverageEnergies/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageEnergies + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergies/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergies/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergies/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergy.hpp new file mode 100644 index 000000000..e6c6b9692 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergy.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_AVERAGEENERGY +#define ALPHA_V2_0_GENERAL_AVERAGEENERGY + +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit, \ + this->uncertainty \ + ) + + // default + AverageEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageEnergy( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &unit = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit AverageEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageEnergy(const AverageEnergy &other) : + 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) : + 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 "alpha/v2.0/general/AverageEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageParameterCovariance.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageParameterCovariance.hpp new file mode 100644 index 000000000..0c97cdc34 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageParameterCovariance.hpp @@ -0,0 +1,248 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_AVERAGEPARAMETERCOVARIANCE +#define ALPHA_V2_0_GENERAL_AVERAGEPARAMETERCOVARIANCE + +#include "alpha/v2.0/general/CovarianceMatrix.hpp" +#include "alpha/v2.0/general/RowData.hpp" +#include "alpha/v2.0/general/ColumnData.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(covarianceMatrix().gridded2d(),array); + GNDSTK_SHORTCUT(covarianceMatrix().gridded2d(),axes); + GNDSTK_SHORTCUT(covarianceMatrix(),gridded2d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->crossTerm, \ + this->covarianceMatrix, \ + this->rowData, \ + this->columnData \ + ) + + // default + AverageParameterCovariance() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageParameterCovariance(const AverageParameterCovariance &other) : + 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) : + 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 "alpha/v2.0/general/AverageParameterCovariance/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageParameterCovariance + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageParameterCovariance/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageParameterCovariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageParameterCovariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageProductEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageProductEnergy.hpp new file mode 100644 index 000000000..74b86a4c8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageProductEnergy.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_AVERAGEPRODUCTENERGY +#define ALPHA_V2_0_GENERAL_AVERAGEPRODUCTENERGY + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + AverageProductEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageProductEnergy( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit AverageProductEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageProductEnergy(const AverageProductEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + AverageProductEnergy(AverageProductEnergy &&other) : + 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 "alpha/v2.0/general/AverageProductEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageProductEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageProductEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageProductEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/AverageProductEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axes.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axes.hpp new file mode 100644 index 000000000..6fb4d3d8e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axes.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_AXES +#define ALPHA_V2_0_GENERAL_AXES + +#include "alpha/v2.0/general/Axis.hpp" +#include "alpha/v2.0/general/Grid.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->axis, \ + this->grid \ + ) + + // default + Axes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axes( + const wrapper> + &axis, + const wrapper>> + &grid = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + axis(this,axis), + grid(this,grid) + { + Component::finish(); + } + + // from node + explicit Axes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axes(const Axes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + axis(this,other.axis), + grid(this,other.grid) + { + Component::finish(other); + } + + // move + Axes(Axes &&other) : + 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 "alpha/v2.0/general/Axes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Axes + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axes/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axis.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axis.hpp new file mode 100644 index 000000000..3f8f3b2e9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axis.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_AXIS +#define ALPHA_V2_0_GENERAL_AXIS + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->label, \ + this->unit \ + ) + + // default + Axis() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axis( + const wrapper + &index, + const wrapper + &label = {}, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + label(this,label), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Axis(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axis(const Axis &other) : + 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) : + 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 "alpha/v2.0/general/Axis/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Axis + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axis/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axis/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Axis/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Background.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Background.hpp new file mode 100644 index 000000000..f441419d5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Background.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_BACKGROUND +#define ALPHA_V2_0_GENERAL_BACKGROUND + +#include "alpha/v2.0/general/ResolvedRegion.hpp" +#include "alpha/v2.0/general/FastRegion.hpp" +#include "alpha/v2.0/general/UnresolvedRegion.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->resolvedRegion, \ + this->fastRegion, \ + this->unresolvedRegion \ + ) + + // default + Background() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Background( + const wrapper> + &resolvedRegion, + const wrapper + &fastRegion = {}, + const wrapper> + &unresolvedRegion = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + resolvedRegion(this,resolvedRegion), + fastRegion(this,fastRegion), + unresolvedRegion(this,unresolvedRegion) + { + Component::finish(); + } + + // from node + explicit Background(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Background(const Background &other) : + 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) : + 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 "alpha/v2.0/general/Background/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Background + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Background/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Background/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Background/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryon.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryon.hpp new file mode 100644 index 000000000..c1aff068b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryon.hpp @@ -0,0 +1,278 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_BARYON +#define ALPHA_V2_0_GENERAL_BARYON + +#include "alpha/v2.0/general/Mass.hpp" +#include "alpha/v2.0/general/Spin.hpp" +#include "alpha/v2.0/general/Parity.hpp" +#include "alpha/v2.0/general/Charge.hpp" +#include "alpha/v2.0/general/Halflife.hpp" +#include "alpha/v2.0/general/DecayData.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(spin(),fraction); + GNDSTK_SHORTCUT(halflife(),string); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->charge, \ + this->halflife, \ + this->decayData \ + ) + + // default + Baryon() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Baryon(const Baryon &other) : + 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) : + 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 "alpha/v2.0/general/Baryon/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Baryon + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryon/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryon/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryon/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryons.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryons.hpp new file mode 100644 index 000000000..7f0d6620e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_BARYONS +#define ALPHA_V2_0_GENERAL_BARYONS + +#include "alpha/v2.0/general/Baryon.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->baryon \ + ) + + // default + Baryons() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Baryons( + const wrapper> + &baryon + ) : + GNDSTK_COMPONENT(BlockData{}), + baryon(this,baryon) + { + Component::finish(); + } + + // from node + explicit Baryons(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Baryons(const Baryons &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + baryon(this,other.baryon) + { + Component::finish(other); + } + + // move + Baryons(Baryons &&other) : + 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 "alpha/v2.0/general/Baryons/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Baryons + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryons/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Baryons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BindingEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BindingEnergy.hpp new file mode 100644 index 000000000..8263a2658 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BindingEnergy.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_BINDINGENERGY +#define ALPHA_V2_0_GENERAL_BINDINGENERGY + +#include "alpha/v2.0/general/Double.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Double(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + BindingEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BindingEnergy( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit BindingEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BindingEnergy(const BindingEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + BindingEnergy(BindingEnergy &&other) : + 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 "alpha/v2.0/general/BindingEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BindingEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BindingEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BindingEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BindingEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Body.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Body.hpp new file mode 100644 index 000000000..c195bb0dc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Body.hpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_BODY +#define ALPHA_V2_0_GENERAL_BODY + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + Body() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Body(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Body(const Body &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Body(Body &&other) : + 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 "alpha/v2.0/general/Body/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Body + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Body/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Body/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Body/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BoundAtomCrossSection.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BoundAtomCrossSection.hpp new file mode 100644 index 000000000..55b389b7f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BoundAtomCrossSection.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_BOUNDATOMCROSSSECTION +#define ALPHA_V2_0_GENERAL_BOUNDATOMCROSSSECTION + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + BoundAtomCrossSection() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BoundAtomCrossSection( + const wrapper + &value, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit BoundAtomCrossSection(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BoundAtomCrossSection(const BoundAtomCrossSection &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + BoundAtomCrossSection(BoundAtomCrossSection &&other) : + 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 "alpha/v2.0/general/BoundAtomCrossSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BoundAtomCrossSection + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BoundAtomCrossSection/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BoundAtomCrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BoundAtomCrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching1d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching1d.hpp new file mode 100644 index 000000000..9aedaa4ed --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching1d.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_BRANCHING1D +#define ALPHA_V2_0_GENERAL_BRANCHING1D + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label \ + ) + + // default + Branching1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Branching1d( + const wrapper + &label + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Branching1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Branching1d(const Branching1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label) + { + Component::finish(other); + } + + // move + Branching1d(Branching1d &&other) : + 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 "alpha/v2.0/general/Branching1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Branching1d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching1d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching3d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching3d.hpp new file mode 100644 index 000000000..2dbc2e393 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching3d.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_BRANCHING3D +#define ALPHA_V2_0_GENERAL_BRANCHING3D + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame \ + ) + + // default + Branching3d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Branching3d( + const wrapper + &label, + const wrapper + &productFrame = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame) + { + Component::finish(); + } + + // from node + explicit Branching3d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Branching3d(const Branching3d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame) + { + Component::finish(other); + } + + // move + Branching3d(Branching3d &&other) : + 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 "alpha/v2.0/general/Branching3d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Branching3d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching3d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Branching3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BreitWigner.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BreitWigner.hpp new file mode 100644 index 000000000..1415b3606 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BreitWigner.hpp @@ -0,0 +1,262 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_BREITWIGNER +#define ALPHA_V2_0_GENERAL_BREITWIGNER + +#include "alpha/v2.0/general/ResonanceParameters.hpp" +#include "alpha/v2.0/top/PoPs.hpp" +#include "alpha/v2.0/general/ScatteringRadius.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(resonanceParameters().table(),columnHeaders); + GNDSTK_SHORTCUT(resonanceParameters().table(),data); + GNDSTK_SHORTCUT(resonanceParameters(),table); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->approximation, \ + this->calculateChannelRadius, \ + this->resonanceParameters, \ + this->PoPs, \ + this->scatteringRadius \ + ) + + // default + BreitWigner() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BreitWigner(const BreitWigner &other) : + 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) : + 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 "alpha/v2.0/general/BreitWigner/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BreitWigner + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BreitWigner/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BreitWigner/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/BreitWigner/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channel.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channel.hpp new file mode 100644 index 000000000..d7ce647e2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channel.hpp @@ -0,0 +1,268 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CHANNEL +#define ALPHA_V2_0_GENERAL_CHANNEL + +#include "alpha/v2.0/general/ScatteringRadius.hpp" +#include "alpha/v2.0/general/HardSphereRadius.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->resonanceReaction, \ + this->L, \ + this->channelSpin, \ + this->columnIndex, \ + this->scatteringRadius, \ + this->hardSphereRadius \ + ) + + // default + Channel() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Channel(const Channel &other) : + 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) : + 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 "alpha/v2.0/general/Channel/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Channel + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channel/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channels.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channels.hpp new file mode 100644 index 000000000..b341c89cd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channels.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CHANNELS +#define ALPHA_V2_0_GENERAL_CHANNELS + +#include "alpha/v2.0/general/Channel.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->channel \ + ) + + // default + Channels() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Channels( + const wrapper> + &channel + ) : + GNDSTK_COMPONENT(BlockData{}), + channel(this,channel) + { + Component::finish(); + } + + // from node + explicit Channels(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Channels(const Channels &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + channel(this,other.channel) + { + Component::finish(other); + } + + // move + Channels(Channels &&other) : + 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 "alpha/v2.0/general/Channels/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Channels + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channels/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channels/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Channels/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Charge.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Charge.hpp new file mode 100644 index 000000000..5a0b92e1b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Charge.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CHARGE +#define ALPHA_V2_0_GENERAL_CHARGE + +#include "alpha/v2.0/general/Integer.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->integer \ + ) + + // default + Charge() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Charge( + const wrapper + &integer + ) : + GNDSTK_COMPONENT(BlockData{}), + integer(this,integer) + { + Component::finish(); + } + + // from node + explicit Charge(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Charge(const Charge &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + integer(this,other.integer) + { + Component::finish(other); + } + + // move + Charge(Charge &&other) : + 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 "alpha/v2.0/general/Charge/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Charge + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Charge/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Charge/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Charge/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElement.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElement.hpp new file mode 100644 index 000000000..166b21073 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElement.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CHEMICALELEMENT +#define ALPHA_V2_0_GENERAL_CHEMICALELEMENT + +#include "alpha/v2.0/general/Atomic.hpp" +#include "alpha/v2.0/general/Isotopes.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symbol, \ + this->Z, \ + this->name, \ + this->atomic, \ + this->isotopes \ + ) + + // default + ChemicalElement() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ChemicalElement(const ChemicalElement &other) : + 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) : + 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 "alpha/v2.0/general/ChemicalElement/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ChemicalElement + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElement/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElement/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElement/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElements.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElements.hpp new file mode 100644 index 000000000..e99f88aef --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElements.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CHEMICALELEMENTS +#define ALPHA_V2_0_GENERAL_CHEMICALELEMENTS + +#include "alpha/v2.0/general/ChemicalElement.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->chemicalElement \ + ) + + // default + ChemicalElements() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ChemicalElements( + const wrapper> + &chemicalElement + ) : + GNDSTK_COMPONENT(BlockData{}), + chemicalElement(this,chemicalElement) + { + Component::finish(); + } + + // from node + explicit ChemicalElements(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ChemicalElements(const ChemicalElements &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + chemicalElement(this,other.chemicalElement) + { + Component::finish(other); + } + + // move + ChemicalElements(ChemicalElements &&other) : + 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 "alpha/v2.0/general/ChemicalElements/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ChemicalElements + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElements/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElements/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ChemicalElements/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoherentPhotonScattering.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoherentPhotonScattering.hpp new file mode 100644 index 000000000..a27602e59 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoherentPhotonScattering.hpp @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_COHERENTPHOTONSCATTERING +#define ALPHA_V2_0_GENERAL_COHERENTPHOTONSCATTERING + +#include "alpha/v2.0/general/FormFactor.hpp" +#include "alpha/v2.0/general/RealAnomalousFactor.hpp" +#include "alpha/v2.0/general/ImaginaryAnomalousFactor.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href, \ + this->pid, \ + this->productFrame, \ + this->formFactor, \ + this->realAnomalousFactor, \ + this->imaginaryAnomalousFactor \ + ) + + // default + CoherentPhotonScattering() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CoherentPhotonScattering(const CoherentPhotonScattering &other) : + 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) : + 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 "alpha/v2.0/general/CoherentPhotonScattering/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CoherentPhotonScattering + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoherentPhotonScattering/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoherentPhotonScattering/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoherentPhotonScattering/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Column.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Column.hpp new file mode 100644 index 000000000..36f5a0a60 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Column.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_COLUMN +#define ALPHA_V2_0_GENERAL_COLUMN + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->name, \ + this->unit \ + ) + + // default + Column() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Column( + const wrapper + &index, + const wrapper + &name = {}, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + name(this,name), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Column(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Column(const Column &other) : + 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) : + 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 "alpha/v2.0/general/Column/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Column + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Column/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Column/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Column/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnData.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnData.hpp new file mode 100644 index 000000000..ecdc5d4bf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnData.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_COLUMNDATA +#define ALPHA_V2_0_GENERAL_COLUMNDATA + +#include "alpha/v2.0/general/Slices.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MFMT, \ + this->href, \ + this->slices \ + ) + + // default + ColumnData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ColumnData( + const wrapper> + &ENDF_MFMT, + const wrapper + &href = {}, + const wrapper> + &slices = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MFMT(this,ENDF_MFMT), + href(this,href), + slices(this,slices) + { + Component::finish(); + } + + // from node + explicit ColumnData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ColumnData(const ColumnData &other) : + 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) : + 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 "alpha/v2.0/general/ColumnData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ColumnData + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnData/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnHeaders.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnHeaders.hpp new file mode 100644 index 000000000..eb030e1ae --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnHeaders.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_COLUMNHEADERS +#define ALPHA_V2_0_GENERAL_COLUMNHEADERS + +#include "alpha/v2.0/general/Column.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->column \ + ) + + // default + ColumnHeaders() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ColumnHeaders( + const wrapper> + &column + ) : + GNDSTK_COMPONENT(BlockData{}), + column(this,column) + { + Component::finish(); + } + + // from node + explicit ColumnHeaders(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ColumnHeaders(const ColumnHeaders &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + column(this,other.column) + { + Component::finish(other); + } + + // move + ColumnHeaders(ColumnHeaders &&other) : + 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 "alpha/v2.0/general/ColumnHeaders/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ColumnHeaders + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnHeaders/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnHeaders/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ColumnHeaders/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configuration.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configuration.hpp new file mode 100644 index 000000000..009e51fe0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configuration.hpp @@ -0,0 +1,232 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CONFIGURATION +#define ALPHA_V2_0_GENERAL_CONFIGURATION + +#include "alpha/v2.0/general/BindingEnergy.hpp" +#include "alpha/v2.0/general/DecayData.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(bindingEnergy(),Double); + GNDSTK_SHORTCUT(bindingEnergy().Double(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->subshell, \ + this->electronNumber, \ + this->bindingEnergy, \ + this->decayData \ + ) + + // default + Configuration() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Configuration( + const wrapper + &subshell, + const wrapper + &electronNumber = {}, + const wrapper + &bindingEnergy = {}, + const wrapper> + &decayData = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + subshell(this,subshell), + electronNumber(this,electronNumber), + bindingEnergy(this,bindingEnergy), + decayData(this,decayData) + { + Component::finish(); + } + + // from node + explicit Configuration(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Configuration(const Configuration &other) : + 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) : + 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 "alpha/v2.0/general/Configuration/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Configuration + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configuration/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configuration/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configuration/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configurations.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configurations.hpp new file mode 100644 index 000000000..2f2921f68 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configurations.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CONFIGURATIONS +#define ALPHA_V2_0_GENERAL_CONFIGURATIONS + +#include "alpha/v2.0/general/Configuration.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->configuration \ + ) + + // default + Configurations() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Configurations( + const wrapper> + &configuration + ) : + GNDSTK_COMPONENT(BlockData{}), + configuration(this,configuration) + { + Component::finish(); + } + + // from node + explicit Configurations(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Configurations(const Configurations &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + configuration(this,other.configuration) + { + Component::finish(other); + } + + // move + Configurations(Configurations &&other) : + 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 "alpha/v2.0/general/Configurations/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Configurations + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configurations/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configurations/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Configurations/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Constant1d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Constant1d.hpp new file mode 100644 index 000000000..e60baf6f2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Constant1d.hpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CONSTANT1D +#define ALPHA_V2_0_GENERAL_CONSTANT1D + +#include "alpha/v2.0/general/Axes.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->domainMin, \ + this->domainMax, \ + this->axes \ + ) + + // default + Constant1d() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Constant1d(const Constant1d &other) : + 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) : + 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 "alpha/v2.0/general/Constant1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Constant1d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Constant1d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Constant1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Constant1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Continuum.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Continuum.hpp new file mode 100644 index 000000000..62d97d708 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Continuum.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CONTINUUM +#define ALPHA_V2_0_GENERAL_CONTINUUM + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + Continuum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Continuum( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit Continuum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Continuum(const Continuum &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + Continuum(Continuum &&other) : + 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 "alpha/v2.0/general/Continuum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Continuum + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Continuum/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Continuum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Continuum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Conversion.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Conversion.hpp new file mode 100644 index 000000000..f04f42bef --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Conversion.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CONVERSION +#define ALPHA_V2_0_GENERAL_CONVERSION + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->flags, \ + this->href \ + ) + + // default + Conversion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Conversion( + const wrapper + &flags, + const wrapper + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + flags(this,flags), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Conversion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Conversion(const Conversion &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + flags(this,other.flags), + href(this,other.href) + { + Component::finish(other); + } + + // move + Conversion(Conversion &&other) : + 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 "alpha/v2.0/general/Conversion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Conversion + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Conversion/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Conversion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Conversion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoulombPlusNuclearElastic.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoulombPlusNuclearElastic.hpp new file mode 100644 index 000000000..511e0ff4a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoulombPlusNuclearElastic.hpp @@ -0,0 +1,283 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_COULOMBPLUSNUCLEARELASTIC +#define ALPHA_V2_0_GENERAL_COULOMBPLUSNUCLEARELASTIC + +#include "alpha/v2.0/general/RutherfordScattering.hpp" +#include "alpha/v2.0/general/NuclearAmplitudeExpansion.hpp" +#include "alpha/v2.0/general/NuclearPlusInterference.hpp" + +namespace alpha { +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 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CoulombPlusNuclearElastic(const CoulombPlusNuclearElastic &other) : + 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) : + 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 "alpha/v2.0/general/CoulombPlusNuclearElastic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CoulombPlusNuclearElastic + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoulombPlusNuclearElastic/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoulombPlusNuclearElastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CoulombPlusNuclearElastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Covariance.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Covariance.hpp new file mode 100644 index 000000000..a7c212c69 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Covariance.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_COVARIANCE +#define ALPHA_V2_0_GENERAL_COVARIANCE + +#include "alpha/v2.0/general/Array.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href, \ + this->array \ + ) + + // default + Covariance() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Covariance( + const wrapper> + &label, + const wrapper> + &href = {}, + const wrapper> + &array = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href), + array(this,array) + { + Component::finish(); + } + + // from node + explicit Covariance(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Covariance(const Covariance &other) : + 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) : + 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 "alpha/v2.0/general/Covariance/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Covariance + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Covariance/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Covariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Covariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceMatrix.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceMatrix.hpp new file mode 100644 index 000000000..29fd01a26 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceMatrix.hpp @@ -0,0 +1,234 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_COVARIANCEMATRIX +#define ALPHA_V2_0_GENERAL_COVARIANCEMATRIX + +#include "alpha/v2.0/general/Gridded2d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(gridded2d(),array); + GNDSTK_SHORTCUT(gridded2d(),axes); + GNDSTK_SHORTCUT(gridded2d().axes(),axis); + GNDSTK_SHORTCUT(gridded2d().axes(),grid); + GNDSTK_SHORTCUT(gridded2d().array(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->type, \ + this->productFrame, \ + this->gridded2d \ + ) + + // default + CovarianceMatrix() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CovarianceMatrix( + const wrapper + &label, + const wrapper + &type = {}, + const wrapper> + &productFrame = {}, + const wrapper + &gridded2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + type(this,type), + productFrame(this,productFrame), + gridded2d(this,gridded2d) + { + Component::finish(); + } + + // from node + explicit CovarianceMatrix(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceMatrix(const CovarianceMatrix &other) : + 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) : + 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 "alpha/v2.0/general/CovarianceMatrix/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CovarianceMatrix + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceMatrix/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSection.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSection.hpp new file mode 100644 index 000000000..b9e124361 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSection.hpp @@ -0,0 +1,271 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_COVARIANCESECTION +#define ALPHA_V2_0_GENERAL_COVARIANCESECTION + +#include "alpha/v2.0/general/RowData.hpp" +#include "alpha/v2.0/general/ColumnData.hpp" +#include "alpha/v2.0/general/CovarianceMatrix.hpp" +#include "alpha/v2.0/general/Mixed.hpp" +#include "alpha/v2.0/general/Sum.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->crossTerm, \ + this->rowData, \ + this->columnData, \ + this->covarianceMatrix, \ + this->mixed, \ + this->sum \ + ) + + // default + CovarianceSection() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceSection(const CovarianceSection &other) : + 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) : + 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 "alpha/v2.0/general/CovarianceSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CovarianceSection + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSection/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSections.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSections.hpp new file mode 100644 index 000000000..63a1aead5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSections.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_COVARIANCESECTIONS +#define ALPHA_V2_0_GENERAL_COVARIANCESECTIONS + +#include "alpha/v2.0/general/CovarianceSection.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->covarianceSection \ + ) + + // default + CovarianceSections() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CovarianceSections( + const wrapper> + &covarianceSection + ) : + GNDSTK_COMPONENT(BlockData{}), + covarianceSection(this,covarianceSection) + { + Component::finish(); + } + + // from node + explicit CovarianceSections(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceSections(const CovarianceSections &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + covarianceSection(this,other.covarianceSection) + { + Component::finish(other); + } + + // move + CovarianceSections(CovarianceSections &&other) : + 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 "alpha/v2.0/general/CovarianceSections/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CovarianceSections + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSections/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSections/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CovarianceSections/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSection.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSection.hpp new file mode 100644 index 000000000..0dd78bcb1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSection.hpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CROSSSECTION +#define ALPHA_V2_0_GENERAL_CROSSSECTION + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" +#include "alpha/v2.0/general/Reference.hpp" +#include "alpha/v2.0/general/ResonancesWithBackground.hpp" +#include "alpha/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d, \ + this->reference, \ + this->resonancesWithBackground, \ + this->CoulombPlusNuclearElastic, \ + this->thermalNeutronScatteringLaw1d \ + ) + + // default + CrossSection() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSection(const CrossSection &other) : + 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) : + 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 "alpha/v2.0/general/CrossSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CrossSection + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSection/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionReconstructed.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionReconstructed.hpp new file mode 100644 index 000000000..56ddf8f28 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionReconstructed.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CROSSSECTIONRECONSTRUCTED +#define ALPHA_V2_0_GENERAL_CROSSSECTIONRECONSTRUCTED + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->derivedFrom, \ + this->date \ + ) + + // default + CrossSectionReconstructed() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSectionReconstructed( + const wrapper + &label, + const wrapper + &derivedFrom = {}, + const wrapper + &date = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + derivedFrom(this,derivedFrom), + date(this,date) + { + Component::finish(); + } + + // from node + explicit CrossSectionReconstructed(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSectionReconstructed(const CrossSectionReconstructed &other) : + 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) : + 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 "alpha/v2.0/general/CrossSectionReconstructed/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CrossSectionReconstructed + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionReconstructed/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionReconstructed/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionReconstructed/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSum.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSum.hpp new file mode 100644 index 000000000..72e43db49 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSum.hpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CROSSSECTIONSUM +#define ALPHA_V2_0_GENERAL_CROSSSECTIONSUM + +#include "alpha/v2.0/general/Summands.hpp" +#include "alpha/v2.0/general/Q.hpp" +#include "alpha/v2.0/general/CrossSection.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(crossSection(),CoulombPlusNuclearElastic); + GNDSTK_SHORTCUT(Q(),Double); + GNDSTK_SHORTCUT(crossSection(),XYs1d); + GNDSTK_SHORTCUT(summands(),add); + GNDSTK_SHORTCUT(Q(),constant1d); + GNDSTK_SHORTCUT(crossSection(),reference); + GNDSTK_SHORTCUT(crossSection(),regions1d); + GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->summands, \ + this->Q, \ + this->crossSection \ + ) + + // default + CrossSectionSum() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSectionSum(const CrossSectionSum &other) : + 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) : + 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 "alpha/v2.0/general/CrossSectionSum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CrossSectionSum + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSum/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSums.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSums.hpp new file mode 100644 index 000000000..f2802e5ec --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSums.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_CROSSSECTIONSUMS +#define ALPHA_V2_0_GENERAL_CROSSSECTIONSUMS + +#include "alpha/v2.0/general/CrossSectionSum.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->crossSectionSum \ + ) + + // default + CrossSectionSums() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSectionSums( + const wrapper> + &crossSectionSum + ) : + GNDSTK_COMPONENT(BlockData{}), + crossSectionSum(this,crossSectionSum) + { + Component::finish(); + } + + // from node + explicit CrossSectionSums(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSectionSums(const CrossSectionSums &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + crossSectionSum(this,other.crossSectionSum) + { + Component::finish(other); + } + + // move + CrossSectionSums(CrossSectionSums &&other) : + 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 "alpha/v2.0/general/CrossSectionSums/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CrossSectionSums + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSums/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSums/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/CrossSectionSums/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Data.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Data.hpp new file mode 100644 index 000000000..3dee4dd0e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Data.hpp @@ -0,0 +1,176 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DATA +#define ALPHA_V2_0_GENERAL_DATA + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + Data() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Data(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Data(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Data(const Data &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Data(Data &&other) : + 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 "alpha/v2.0/general/Data/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Data + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Data/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Data/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Data/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Date.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Date.hpp new file mode 100644 index 000000000..bac65ed96 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Date.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DATE +#define ALPHA_V2_0_GENERAL_DATE + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->dateType \ + ) + + // default + Date() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Date( + const wrapper + &value, + const wrapper + &dateType = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + dateType(this,dateType) + { + Component::finish(); + } + + // from node + explicit Date(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Date(const Date &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + dateType(this,other.dateType) + { + Component::finish(other); + } + + // move + Date(Date &&other) : + 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 "alpha/v2.0/general/Date/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Date + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Date/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Date/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Date/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Dates.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Dates.hpp new file mode 100644 index 000000000..f068b2e60 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Dates.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DATES +#define ALPHA_V2_0_GENERAL_DATES + +#include "alpha/v2.0/general/Date.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date \ + ) + + // default + Dates() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Dates( + const wrapper> + &date + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date) + { + Component::finish(); + } + + // from node + explicit Dates(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Dates(const Dates &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date) + { + Component::finish(other); + } + + // move + Dates(Dates &&other) : + 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 "alpha/v2.0/general/Dates/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Dates + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Dates/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Dates/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Dates/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DebyeWallerIntegral.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DebyeWallerIntegral.hpp new file mode 100644 index 000000000..5aa8d6c3e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DebyeWallerIntegral.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DEBYEWALLERINTEGRAL +#define ALPHA_V2_0_GENERAL_DEBYEWALLERINTEGRAL + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + DebyeWallerIntegral() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DebyeWallerIntegral( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit DebyeWallerIntegral(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DebyeWallerIntegral(const DebyeWallerIntegral &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + DebyeWallerIntegral(DebyeWallerIntegral &&other) : + 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 "alpha/v2.0/general/DebyeWallerIntegral/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DebyeWallerIntegral + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DebyeWallerIntegral/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DebyeWallerIntegral/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DebyeWallerIntegral/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Decay.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Decay.hpp new file mode 100644 index 000000000..a4289c253 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Decay.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DECAY +#define ALPHA_V2_0_GENERAL_DECAY + +#include "alpha/v2.0/general/Products.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->mode, \ + this->complete, \ + this->products \ + ) + + // default + Decay() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Decay( + const wrapper + &index, + const wrapper> + &mode = {}, + const wrapper> + &complete = {}, + const wrapper> + &products = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + mode(this,mode), + complete(this,complete), + products(this,products) + { + Component::finish(); + } + + // from node + explicit Decay(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Decay(const Decay &other) : + 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) : + 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 "alpha/v2.0/general/Decay/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Decay + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Decay/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Decay/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Decay/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayData.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayData.hpp new file mode 100644 index 000000000..ecc9646cc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayData.hpp @@ -0,0 +1,199 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DECAYDATA +#define ALPHA_V2_0_GENERAL_DECAYDATA + +#include "alpha/v2.0/general/DecayModes.hpp" +#include "alpha/v2.0/general/AverageEnergies.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(decayModes(),decayMode); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->decayModes, \ + this->averageEnergies \ + ) + + // default + DecayData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayData( + const wrapper + &decayModes, + const wrapper> + &averageEnergies = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + decayModes(this,decayModes), + averageEnergies(this,averageEnergies) + { + Component::finish(); + } + + // from node + explicit DecayData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayData(const DecayData &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + decayModes(this,other.decayModes), + averageEnergies(this,other.averageEnergies) + { + Component::finish(other); + } + + // move + DecayData(DecayData &&other) : + 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 "alpha/v2.0/general/DecayData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DecayData + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayData/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayMode.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayMode.hpp new file mode 100644 index 000000000..8c5365945 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayMode.hpp @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DECAYMODE +#define ALPHA_V2_0_GENERAL_DECAYMODE + +#include "alpha/v2.0/general/Probability.hpp" +#include "alpha/v2.0/general/DecayPath.hpp" +#include "alpha/v2.0/general/PhotonEmissionProbabilities.hpp" +#include "alpha/v2.0/general/Q.hpp" +#include "alpha/v2.0/general/Spectra.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(decayPath(),decay); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->mode, \ + this->probability, \ + this->decayPath, \ + this->photonEmissionProbabilities, \ + this->Q, \ + this->spectra \ + ) + + // default + DecayMode() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayMode(const DecayMode &other) : + 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) : + 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 "alpha/v2.0/general/DecayMode/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DecayMode + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayMode/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayMode/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayMode/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayModes.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayModes.hpp new file mode 100644 index 000000000..029e326df --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayModes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DECAYMODES +#define ALPHA_V2_0_GENERAL_DECAYMODES + +#include "alpha/v2.0/general/DecayMode.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->decayMode \ + ) + + // default + DecayModes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayModes( + const wrapper> + &decayMode + ) : + GNDSTK_COMPONENT(BlockData{}), + decayMode(this,decayMode) + { + Component::finish(); + } + + // from node + explicit DecayModes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayModes(const DecayModes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + decayMode(this,other.decayMode) + { + Component::finish(other); + } + + // move + DecayModes(DecayModes &&other) : + 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 "alpha/v2.0/general/DecayModes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DecayModes + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayModes/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayModes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayModes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayPath.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayPath.hpp new file mode 100644 index 000000000..c45016fad --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayPath.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DECAYPATH +#define ALPHA_V2_0_GENERAL_DECAYPATH + +#include "alpha/v2.0/general/Decay.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->decay \ + ) + + // default + DecayPath() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayPath( + const wrapper> + &decay + ) : + GNDSTK_COMPONENT(BlockData{}), + decay(this,decay) + { + Component::finish(); + } + + // from node + explicit DecayPath(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayPath(const DecayPath &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + decay(this,other.decay) + { + Component::finish(other); + } + + // move + DecayPath(DecayPath &&other) : + 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 "alpha/v2.0/general/DecayPath/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DecayPath + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayPath/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayPath/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DecayPath/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedBetaEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedBetaEnergy.hpp new file mode 100644 index 000000000..5a005ce3c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedBetaEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DELAYEDBETAENERGY +#define ALPHA_V2_0_GENERAL_DELAYEDBETAENERGY + +#include "alpha/v2.0/general/Polynomial1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(polynomial1d(),axes); + GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + GNDSTK_SHORTCUT(polynomial1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + DelayedBetaEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedBetaEnergy( + const wrapper + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit DelayedBetaEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedBetaEnergy(const DelayedBetaEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + DelayedBetaEnergy(DelayedBetaEnergy &&other) : + 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 "alpha/v2.0/general/DelayedBetaEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedBetaEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedBetaEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedBetaEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedBetaEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedGammaEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedGammaEnergy.hpp new file mode 100644 index 000000000..df33d1e87 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedGammaEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DELAYEDGAMMAENERGY +#define ALPHA_V2_0_GENERAL_DELAYEDGAMMAENERGY + +#include "alpha/v2.0/general/Polynomial1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(polynomial1d(),axes); + GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + GNDSTK_SHORTCUT(polynomial1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + DelayedGammaEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedGammaEnergy( + const wrapper + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit DelayedGammaEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedGammaEnergy(const DelayedGammaEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + DelayedGammaEnergy(DelayedGammaEnergy &&other) : + 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 "alpha/v2.0/general/DelayedGammaEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedGammaEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedGammaEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedGammaEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedGammaEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutron.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutron.hpp new file mode 100644 index 000000000..50464473d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutron.hpp @@ -0,0 +1,229 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DELAYEDNEUTRON +#define ALPHA_V2_0_GENERAL_DELAYEDNEUTRON + +#include "alpha/v2.0/general/Rate.hpp" +#include "alpha/v2.0/reduced/Product.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(rate(),Double); + GNDSTK_SHORTCUT(product().multiplicity(),XYs1d); + GNDSTK_SHORTCUT(product().distribution(),XYs2d); + GNDSTK_SHORTCUT(product().multiplicity(),branching1d); + GNDSTK_SHORTCUT(product().multiplicity(),constant1d); + GNDSTK_SHORTCUT(product(),distribution); + GNDSTK_SHORTCUT(product(),multiplicity); + GNDSTK_SHORTCUT(product().multiplicity(),polynomial1d); + GNDSTK_SHORTCUT(product().multiplicity(),reference); + GNDSTK_SHORTCUT(product().multiplicity(),regions1d); + GNDSTK_SHORTCUT(product().distribution(),thermalNeutronScatteringLaw); + GNDSTK_SHORTCUT(rate().Double(),uncertainty); + GNDSTK_SHORTCUT(product().distribution(),uncorrelated); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->rate, \ + this->product \ + ) + + // default + DelayedNeutron() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedNeutron( + const wrapper + &label, + const wrapper + &rate = {}, + const wrapper + &product = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + rate(this,rate), + product(this,product) + { + Component::finish(); + } + + // from node + explicit DelayedNeutron(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedNeutron(const DelayedNeutron &other) : + 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) : + 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 "alpha/v2.0/general/DelayedNeutron/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedNeutron + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutron/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutron/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutron/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutronKE.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutronKE.hpp new file mode 100644 index 000000000..9f291c9c8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutronKE.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DELAYEDNEUTRONKE +#define ALPHA_V2_0_GENERAL_DELAYEDNEUTRONKE + +#include "alpha/v2.0/general/Polynomial1d.hpp" +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d, \ + this->XYs1d \ + ) + + // default + DelayedNeutronKE() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedNeutronKE( + const wrapper> + &polynomial1d, + const wrapper> + &XYs1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit DelayedNeutronKE(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedNeutronKE(const DelayedNeutronKE &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + DelayedNeutronKE(DelayedNeutronKE &&other) : + 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 "alpha/v2.0/general/DelayedNeutronKE/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedNeutronKE + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutronKE/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutronKE/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutronKE/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutrons.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutrons.hpp new file mode 100644 index 000000000..a909ef836 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutrons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DELAYEDNEUTRONS +#define ALPHA_V2_0_GENERAL_DELAYEDNEUTRONS + +#include "alpha/v2.0/general/DelayedNeutron.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->delayedNeutron \ + ) + + // default + DelayedNeutrons() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedNeutrons( + const wrapper> + &delayedNeutron + ) : + GNDSTK_COMPONENT(BlockData{}), + delayedNeutron(this,delayedNeutron) + { + Component::finish(); + } + + // from node + explicit DelayedNeutrons(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedNeutrons(const DelayedNeutrons &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + delayedNeutron(this,other.delayedNeutron) + { + Component::finish(other); + } + + // move + DelayedNeutrons(DelayedNeutrons &&other) : + 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 "alpha/v2.0/general/DelayedNeutrons/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedNeutrons + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutrons/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutrons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DelayedNeutrons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Discrete.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Discrete.hpp new file mode 100644 index 000000000..164150eda --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Discrete.hpp @@ -0,0 +1,256 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DISCRETE +#define ALPHA_V2_0_GENERAL_DISCRETE + +#include "alpha/v2.0/general/Intensity.hpp" +#include "alpha/v2.0/general/Energy.hpp" +#include "alpha/v2.0/general/InternalConversionCoefficients.hpp" +#include "alpha/v2.0/general/PositronEmissionIntensity.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(energy(),Double); + GNDSTK_SHORTCUT(energy(),MadlandNix); + GNDSTK_SHORTCUT(energy(),NBodyPhaseSpace); + GNDSTK_SHORTCUT(energy(),XYs2d); + GNDSTK_SHORTCUT(energy(),discreteGamma); + GNDSTK_SHORTCUT(energy(),evaporation); + GNDSTK_SHORTCUT(energy(),generalEvaporation); + GNDSTK_SHORTCUT(energy(),primaryGamma); + GNDSTK_SHORTCUT(energy(),simpleMaxwellianFission); + GNDSTK_SHORTCUT(energy(),weightedFunctionals); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->type, \ + this->intensity, \ + this->energy, \ + this->internalConversionCoefficients, \ + this->positronEmissionIntensity \ + ) + + // default + Discrete() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Discrete(const Discrete &other) : + 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) : + 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 "alpha/v2.0/general/Discrete/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Discrete + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Discrete/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Discrete/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Discrete/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DiscreteGamma.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DiscreteGamma.hpp new file mode 100644 index 000000000..65d4929b8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DiscreteGamma.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DISCRETEGAMMA +#define ALPHA_V2_0_GENERAL_DISCRETEGAMMA + +#include "alpha/v2.0/general/Axes.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->domainMin, \ + this->domainMax, \ + this->axes \ + ) + + // default + DiscreteGamma() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DiscreteGamma( + const wrapper + &value, + const wrapper + &domainMin = {}, + const wrapper + &domainMax = {}, + const wrapper + &axes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit DiscreteGamma(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DiscreteGamma(const DiscreteGamma &other) : + 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) : + 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 "alpha/v2.0/general/DiscreteGamma/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DiscreteGamma + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DiscreteGamma/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DiscreteGamma/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DiscreteGamma/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Distribution.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Distribution.hpp new file mode 100644 index 000000000..2019c225d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Distribution.hpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DISTRIBUTION +#define ALPHA_V2_0_GENERAL_DISTRIBUTION + +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "alpha/v2.0/general/Uncorrelated.hpp" +#include "alpha/v2.0/general/Unspecified.hpp" +#include "alpha/v2.0/general/Branching3d.hpp" +#include "alpha/v2.0/general/AngularTwoBody.hpp" +#include "alpha/v2.0/general/EnergyAngular.hpp" +#include "alpha/v2.0/general/KalbachMann.hpp" +#include "alpha/v2.0/general/AngularEnergy.hpp" +#include "alpha/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "alpha/v2.0/general/CoherentPhotonScattering.hpp" +#include "alpha/v2.0/general/IncoherentPhotonScattering.hpp" + +namespace alpha { +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 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Distribution(const Distribution &other) : + 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) : + 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 "alpha/v2.0/general/Distribution/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Distribution + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Distribution/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Distribution/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Distribution/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Documentation.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Documentation.hpp new file mode 100644 index 000000000..517952d11 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Documentation.hpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DOCUMENTATION +#define ALPHA_V2_0_GENERAL_DOCUMENTATION + +#include "alpha/v2.0/general/Authors.hpp" +#include "alpha/v2.0/general/Dates.hpp" +#include "alpha/v2.0/general/Title.hpp" +#include "alpha/v2.0/general/Body.hpp" +#include "alpha/v2.0/general/EndfCompatible.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(authors(),author); + GNDSTK_SHORTCUT(dates(),date); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->authors, \ + this->dates, \ + this->title, \ + this->body, \ + this->endfCompatible \ + ) + + // default + Documentation() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Documentation(const Documentation &other) : + 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) : + 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 "alpha/v2.0/general/Documentation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Documentation + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Documentation/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Documentation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Documentation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Double.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Double.hpp new file mode 100644 index 000000000..765ea7aac --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Double.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DOUBLE +#define ALPHA_V2_0_GENERAL_DOUBLE + +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit, \ + this->uncertainty \ + ) + + // default + Double() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Double( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper> + &unit = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Double(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Double(const Double &other) : + 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) : + 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 "alpha/v2.0/general/Double/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Double + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Double/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Double/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Double/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DoubleDifferentialCrossSection.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DoubleDifferentialCrossSection.hpp new file mode 100644 index 000000000..cb1bf63f2 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DoubleDifferentialCrossSection.hpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_DOUBLEDIFFERENTIALCROSSSECTION +#define ALPHA_V2_0_GENERAL_DOUBLEDIFFERENTIALCROSSSECTION + +#include "alpha/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "alpha/v2.0/general/CoherentPhotonScattering.hpp" +#include "alpha/v2.0/general/IncoherentPhotonScattering.hpp" +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->CoulombPlusNuclearElastic, \ + this->coherentPhotonScattering, \ + this->incoherentPhotonScattering, \ + this->thermalNeutronScatteringLaw_coherentElastic, \ + this->thermalNeutronScatteringLaw_incoherentElastic, \ + this->thermalNeutronScatteringLaw_incoherentInelastic \ + ) + + // default + DoubleDifferentialCrossSection() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DoubleDifferentialCrossSection(const DoubleDifferentialCrossSection &other) : + 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) : + 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 "alpha/v2.0/general/DoubleDifferentialCrossSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DoubleDifferentialCrossSection + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DoubleDifferentialCrossSection/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DoubleDifferentialCrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/DoubleDifferentialCrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFH.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFH.hpp new file mode 100644 index 000000000..e4951d616 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFH.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_EFH +#define ALPHA_V2_0_GENERAL_EFH + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + EFH() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EFH( + const wrapper + &value, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit EFH(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EFH(const EFH &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + EFH(EFH &&other) : + 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 "alpha/v2.0/general/EFH/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EFH + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFH/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFH/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFH/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFL.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFL.hpp new file mode 100644 index 000000000..deddf1d4e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFL.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_EFL +#define ALPHA_V2_0_GENERAL_EFL + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + EFL() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EFL( + const wrapper + &value, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit EFL(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EFL(const EFL &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + EFL(EFL &&other) : + 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 "alpha/v2.0/general/EFL/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EFL + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFL/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFL/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EFL/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ENDFconversionFlags.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ENDFconversionFlags.hpp new file mode 100644 index 000000000..dfe9a6d7b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ENDFconversionFlags.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ENDFCONVERSIONFLAGS +#define ALPHA_V2_0_GENERAL_ENDFCONVERSIONFLAGS + +#include "alpha/v2.0/general/Conversion.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->flags, \ + this->href, \ + this->conversion \ + ) + + // default + ENDFconversionFlags() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ENDFconversionFlags( + const wrapper> + &flags, + const wrapper> + &href = {}, + const wrapper> + &conversion = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + flags(this,flags), + href(this,href), + conversion(this,conversion) + { + Component::finish(); + } + + // from node + explicit ENDFconversionFlags(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ENDFconversionFlags(const ENDFconversionFlags &other) : + 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) : + 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 "alpha/v2.0/general/ENDFconversionFlags/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ENDFconversionFlags + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ENDFconversionFlags/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ENDFconversionFlags/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ENDFconversionFlags/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_critical.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_critical.hpp new file mode 100644 index 000000000..f04f0a334 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_critical.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_E_CRITICAL +#define ALPHA_V2_0_GENERAL_E_CRITICAL + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + E_critical() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit E_critical( + const wrapper + &value, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit E_critical(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + E_critical(const E_critical &other) : + 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) : + 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 "alpha/v2.0/general/E_critical/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class E_critical + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_critical/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_critical/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_critical/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_max.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_max.hpp new file mode 100644 index 000000000..58937884b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_max.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_E_MAX +#define ALPHA_V2_0_GENERAL_E_MAX + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + E_max() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit E_max( + const wrapper + &value, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit E_max(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + E_max(const E_max &other) : + 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) : + 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 "alpha/v2.0/general/E_max/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class E_max + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_max/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_max/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/E_max/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTime.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTime.hpp new file mode 100644 index 000000000..d9246be0a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTime.hpp @@ -0,0 +1,233 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ELAPSEDTIME +#define ALPHA_V2_0_GENERAL_ELAPSEDTIME + +#include "alpha/v2.0/general/Time.hpp" +#include "alpha/v2.0/general/Yields.hpp" +#include "alpha/v2.0/general/IncidentEnergies.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(time(),Double); + GNDSTK_SHORTCUT(time(),string); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->time, \ + this->yields, \ + this->incidentEnergies \ + ) + + // default + ElapsedTime() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ElapsedTime( + const wrapper + &label, + const wrapper + &time = {}, + const wrapper> + &yields = {}, + const wrapper> + &incidentEnergies = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + time(this,time), + yields(this,yields), + incidentEnergies(this,incidentEnergies) + { + Component::finish(); + } + + // from node + explicit ElapsedTime(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ElapsedTime(const ElapsedTime &other) : + 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) : + 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 "alpha/v2.0/general/ElapsedTime/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ElapsedTime + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTime/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTime/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTime/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTimes.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTimes.hpp new file mode 100644 index 000000000..e3033b501 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTimes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ELAPSEDTIMES +#define ALPHA_V2_0_GENERAL_ELAPSEDTIMES + +#include "alpha/v2.0/general/ElapsedTime.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->elapsedTime \ + ) + + // default + ElapsedTimes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ElapsedTimes( + const wrapper> + &elapsedTime + ) : + GNDSTK_COMPONENT(BlockData{}), + elapsedTime(this,elapsedTime) + { + Component::finish(); + } + + // from node + explicit ElapsedTimes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ElapsedTimes(const ElapsedTimes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + elapsedTime(this,other.elapsedTime) + { + Component::finish(other); + } + + // move + ElapsedTimes(ElapsedTimes &&other) : + 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 "alpha/v2.0/general/ElapsedTimes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ElapsedTimes + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTimes/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTimes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ElapsedTimes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EndfCompatible.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EndfCompatible.hpp new file mode 100644 index 000000000..bcece649e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EndfCompatible.hpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ENDFCOMPATIBLE +#define ALPHA_V2_0_GENERAL_ENDFCOMPATIBLE + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + EndfCompatible() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit EndfCompatible(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EndfCompatible(const EndfCompatible &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + EndfCompatible(EndfCompatible &&other) : + 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 "alpha/v2.0/general/EndfCompatible/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EndfCompatible + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EndfCompatible/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EndfCompatible/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EndfCompatible/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Energy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Energy.hpp new file mode 100644 index 000000000..76812d218 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Energy.hpp @@ -0,0 +1,361 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ENERGY +#define ALPHA_V2_0_GENERAL_ENERGY + +#include "alpha/v2.0/general/Double.hpp" +#include "alpha/v2.0/general/Uncertainty.hpp" +#include "alpha/v2.0/general/NBodyPhaseSpace.hpp" +#include "alpha/v2.0/general/PrimaryGamma.hpp" +#include "alpha/v2.0/general/DiscreteGamma.hpp" +#include "alpha/v2.0/general/XYs2d.hpp" +#include "alpha/v2.0/general/GeneralEvaporation.hpp" +#include "alpha/v2.0/general/Evaporation.hpp" +#include "alpha/v2.0/general/WeightedFunctionals.hpp" +#include "alpha/v2.0/general/SimpleMaxwellianFission.hpp" +#include "alpha/v2.0/general/MadlandNix.hpp" + +namespace alpha { +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 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Energy(const Energy &other) : + 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) : + 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 "alpha/v2.0/general/Energy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Energy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Energy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Energy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Energy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EnergyAngular.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EnergyAngular.hpp new file mode 100644 index 000000000..4fe737c3b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EnergyAngular.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ENERGYANGULAR +#define ALPHA_V2_0_GENERAL_ENERGYANGULAR + +#include "alpha/v2.0/general/XYs3d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->XYs3d \ + ) + + // default + EnergyAngular() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EnergyAngular( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper> + &XYs3d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + XYs3d(this,XYs3d) + { + Component::finish(); + } + + // from node + explicit EnergyAngular(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EnergyAngular(const EnergyAngular &other) : + 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) : + 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 "alpha/v2.0/general/EnergyAngular/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EnergyAngular + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EnergyAngular/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EnergyAngular/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/EnergyAngular/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaluated.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaluated.hpp new file mode 100644 index 000000000..60936a002 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaluated.hpp @@ -0,0 +1,279 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_EVALUATED +#define ALPHA_V2_0_GENERAL_EVALUATED + +#include "alpha/v2.0/general/Documentation.hpp" +#include "alpha/v2.0/general/Temperature.hpp" +#include "alpha/v2.0/general/ProjectileEnergyDomain.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(documentation().authors(),author); + GNDSTK_SHORTCUT(documentation(),authors); + GNDSTK_SHORTCUT(documentation(),body); + GNDSTK_SHORTCUT(documentation(),dates); + GNDSTK_SHORTCUT(documentation(),endfCompatible); + GNDSTK_SHORTCUT(documentation(),title); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->date, \ + this->library, \ + this->version, \ + this->documentation, \ + this->temperature, \ + this->projectileEnergyDomain \ + ) + + // default + Evaluated() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Evaluated(const Evaluated &other) : + 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) : + 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 "alpha/v2.0/general/Evaluated/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Evaluated + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaluated/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaluated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaluated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaporation.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaporation.hpp new file mode 100644 index 000000000..5dba659cf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaporation.hpp @@ -0,0 +1,200 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_EVAPORATION +#define ALPHA_V2_0_GENERAL_EVAPORATION + +#include "alpha/v2.0/general/U.hpp" +#include "alpha/v2.0/general/Theta.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(theta(),XYs1d); + GNDSTK_SHORTCUT(theta(),regions1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->theta \ + ) + + // default + Evaporation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Evaporation( + const wrapper + &U, + const wrapper + &theta = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + U(this,U), + theta(this,theta) + { + Component::finish(); + } + + // from node + explicit Evaporation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Evaporation(const Evaporation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + U(this,other.U), + theta(this,other.theta) + { + Component::finish(other); + } + + // move + Evaporation(Evaporation &&other) : + 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 "alpha/v2.0/general/Evaporation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Evaporation + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaporation/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaporation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Evaporation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFile.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFile.hpp new file mode 100644 index 000000000..e9371d326 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFile.hpp @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_EXTERNALFILE +#define ALPHA_V2_0_GENERAL_EXTERNALFILE + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->path, \ + this->checksum, \ + this->algorithm \ + ) + + // default + ExternalFile() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ExternalFile( + const wrapper + &label, + const wrapper + &path = {}, + const wrapper> + &checksum = {}, + const wrapper> + &algorithm = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + path(this,path), + checksum(this,checksum), + algorithm(this,algorithm) + { + Component::finish(); + } + + // from node + explicit ExternalFile(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExternalFile(const ExternalFile &other) : + 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) : + 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 "alpha/v2.0/general/ExternalFile/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ExternalFile + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFile/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFile/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFile/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFiles.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFiles.hpp new file mode 100644 index 000000000..44c819bfb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFiles.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_EXTERNALFILES +#define ALPHA_V2_0_GENERAL_EXTERNALFILES + +#include "alpha/v2.0/general/ExternalFile.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->externalFile \ + ) + + // default + ExternalFiles() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ExternalFiles( + const wrapper> + &externalFile + ) : + GNDSTK_COMPONENT(BlockData{}), + externalFile(this,externalFile) + { + Component::finish(); + } + + // from node + explicit ExternalFiles(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExternalFiles(const ExternalFiles &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + externalFile(this,other.externalFile) + { + Component::finish(other); + } + + // move + ExternalFiles(ExternalFiles &&other) : + 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 "alpha/v2.0/general/ExternalFiles/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ExternalFiles + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFiles/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFiles/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ExternalFiles/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/F.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/F.hpp new file mode 100644 index 000000000..a0e784589 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/F.hpp @@ -0,0 +1,189 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_F +#define ALPHA_V2_0_GENERAL_F + +#include "alpha/v2.0/general/XYs2d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs2d().function1ds(),Legendre); + GNDSTK_SHORTCUT(XYs2d().function1ds(),XYs1d); + GNDSTK_SHORTCUT(XYs2d(),axes); + GNDSTK_SHORTCUT(XYs2d(),function1ds); + GNDSTK_SHORTCUT(XYs2d().function1ds(),regions1d); + GNDSTK_SHORTCUT(XYs2d(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d \ + ) + + // default + F() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit F( + const wrapper + &XYs2d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit F(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + F(const F &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + F(F &&other) : + 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 "alpha/v2.0/general/F/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class F + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/F/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/F/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/F/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FastRegion.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FastRegion.hpp new file mode 100644 index 000000000..90d5c9aed --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FastRegion.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FASTREGION +#define ALPHA_V2_0_GENERAL_FASTREGION + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + FastRegion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FastRegion( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit FastRegion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FastRegion(const FastRegion &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + FastRegion(FastRegion &&other) : + 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 "alpha/v2.0/general/FastRegion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FastRegion + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FastRegion/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FastRegion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FastRegion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponent.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponent.hpp new file mode 100644 index 000000000..a7cb375bd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponent.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FISSIONCOMPONENT +#define ALPHA_V2_0_GENERAL_FISSIONCOMPONENT + +#include "alpha/v2.0/general/CrossSection.hpp" +#include "alpha/v2.0/general/OutputChannel.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(crossSection(),CoulombPlusNuclearElastic); + GNDSTK_SHORTCUT(outputChannel().Q(),Double); + GNDSTK_SHORTCUT(outputChannel(),Q); + GNDSTK_SHORTCUT(crossSection(),XYs1d); + GNDSTK_SHORTCUT(outputChannel().Q(),constant1d); + GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + GNDSTK_SHORTCUT(outputChannel(),products); + GNDSTK_SHORTCUT(crossSection(),reference); + GNDSTK_SHORTCUT(crossSection(),regions1d); + GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->fissionGenre, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + FissionComponent() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionComponent(const FissionComponent &other) : + 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) : + 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 "alpha/v2.0/general/FissionComponent/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FissionComponent + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponent/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponent/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponent/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponents.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponents.hpp new file mode 100644 index 000000000..629b968fb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponents.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FISSIONCOMPONENTS +#define ALPHA_V2_0_GENERAL_FISSIONCOMPONENTS + +#include "alpha/v2.0/general/FissionComponent.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->fissionComponent \ + ) + + // default + FissionComponents() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionComponents( + const wrapper>> + &fissionComponent + ) : + GNDSTK_COMPONENT(BlockData{}), + fissionComponent(this,fissionComponent) + { + Component::finish(); + } + + // from node + explicit FissionComponents(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionComponents(const FissionComponents &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + fissionComponent(this,other.fissionComponent) + { + Component::finish(other); + } + + // move + FissionComponents(FissionComponents &&other) : + 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 "alpha/v2.0/general/FissionComponents/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FissionComponents + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponents/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponents/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionComponents/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyRelease.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyRelease.hpp new file mode 100644 index 000000000..add8beb74 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyRelease.hpp @@ -0,0 +1,317 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FISSIONENERGYRELEASE +#define ALPHA_V2_0_GENERAL_FISSIONENERGYRELEASE + +#include "alpha/v2.0/general/PromptProductKE.hpp" +#include "alpha/v2.0/general/PromptNeutronKE.hpp" +#include "alpha/v2.0/general/DelayedNeutronKE.hpp" +#include "alpha/v2.0/general/PromptGammaEnergy.hpp" +#include "alpha/v2.0/general/DelayedGammaEnergy.hpp" +#include "alpha/v2.0/general/DelayedBetaEnergy.hpp" +#include "alpha/v2.0/general/NeutrinoEnergy.hpp" +#include "alpha/v2.0/general/NonNeutrinoEnergy.hpp" +#include "alpha/v2.0/general/TotalEnergy.hpp" + +namespace alpha { +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 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionEnergyRelease(const FissionEnergyRelease &other) : + 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) : + 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 "alpha/v2.0/general/FissionEnergyRelease/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FissionEnergyRelease + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyRelease/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyRelease/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyRelease/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyReleases.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyReleases.hpp new file mode 100644 index 000000000..4028fd710 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyReleases.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FISSIONENERGYRELEASES +#define ALPHA_V2_0_GENERAL_FISSIONENERGYRELEASES + +#include "alpha/v2.0/general/FissionEnergyRelease.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->fissionEnergyRelease \ + ) + + // default + FissionEnergyReleases() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionEnergyReleases( + const wrapper> + &fissionEnergyRelease + ) : + GNDSTK_COMPONENT(BlockData{}), + fissionEnergyRelease(this,fissionEnergyRelease) + { + Component::finish(); + } + + // from node + explicit FissionEnergyReleases(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionEnergyReleases(const FissionEnergyReleases &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + fissionEnergyRelease(this,other.fissionEnergyRelease) + { + Component::finish(other); + } + + // move + FissionEnergyReleases(FissionEnergyReleases &&other) : + 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 "alpha/v2.0/general/FissionEnergyReleases/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FissionEnergyReleases + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyReleases/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyReleases/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FissionEnergyReleases/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FormFactor.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FormFactor.hpp new file mode 100644 index 000000000..18a95d332 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FormFactor.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FORMFACTOR +#define ALPHA_V2_0_GENERAL_FORMFACTOR + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + FormFactor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FormFactor( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit FormFactor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FormFactor(const FormFactor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + FormFactor(FormFactor &&other) : + 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 "alpha/v2.0/general/FormFactor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FormFactor + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FormFactor/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FormFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FormFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Fraction.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Fraction.hpp new file mode 100644 index 000000000..571c5ae9a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Fraction.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FRACTION +#define ALPHA_V2_0_GENERAL_FRACTION + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit \ + ) + + // default + Fraction() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Fraction( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Fraction(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Fraction(const Fraction &other) : + 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) : + 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 "alpha/v2.0/general/Fraction/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Fraction + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Fraction/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Fraction/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Fraction/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FreeGasApproximation.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FreeGasApproximation.hpp new file mode 100644 index 000000000..c17907550 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FreeGasApproximation.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FREEGASAPPROXIMATION +#define ALPHA_V2_0_GENERAL_FREEGASAPPROXIMATION + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + FreeGasApproximation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit FreeGasApproximation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FreeGasApproximation(const FreeGasApproximation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + FreeGasApproximation(FreeGasApproximation &&other) : + 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 "alpha/v2.0/general/FreeGasApproximation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FreeGasApproximation + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FreeGasApproximation/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FreeGasApproximation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/FreeGasApproximation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function1ds.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function1ds.hpp new file mode 100644 index 000000000..7c338f888 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function1ds.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FUNCTION1DS +#define ALPHA_V2_0_GENERAL_FUNCTION1DS + +#include "alpha/v2.0/general/Legendre.hpp" +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Legendre, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + Function1ds() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Function1ds( + const wrapper> + &Legendre, + const wrapper>> + &XYs1d = {}, + const wrapper>> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + Legendre(this,Legendre), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit Function1ds(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Function1ds(const Function1ds &other) : + 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) : + 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 "alpha/v2.0/general/Function1ds/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Function1ds + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function1ds/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function1ds/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function1ds/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function2ds.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function2ds.hpp new file mode 100644 index 000000000..f662def21 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function2ds.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_FUNCTION2DS +#define ALPHA_V2_0_GENERAL_FUNCTION2DS + +#include "alpha/v2.0/general/XYs2d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d \ + ) + + // default + Function2ds() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Function2ds( + const wrapper> + &XYs2d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit Function2ds(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Function2ds(const Function2ds &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + Function2ds(Function2ds &&other) : + 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 "alpha/v2.0/general/Function2ds/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Function2ds + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function2ds/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function2ds/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Function2ds/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/G.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/G.hpp new file mode 100644 index 000000000..a918a938f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/G.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_G +#define ALPHA_V2_0_GENERAL_G + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + G() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit G( + const wrapper> + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit G(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + G(const G &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + G(G &&other) : + 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 "alpha/v2.0/general/G/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class G + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/G/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/G/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/G/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBoson.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBoson.hpp new file mode 100644 index 000000000..e72760a71 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBoson.hpp @@ -0,0 +1,263 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_GAUGEBOSON +#define ALPHA_V2_0_GENERAL_GAUGEBOSON + +#include "alpha/v2.0/general/Mass.hpp" +#include "alpha/v2.0/general/Spin.hpp" +#include "alpha/v2.0/general/Parity.hpp" +#include "alpha/v2.0/general/Charge.hpp" +#include "alpha/v2.0/general/Halflife.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(spin(),fraction); + GNDSTK_SHORTCUT(halflife(),string); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->charge, \ + this->halflife \ + ) + + // default + GaugeBoson() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GaugeBoson(const GaugeBoson &other) : + 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) : + 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 "alpha/v2.0/general/GaugeBoson/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class GaugeBoson + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBoson/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBoson/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBoson/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBosons.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBosons.hpp new file mode 100644 index 000000000..4b5b23e8f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBosons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_GAUGEBOSONS +#define ALPHA_V2_0_GENERAL_GAUGEBOSONS + +#include "alpha/v2.0/general/GaugeBoson.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->gaugeBoson \ + ) + + // default + GaugeBosons() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GaugeBosons( + const wrapper> + &gaugeBoson + ) : + GNDSTK_COMPONENT(BlockData{}), + gaugeBoson(this,gaugeBoson) + { + Component::finish(); + } + + // from node + explicit GaugeBosons(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GaugeBosons(const GaugeBosons &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + gaugeBoson(this,other.gaugeBoson) + { + Component::finish(other); + } + + // move + GaugeBosons(GaugeBosons &&other) : + 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 "alpha/v2.0/general/GaugeBosons/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class GaugeBosons + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBosons/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBosons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GaugeBosons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GeneralEvaporation.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GeneralEvaporation.hpp new file mode 100644 index 000000000..fd31fd042 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GeneralEvaporation.hpp @@ -0,0 +1,214 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_GENERALEVAPORATION +#define ALPHA_V2_0_GENERAL_GENERALEVAPORATION + +#include "alpha/v2.0/general/U.hpp" +#include "alpha/v2.0/general/Theta.hpp" +#include "alpha/v2.0/general/G.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(theta(),regions1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->theta, \ + this->g \ + ) + + // default + GeneralEvaporation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GeneralEvaporation( + const wrapper + &U, + const wrapper + &theta = {}, + const wrapper + &g = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + U(this,U), + theta(this,theta), + g(this,g) + { + Component::finish(); + } + + // from node + explicit GeneralEvaporation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GeneralEvaporation(const GeneralEvaporation &other) : + 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) : + 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 "alpha/v2.0/general/GeneralEvaporation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class GeneralEvaporation + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GeneralEvaporation/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GeneralEvaporation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/GeneralEvaporation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Grid.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Grid.hpp new file mode 100644 index 000000000..f0921eaa1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Grid.hpp @@ -0,0 +1,268 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_GRID +#define ALPHA_V2_0_GENERAL_GRID + +#include "alpha/v2.0/general/Link.hpp" +#include "alpha/v2.0/general/Values.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->label, \ + this->unit, \ + this->style, \ + this->interpolation, \ + this->link, \ + this->values \ + ) + + // default + Grid() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Grid(const Grid &other) : + 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) : + 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 "alpha/v2.0/general/Grid/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Grid + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Grid/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Grid/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Grid/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded2d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded2d.hpp new file mode 100644 index 000000000..2626ac800 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded2d.hpp @@ -0,0 +1,200 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_GRIDDED2D +#define ALPHA_V2_0_GENERAL_GRIDDED2D + +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/g2d/Array.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->axes, \ + this->array \ + ) + + // default + Gridded2d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Gridded2d( + const wrapper + &axes, + const wrapper + &array = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + axes(this,axes), + array(this,array) + { + Component::finish(); + } + + // from node + explicit Gridded2d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Gridded2d(const Gridded2d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + axes(this,other.axes), + array(this,other.array) + { + Component::finish(other); + } + + // move + Gridded2d(Gridded2d &&other) : + 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 "alpha/v2.0/general/Gridded2d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Gridded2d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded2d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded3d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded3d.hpp new file mode 100644 index 000000000..9b15d6435 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded3d.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_GRIDDED3D +#define ALPHA_V2_0_GENERAL_GRIDDED3D + +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/g3d/Array.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + GNDSTK_SHORTCUT(array(),lengths); + GNDSTK_SHORTCUT(array(),starts); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->axes, \ + this->array \ + ) + + // default + Gridded3d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Gridded3d( + const wrapper + &axes, + const wrapper + &array = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + axes(this,axes), + array(this,array) + { + Component::finish(); + } + + // from node + explicit Gridded3d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Gridded3d(const Gridded3d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + axes(this,other.axes), + array(this,other.array) + { + Component::finish(other); + } + + // move + Gridded3d(Gridded3d &&other) : + 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 "alpha/v2.0/general/Gridded3d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Gridded3d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded3d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Gridded3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Halflife.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Halflife.hpp new file mode 100644 index 000000000..ececa1f00 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Halflife.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_HALFLIFE +#define ALPHA_V2_0_GENERAL_HALFLIFE + +#include "alpha/v2.0/general/String.hpp" +#include "alpha/v2.0/general/Double.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->string, \ + this->Double \ + ) + + // default + Halflife() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Halflife( + const wrapper> + &string, + const wrapper> + &Double = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + string(this,string), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Halflife(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Halflife(const Halflife &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + string(this,other.string), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Halflife(Halflife &&other) : + 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 "alpha/v2.0/general/Halflife/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Halflife + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Halflife/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Halflife/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Halflife/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/HardSphereRadius.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/HardSphereRadius.hpp new file mode 100644 index 000000000..7128e4912 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/HardSphereRadius.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_HARDSPHERERADIUS +#define ALPHA_V2_0_GENERAL_HARDSPHERERADIUS + +#include "alpha/v2.0/general/Constant1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(constant1d(),axes); + GNDSTK_SHORTCUT(constant1d().axes(),axis); + GNDSTK_SHORTCUT(constant1d().axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->constant1d \ + ) + + // default + HardSphereRadius() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit HardSphereRadius( + const wrapper + &constant1d + ) : + GNDSTK_COMPONENT(BlockData{}), + constant1d(this,constant1d) + { + Component::finish(); + } + + // from node + explicit HardSphereRadius(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + HardSphereRadius(const HardSphereRadius &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + constant1d(this,other.constant1d) + { + Component::finish(other); + } + + // move + HardSphereRadius(HardSphereRadius &&other) : + 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 "alpha/v2.0/general/HardSphereRadius/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class HardSphereRadius + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/HardSphereRadius/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/HardSphereRadius/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/HardSphereRadius/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryAnomalousFactor.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryAnomalousFactor.hpp new file mode 100644 index 000000000..e7ed8edbe --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryAnomalousFactor.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_IMAGINARYANOMALOUSFACTOR +#define ALPHA_V2_0_GENERAL_IMAGINARYANOMALOUSFACTOR + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + ImaginaryAnomalousFactor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ImaginaryAnomalousFactor( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit ImaginaryAnomalousFactor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ImaginaryAnomalousFactor(const ImaginaryAnomalousFactor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + ImaginaryAnomalousFactor(ImaginaryAnomalousFactor &&other) : + 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 "alpha/v2.0/general/ImaginaryAnomalousFactor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ImaginaryAnomalousFactor + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryAnomalousFactor/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryAnomalousFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryAnomalousFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryInterferenceTerm.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryInterferenceTerm.hpp new file mode 100644 index 000000000..886f50c48 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryInterferenceTerm.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_IMAGINARYINTERFERENCETERM +#define ALPHA_V2_0_GENERAL_IMAGINARYINTERFERENCETERM + +#include "alpha/v2.0/general/Regions2d.hpp" +#include "alpha/v2.0/general/XYs2d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->regions2d, \ + this->XYs2d \ + ) + + // default + ImaginaryInterferenceTerm() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ImaginaryInterferenceTerm( + const wrapper> + ®ions2d, + const wrapper> + &XYs2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + regions2d(this,regions2d), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit ImaginaryInterferenceTerm(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ImaginaryInterferenceTerm(const ImaginaryInterferenceTerm &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + regions2d(this,other.regions2d), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + ImaginaryInterferenceTerm(ImaginaryInterferenceTerm &&other) : + 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 "alpha/v2.0/general/ImaginaryInterferenceTerm/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ImaginaryInterferenceTerm + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryInterferenceTerm/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryInterferenceTerm/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ImaginaryInterferenceTerm/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergies.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergies.hpp new file mode 100644 index 000000000..f250a396b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergies.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_INCIDENTENERGIES +#define ALPHA_V2_0_GENERAL_INCIDENTENERGIES + +#include "alpha/v2.0/general/IncidentEnergy.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->incidentEnergy \ + ) + + // default + IncidentEnergies() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncidentEnergies( + const wrapper> + &incidentEnergy + ) : + GNDSTK_COMPONENT(BlockData{}), + incidentEnergy(this,incidentEnergy) + { + Component::finish(); + } + + // from node + explicit IncidentEnergies(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncidentEnergies(const IncidentEnergies &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + incidentEnergy(this,other.incidentEnergy) + { + Component::finish(other); + } + + // move + IncidentEnergies(IncidentEnergies &&other) : + 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 "alpha/v2.0/general/IncidentEnergies/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class IncidentEnergies + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergies/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergies/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergies/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergy.hpp new file mode 100644 index 000000000..da09e95b9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergy.hpp @@ -0,0 +1,228 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_INCIDENTENERGY +#define ALPHA_V2_0_GENERAL_INCIDENTENERGY + +#include "alpha/v2.0/general/Energy.hpp" +#include "alpha/v2.0/general/Yields.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(energy(),Double); + GNDSTK_SHORTCUT(energy(),MadlandNix); + GNDSTK_SHORTCUT(energy(),NBodyPhaseSpace); + GNDSTK_SHORTCUT(energy(),XYs2d); + GNDSTK_SHORTCUT(energy(),discreteGamma); + GNDSTK_SHORTCUT(energy(),evaporation); + GNDSTK_SHORTCUT(energy(),generalEvaporation); + GNDSTK_SHORTCUT(yields(),nuclides); + GNDSTK_SHORTCUT(energy(),primaryGamma); + GNDSTK_SHORTCUT(energy(),simpleMaxwellianFission); + GNDSTK_SHORTCUT(yields(),values); + GNDSTK_SHORTCUT(energy(),weightedFunctionals); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->energy, \ + this->yields \ + ) + + // default + IncidentEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncidentEnergy( + const wrapper + &label, + const wrapper + &energy = {}, + const wrapper + &yields = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + energy(this,energy), + yields(this,yields) + { + Component::finish(); + } + + // from node + explicit IncidentEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncidentEnergy(const IncidentEnergy &other) : + 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) : + 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 "alpha/v2.0/general/IncidentEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class IncidentEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncidentEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncoherentPhotonScattering.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncoherentPhotonScattering.hpp new file mode 100644 index 000000000..6807f94d6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncoherentPhotonScattering.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_INCOHERENTPHOTONSCATTERING +#define ALPHA_V2_0_GENERAL_INCOHERENTPHOTONSCATTERING + +#include "alpha/v2.0/general/ScatteringFactor.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href, \ + this->pid, \ + this->productFrame, \ + this->scatteringFactor \ + ) + + // default + IncoherentPhotonScattering() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncoherentPhotonScattering(const IncoherentPhotonScattering &other) : + 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) : + 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 "alpha/v2.0/general/IncoherentPhotonScattering/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class IncoherentPhotonScattering + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncoherentPhotonScattering/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncoherentPhotonScattering/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncoherentPhotonScattering/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncompleteReactions.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncompleteReactions.hpp new file mode 100644 index 000000000..54a08f7ad --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncompleteReactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_INCOMPLETEREACTIONS +#define ALPHA_V2_0_GENERAL_INCOMPLETEREACTIONS + +#include "alpha/v2.0/general/Reaction.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->reaction \ + ) + + // default + IncompleteReactions() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncompleteReactions( + const wrapper> + &reaction + ) : + GNDSTK_COMPONENT(BlockData{}), + reaction(this,reaction) + { + Component::finish(); + } + + // from node + explicit IncompleteReactions(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncompleteReactions(const IncompleteReactions &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + reaction(this,other.reaction) + { + Component::finish(other); + } + + // move + IncompleteReactions(IncompleteReactions &&other) : + 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 "alpha/v2.0/general/IncompleteReactions/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class IncompleteReactions + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncompleteReactions/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncompleteReactions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/IncompleteReactions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Institution.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Institution.hpp new file mode 100644 index 000000000..c4d24fc93 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Institution.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_INSTITUTION +#define ALPHA_V2_0_GENERAL_INSTITUTION + +#include "alpha/v2.0/general/ENDFconversionFlags.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(ENDFconversionFlags(),conversion); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDFconversionFlags \ + ) + + // default + Institution() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Institution( + const wrapper> + &label, + const wrapper + &ENDFconversionFlags = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ENDFconversionFlags(this,ENDFconversionFlags) + { + Component::finish(); + } + + // from node + explicit Institution(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Institution(const Institution &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ENDFconversionFlags(this,other.ENDFconversionFlags) + { + Component::finish(other); + } + + // move + Institution(Institution &&other) : + 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 "alpha/v2.0/general/Institution/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Institution + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Institution/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Institution/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Institution/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Integer.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Integer.hpp new file mode 100644 index 000000000..a020c43fa --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Integer.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_INTEGER +#define ALPHA_V2_0_GENERAL_INTEGER + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit \ + ) + + // default + Integer() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Integer( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper> + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Integer(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Integer(const Integer &other) : + 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) : + 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 "alpha/v2.0/general/Integer/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Integer + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Integer/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Integer/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Integer/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Intensity.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Intensity.hpp new file mode 100644 index 000000000..05350f4a8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Intensity.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_INTENSITY +#define ALPHA_V2_0_GENERAL_INTENSITY + +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->uncertainty \ + ) + + // default + Intensity() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Intensity( + const wrapper + &value, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Intensity(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Intensity(const Intensity &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Intensity(Intensity &&other) : + 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 "alpha/v2.0/general/Intensity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Intensity + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Intensity/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Intensity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Intensity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/InternalConversionCoefficients.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/InternalConversionCoefficients.hpp new file mode 100644 index 000000000..a4246eb66 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/InternalConversionCoefficients.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_INTERNALCONVERSIONCOEFFICIENTS +#define ALPHA_V2_0_GENERAL_INTERNALCONVERSIONCOEFFICIENTS + +#include "alpha/v2.0/general/Shell.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shell \ + ) + + // default + InternalConversionCoefficients() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit InternalConversionCoefficients( + const wrapper> + &shell + ) : + GNDSTK_COMPONENT(BlockData{}), + shell(this,shell) + { + Component::finish(); + } + + // from node + explicit InternalConversionCoefficients(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + InternalConversionCoefficients(const InternalConversionCoefficients &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shell(this,other.shell) + { + Component::finish(other); + } + + // move + InternalConversionCoefficients(InternalConversionCoefficients &&other) : + 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 "alpha/v2.0/general/InternalConversionCoefficients/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class InternalConversionCoefficients + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/InternalConversionCoefficients/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/InternalConversionCoefficients/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/InternalConversionCoefficients/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotope.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotope.hpp new file mode 100644 index 000000000..dd4bf96c5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotope.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ISOTOPE +#define ALPHA_V2_0_GENERAL_ISOTOPE + +#include "alpha/v2.0/general/Nuclides.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(nuclides(),nuclide); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symbol, \ + this->A, \ + this->nuclides \ + ) + + // default + Isotope() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Isotope( + const wrapper + &symbol, + const wrapper + &A = {}, + const wrapper + &nuclides = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + symbol(this,symbol), + A(this,A), + nuclides(this,nuclides) + { + Component::finish(); + } + + // from node + explicit Isotope(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotope(const Isotope &other) : + 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) : + 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 "alpha/v2.0/general/Isotope/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Isotope + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotope/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotope/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotope/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotopes.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotopes.hpp new file mode 100644 index 000000000..1b2d38b24 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotopes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ISOTOPES +#define ALPHA_V2_0_GENERAL_ISOTOPES + +#include "alpha/v2.0/general/Isotope.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->isotope \ + ) + + // default + Isotopes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Isotopes( + const wrapper> + &isotope + ) : + GNDSTK_COMPONENT(BlockData{}), + isotope(this,isotope) + { + Component::finish(); + } + + // from node + explicit Isotopes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotopes(const Isotopes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + isotope(this,other.isotope) + { + Component::finish(other); + } + + // move + Isotopes(Isotopes &&other) : + 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 "alpha/v2.0/general/Isotopes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Isotopes + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotopes/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotopes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotopes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotropic2d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotropic2d.hpp new file mode 100644 index 000000000..76e275fd6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotropic2d.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ISOTROPIC2D +#define ALPHA_V2_0_GENERAL_ISOTROPIC2D + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + Isotropic2d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Isotropic2d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotropic2d(const Isotropic2d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Isotropic2d(Isotropic2d &&other) : + 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 "alpha/v2.0/general/Isotropic2d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Isotropic2d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotropic2d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotropic2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Isotropic2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/J.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/J.hpp new file mode 100644 index 000000000..fa6c3b4b7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/J.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_J +#define ALPHA_V2_0_GENERAL_J + +#include "alpha/v2.0/general/LevelSpacing.hpp" +#include "alpha/v2.0/general/Widths.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(widths(),width); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->levelSpacing, \ + this->widths \ + ) + + // default + J() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit J( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &levelSpacing = {}, + const wrapper + &widths = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + levelSpacing(this,levelSpacing), + widths(this,widths) + { + Component::finish(); + } + + // from node + explicit J(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + J(const J &other) : + 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) : + 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 "alpha/v2.0/general/J/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class J + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/J/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/J/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/J/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Js.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Js.hpp new file mode 100644 index 000000000..a6d01803d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Js.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_JS +#define ALPHA_V2_0_GENERAL_JS + +#include "alpha/v2.0/general/J.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->J \ + ) + + // default + Js() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Js( + const wrapper> + &J + ) : + GNDSTK_COMPONENT(BlockData{}), + J(this,J) + { + Component::finish(); + } + + // from node + explicit Js(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Js(const Js &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + J(this,other.J) + { + Component::finish(other); + } + + // move + Js(Js &&other) : + 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 "alpha/v2.0/general/Js/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Js + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Js/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Js/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Js/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/KalbachMann.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/KalbachMann.hpp new file mode 100644 index 000000000..57232a4dd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/KalbachMann.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_KALBACHMANN +#define ALPHA_V2_0_GENERAL_KALBACHMANN + +#include "alpha/v2.0/general/F.hpp" +#include "alpha/v2.0/general/R.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->f, \ + this->r \ + ) + + // default + KalbachMann() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit KalbachMann( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper> + &f = {}, + const wrapper> + &r = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + f(this,f), + r(this,r) + { + Component::finish(); + } + + // from node + explicit KalbachMann(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + KalbachMann(const KalbachMann &other) : + 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) : + 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 "alpha/v2.0/general/KalbachMann/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class KalbachMann + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/KalbachMann/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/KalbachMann/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/KalbachMann/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/L.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/L.hpp new file mode 100644 index 000000000..b52d7aa1d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/L.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_L +#define ALPHA_V2_0_GENERAL_L + +#include "alpha/v2.0/general/Js.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Js(),J); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->Js \ + ) + + // default + L() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit L( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &Js = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + Js(this,Js) + { + Component::finish(); + } + + // from node + explicit L(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + L(const L &other) : + 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) : + 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 "alpha/v2.0/general/L/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class L + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/L/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/L/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/L/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Legendre.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Legendre.hpp new file mode 100644 index 000000000..5fbb36059 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Legendre.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_LEGENDRE +#define ALPHA_V2_0_GENERAL_LEGENDRE + +#include "alpha/v2.0/general/Values.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->outerDomainValue, \ + this->values \ + ) + + // default + Legendre() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Legendre( + const wrapper + &outerDomainValue, + const wrapper + &values = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + outerDomainValue(this,outerDomainValue), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Legendre(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Legendre(const Legendre &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + outerDomainValue(this,other.outerDomainValue), + values(this,other.values) + { + Component::finish(other); + } + + // move + Legendre(Legendre &&other) : + 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 "alpha/v2.0/general/Legendre/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Legendre + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Legendre/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Legendre/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Legendre/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Lepton.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Lepton.hpp new file mode 100644 index 000000000..fc867feaf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Lepton.hpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_LEPTON +#define ALPHA_V2_0_GENERAL_LEPTON + +#include "alpha/v2.0/general/Mass.hpp" +#include "alpha/v2.0/general/Spin.hpp" +#include "alpha/v2.0/general/Parity.hpp" +#include "alpha/v2.0/general/Charge.hpp" +#include "alpha/v2.0/general/Halflife.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(spin(),fraction); + GNDSTK_SHORTCUT(halflife(),string); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->generation, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->charge, \ + this->halflife \ + ) + + // default + Lepton() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Lepton(const Lepton &other) : + 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) : + 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 "alpha/v2.0/general/Lepton/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Lepton + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Lepton/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Lepton/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Lepton/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Leptons.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Leptons.hpp new file mode 100644 index 000000000..ad148c1a5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Leptons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_LEPTONS +#define ALPHA_V2_0_GENERAL_LEPTONS + +#include "alpha/v2.0/general/Lepton.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->lepton \ + ) + + // default + Leptons() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Leptons( + const wrapper> + &lepton + ) : + GNDSTK_COMPONENT(BlockData{}), + lepton(this,lepton) + { + Component::finish(); + } + + // from node + explicit Leptons(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Leptons(const Leptons &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + lepton(this,other.lepton) + { + Component::finish(other); + } + + // move + Leptons(Leptons &&other) : + 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 "alpha/v2.0/general/Leptons/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Leptons + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Leptons/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Leptons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Leptons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/LevelSpacing.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/LevelSpacing.hpp new file mode 100644 index 000000000..3e94ef854 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/LevelSpacing.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_LEVELSPACING +#define ALPHA_V2_0_GENERAL_LEVELSPACING + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Constant1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->constant1d \ + ) + + // default + LevelSpacing() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit LevelSpacing( + const wrapper> + &XYs1d, + const wrapper> + &constant1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + constant1d(this,constant1d) + { + Component::finish(); + } + + // from node + explicit LevelSpacing(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + LevelSpacing(const LevelSpacing &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + constant1d(this,other.constant1d) + { + Component::finish(other); + } + + // move + LevelSpacing(LevelSpacing &&other) : + 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 "alpha/v2.0/general/LevelSpacing/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class LevelSpacing + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/LevelSpacing/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/LevelSpacing/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/LevelSpacing/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Link.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Link.hpp new file mode 100644 index 000000000..4498c6597 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Link.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_LINK +#define ALPHA_V2_0_GENERAL_LINK + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Link() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Link( + const wrapper + &href + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Link(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Link(const Link &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Link(Link &&other) : + 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 "alpha/v2.0/general/Link/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Link + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Link/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Link/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Link/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ListOfCovariances.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ListOfCovariances.hpp new file mode 100644 index 000000000..f7939c051 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ListOfCovariances.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_LISTOFCOVARIANCES +#define ALPHA_V2_0_GENERAL_LISTOFCOVARIANCES + +#include "alpha/v2.0/general/Covariance.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->covariance \ + ) + + // default + ListOfCovariances() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ListOfCovariances( + const wrapper> + &covariance + ) : + GNDSTK_COMPONENT(BlockData{}), + covariance(this,covariance) + { + Component::finish(); + } + + // from node + explicit ListOfCovariances(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ListOfCovariances(const ListOfCovariances &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + covariance(this,other.covariance) + { + Component::finish(other); + } + + // move + ListOfCovariances(ListOfCovariances &&other) : + 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 "alpha/v2.0/general/ListOfCovariances/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ListOfCovariances + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ListOfCovariances/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ListOfCovariances/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ListOfCovariances/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Ls.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Ls.hpp new file mode 100644 index 000000000..e67111ed9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Ls.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_LS +#define ALPHA_V2_0_GENERAL_LS + +#include "alpha/v2.0/general/L.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->L \ + ) + + // default + Ls() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Ls( + const wrapper> + &L + ) : + GNDSTK_COMPONENT(BlockData{}), + L(this,L) + { + Component::finish(); + } + + // from node + explicit Ls(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Ls(const Ls &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + L(this,other.L) + { + Component::finish(other); + } + + // move + Ls(Ls &&other) : + 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 "alpha/v2.0/general/Ls/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Ls + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Ls/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Ls/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Ls/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MadlandNix.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MadlandNix.hpp new file mode 100644 index 000000000..e52f89a6d --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MadlandNix.hpp @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_MADLANDNIX +#define ALPHA_V2_0_GENERAL_MADLANDNIX + +#include "alpha/v2.0/general/EFL.hpp" +#include "alpha/v2.0/general/EFH.hpp" +#include "alpha/v2.0/general/T_M.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(T_M(),XYs1d); + GNDSTK_SHORTCUT(T_M().XYs1d(),axes); + GNDSTK_SHORTCUT(T_M().XYs1d(),uncertainty); + GNDSTK_SHORTCUT(T_M().XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->EFL, \ + this->EFH, \ + this->T_M \ + ) + + // default + MadlandNix() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MadlandNix( + const wrapper + &EFL, + const wrapper + &EFH = {}, + const wrapper + &T_M = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + EFL(this,EFL), + EFH(this,EFH), + T_M(this,T_M) + { + Component::finish(); + } + + // from node + explicit MadlandNix(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MadlandNix(const MadlandNix &other) : + 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) : + 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 "alpha/v2.0/general/MadlandNix/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MadlandNix + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MadlandNix/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MadlandNix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MadlandNix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mass.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mass.hpp new file mode 100644 index 000000000..0cb9865db --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mass.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_MASS +#define ALPHA_V2_0_GENERAL_MASS + +#include "alpha/v2.0/general/Double.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit, \ + this->Double \ + ) + + // default + Mass() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Mass( + const wrapper> + &value, + const wrapper> + &unit = {}, + const wrapper> + &Double = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Mass(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Mass(const Mass &other) : + 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) : + 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 "alpha/v2.0/general/Mass/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Mass + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mass/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mass/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mass/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MetaStable.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MetaStable.hpp new file mode 100644 index 000000000..ff628c93c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MetaStable.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_METASTABLE +#define ALPHA_V2_0_GENERAL_METASTABLE + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->pid, \ + this->metaStableIndex \ + ) + + // default + MetaStable() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MetaStable( + const wrapper + &id, + const wrapper + &pid = {}, + const wrapper + &metaStableIndex = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + pid(this,pid), + metaStableIndex(this,metaStableIndex) + { + Component::finish(); + } + + // from node + explicit MetaStable(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MetaStable(const MetaStable &other) : + 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) : + 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 "alpha/v2.0/general/MetaStable/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MetaStable + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MetaStable/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MetaStable/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MetaStable/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mixed.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mixed.hpp new file mode 100644 index 000000000..8bd7be69b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mixed.hpp @@ -0,0 +1,227 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_MIXED +#define ALPHA_V2_0_GENERAL_MIXED + +#include "alpha/v2.0/general/CovarianceMatrix.hpp" +#include "alpha/v2.0/general/Sum.hpp" +#include "alpha/v2.0/general/ShortRangeSelfScalingVariance.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->covarianceMatrix, \ + this->sum, \ + this->shortRangeSelfScalingVariance \ + ) + + // default + Mixed() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Mixed( + const wrapper + &label, + const wrapper> + &covarianceMatrix = {}, + const wrapper>> + &sum = {}, + const wrapper> + &shortRangeSelfScalingVariance = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + covarianceMatrix(this,covarianceMatrix), + sum(this,sum), + shortRangeSelfScalingVariance(this,shortRangeSelfScalingVariance) + { + Component::finish(); + } + + // from node + explicit Mixed(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Mixed(const Mixed &other) : + 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) : + 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 "alpha/v2.0/general/Mixed/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Mixed + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mixed/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mixed/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Mixed/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Multiplicity.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Multiplicity.hpp new file mode 100644 index 000000000..05df11ed1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Multiplicity.hpp @@ -0,0 +1,284 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_MULTIPLICITY +#define ALPHA_V2_0_GENERAL_MULTIPLICITY + +#include "alpha/v2.0/general/Constant1d.hpp" +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" +#include "alpha/v2.0/general/Polynomial1d.hpp" +#include "alpha/v2.0/general/Reference.hpp" +#include "alpha/v2.0/general/Branching1d.hpp" +#include "alpha/v2.0/general/Branching3d.hpp" +#include "alpha/v2.0/general/Unspecified.hpp" + +namespace alpha { +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 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Multiplicity(const Multiplicity &other) : + 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) : + 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 "alpha/v2.0/general/Multiplicity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Multiplicity + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Multiplicity/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Multiplicity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Multiplicity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySum.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySum.hpp new file mode 100644 index 000000000..cecdf1268 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySum.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_MULTIPLICITYSUM +#define ALPHA_V2_0_GENERAL_MULTIPLICITYSUM + +#include "alpha/v2.0/general/Multiplicity.hpp" +#include "alpha/v2.0/general/Summands.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(multiplicity(),XYs1d); + GNDSTK_SHORTCUT(summands(),add); + GNDSTK_SHORTCUT(multiplicity(),branching1d); + GNDSTK_SHORTCUT(multiplicity(),branching3d); + GNDSTK_SHORTCUT(multiplicity(),constant1d); + GNDSTK_SHORTCUT(multiplicity(),polynomial1d); + GNDSTK_SHORTCUT(multiplicity(),reference); + GNDSTK_SHORTCUT(multiplicity(),regions1d); + GNDSTK_SHORTCUT(multiplicity(),unspecified); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->multiplicity, \ + this->summands \ + ) + + // default + MultiplicitySum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiplicitySum( + const wrapper + &label, + const wrapper + &ENDF_MT = {}, + const wrapper + &multiplicity = {}, + const wrapper + &summands = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiplicitySum(const MultiplicitySum &other) : + 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) : + 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 "alpha/v2.0/general/MultiplicitySum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MultiplicitySum + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySum/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySums.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySums.hpp new file mode 100644 index 000000000..e0b135d2e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySums.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_MULTIPLICITYSUMS +#define ALPHA_V2_0_GENERAL_MULTIPLICITYSUMS + +#include "alpha/v2.0/general/MultiplicitySum.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->multiplicitySum \ + ) + + // default + MultiplicitySums() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiplicitySums( + const wrapper> + &multiplicitySum + ) : + GNDSTK_COMPONENT(BlockData{}), + multiplicitySum(this,multiplicitySum) + { + Component::finish(); + } + + // from node + explicit MultiplicitySums(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiplicitySums(const MultiplicitySums &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + multiplicitySum(this,other.multiplicitySum) + { + Component::finish(other); + } + + // move + MultiplicitySums(MultiplicitySums &&other) : + 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 "alpha/v2.0/general/MultiplicitySums/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MultiplicitySums + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySums/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySums/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/MultiplicitySums/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NBodyPhaseSpace.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NBodyPhaseSpace.hpp new file mode 100644 index 000000000..ba1dfccaf --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NBodyPhaseSpace.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_NBODYPHASESPACE +#define ALPHA_V2_0_GENERAL_NBODYPHASESPACE + +#include "alpha/v2.0/general/Mass.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(mass(),Double); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->numberOfProducts, \ + this->mass \ + ) + + // default + NBodyPhaseSpace() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NBodyPhaseSpace( + const wrapper + &numberOfProducts, + const wrapper + &mass = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + numberOfProducts(this,numberOfProducts), + mass(this,mass) + { + Component::finish(); + } + + // from node + explicit NBodyPhaseSpace(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NBodyPhaseSpace(const NBodyPhaseSpace &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + numberOfProducts(this,other.numberOfProducts), + mass(this,other.mass) + { + Component::finish(other); + } + + // move + NBodyPhaseSpace(NBodyPhaseSpace &&other) : + 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 "alpha/v2.0/general/NBodyPhaseSpace/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NBodyPhaseSpace + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NBodyPhaseSpace/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NBodyPhaseSpace/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NBodyPhaseSpace/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NeutrinoEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NeutrinoEnergy.hpp new file mode 100644 index 000000000..a0a9fee86 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NeutrinoEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_NEUTRINOENERGY +#define ALPHA_V2_0_GENERAL_NEUTRINOENERGY + +#include "alpha/v2.0/general/Polynomial1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(polynomial1d(),axes); + GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + GNDSTK_SHORTCUT(polynomial1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + NeutrinoEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NeutrinoEnergy( + const wrapper + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit NeutrinoEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NeutrinoEnergy(const NeutrinoEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + NeutrinoEnergy(NeutrinoEnergy &&other) : + 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 "alpha/v2.0/general/NeutrinoEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NeutrinoEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NeutrinoEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NeutrinoEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NeutrinoEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NonNeutrinoEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NonNeutrinoEnergy.hpp new file mode 100644 index 000000000..7c16ff5da --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NonNeutrinoEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_NONNEUTRINOENERGY +#define ALPHA_V2_0_GENERAL_NONNEUTRINOENERGY + +#include "alpha/v2.0/general/Polynomial1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(polynomial1d(),axes); + GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + GNDSTK_SHORTCUT(polynomial1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + NonNeutrinoEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NonNeutrinoEnergy( + const wrapper + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit NonNeutrinoEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NonNeutrinoEnergy(const NonNeutrinoEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + NonNeutrinoEnergy(NonNeutrinoEnergy &&other) : + 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 "alpha/v2.0/general/NonNeutrinoEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NonNeutrinoEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NonNeutrinoEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NonNeutrinoEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NonNeutrinoEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearAmplitudeExpansion.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearAmplitudeExpansion.hpp new file mode 100644 index 000000000..5697e9fae --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearAmplitudeExpansion.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_NUCLEARAMPLITUDEEXPANSION +#define ALPHA_V2_0_GENERAL_NUCLEARAMPLITUDEEXPANSION + +#include "alpha/v2.0/general/NuclearTerm.hpp" +#include "alpha/v2.0/general/RealInterferenceTerm.hpp" +#include "alpha/v2.0/general/ImaginaryInterferenceTerm.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclearTerm, \ + this->realInterferenceTerm, \ + this->imaginaryInterferenceTerm \ + ) + + // default + NuclearAmplitudeExpansion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NuclearAmplitudeExpansion( + const wrapper + &nuclearTerm, + const wrapper + &realInterferenceTerm = {}, + const wrapper + &imaginaryInterferenceTerm = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + nuclearTerm(this,nuclearTerm), + realInterferenceTerm(this,realInterferenceTerm), + imaginaryInterferenceTerm(this,imaginaryInterferenceTerm) + { + Component::finish(); + } + + // from node + explicit NuclearAmplitudeExpansion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NuclearAmplitudeExpansion(const NuclearAmplitudeExpansion &other) : + 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) : + 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 "alpha/v2.0/general/NuclearAmplitudeExpansion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NuclearAmplitudeExpansion + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearAmplitudeExpansion/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearAmplitudeExpansion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearAmplitudeExpansion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearPlusInterference.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearPlusInterference.hpp new file mode 100644 index 000000000..84da5320b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearPlusInterference.hpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_NUCLEARPLUSINTERFERENCE +#define ALPHA_V2_0_GENERAL_NUCLEARPLUSINTERFERENCE + +#include "alpha/v2.0/reduced/CrossSection.hpp" +#include "alpha/v2.0/reduced/Distribution.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(crossSection(),XYs1d); + GNDSTK_SHORTCUT(distribution(),XYs2d); + GNDSTK_SHORTCUT(distribution(),branching3d); + GNDSTK_SHORTCUT(crossSection(),reference); + GNDSTK_SHORTCUT(crossSection(),regions1d); + GNDSTK_SHORTCUT(distribution(),thermalNeutronScatteringLaw); + GNDSTK_SHORTCUT(distribution(),uncorrelated); + GNDSTK_SHORTCUT(distribution(),unspecified); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->muCutoff, \ + this->crossSection, \ + this->distribution \ + ) + + // default + NuclearPlusInterference() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NuclearPlusInterference( + const wrapper + &muCutoff, + const wrapper + &crossSection = {}, + const wrapper + &distribution = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + muCutoff(this,muCutoff), + crossSection(this,crossSection), + distribution(this,distribution) + { + Component::finish(); + } + + // from node + explicit NuclearPlusInterference(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NuclearPlusInterference(const NuclearPlusInterference &other) : + 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) : + 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 "alpha/v2.0/general/NuclearPlusInterference/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NuclearPlusInterference + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearPlusInterference/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearPlusInterference/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearPlusInterference/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearTerm.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearTerm.hpp new file mode 100644 index 000000000..9afc0bfd4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearTerm.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_NUCLEARTERM +#define ALPHA_V2_0_GENERAL_NUCLEARTERM + +#include "alpha/v2.0/general/Regions2d.hpp" +#include "alpha/v2.0/general/XYs2d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->regions2d, \ + this->XYs2d \ + ) + + // default + NuclearTerm() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NuclearTerm( + const wrapper> + ®ions2d, + const wrapper> + &XYs2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + regions2d(this,regions2d), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit NuclearTerm(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NuclearTerm(const NuclearTerm &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + regions2d(this,other.regions2d), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + NuclearTerm(NuclearTerm &&other) : + 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 "alpha/v2.0/general/NuclearTerm/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NuclearTerm + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearTerm/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearTerm/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/NuclearTerm/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nucleus.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nucleus.hpp new file mode 100644 index 000000000..e66e5defc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nucleus.hpp @@ -0,0 +1,314 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_NUCLEUS +#define ALPHA_V2_0_GENERAL_NUCLEUS + +#include "alpha/v2.0/general/Mass.hpp" +#include "alpha/v2.0/general/Spin.hpp" +#include "alpha/v2.0/general/Parity.hpp" +#include "alpha/v2.0/general/Charge.hpp" +#include "alpha/v2.0/general/Halflife.hpp" +#include "alpha/v2.0/general/Energy.hpp" +#include "alpha/v2.0/general/DecayData.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(energy(),MadlandNix); + GNDSTK_SHORTCUT(energy(),NBodyPhaseSpace); + GNDSTK_SHORTCUT(energy(),XYs2d); + GNDSTK_SHORTCUT(energy(),discreteGamma); + GNDSTK_SHORTCUT(energy(),evaporation); + GNDSTK_SHORTCUT(energy(),generalEvaporation); + GNDSTK_SHORTCUT(energy(),primaryGamma); + GNDSTK_SHORTCUT(energy(),simpleMaxwellianFission); + GNDSTK_SHORTCUT(energy(),weightedFunctionals); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Nucleus(const Nucleus &other) : + 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) : + 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 "alpha/v2.0/general/Nucleus/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Nucleus + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nucleus/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nucleus/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nucleus/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclide.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclide.hpp new file mode 100644 index 000000000..c475c8a20 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclide.hpp @@ -0,0 +1,274 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_NUCLIDE +#define ALPHA_V2_0_GENERAL_NUCLIDE + +#include "alpha/v2.0/general/Mass.hpp" +#include "alpha/v2.0/general/Charge.hpp" +#include "alpha/v2.0/general/Nucleus.hpp" +#include "alpha/v2.0/general/DecayData.hpp" +#include "alpha/v2.0/top/FissionFragmentData.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(nucleus().energy(),MadlandNix); + GNDSTK_SHORTCUT(nucleus().energy(),NBodyPhaseSpace); + GNDSTK_SHORTCUT(nucleus().energy(),XYs2d); + GNDSTK_SHORTCUT(nucleus().energy(),discreteGamma); + GNDSTK_SHORTCUT(nucleus(),energy); + GNDSTK_SHORTCUT(nucleus().energy(),evaporation); + GNDSTK_SHORTCUT(nucleus().energy(),generalEvaporation); + GNDSTK_SHORTCUT(nucleus(),halflife); + GNDSTK_SHORTCUT(nucleus(),parity); + GNDSTK_SHORTCUT(nucleus().energy(),primaryGamma); + GNDSTK_SHORTCUT(nucleus().energy(),simpleMaxwellianFission); + GNDSTK_SHORTCUT(nucleus(),spin); + GNDSTK_SHORTCUT(nucleus().energy(),weightedFunctionals); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->mass, \ + this->charge, \ + this->nucleus, \ + this->decayData, \ + this->fissionFragmentData \ + ) + + // default + Nuclide() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Nuclide(const Nuclide &other) : + 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) : + 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 "alpha/v2.0/general/Nuclide/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Nuclide + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclide/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclide/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclide/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclides.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclides.hpp new file mode 100644 index 000000000..f3d798f77 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclides.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_NUCLIDES +#define ALPHA_V2_0_GENERAL_NUCLIDES + +#include "alpha/v2.0/general/Nuclide.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclide \ + ) + + // default + Nuclides() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nuclides( + const wrapper> + &nuclide + ) : + GNDSTK_COMPONENT(BlockData{}), + nuclide(this,nuclide) + { + Component::finish(); + } + + // from node + explicit Nuclides(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Nuclides(const Nuclides &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + nuclide(this,other.nuclide) + { + Component::finish(other); + } + + // move + Nuclides(Nuclides &&other) : + 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 "alpha/v2.0/general/Nuclides/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Nuclides + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclides/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclides/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Nuclides/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProduct.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProduct.hpp new file mode 100644 index 000000000..7bc669607 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProduct.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ORPHANPRODUCT +#define ALPHA_V2_0_GENERAL_ORPHANPRODUCT + +#include "alpha/v2.0/general/CrossSection.hpp" +#include "alpha/v2.0/general/OutputChannel.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(crossSection(),CoulombPlusNuclearElastic); + GNDSTK_SHORTCUT(outputChannel().Q(),Double); + GNDSTK_SHORTCUT(outputChannel(),Q); + GNDSTK_SHORTCUT(crossSection(),XYs1d); + GNDSTK_SHORTCUT(outputChannel().Q(),constant1d); + GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + GNDSTK_SHORTCUT(outputChannel(),products); + GNDSTK_SHORTCUT(crossSection(),reference); + GNDSTK_SHORTCUT(crossSection(),regions1d); + GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + OrphanProduct() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OrphanProduct( + const wrapper + &label, + const wrapper + &ENDF_MT = {}, + const wrapper + &crossSection = {}, + const wrapper + &outputChannel = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OrphanProduct(const OrphanProduct &other) : + 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) : + 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 "alpha/v2.0/general/OrphanProduct/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class OrphanProduct + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProduct/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProduct/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProduct/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProducts.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProducts.hpp new file mode 100644 index 000000000..48e0230ee --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProducts.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ORPHANPRODUCTS +#define ALPHA_V2_0_GENERAL_ORPHANPRODUCTS + +#include "alpha/v2.0/general/OrphanProduct.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->orphanProduct \ + ) + + // default + OrphanProducts() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OrphanProducts( + const wrapper> + &orphanProduct + ) : + GNDSTK_COMPONENT(BlockData{}), + orphanProduct(this,orphanProduct) + { + Component::finish(); + } + + // from node + explicit OrphanProducts(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OrphanProducts(const OrphanProducts &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + orphanProduct(this,other.orphanProduct) + { + Component::finish(other); + } + + // move + OrphanProducts(OrphanProducts &&other) : + 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 "alpha/v2.0/general/OrphanProducts/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class OrphanProducts + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProducts/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProducts/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OrphanProducts/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OutputChannel.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OutputChannel.hpp new file mode 100644 index 000000000..df2d8c1ba --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OutputChannel.hpp @@ -0,0 +1,247 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_OUTPUTCHANNEL +#define ALPHA_V2_0_GENERAL_OUTPUTCHANNEL + +#include "alpha/v2.0/general/Q.hpp" +#include "alpha/v2.0/general/Products.hpp" +#include "alpha/v2.0/top/FissionFragmentData.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Q(),Double); + GNDSTK_SHORTCUT(Q(),constant1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->genre, \ + this->process, \ + this->Q, \ + this->products, \ + this->fissionFragmentData \ + ) + + // default + OutputChannel() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OutputChannel(const OutputChannel &other) : + 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) : + 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 "alpha/v2.0/general/OutputChannel/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class OutputChannel + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OutputChannel/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OutputChannel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/OutputChannel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariance.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariance.hpp new file mode 100644 index 000000000..b72afa7f0 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariance.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PARAMETERCOVARIANCE +#define ALPHA_V2_0_GENERAL_PARAMETERCOVARIANCE + +#include "alpha/v2.0/general/RowData.hpp" +#include "alpha/v2.0/general/ParameterCovarianceMatrix.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(parameterCovarianceMatrix(),array); + GNDSTK_SHORTCUT(parameterCovarianceMatrix().array(),lengths); + GNDSTK_SHORTCUT(parameterCovarianceMatrix().parameters(),parameterLink); + GNDSTK_SHORTCUT(parameterCovarianceMatrix(),parameters); + GNDSTK_SHORTCUT(rowData(),slices); + GNDSTK_SHORTCUT(parameterCovarianceMatrix().array(),starts); + GNDSTK_SHORTCUT(parameterCovarianceMatrix().array(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->rowData, \ + this->parameterCovarianceMatrix \ + ) + + // default + ParameterCovariance() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterCovariance( + const wrapper + &label, + const wrapper + &rowData = {}, + const wrapper + ¶meterCovarianceMatrix = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + rowData(this,rowData), + parameterCovarianceMatrix(this,parameterCovarianceMatrix) + { + Component::finish(); + } + + // from node + explicit ParameterCovariance(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterCovariance(const ParameterCovariance &other) : + 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) : + 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 "alpha/v2.0/general/ParameterCovariance/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ParameterCovariance + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariance/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovarianceMatrix.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovarianceMatrix.hpp new file mode 100644 index 000000000..f197672c9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovarianceMatrix.hpp @@ -0,0 +1,234 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PARAMETERCOVARIANCEMATRIX +#define ALPHA_V2_0_GENERAL_PARAMETERCOVARIANCEMATRIX + +#include "alpha/v2.0/g3d/Array.hpp" +#include "alpha/v2.0/general/Parameters.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(array(),lengths); + GNDSTK_SHORTCUT(parameters(),parameterLink); + GNDSTK_SHORTCUT(array(),starts); + GNDSTK_SHORTCUT(array(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->type, \ + this->array, \ + this->parameters \ + ) + + // default + ParameterCovarianceMatrix() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterCovarianceMatrix( + const wrapper + &label, + const wrapper + &type = {}, + const wrapper + &array = {}, + const wrapper + ¶meters = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + type(this,type), + array(this,array), + parameters(this,parameters) + { + Component::finish(); + } + + // from node + explicit ParameterCovarianceMatrix(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterCovarianceMatrix(const ParameterCovarianceMatrix &other) : + 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) : + 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 "alpha/v2.0/general/ParameterCovarianceMatrix/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ParameterCovarianceMatrix + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovarianceMatrix/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovarianceMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovarianceMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariances.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariances.hpp new file mode 100644 index 000000000..0135cd86a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariances.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PARAMETERCOVARIANCES +#define ALPHA_V2_0_GENERAL_PARAMETERCOVARIANCES + +#include "alpha/v2.0/general/ParameterCovariance.hpp" +#include "alpha/v2.0/general/AverageParameterCovariance.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->parameterCovariance, \ + this->averageParameterCovariance \ + ) + + // default + ParameterCovariances() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterCovariances( + const wrapper> + ¶meterCovariance, + const wrapper>> + &averageParameterCovariance = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + parameterCovariance(this,parameterCovariance), + averageParameterCovariance(this,averageParameterCovariance) + { + Component::finish(); + } + + // from node + explicit ParameterCovariances(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterCovariances(const ParameterCovariances &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + parameterCovariance(this,other.parameterCovariance), + averageParameterCovariance(this,other.averageParameterCovariance) + { + Component::finish(other); + } + + // move + ParameterCovariances(ParameterCovariances &&other) : + 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 "alpha/v2.0/general/ParameterCovariances/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ParameterCovariances + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariances/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariances/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterCovariances/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterLink.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterLink.hpp new file mode 100644 index 000000000..ac836aae7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterLink.hpp @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PARAMETERLINK +#define ALPHA_V2_0_GENERAL_PARAMETERLINK + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href, \ + this->nParameters, \ + this->matrixStartIndex \ + ) + + // default + ParameterLink() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterLink( + const wrapper + &label, + const wrapper + &href = {}, + const wrapper> + &nParameters = {}, + const wrapper> + &matrixStartIndex = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href), + nParameters(this,nParameters), + matrixStartIndex(this,matrixStartIndex) + { + Component::finish(); + } + + // from node + explicit ParameterLink(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterLink(const ParameterLink &other) : + 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) : + 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 "alpha/v2.0/general/ParameterLink/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ParameterLink + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterLink/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterLink/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ParameterLink/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parameters.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parameters.hpp new file mode 100644 index 000000000..69ff95a9f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parameters.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PARAMETERS +#define ALPHA_V2_0_GENERAL_PARAMETERS + +#include "alpha/v2.0/general/ParameterLink.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->parameterLink \ + ) + + // default + Parameters() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Parameters( + const wrapper> + ¶meterLink + ) : + GNDSTK_COMPONENT(BlockData{}), + parameterLink(this,parameterLink) + { + Component::finish(); + } + + // from node + explicit Parameters(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Parameters(const Parameters &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + parameterLink(this,other.parameterLink) + { + Component::finish(other); + } + + // move + Parameters(Parameters &&other) : + 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 "alpha/v2.0/general/Parameters/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Parameters + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parameters/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parameters/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parameters/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parity.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parity.hpp new file mode 100644 index 000000000..981f3e5dd --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parity.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PARITY +#define ALPHA_V2_0_GENERAL_PARITY + +#include "alpha/v2.0/general/Integer.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->integer \ + ) + + // default + Parity() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Parity( + const wrapper + &integer + ) : + GNDSTK_COMPONENT(BlockData{}), + integer(this,integer) + { + Component::finish(); + } + + // from node + explicit Parity(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Parity(const Parity &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + integer(this,other.integer) + { + Component::finish(other); + } + + // move + Parity(Parity &&other) : + 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 "alpha/v2.0/general/Parity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Parity + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parity/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Parity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PhotonEmissionProbabilities.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PhotonEmissionProbabilities.hpp new file mode 100644 index 000000000..b7aed8eb7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PhotonEmissionProbabilities.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PHOTONEMISSIONPROBABILITIES +#define ALPHA_V2_0_GENERAL_PHOTONEMISSIONPROBABILITIES + +#include "alpha/v2.0/general/Shell.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(shell(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shell \ + ) + + // default + PhotonEmissionProbabilities() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PhotonEmissionProbabilities( + const wrapper + &shell + ) : + GNDSTK_COMPONENT(BlockData{}), + shell(this,shell) + { + Component::finish(); + } + + // from node + explicit PhotonEmissionProbabilities(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PhotonEmissionProbabilities(const PhotonEmissionProbabilities &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shell(this,other.shell) + { + Component::finish(other); + } + + // move + PhotonEmissionProbabilities(PhotonEmissionProbabilities &&other) : + 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 "alpha/v2.0/general/PhotonEmissionProbabilities/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PhotonEmissionProbabilities + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PhotonEmissionProbabilities/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PhotonEmissionProbabilities/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PhotonEmissionProbabilities/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Polynomial1d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Polynomial1d.hpp new file mode 100644 index 000000000..8e408f71a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Polynomial1d.hpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_POLYNOMIAL1D +#define ALPHA_V2_0_GENERAL_POLYNOMIAL1D + +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/general/Values.hpp" +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->domainMin, \ + this->domainMax, \ + this->axes, \ + this->values, \ + this->uncertainty \ + ) + + // default + Polynomial1d() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Polynomial1d(const Polynomial1d &other) : + 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) : + 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 "alpha/v2.0/general/Polynomial1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Polynomial1d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Polynomial1d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Polynomial1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Polynomial1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PositronEmissionIntensity.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PositronEmissionIntensity.hpp new file mode 100644 index 000000000..d7802bd94 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PositronEmissionIntensity.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_POSITRONEMISSIONINTENSITY +#define ALPHA_V2_0_GENERAL_POSITRONEMISSIONINTENSITY + +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->uncertainty \ + ) + + // default + PositronEmissionIntensity() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PositronEmissionIntensity( + const wrapper + &value, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit PositronEmissionIntensity(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PositronEmissionIntensity(const PositronEmissionIntensity &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + PositronEmissionIntensity(PositronEmissionIntensity &&other) : + 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 "alpha/v2.0/general/PositronEmissionIntensity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PositronEmissionIntensity + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PositronEmissionIntensity/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PositronEmissionIntensity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PositronEmissionIntensity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PrimaryGamma.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PrimaryGamma.hpp new file mode 100644 index 000000000..38a984a95 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PrimaryGamma.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PRIMARYGAMMA +#define ALPHA_V2_0_GENERAL_PRIMARYGAMMA + +#include "alpha/v2.0/general/Axes.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->domainMin, \ + this->domainMax, \ + this->axes \ + ) + + // default + PrimaryGamma() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PrimaryGamma( + const wrapper + &value, + const wrapper + &domainMin = {}, + const wrapper + &domainMax = {}, + const wrapper + &axes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit PrimaryGamma(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PrimaryGamma(const PrimaryGamma &other) : + 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) : + 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 "alpha/v2.0/general/PrimaryGamma/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PrimaryGamma + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PrimaryGamma/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PrimaryGamma/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PrimaryGamma/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Probability.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Probability.hpp new file mode 100644 index 000000000..6c07c8d32 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Probability.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PROBABILITY +#define ALPHA_V2_0_GENERAL_PROBABILITY + +#include "alpha/v2.0/general/Double.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Double(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Probability() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Probability( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Probability(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Probability(const Probability &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Probability(Probability &&other) : + 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 "alpha/v2.0/general/Probability/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Probability + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Probability/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Probability/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Probability/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Product.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Product.hpp new file mode 100644 index 000000000..f5a889b11 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Product.hpp @@ -0,0 +1,256 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PRODUCT +#define ALPHA_V2_0_GENERAL_PRODUCT + +#include "alpha/v2.0/general/Multiplicity.hpp" +#include "alpha/v2.0/general/Distribution.hpp" +#include "alpha/v2.0/reduced/OutputChannel.hpp" +#include "alpha/v2.0/general/AverageProductEnergy.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->multiplicity, \ + this->distribution, \ + this->outputChannel, \ + this->averageProductEnergy \ + ) + + // default + Product() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Product(const Product &other) : + 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) : + 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 "alpha/v2.0/general/Product/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Product + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Product/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Product/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Product/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYield.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYield.hpp new file mode 100644 index 000000000..267e21551 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYield.hpp @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PRODUCTYIELD +#define ALPHA_V2_0_GENERAL_PRODUCTYIELD + +#include "alpha/v2.0/reduced/Nuclides.hpp" +#include "alpha/v2.0/general/ElapsedTimes.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(elapsedTimes(),elapsedTime); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->nuclides, \ + this->elapsedTimes \ + ) + + // default + ProductYield() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ProductYield( + const wrapper> + &label, + const wrapper> + &nuclides = {}, + const wrapper + &elapsedTimes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + nuclides(this,nuclides), + elapsedTimes(this,elapsedTimes) + { + Component::finish(); + } + + // from node + explicit ProductYield(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ProductYield(const ProductYield &other) : + 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) : + 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 "alpha/v2.0/general/ProductYield/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ProductYield + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYield/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYield/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYield/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYields.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYields.hpp new file mode 100644 index 000000000..cd8e89219 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYields.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PRODUCTYIELDS +#define ALPHA_V2_0_GENERAL_PRODUCTYIELDS + +#include "alpha/v2.0/general/ProductYield.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->productYield \ + ) + + // default + ProductYields() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ProductYields( + const wrapper> + &productYield + ) : + GNDSTK_COMPONENT(BlockData{}), + productYield(this,productYield) + { + Component::finish(); + } + + // from node + explicit ProductYields(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ProductYields(const ProductYields &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + productYield(this,other.productYield) + { + Component::finish(other); + } + + // move + ProductYields(ProductYields &&other) : + 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 "alpha/v2.0/general/ProductYields/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ProductYields + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYields/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYields/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProductYields/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Production.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Production.hpp new file mode 100644 index 000000000..610b836f9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Production.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PRODUCTION +#define ALPHA_V2_0_GENERAL_PRODUCTION + +#include "alpha/v2.0/general/CrossSection.hpp" +#include "alpha/v2.0/general/OutputChannel.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(crossSection(),CoulombPlusNuclearElastic); + GNDSTK_SHORTCUT(outputChannel().Q(),Double); + GNDSTK_SHORTCUT(outputChannel(),Q); + GNDSTK_SHORTCUT(crossSection(),XYs1d); + GNDSTK_SHORTCUT(outputChannel().Q(),constant1d); + GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + GNDSTK_SHORTCUT(outputChannel(),products); + GNDSTK_SHORTCUT(crossSection(),reference); + GNDSTK_SHORTCUT(crossSection(),regions1d); + GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + Production() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Production( + const wrapper + &label, + const wrapper + &ENDF_MT = {}, + const wrapper + &crossSection = {}, + const wrapper + &outputChannel = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Production(const Production &other) : + 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) : + 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 "alpha/v2.0/general/Production/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Production + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Production/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Production/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Production/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Productions.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Productions.hpp new file mode 100644 index 000000000..3c4274820 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Productions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PRODUCTIONS +#define ALPHA_V2_0_GENERAL_PRODUCTIONS + +#include "alpha/v2.0/general/Production.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->production \ + ) + + // default + Productions() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Productions( + const wrapper> + &production + ) : + GNDSTK_COMPONENT(BlockData{}), + production(this,production) + { + Component::finish(); + } + + // from node + explicit Productions(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Productions(const Productions &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + production(this,other.production) + { + Component::finish(other); + } + + // move + Productions(Productions &&other) : + 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 "alpha/v2.0/general/Productions/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Productions + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Productions/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Productions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Productions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Products.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Products.hpp new file mode 100644 index 000000000..61afecb55 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Products.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PRODUCTS +#define ALPHA_V2_0_GENERAL_PRODUCTS + +#include "alpha/v2.0/general/Product.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->product \ + ) + + // default + Products() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Products( + const wrapper>> + &product + ) : + GNDSTK_COMPONENT(BlockData{}), + product(this,product) + { + Component::finish(); + } + + // from node + explicit Products(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Products(const Products &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + product(this,other.product) + { + Component::finish(other); + } + + // move + Products(Products &&other) : + 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 "alpha/v2.0/general/Products/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Products + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Products/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Products/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Products/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProjectileEnergyDomain.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProjectileEnergyDomain.hpp new file mode 100644 index 000000000..8ad921bd9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProjectileEnergyDomain.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PROJECTILEENERGYDOMAIN +#define ALPHA_V2_0_GENERAL_PROJECTILEENERGYDOMAIN + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->min, \ + this->max, \ + this->unit \ + ) + + // default + ProjectileEnergyDomain() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ProjectileEnergyDomain( + const wrapper + &min, + const wrapper + &max = {}, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + min(this,min), + max(this,max), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit ProjectileEnergyDomain(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ProjectileEnergyDomain(const ProjectileEnergyDomain &other) : + 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) : + 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 "alpha/v2.0/general/ProjectileEnergyDomain/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ProjectileEnergyDomain + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProjectileEnergyDomain/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProjectileEnergyDomain/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ProjectileEnergyDomain/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptGammaEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptGammaEnergy.hpp new file mode 100644 index 000000000..bda40ad46 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptGammaEnergy.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PROMPTGAMMAENERGY +#define ALPHA_V2_0_GENERAL_PROMPTGAMMAENERGY + +#include "alpha/v2.0/general/Polynomial1d.hpp" +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d, \ + this->XYs1d \ + ) + + // default + PromptGammaEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PromptGammaEnergy( + const wrapper> + &polynomial1d, + const wrapper> + &XYs1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit PromptGammaEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PromptGammaEnergy(const PromptGammaEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + PromptGammaEnergy(PromptGammaEnergy &&other) : + 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 "alpha/v2.0/general/PromptGammaEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PromptGammaEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptGammaEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptGammaEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptGammaEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptNeutronKE.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptNeutronKE.hpp new file mode 100644 index 000000000..f27f65efe --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptNeutronKE.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PROMPTNEUTRONKE +#define ALPHA_V2_0_GENERAL_PROMPTNEUTRONKE + +#include "alpha/v2.0/general/Polynomial1d.hpp" +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d, \ + this->XYs1d \ + ) + + // default + PromptNeutronKE() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PromptNeutronKE( + const wrapper> + &polynomial1d, + const wrapper> + &XYs1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit PromptNeutronKE(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PromptNeutronKE(const PromptNeutronKE &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + PromptNeutronKE(PromptNeutronKE &&other) : + 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 "alpha/v2.0/general/PromptNeutronKE/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PromptNeutronKE + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptNeutronKE/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptNeutronKE/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptNeutronKE/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptProductKE.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptProductKE.hpp new file mode 100644 index 000000000..03f304f03 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptProductKE.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_PROMPTPRODUCTKE +#define ALPHA_V2_0_GENERAL_PROMPTPRODUCTKE + +#include "alpha/v2.0/general/Polynomial1d.hpp" +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d, \ + this->XYs1d \ + ) + + // default + PromptProductKE() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PromptProductKE( + const wrapper> + &polynomial1d, + const wrapper> + &XYs1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit PromptProductKE(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PromptProductKE(const PromptProductKE &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + PromptProductKE(PromptProductKE &&other) : + 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 "alpha/v2.0/general/PromptProductKE/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PromptProductKE + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptProductKE/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptProductKE/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/PromptProductKE/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Q.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Q.hpp new file mode 100644 index 000000000..0644ed854 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Q.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_Q +#define ALPHA_V2_0_GENERAL_Q + +#include "alpha/v2.0/general/Double.hpp" +#include "alpha/v2.0/general/Constant1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double, \ + this->constant1d \ + ) + + // default + Q() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Q( + const wrapper> + &Double, + const wrapper> + &constant1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double), + constant1d(this,constant1d) + { + Component::finish(); + } + + // from node + explicit Q(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Q(const Q &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double), + constant1d(this,other.constant1d) + { + Component::finish(other); + } + + // move + Q(Q &&other) : + 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 "alpha/v2.0/general/Q/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Q + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Q/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Q/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Q/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/R.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/R.hpp new file mode 100644 index 000000000..5c7e3b339 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/R.hpp @@ -0,0 +1,189 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_R +#define ALPHA_V2_0_GENERAL_R + +#include "alpha/v2.0/general/XYs2d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs2d().function1ds(),Legendre); + GNDSTK_SHORTCUT(XYs2d().function1ds(),XYs1d); + GNDSTK_SHORTCUT(XYs2d(),axes); + GNDSTK_SHORTCUT(XYs2d(),function1ds); + GNDSTK_SHORTCUT(XYs2d().function1ds(),regions1d); + GNDSTK_SHORTCUT(XYs2d(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d \ + ) + + // default + R() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit R( + const wrapper + &XYs2d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit R(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + R(const R &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + R(R &&other) : + 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 "alpha/v2.0/general/R/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class R + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/R/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/R/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/R/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RMatrix.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RMatrix.hpp new file mode 100644 index 000000000..8b7738218 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RMatrix.hpp @@ -0,0 +1,289 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RMATRIX +#define ALPHA_V2_0_GENERAL_RMATRIX + +#include "alpha/v2.0/top/PoPs.hpp" +#include "alpha/v2.0/general/ResonanceReactions.hpp" +#include "alpha/v2.0/general/SpinGroups.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(resonanceReactions(),resonanceReaction); + GNDSTK_SHORTCUT(spinGroups(),spinGroup); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RMatrix(const RMatrix &other) : + 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) : + 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 "alpha/v2.0/general/RMatrix/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RMatrix + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RMatrix/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Rate.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Rate.hpp new file mode 100644 index 000000000..389e0ebab --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Rate.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RATE +#define ALPHA_V2_0_GENERAL_RATE + +#include "alpha/v2.0/general/Double.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Double(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Rate() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Rate( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Rate(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Rate(const Rate &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Rate(Rate &&other) : + 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 "alpha/v2.0/general/Rate/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Rate + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Rate/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Rate/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Rate/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reaction.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reaction.hpp new file mode 100644 index 000000000..41766d11c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reaction.hpp @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_REACTION +#define ALPHA_V2_0_GENERAL_REACTION + +#include "alpha/v2.0/general/CrossSection.hpp" +#include "alpha/v2.0/general/OutputChannel.hpp" +#include "alpha/v2.0/general/DoubleDifferentialCrossSection.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(outputChannel().Q(),Double); + GNDSTK_SHORTCUT(outputChannel(),Q); + GNDSTK_SHORTCUT(crossSection(),XYs1d); + GNDSTK_SHORTCUT(outputChannel().Q(),constant1d); + GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + GNDSTK_SHORTCUT(outputChannel(),products); + GNDSTK_SHORTCUT(crossSection(),reference); + GNDSTK_SHORTCUT(crossSection(),regions1d); + GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->fissionGenre, \ + this->crossSection, \ + this->outputChannel, \ + this->doubleDifferentialCrossSection \ + ) + + // default + Reaction() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reaction(const Reaction &other) : + 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) : + 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 "alpha/v2.0/general/Reaction/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Reaction + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reaction/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reaction/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reaction/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reactions.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reactions.hpp new file mode 100644 index 000000000..dcae46428 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_REACTIONS +#define ALPHA_V2_0_GENERAL_REACTIONS + +#include "alpha/v2.0/general/Reaction.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->reaction \ + ) + + // default + Reactions() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reactions( + const wrapper> + &reaction + ) : + GNDSTK_COMPONENT(BlockData{}), + reaction(this,reaction) + { + Component::finish(); + } + + // from node + explicit Reactions(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reactions(const Reactions &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + reaction(this,other.reaction) + { + Component::finish(other); + } + + // move + Reactions(Reactions &&other) : + 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 "alpha/v2.0/general/Reactions/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Reactions + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reactions/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reactions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reactions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealAnomalousFactor.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealAnomalousFactor.hpp new file mode 100644 index 000000000..9085c2988 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealAnomalousFactor.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_REALANOMALOUSFACTOR +#define ALPHA_V2_0_GENERAL_REALANOMALOUSFACTOR + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + RealAnomalousFactor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RealAnomalousFactor( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit RealAnomalousFactor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RealAnomalousFactor(const RealAnomalousFactor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + RealAnomalousFactor(RealAnomalousFactor &&other) : + 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 "alpha/v2.0/general/RealAnomalousFactor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RealAnomalousFactor + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealAnomalousFactor/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealAnomalousFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealAnomalousFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealInterferenceTerm.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealInterferenceTerm.hpp new file mode 100644 index 000000000..0c1b5be5b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealInterferenceTerm.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_REALINTERFERENCETERM +#define ALPHA_V2_0_GENERAL_REALINTERFERENCETERM + +#include "alpha/v2.0/general/Regions2d.hpp" +#include "alpha/v2.0/general/XYs2d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->regions2d, \ + this->XYs2d \ + ) + + // default + RealInterferenceTerm() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RealInterferenceTerm( + const wrapper> + ®ions2d, + const wrapper> + &XYs2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + regions2d(this,regions2d), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit RealInterferenceTerm(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RealInterferenceTerm(const RealInterferenceTerm &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + regions2d(this,other.regions2d), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + RealInterferenceTerm(RealInterferenceTerm &&other) : + 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 "alpha/v2.0/general/RealInterferenceTerm/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RealInterferenceTerm + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealInterferenceTerm/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealInterferenceTerm/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RealInterferenceTerm/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Recoil.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Recoil.hpp new file mode 100644 index 000000000..32bb4cf02 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Recoil.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RECOIL +#define ALPHA_V2_0_GENERAL_RECOIL + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Recoil() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Recoil( + const wrapper + &href + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Recoil(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Recoil(const Recoil &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Recoil(Recoil &&other) : + 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 "alpha/v2.0/general/Recoil/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Recoil + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Recoil/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Recoil/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Recoil/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reference.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reference.hpp new file mode 100644 index 000000000..24b957509 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reference.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_REFERENCE +#define ALPHA_V2_0_GENERAL_REFERENCE + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + Reference() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reference( + const wrapper + &label, + const wrapper + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Reference(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reference(const Reference &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + Reference(Reference &&other) : + 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 "alpha/v2.0/general/Reference/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Reference + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reference/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reference/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Reference/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions1d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions1d.hpp new file mode 100644 index 000000000..13446f6d1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions1d.hpp @@ -0,0 +1,247 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_REGIONS1D +#define ALPHA_V2_0_GENERAL_REGIONS1D + +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/general/Uncertainty.hpp" +#include "alpha/v2.0/reduced/Function1ds.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(function1ds(),Legendre); + GNDSTK_SHORTCUT(function1ds(),XYs1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->uncertainty, \ + this->function1ds \ + ) + + // default + Regions1d() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Regions1d(const Regions1d &other) : + 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) : + 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 "alpha/v2.0/general/Regions1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Regions1d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions1d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions2d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions2d.hpp new file mode 100644 index 000000000..ee89e7ef3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions2d.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_REGIONS2D +#define ALPHA_V2_0_GENERAL_REGIONS2D + +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/general/Function2ds.hpp" +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(function2ds(),XYs2d); + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->axes, \ + this->function2ds, \ + this->uncertainty \ + ) + + // default + Regions2d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Regions2d( + const wrapper + &axes, + const wrapper + &function2ds = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + axes(this,axes), + function2ds(this,function2ds), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Regions2d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Regions2d(const Regions2d &other) : + 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) : + 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 "alpha/v2.0/general/Regions2d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Regions2d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions2d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Regions2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resolved.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resolved.hpp new file mode 100644 index 000000000..66efa77a9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resolved.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RESOLVED +#define ALPHA_V2_0_GENERAL_RESOLVED + +#include "alpha/v2.0/general/BreitWigner.hpp" +#include "alpha/v2.0/general/RMatrix.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->BreitWigner, \ + this->RMatrix \ + ) + + // default + Resolved() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Resolved(const Resolved &other) : + 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) : + 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 "alpha/v2.0/general/Resolved/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Resolved + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resolved/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resolved/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resolved/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResolvedRegion.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResolvedRegion.hpp new file mode 100644 index 000000000..eecb3b964 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResolvedRegion.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RESOLVEDREGION +#define ALPHA_V2_0_GENERAL_RESOLVEDREGION + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + ResolvedRegion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResolvedRegion( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit ResolvedRegion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResolvedRegion(const ResolvedRegion &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + ResolvedRegion(ResolvedRegion &&other) : + 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 "alpha/v2.0/general/ResolvedRegion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResolvedRegion + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResolvedRegion/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResolvedRegion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResolvedRegion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceParameters.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceParameters.hpp new file mode 100644 index 000000000..3c6c8a159 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceParameters.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RESONANCEPARAMETERS +#define ALPHA_V2_0_GENERAL_RESONANCEPARAMETERS + +#include "alpha/v2.0/general/Table.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(table().columnHeaders(),column); + GNDSTK_SHORTCUT(table(),columnHeaders); + GNDSTK_SHORTCUT(table(),data); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->table \ + ) + + // default + ResonanceParameters() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonanceParameters( + const wrapper + &table + ) : + GNDSTK_COMPONENT(BlockData{}), + table(this,table) + { + Component::finish(); + } + + // from node + explicit ResonanceParameters(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonanceParameters(const ResonanceParameters &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + table(this,other.table) + { + Component::finish(other); + } + + // move + ResonanceParameters(ResonanceParameters &&other) : + 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 "alpha/v2.0/general/ResonanceParameters/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResonanceParameters + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceParameters/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceParameters/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceParameters/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReaction.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReaction.hpp new file mode 100644 index 000000000..61a6ef0a7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReaction.hpp @@ -0,0 +1,270 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RESONANCEREACTION +#define ALPHA_V2_0_GENERAL_RESONANCEREACTION + +#include "alpha/v2.0/general/Link.hpp" +#include "alpha/v2.0/general/HardSphereRadius.hpp" +#include "alpha/v2.0/general/Q.hpp" +#include "alpha/v2.0/general/ScatteringRadius.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ejectile, \ + this->eliminated, \ + this->link, \ + this->hardSphereRadius, \ + this->Q, \ + this->scatteringRadius \ + ) + + // default + ResonanceReaction() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonanceReaction(const ResonanceReaction &other) : + 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) : + 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 "alpha/v2.0/general/ResonanceReaction/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResonanceReaction + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReaction/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReaction/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReaction/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReactions.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReactions.hpp new file mode 100644 index 000000000..c75a76d32 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RESONANCEREACTIONS +#define ALPHA_V2_0_GENERAL_RESONANCEREACTIONS + +#include "alpha/v2.0/general/ResonanceReaction.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->resonanceReaction \ + ) + + // default + ResonanceReactions() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonanceReactions( + const wrapper> + &resonanceReaction + ) : + GNDSTK_COMPONENT(BlockData{}), + resonanceReaction(this,resonanceReaction) + { + Component::finish(); + } + + // from node + explicit ResonanceReactions(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonanceReactions(const ResonanceReactions &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + resonanceReaction(this,other.resonanceReaction) + { + Component::finish(other); + } + + // move + ResonanceReactions(ResonanceReactions &&other) : + 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 "alpha/v2.0/general/ResonanceReactions/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResonanceReactions + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReactions/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReactions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonanceReactions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resonances.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resonances.hpp new file mode 100644 index 000000000..593432fe7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resonances.hpp @@ -0,0 +1,227 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RESONANCES +#define ALPHA_V2_0_GENERAL_RESONANCES + +#include "alpha/v2.0/general/ScatteringRadius.hpp" +#include "alpha/v2.0/general/Resolved.hpp" +#include "alpha/v2.0/general/Unresolved.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->scatteringRadius, \ + this->resolved, \ + this->unresolved \ + ) + + // default + Resonances() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Resonances( + const wrapper> + &href, + const wrapper> + &scatteringRadius = {}, + const wrapper> + &resolved = {}, + const wrapper> + &unresolved = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href), + scatteringRadius(this,scatteringRadius), + resolved(this,resolved), + unresolved(this,unresolved) + { + Component::finish(); + } + + // from node + explicit Resonances(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Resonances(const Resonances &other) : + 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) : + 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 "alpha/v2.0/general/Resonances/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Resonances + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resonances/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resonances/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Resonances/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonancesWithBackground.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonancesWithBackground.hpp new file mode 100644 index 000000000..4f7ce9471 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonancesWithBackground.hpp @@ -0,0 +1,237 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RESONANCESWITHBACKGROUND +#define ALPHA_V2_0_GENERAL_RESONANCESWITHBACKGROUND + +#include "alpha/v2.0/general/Resonances.hpp" +#include "alpha/v2.0/general/Background.hpp" +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(background(),fastRegion); + GNDSTK_SHORTCUT(resonances(),resolved); + GNDSTK_SHORTCUT(background(),resolvedRegion); + GNDSTK_SHORTCUT(resonances(),scatteringRadius); + GNDSTK_SHORTCUT(resonances(),unresolved); + GNDSTK_SHORTCUT(background(),unresolvedRegion); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->resonances, \ + this->background, \ + this->uncertainty \ + ) + + // default + ResonancesWithBackground() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonancesWithBackground( + const wrapper + &label, + const wrapper + &resonances = {}, + const wrapper + &background = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + resonances(this,resonances), + background(this,background), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit ResonancesWithBackground(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonancesWithBackground(const ResonancesWithBackground &other) : + 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) : + 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 "alpha/v2.0/general/ResonancesWithBackground/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResonancesWithBackground + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonancesWithBackground/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonancesWithBackground/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ResonancesWithBackground/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RowData.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RowData.hpp new file mode 100644 index 000000000..fe47420d9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RowData.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_ROWDATA +#define ALPHA_V2_0_GENERAL_ROWDATA + +#include "alpha/v2.0/general/Slices.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MFMT, \ + this->dimension, \ + this->href, \ + this->slices \ + ) + + // default + RowData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RowData( + const wrapper> + &ENDF_MFMT, + const wrapper> + &dimension = {}, + const wrapper + &href = {}, + const wrapper> + &slices = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RowData(const RowData &other) : + 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) : + 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 "alpha/v2.0/general/RowData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RowData + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RowData/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RowData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RowData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RutherfordScattering.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RutherfordScattering.hpp new file mode 100644 index 000000000..9e84e6196 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RutherfordScattering.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_RUTHERFORDSCATTERING +#define ALPHA_V2_0_GENERAL_RUTHERFORDSCATTERING + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + RutherfordScattering() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit RutherfordScattering(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RutherfordScattering(const RutherfordScattering &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + RutherfordScattering(RutherfordScattering &&other) : + 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 "alpha/v2.0/general/RutherfordScattering/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RutherfordScattering + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RutherfordScattering/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RutherfordScattering/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/RutherfordScattering/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SCTApproximation.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SCTApproximation.hpp new file mode 100644 index 000000000..e56a22bcc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SCTApproximation.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SCTAPPROXIMATION +#define ALPHA_V2_0_GENERAL_SCTAPPROXIMATION + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + SCTApproximation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit SCTApproximation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SCTApproximation(const SCTApproximation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + SCTApproximation(SCTApproximation &&other) : + 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 "alpha/v2.0/general/SCTApproximation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SCTApproximation + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SCTApproximation/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SCTApproximation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SCTApproximation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/S_table.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/S_table.hpp new file mode 100644 index 000000000..f5e8e4bf8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/S_table.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_S_TABLE +#define ALPHA_V2_0_GENERAL_S_TABLE + +#include "alpha/v2.0/general/Gridded2d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(gridded2d(),array); + GNDSTK_SHORTCUT(gridded2d(),axes); + GNDSTK_SHORTCUT(gridded2d().axes(),axis); + GNDSTK_SHORTCUT(gridded2d().axes(),grid); + GNDSTK_SHORTCUT(gridded2d().array(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->gridded2d \ + ) + + // default + S_table() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit S_table( + const wrapper + &gridded2d + ) : + GNDSTK_COMPONENT(BlockData{}), + gridded2d(this,gridded2d) + { + Component::finish(); + } + + // from node + explicit S_table(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + S_table(const S_table &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + gridded2d(this,other.gridded2d) + { + Component::finish(other); + } + + // move + S_table(S_table &&other) : + 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 "alpha/v2.0/general/S_table/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class S_table + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/S_table/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/S_table/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/S_table/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtom.hpp new file mode 100644 index 000000000..1767b869b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtom.hpp @@ -0,0 +1,308 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SCATTERINGATOM +#define ALPHA_V2_0_GENERAL_SCATTERINGATOM + +#include "alpha/v2.0/general/Mass.hpp" +#include "alpha/v2.0/general/E_critical.hpp" +#include "alpha/v2.0/general/E_max.hpp" +#include "alpha/v2.0/general/BoundAtomCrossSection.hpp" +#include "alpha/v2.0/general/SelfScatteringKernel.hpp" +#include "alpha/v2.0/general/T_effective.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(mass(),Double); + GNDSTK_SHORTCUT(selfScatteringKernel(),SCTApproximation); + GNDSTK_SHORTCUT(selfScatteringKernel(),freeGasApproximation); + GNDSTK_SHORTCUT(selfScatteringKernel(),gridded3d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringAtom(const ScatteringAtom &other) : + 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) : + 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 "alpha/v2.0/general/ScatteringAtom/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ScatteringAtom + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtom/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtom/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtom/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtoms.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtoms.hpp new file mode 100644 index 000000000..256f1469e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtoms.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SCATTERINGATOMS +#define ALPHA_V2_0_GENERAL_SCATTERINGATOMS + +#include "alpha/v2.0/general/ScatteringAtom.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->scatteringAtom \ + ) + + // default + ScatteringAtoms() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringAtoms( + const wrapper> + &scatteringAtom + ) : + GNDSTK_COMPONENT(BlockData{}), + scatteringAtom(this,scatteringAtom) + { + Component::finish(); + } + + // from node + explicit ScatteringAtoms(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringAtoms(const ScatteringAtoms &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + scatteringAtom(this,other.scatteringAtom) + { + Component::finish(other); + } + + // move + ScatteringAtoms(ScatteringAtoms &&other) : + 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 "alpha/v2.0/general/ScatteringAtoms/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ScatteringAtoms + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtoms/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtoms/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringAtoms/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringFactor.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringFactor.hpp new file mode 100644 index 000000000..05cead9a5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringFactor.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SCATTERINGFACTOR +#define ALPHA_V2_0_GENERAL_SCATTERINGFACTOR + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + ScatteringFactor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringFactor( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit ScatteringFactor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringFactor(const ScatteringFactor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + ScatteringFactor(ScatteringFactor &&other) : + 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 "alpha/v2.0/general/ScatteringFactor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ScatteringFactor + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringFactor/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringRadius.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringRadius.hpp new file mode 100644 index 000000000..a675aaeed --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringRadius.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SCATTERINGRADIUS +#define ALPHA_V2_0_GENERAL_SCATTERINGRADIUS + +#include "alpha/v2.0/general/Constant1d.hpp" +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->constant1d, \ + this->XYs1d \ + ) + + // default + ScatteringRadius() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringRadius( + const wrapper> + &constant1d, + const wrapper> + &XYs1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + constant1d(this,constant1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit ScatteringRadius(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringRadius(const ScatteringRadius &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + constant1d(this,other.constant1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + ScatteringRadius(ScatteringRadius &&other) : + 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 "alpha/v2.0/general/ScatteringRadius/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ScatteringRadius + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringRadius/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringRadius/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ScatteringRadius/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SelfScatteringKernel.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SelfScatteringKernel.hpp new file mode 100644 index 000000000..b7c9a2563 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SelfScatteringKernel.hpp @@ -0,0 +1,227 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SELFSCATTERINGKERNEL +#define ALPHA_V2_0_GENERAL_SELFSCATTERINGKERNEL + +#include "alpha/v2.0/general/Gridded3d.hpp" +#include "alpha/v2.0/general/SCTApproximation.hpp" +#include "alpha/v2.0/general/FreeGasApproximation.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symmetric, \ + this->gridded3d, \ + this->SCTApproximation, \ + this->freeGasApproximation \ + ) + + // default + SelfScatteringKernel() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SelfScatteringKernel( + const wrapper> + &symmetric, + const wrapper> + &gridded3d = {}, + const wrapper> + &SCTApproximation = {}, + const wrapper> + &freeGasApproximation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + symmetric(this,symmetric), + gridded3d(this,gridded3d), + SCTApproximation(this,SCTApproximation), + freeGasApproximation(this,freeGasApproximation) + { + Component::finish(); + } + + // from node + explicit SelfScatteringKernel(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SelfScatteringKernel(const SelfScatteringKernel &other) : + 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) : + 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 "alpha/v2.0/general/SelfScatteringKernel/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SelfScatteringKernel + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SelfScatteringKernel/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SelfScatteringKernel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SelfScatteringKernel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Shell.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Shell.hpp new file mode 100644 index 000000000..ad87928a4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Shell.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SHELL +#define ALPHA_V2_0_GENERAL_SHELL + +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->uncertainty \ + ) + + // default + Shell() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Shell( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Shell(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Shell(const Shell &other) : + 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) : + 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 "alpha/v2.0/general/Shell/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Shell + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Shell/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Shell/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Shell/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ShortRangeSelfScalingVariance.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ShortRangeSelfScalingVariance.hpp new file mode 100644 index 000000000..ec280106a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ShortRangeSelfScalingVariance.hpp @@ -0,0 +1,234 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SHORTRANGESELFSCALINGVARIANCE +#define ALPHA_V2_0_GENERAL_SHORTRANGESELFSCALINGVARIANCE + +#include "alpha/v2.0/general/Gridded2d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(gridded2d(),array); + GNDSTK_SHORTCUT(gridded2d(),axes); + GNDSTK_SHORTCUT(gridded2d().axes(),axis); + GNDSTK_SHORTCUT(gridded2d().axes(),grid); + GNDSTK_SHORTCUT(gridded2d().array(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->type, \ + this->dependenceOnProcessedGroupWidth, \ + this->gridded2d \ + ) + + // default + ShortRangeSelfScalingVariance() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ShortRangeSelfScalingVariance( + const wrapper + &label, + const wrapper + &type = {}, + const wrapper + &dependenceOnProcessedGroupWidth = {}, + const wrapper + &gridded2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + type(this,type), + dependenceOnProcessedGroupWidth(this,dependenceOnProcessedGroupWidth), + gridded2d(this,gridded2d) + { + Component::finish(); + } + + // from node + explicit ShortRangeSelfScalingVariance(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ShortRangeSelfScalingVariance(const ShortRangeSelfScalingVariance &other) : + 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) : + 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 "alpha/v2.0/general/ShortRangeSelfScalingVariance/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ShortRangeSelfScalingVariance + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ShortRangeSelfScalingVariance/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ShortRangeSelfScalingVariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ShortRangeSelfScalingVariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SimpleMaxwellianFission.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SimpleMaxwellianFission.hpp new file mode 100644 index 000000000..8be536c91 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SimpleMaxwellianFission.hpp @@ -0,0 +1,200 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SIMPLEMAXWELLIANFISSION +#define ALPHA_V2_0_GENERAL_SIMPLEMAXWELLIANFISSION + +#include "alpha/v2.0/general/U.hpp" +#include "alpha/v2.0/general/Theta.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(theta(),XYs1d); + GNDSTK_SHORTCUT(theta(),regions1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->theta \ + ) + + // default + SimpleMaxwellianFission() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SimpleMaxwellianFission( + const wrapper + &U, + const wrapper + &theta = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + U(this,U), + theta(this,theta) + { + Component::finish(); + } + + // from node + explicit SimpleMaxwellianFission(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SimpleMaxwellianFission(const SimpleMaxwellianFission &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + U(this,other.U), + theta(this,other.theta) + { + Component::finish(other); + } + + // move + SimpleMaxwellianFission(SimpleMaxwellianFission &&other) : + 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 "alpha/v2.0/general/SimpleMaxwellianFission/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SimpleMaxwellianFission + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SimpleMaxwellianFission/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SimpleMaxwellianFission/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SimpleMaxwellianFission/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slice.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slice.hpp new file mode 100644 index 000000000..78f49d2b7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slice.hpp @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SLICE +#define ALPHA_V2_0_GENERAL_SLICE + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->dimension, \ + this->domainValue, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit \ + ) + + // default + Slice() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Slice(const Slice &other) : + 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) : + 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 "alpha/v2.0/general/Slice/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Slice + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slice/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slice/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slice/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slices.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slices.hpp new file mode 100644 index 000000000..e1a7cb802 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slices.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SLICES +#define ALPHA_V2_0_GENERAL_SLICES + +#include "alpha/v2.0/general/Slice.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->slice \ + ) + + // default + Slices() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Slices( + const wrapper> + &slice + ) : + GNDSTK_COMPONENT(BlockData{}), + slice(this,slice) + { + Component::finish(); + } + + // from node + explicit Slices(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Slices(const Slices &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + slice(this,other.slice) + { + Component::finish(other); + } + + // move + Slices(Slices &&other) : + 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 "alpha/v2.0/general/Slices/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Slices + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slices/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slices/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Slices/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectra.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectra.hpp new file mode 100644 index 000000000..76578ca19 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectra.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SPECTRA +#define ALPHA_V2_0_GENERAL_SPECTRA + +#include "alpha/v2.0/general/Spectrum.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->spectrum \ + ) + + // default + Spectra() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Spectra( + const wrapper> + &spectrum + ) : + GNDSTK_COMPONENT(BlockData{}), + spectrum(this,spectrum) + { + Component::finish(); + } + + // from node + explicit Spectra(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Spectra(const Spectra &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + spectrum(this,other.spectrum) + { + Component::finish(other); + } + + // move + Spectra(Spectra &&other) : + 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 "alpha/v2.0/general/Spectra/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Spectra + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectra/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectra/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectra/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectrum.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectrum.hpp new file mode 100644 index 000000000..07a51cd74 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectrum.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SPECTRUM +#define ALPHA_V2_0_GENERAL_SPECTRUM + +#include "alpha/v2.0/general/Discrete.hpp" +#include "alpha/v2.0/general/Continuum.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->discrete, \ + this->continuum \ + ) + + // default + Spectrum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Spectrum( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper> + &discrete = {}, + const wrapper> + &continuum = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + discrete(this,discrete), + continuum(this,continuum) + { + Component::finish(); + } + + // from node + explicit Spectrum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Spectrum(const Spectrum &other) : + 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) : + 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 "alpha/v2.0/general/Spectrum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Spectrum + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectrum/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectrum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spectrum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spin.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spin.hpp new file mode 100644 index 000000000..9aad41355 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spin.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SPIN +#define ALPHA_V2_0_GENERAL_SPIN + +#include "alpha/v2.0/general/Fraction.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->fraction \ + ) + + // default + Spin() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Spin( + const wrapper + &fraction + ) : + GNDSTK_COMPONENT(BlockData{}), + fraction(this,fraction) + { + Component::finish(); + } + + // from node + explicit Spin(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Spin(const Spin &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + fraction(this,other.fraction) + { + Component::finish(other); + } + + // move + Spin(Spin &&other) : + 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 "alpha/v2.0/general/Spin/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Spin + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spin/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spin/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Spin/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroup.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroup.hpp new file mode 100644 index 000000000..6d1400ab6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroup.hpp @@ -0,0 +1,248 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SPINGROUP +#define ALPHA_V2_0_GENERAL_SPINGROUP + +#include "alpha/v2.0/general/Channels.hpp" +#include "alpha/v2.0/general/ResonanceParameters.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(channels(),channel); + GNDSTK_SHORTCUT(resonanceParameters().table(),columnHeaders); + GNDSTK_SHORTCUT(resonanceParameters().table(),data); + GNDSTK_SHORTCUT(resonanceParameters(),table); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->spin, \ + this->parity, \ + this->channels, \ + this->resonanceParameters \ + ) + + // default + SpinGroup() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SpinGroup(const SpinGroup &other) : + 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) : + 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 "alpha/v2.0/general/SpinGroup/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SpinGroup + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroup/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroup/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroup/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroups.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroups.hpp new file mode 100644 index 000000000..6645b4ee8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroups.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SPINGROUPS +#define ALPHA_V2_0_GENERAL_SPINGROUPS + +#include "alpha/v2.0/general/SpinGroup.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->spinGroup \ + ) + + // default + SpinGroups() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SpinGroups( + const wrapper> + &spinGroup + ) : + GNDSTK_COMPONENT(BlockData{}), + spinGroup(this,spinGroup) + { + Component::finish(); + } + + // from node + explicit SpinGroups(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SpinGroups(const SpinGroups &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + spinGroup(this,other.spinGroup) + { + Component::finish(other); + } + + // move + SpinGroups(SpinGroups &&other) : + 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 "alpha/v2.0/general/SpinGroups/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SpinGroups + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroups/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroups/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/SpinGroups/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Standard.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Standard.hpp new file mode 100644 index 000000000..5dd30ad36 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Standard.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_STANDARD +#define ALPHA_V2_0_GENERAL_STANDARD + +#include "alpha/v2.0/reduced/Double.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Standard() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Standard( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Standard(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Standard(const Standard &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Standard(Standard &&other) : + 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 "alpha/v2.0/general/Standard/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Standard + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Standard/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Standard/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Standard/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/String.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/String.hpp new file mode 100644 index 000000000..a797dca43 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/String.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_STRING +#define ALPHA_V2_0_GENERAL_STRING + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit \ + ) + + // default + String() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit String( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit String(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + String(const String &other) : + 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) : + 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 "alpha/v2.0/general/String/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class String + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/String/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/String/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/String/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Styles.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Styles.hpp new file mode 100644 index 000000000..807ab3f2b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Styles.hpp @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_STYLES +#define ALPHA_V2_0_GENERAL_STYLES + +#include "alpha/v2.0/general/Evaluated.hpp" +#include "alpha/v2.0/general/CrossSectionReconstructed.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(evaluated().documentation(),authors); + GNDSTK_SHORTCUT(evaluated().documentation(),body); + GNDSTK_SHORTCUT(evaluated().documentation(),dates); + GNDSTK_SHORTCUT(evaluated(),documentation); + GNDSTK_SHORTCUT(evaluated().documentation(),endfCompatible); + GNDSTK_SHORTCUT(evaluated(),projectileEnergyDomain); + GNDSTK_SHORTCUT(evaluated(),temperature); + GNDSTK_SHORTCUT(evaluated().documentation(),title); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->evaluated, \ + this->crossSectionReconstructed \ + ) + + // default + Styles() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Styles( + const wrapper + &evaluated, + const wrapper> + &crossSectionReconstructed = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + evaluated(this,evaluated), + crossSectionReconstructed(this,crossSectionReconstructed) + { + Component::finish(); + } + + // from node + explicit Styles(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Styles(const Styles &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + evaluated(this,other.evaluated), + crossSectionReconstructed(this,other.crossSectionReconstructed) + { + Component::finish(other); + } + + // move + Styles(Styles &&other) : + 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 "alpha/v2.0/general/Styles/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Styles + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Styles/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Styles/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Styles/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sum.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sum.hpp new file mode 100644 index 000000000..57c8fc44c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sum.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SUM +#define ALPHA_V2_0_GENERAL_SUM + +#include "alpha/v2.0/general/Summand.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->summand \ + ) + + // default + Sum() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Sum(const Sum &other) : + 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) : + 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 "alpha/v2.0/general/Sum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Sum + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sum/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summand.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summand.hpp new file mode 100644 index 000000000..04c9baca9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summand.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SUMMAND +#define ALPHA_V2_0_GENERAL_SUMMAND + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MFMT, \ + this->coefficient, \ + this->href \ + ) + + // default + Summand() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Summand( + const wrapper> + &ENDF_MFMT, + const wrapper> + &coefficient = {}, + const wrapper> + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MFMT(this,ENDF_MFMT), + coefficient(this,coefficient), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Summand(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Summand(const Summand &other) : + 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) : + 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 "alpha/v2.0/general/Summand/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Summand + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summand/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summand/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summand/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summands.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summands.hpp new file mode 100644 index 000000000..8fe43d3d5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summands.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SUMMANDS +#define ALPHA_V2_0_GENERAL_SUMMANDS + +#include "alpha/v2.0/general/Add.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->add \ + ) + + // default + Summands() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Summands( + const wrapper> + &add + ) : + GNDSTK_COMPONENT(BlockData{}), + add(this,add) + { + Component::finish(); + } + + // from node + explicit Summands(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Summands(const Summands &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + add(this,other.add) + { + Component::finish(other); + } + + // move + Summands(Summands &&other) : + 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 "alpha/v2.0/general/Summands/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Summands + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summands/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summands/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Summands/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sums.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sums.hpp new file mode 100644 index 000000000..4fb3dc68a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sums.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_SUMS +#define ALPHA_V2_0_GENERAL_SUMS + +#include "alpha/v2.0/general/CrossSectionSums.hpp" +#include "alpha/v2.0/general/MultiplicitySums.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->crossSectionSums, \ + this->multiplicitySums \ + ) + + // default + Sums() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Sums( + const wrapper> + &crossSectionSums, + const wrapper> + &multiplicitySums = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + crossSectionSums(this,crossSectionSums), + multiplicitySums(this,multiplicitySums) + { + Component::finish(); + } + + // from node + explicit Sums(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Sums(const Sums &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + crossSectionSums(this,other.crossSectionSums), + multiplicitySums(this,other.multiplicitySums) + { + Component::finish(other); + } + + // move + Sums(Sums &&other) : + 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 "alpha/v2.0/general/Sums/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Sums + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sums/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sums/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Sums/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_M.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_M.hpp new file mode 100644 index 000000000..8a0839785 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_M.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_T_M +#define ALPHA_V2_0_GENERAL_T_M + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + T_M() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit T_M( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit T_M(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + T_M(const T_M &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + T_M(T_M &&other) : + 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 "alpha/v2.0/general/T_M/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class T_M + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_M/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_M/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_M/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_effective.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_effective.hpp new file mode 100644 index 000000000..cbb2c7bcb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_effective.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_T_EFFECTIVE +#define ALPHA_V2_0_GENERAL_T_EFFECTIVE + +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + T_effective() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit T_effective( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit T_effective(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + T_effective(const T_effective &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + T_effective(T_effective &&other) : + 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 "alpha/v2.0/general/T_effective/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class T_effective + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_effective/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_effective/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/T_effective/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Table.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Table.hpp new file mode 100644 index 000000000..0014b90ca --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Table.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_TABLE +#define ALPHA_V2_0_GENERAL_TABLE + +#include "alpha/v2.0/general/ColumnHeaders.hpp" +#include "alpha/v2.0/general/Data.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(columnHeaders(),column); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->rows, \ + this->columns, \ + this->columnHeaders, \ + this->data \ + ) + + // default + Table() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Table( + const wrapper + &rows, + const wrapper + &columns = {}, + const wrapper + &columnHeaders = {}, + const wrapper + &data = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + rows(this,rows), + columns(this,columns), + columnHeaders(this,columnHeaders), + data(this,data) + { + Component::finish(); + } + + // from node + explicit Table(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Table(const Table &other) : + 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) : + 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 "alpha/v2.0/general/Table/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Table + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Table/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Table/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Table/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TabulatedWidths.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TabulatedWidths.hpp new file mode 100644 index 000000000..3da23a2b9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TabulatedWidths.hpp @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_TABULATEDWIDTHS +#define ALPHA_V2_0_GENERAL_TABULATEDWIDTHS + +#include "alpha/v2.0/general/ResonanceReactions.hpp" +#include "alpha/v2.0/general/Ls.hpp" +#include "alpha/v2.0/top/PoPs.hpp" +#include "alpha/v2.0/general/ScatteringRadius.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Ls(),L); + GNDSTK_SHORTCUT(resonanceReactions(),resonanceReaction); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->approximation, \ + this->useForSelfShieldingOnly, \ + this->resonanceReactions, \ + this->Ls, \ + this->PoPs, \ + this->scatteringRadius \ + ) + + // default + TabulatedWidths() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + TabulatedWidths(const TabulatedWidths &other) : + 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) : + 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 "alpha/v2.0/general/TabulatedWidths/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class TabulatedWidths + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TabulatedWidths/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TabulatedWidths/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TabulatedWidths/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Temperature.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Temperature.hpp new file mode 100644 index 000000000..ad123a800 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Temperature.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_TEMPERATURE +#define ALPHA_V2_0_GENERAL_TEMPERATURE + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + Temperature() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Temperature( + const wrapper + &value, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Temperature(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Temperature(const Temperature &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + Temperature(Temperature &&other) : + 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 "alpha/v2.0/general/Temperature/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Temperature + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Temperature/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Temperature/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Temperature/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw.hpp new file mode 100644 index 000000000..73ab4fa8b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW +#define ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + ThermalNeutronScatteringLaw() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ThermalNeutronScatteringLaw( + const wrapper + &label, + const wrapper + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw(const ThermalNeutronScatteringLaw &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw(ThermalNeutronScatteringLaw &&other) : + 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 "alpha/v2.0/general/ThermalNeutronScatteringLaw/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw1d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw1d.hpp new file mode 100644 index 000000000..272892bb8 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw1d.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW1D +#define ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW1D + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + ThermalNeutronScatteringLaw1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ThermalNeutronScatteringLaw1d( + const wrapper + &label, + const wrapper + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw1d(const ThermalNeutronScatteringLaw1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw1d(ThermalNeutronScatteringLaw1d &&other) : + 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 "alpha/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw1d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp new file mode 100644 index 000000000..6936a5244 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp @@ -0,0 +1,232 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC +#define ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC + +#include "alpha/v2.0/general/S_table.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(S_table().gridded2d(),array); + GNDSTK_SHORTCUT(S_table().gridded2d(),axes); + GNDSTK_SHORTCUT(S_table(),gridded2d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->S_table \ + ) + + // default + ThermalNeutronScatteringLaw_coherentElastic() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw_coherentElastic(const ThermalNeutronScatteringLaw_coherentElastic &other) : + 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) : + 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 "alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw_coherentElastic + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp new file mode 100644 index 000000000..7133dcf76 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp @@ -0,0 +1,248 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC +#define ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC + +#include "alpha/v2.0/general/BoundAtomCrossSection.hpp" +#include "alpha/v2.0/general/DebyeWallerIntegral.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(DebyeWallerIntegral(),XYs1d); + GNDSTK_SHORTCUT(DebyeWallerIntegral().XYs1d(),axes); + GNDSTK_SHORTCUT(DebyeWallerIntegral().XYs1d(),uncertainty); + GNDSTK_SHORTCUT(DebyeWallerIntegral().XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->boundAtomCrossSection, \ + this->DebyeWallerIntegral \ + ) + + // default + ThermalNeutronScatteringLaw_incoherentElastic() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw_incoherentElastic(const ThermalNeutronScatteringLaw_incoherentElastic &other) : + 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) : + 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 "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw_incoherentElastic + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp new file mode 100644 index 000000000..31a34650f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp @@ -0,0 +1,258 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC +#define ALPHA_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC + +#include "alpha/v2.0/general/ScatteringAtoms.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(scatteringAtoms(),scatteringAtom); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->primaryScatterer, \ + this->calculatedAtThermal, \ + this->scatteringAtoms \ + ) + + // default + ThermalNeutronScatteringLaw_incoherentInelastic() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw_incoherentInelastic(const ThermalNeutronScatteringLaw_incoherentInelastic &other) : + 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) : + 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 "alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw_incoherentInelastic + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Theta.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Theta.hpp new file mode 100644 index 000000000..55bbfc211 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Theta.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_THETA +#define ALPHA_V2_0_GENERAL_THETA + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + Theta() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Theta( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit Theta(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Theta(const Theta &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + Theta(Theta &&other) : + 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 "alpha/v2.0/general/Theta/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Theta + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Theta/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Theta/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Theta/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Time.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Time.hpp new file mode 100644 index 000000000..aa3b32541 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Time.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_TIME +#define ALPHA_V2_0_GENERAL_TIME + +#include "alpha/v2.0/general/Double.hpp" +#include "alpha/v2.0/general/String.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double, \ + this->string \ + ) + + // default + Time() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Time( + const wrapper> + &Double, + const wrapper> + &string = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double), + string(this,string) + { + Component::finish(); + } + + // from node + explicit Time(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Time(const Time &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double), + string(this,other.string) + { + Component::finish(other); + } + + // move + Time(Time &&other) : + 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 "alpha/v2.0/general/Time/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Time + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Time/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Time/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Time/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Title.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Title.hpp new file mode 100644 index 000000000..3a4ddaa2c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Title.hpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_TITLE +#define ALPHA_V2_0_GENERAL_TITLE + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + Title() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Title(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Title(const Title &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Title(Title &&other) : + 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 "alpha/v2.0/general/Title/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Title + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Title/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Title/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Title/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TotalEnergy.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TotalEnergy.hpp new file mode 100644 index 000000000..53a4a6d10 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TotalEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_TOTALENERGY +#define ALPHA_V2_0_GENERAL_TOTALENERGY + +#include "alpha/v2.0/general/Polynomial1d.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(polynomial1d(),axes); + GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + GNDSTK_SHORTCUT(polynomial1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + TotalEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit TotalEnergy( + const wrapper + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit TotalEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + TotalEnergy(const TotalEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + TotalEnergy(TotalEnergy &&other) : + 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 "alpha/v2.0/general/TotalEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class TotalEnergy + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TotalEnergy/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TotalEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/TotalEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/U.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/U.hpp new file mode 100644 index 000000000..bb5284390 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/U.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_U +#define ALPHA_V2_0_GENERAL_U + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + U() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit U( + const wrapper + &value, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit U(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + U(const U &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + U(U &&other) : + 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 "alpha/v2.0/general/U/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class U + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/U/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/U/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/U/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncertainty.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncertainty.hpp new file mode 100644 index 000000000..1c1ed043f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncertainty.hpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_UNCERTAINTY +#define ALPHA_V2_0_GENERAL_UNCERTAINTY + +#include "alpha/v2.0/general/Covariance.hpp" +#include "alpha/v2.0/general/Standard.hpp" +#include "alpha/v2.0/general/ListOfCovariances.hpp" +#include "alpha/v2.0/reduced/Polynomial1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->covariance, \ + this->standard, \ + this->listOfCovariances, \ + this->polynomial1d \ + ) + + // default + Uncertainty() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Uncertainty( + const wrapper> + &covariance, + const wrapper> + &standard = {}, + const wrapper> + &listOfCovariances = {}, + const wrapper> + &polynomial1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + covariance(this,covariance), + standard(this,standard), + listOfCovariances(this,listOfCovariances), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit Uncertainty(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Uncertainty(const Uncertainty &other) : + 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) : + 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 "alpha/v2.0/general/Uncertainty/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Uncertainty + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncertainty/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncertainty/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncertainty/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncorrelated.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncorrelated.hpp new file mode 100644 index 000000000..43728f610 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncorrelated.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_UNCORRELATED +#define ALPHA_V2_0_GENERAL_UNCORRELATED + +#include "alpha/v2.0/general/Angular.hpp" +#include "alpha/v2.0/general/Energy.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(energy(),Double); + GNDSTK_SHORTCUT(energy(),MadlandNix); + GNDSTK_SHORTCUT(energy(),NBodyPhaseSpace); + GNDSTK_SHORTCUT(energy(),discreteGamma); + GNDSTK_SHORTCUT(energy(),evaporation); + GNDSTK_SHORTCUT(energy(),generalEvaporation); + GNDSTK_SHORTCUT(angular(),isotropic2d); + GNDSTK_SHORTCUT(energy(),primaryGamma); + GNDSTK_SHORTCUT(energy(),simpleMaxwellianFission); + GNDSTK_SHORTCUT(energy(),weightedFunctionals); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->angular, \ + this->energy \ + ) + + // default + Uncorrelated() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Uncorrelated( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper + &angular = {}, + const wrapper + &energy = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + angular(this,angular), + energy(this,energy) + { + Component::finish(); + } + + // from node + explicit Uncorrelated(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Uncorrelated(const Uncorrelated &other) : + 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) : + 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 "alpha/v2.0/general/Uncorrelated/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Uncorrelated + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncorrelated/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncorrelated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Uncorrelated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodox.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodox.hpp new file mode 100644 index 000000000..0f3baf241 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodox.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_UNORTHODOX +#define ALPHA_V2_0_GENERAL_UNORTHODOX + +#include "alpha/v2.0/general/Mass.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(mass(),Double); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->mass \ + ) + + // default + Unorthodox() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unorthodox( + const wrapper + &id, + const wrapper + &mass = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + mass(this,mass) + { + Component::finish(); + } + + // from node + explicit Unorthodox(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unorthodox(const Unorthodox &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + mass(this,other.mass) + { + Component::finish(other); + } + + // move + Unorthodox(Unorthodox &&other) : + 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 "alpha/v2.0/general/Unorthodox/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Unorthodox + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodox/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodox/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodox/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodoxes.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodoxes.hpp new file mode 100644 index 000000000..7cf65dab3 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodoxes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_UNORTHODOXES +#define ALPHA_V2_0_GENERAL_UNORTHODOXES + +#include "alpha/v2.0/general/Unorthodox.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unorthodox \ + ) + + // default + Unorthodoxes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unorthodoxes( + const wrapper> + &unorthodox + ) : + GNDSTK_COMPONENT(BlockData{}), + unorthodox(this,unorthodox) + { + Component::finish(); + } + + // from node + explicit Unorthodoxes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unorthodoxes(const Unorthodoxes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unorthodox(this,other.unorthodox) + { + Component::finish(other); + } + + // move + Unorthodoxes(Unorthodoxes &&other) : + 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 "alpha/v2.0/general/Unorthodoxes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Unorthodoxes + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodoxes/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodoxes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unorthodoxes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unresolved.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unresolved.hpp new file mode 100644 index 000000000..af88dadaa --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unresolved.hpp @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_UNRESOLVED +#define ALPHA_V2_0_GENERAL_UNRESOLVED + +#include "alpha/v2.0/general/TabulatedWidths.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(tabulatedWidths().Ls(),L); + GNDSTK_SHORTCUT(tabulatedWidths(),Ls); + GNDSTK_SHORTCUT(tabulatedWidths(),PoPs); + GNDSTK_SHORTCUT(tabulatedWidths().resonanceReactions(),resonanceReaction); + GNDSTK_SHORTCUT(tabulatedWidths(),resonanceReactions); + GNDSTK_SHORTCUT(tabulatedWidths(),scatteringRadius); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->tabulatedWidths \ + ) + + // default + Unresolved() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unresolved( + const wrapper + &domainMin, + const wrapper + &domainMax = {}, + const wrapper + &domainUnit = {}, + const wrapper + &tabulatedWidths = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainUnit(this,domainUnit), + tabulatedWidths(this,tabulatedWidths) + { + Component::finish(); + } + + // from node + explicit Unresolved(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unresolved(const Unresolved &other) : + 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) : + 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 "alpha/v2.0/general/Unresolved/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Unresolved + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unresolved/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unresolved/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unresolved/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/UnresolvedRegion.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/UnresolvedRegion.hpp new file mode 100644 index 000000000..13a6c8a87 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/UnresolvedRegion.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_UNRESOLVEDREGION +#define ALPHA_V2_0_GENERAL_UNRESOLVEDREGION + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + UnresolvedRegion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit UnresolvedRegion( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit UnresolvedRegion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + UnresolvedRegion(const UnresolvedRegion &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + UnresolvedRegion(UnresolvedRegion &&other) : + 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 "alpha/v2.0/general/UnresolvedRegion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class UnresolvedRegion + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/UnresolvedRegion/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/UnresolvedRegion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/UnresolvedRegion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unspecified.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unspecified.hpp new file mode 100644 index 000000000..6cb1940ed --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unspecified.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_UNSPECIFIED +#define ALPHA_V2_0_GENERAL_UNSPECIFIED + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame \ + ) + + // default + Unspecified() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unspecified( + const wrapper + &label, + const wrapper> + &productFrame = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame) + { + Component::finish(); + } + + // from node + explicit Unspecified(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unspecified(const Unspecified &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame) + { + Component::finish(other); + } + + // move + Unspecified(Unspecified &&other) : + 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 "alpha/v2.0/general/Unspecified/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Unspecified + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unspecified/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unspecified/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Unspecified/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Values.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Values.hpp new file mode 100644 index 000000000..638caf60f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Values.hpp @@ -0,0 +1,176 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_VALUES +#define ALPHA_V2_0_GENERAL_VALUES + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + Values() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Values(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Values(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Values(const Values &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Values(Values &&other) : + 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 "alpha/v2.0/general/Values/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Values + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Values/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Values/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Values/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Weighted.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Weighted.hpp new file mode 100644 index 000000000..a3a2e2715 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Weighted.hpp @@ -0,0 +1,204 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_WEIGHTED +#define ALPHA_V2_0_GENERAL_WEIGHTED + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Evaporation.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(evaporation(),U); + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(evaporation().theta(),regions1d); + GNDSTK_SHORTCUT(evaporation(),theta); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->evaporation \ + ) + + // default + Weighted() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Weighted( + const wrapper + &XYs1d, + const wrapper + &evaporation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + evaporation(this,evaporation) + { + Component::finish(); + } + + // from node + explicit Weighted(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Weighted(const Weighted &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + evaporation(this,other.evaporation) + { + Component::finish(other); + } + + // move + Weighted(Weighted &&other) : + 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 "alpha/v2.0/general/Weighted/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Weighted + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Weighted/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Weighted/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Weighted/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/WeightedFunctionals.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/WeightedFunctionals.hpp new file mode 100644 index 000000000..8757a966b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/WeightedFunctionals.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_WEIGHTEDFUNCTIONALS +#define ALPHA_V2_0_GENERAL_WEIGHTEDFUNCTIONALS + +#include "alpha/v2.0/general/Weighted.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->weighted \ + ) + + // default + WeightedFunctionals() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit WeightedFunctionals( + const wrapper> + &weighted + ) : + GNDSTK_COMPONENT(BlockData{}), + weighted(this,weighted) + { + Component::finish(); + } + + // from node + explicit WeightedFunctionals(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + WeightedFunctionals(const WeightedFunctionals &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + weighted(this,other.weighted) + { + Component::finish(other); + } + + // move + WeightedFunctionals(WeightedFunctionals &&other) : + 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 "alpha/v2.0/general/WeightedFunctionals/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class WeightedFunctionals + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/WeightedFunctionals/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/WeightedFunctionals/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/WeightedFunctionals/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Width.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Width.hpp new file mode 100644 index 000000000..719948702 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Width.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_WIDTH +#define ALPHA_V2_0_GENERAL_WIDTH + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Constant1d.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->resonanceReaction, \ + this->degreesOfFreedom, \ + this->XYs1d, \ + this->constant1d, \ + this->regions1d \ + ) + + // default + Width() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Width(const Width &other) : + 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) : + 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 "alpha/v2.0/general/Width/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Width + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Width/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Width/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Width/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Widths.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Widths.hpp new file mode 100644 index 000000000..627cdc909 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Widths.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_WIDTHS +#define ALPHA_V2_0_GENERAL_WIDTHS + +#include "alpha/v2.0/general/Width.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->width \ + ) + + // default + Widths() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Widths( + const wrapper> + &width + ) : + GNDSTK_COMPONENT(BlockData{}), + width(this,width) + { + Component::finish(); + } + + // from node + explicit Widths(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Widths(const Widths &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + width(this,other.width) + { + Component::finish(other); + } + + // move + Widths(Widths &&other) : + 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 "alpha/v2.0/general/Widths/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Widths + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Widths/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Widths/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Widths/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs1d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs1d.hpp new file mode 100644 index 000000000..a7ff399e6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs1d.hpp @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_XYS1D +#define ALPHA_V2_0_GENERAL_XYS1D + +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/general/Values.hpp" +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->index, \ + this->interpolation, \ + this->outerDomainValue, \ + this->axes, \ + this->values, \ + this->uncertainty \ + ) + + // default + XYs1d() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs1d(const XYs1d &other) : + 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) : + 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 "alpha/v2.0/general/XYs1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class XYs1d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs1d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs2d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs2d.hpp new file mode 100644 index 000000000..7601256c9 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs2d.hpp @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_XYS2D +#define ALPHA_V2_0_GENERAL_XYS2D + +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/general/Function1ds.hpp" +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(function1ds(),Legendre); + GNDSTK_SHORTCUT(function1ds(),XYs1d); + GNDSTK_SHORTCUT(function1ds(),regions1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->interpolation, \ + this->interpolationQualifier, \ + this->outerDomainValue, \ + this->axes, \ + this->function1ds, \ + this->uncertainty \ + ) + + // default + XYs2d() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs2d(const XYs2d &other) : + 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) : + 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 "alpha/v2.0/general/XYs2d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class XYs2d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs2d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs3d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs3d.hpp new file mode 100644 index 000000000..22465a2b4 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs3d.hpp @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_XYS3D +#define ALPHA_V2_0_GENERAL_XYS3D + +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/general/Function2ds.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->interpolationQualifier, \ + this->axes, \ + this->function2ds \ + ) + + // default + XYs3d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit XYs3d( + const wrapper> + &interpolationQualifier, + const wrapper> + &axes = {}, + const wrapper> + &function2ds = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + interpolationQualifier(this,interpolationQualifier), + axes(this,axes), + function2ds(this,function2ds) + { + Component::finish(); + } + + // from node + explicit XYs3d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs3d(const XYs3d &other) : + 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) : + 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 "alpha/v2.0/general/XYs3d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class XYs3d + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs3d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/XYs3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Yields.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Yields.hpp new file mode 100644 index 000000000..e7ff77456 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Yields.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_GENERAL_YIELDS +#define ALPHA_V2_0_GENERAL_YIELDS + +#include "alpha/v2.0/reduced/Nuclides.hpp" +#include "alpha/v2.0/general/Values.hpp" +#include "alpha/v2.0/general/Uncertainty.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(uncertainty(),listOfCovariances); + GNDSTK_SHORTCUT(uncertainty(),polynomial1d); + GNDSTK_SHORTCUT(uncertainty(),standard); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclides, \ + this->values, \ + this->uncertainty \ + ) + + // default + Yields() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Yields( + const wrapper + &nuclides, + const wrapper + &values = {}, + const wrapper + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + nuclides(this,nuclides), + values(this,values), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Yields(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Yields(const Yields &other) : + 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) : + 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 "alpha/v2.0/general/Yields/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Yields + +} // namespace general +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Yields/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Yields/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/general/Yields/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/key.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/key.hpp new file mode 100644 index 000000000..48d060bf6 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/key.hpp @@ -0,0 +1,474 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_KEY +#define ALPHA_V2_0_KEY + +// GNDStk Core Interface +#include "GNDStk.hpp" + +namespace alpha { +namespace v2_0 { + +using namespace njoy; +using namespace GNDStk; + + +// ----------------------------------------------------------------------------- +// meta:: +// ----------------------------------------------------------------------------- + +namespace meta { + +#define 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 + +GNDSTK_MAKE_LOOKUP(A,A); +GNDSTK_MAKE_LOOKUP(ENDF_MFMT,ENDF_MFMT); +GNDSTK_MAKE_LOOKUP(ENDF_MT,ENDF_MT); +GNDSTK_MAKE_LOOKUP(L,L); +GNDSTK_MAKE_LOOKUP(Z,Z); +GNDSTK_MAKE_LOOKUP(algorithm,algorithm); +GNDSTK_MAKE_LOOKUP(approximation,approximation); +GNDSTK_MAKE_LOOKUP(boundaryCondition,boundaryCondition); +GNDSTK_MAKE_LOOKUP(calculateChannelRadius,calculateChannelRadius); +GNDSTK_MAKE_LOOKUP(calculatedAtThermal,calculatedAtThermal); +GNDSTK_MAKE_LOOKUP(channelSpin,channelSpin); +GNDSTK_MAKE_LOOKUP(checksum,checksum); +GNDSTK_MAKE_LOOKUP(coefficient,coefficient); +GNDSTK_MAKE_LOOKUP(columnIndex,columnIndex); +GNDSTK_MAKE_LOOKUP(columns,columns); +GNDSTK_MAKE_LOOKUP(complete,complete); +GNDSTK_MAKE_LOOKUP(compression,compression); +GNDSTK_MAKE_LOOKUP(crossTerm,crossTerm); +GNDSTK_MAKE_LOOKUP(date,date); +GNDSTK_MAKE_LOOKUP(dateType,dateType); +GNDSTK_MAKE_LOOKUP(degreesOfFreedom,degreesOfFreedom); +GNDSTK_MAKE_LOOKUP(dependenceOnProcessedGroupWidth,dependenceOnProcessedGroupWidth); +GNDSTK_MAKE_LOOKUP(derivedFrom,derivedFrom); +GNDSTK_MAKE_LOOKUP(dimension,dimension); +GNDSTK_MAKE_LOOKUP(domainMax,domainMax); +GNDSTK_MAKE_LOOKUP(domainMin,domainMin); +GNDSTK_MAKE_LOOKUP(domainUnit,domainUnit); +GNDSTK_MAKE_LOOKUP(domainValue,domainValue); +GNDSTK_MAKE_LOOKUP(ejectile,ejectile); +GNDSTK_MAKE_LOOKUP(electronNumber,electronNumber); +GNDSTK_MAKE_LOOKUP(eliminated,eliminated); +GNDSTK_MAKE_LOOKUP(evaluation,evaluation); +GNDSTK_MAKE_LOOKUP(fissionGenre,fissionGenre); +GNDSTK_MAKE_LOOKUP(flags,flags); +GNDSTK_MAKE_LOOKUP(format,format); +GNDSTK_MAKE_LOOKUP(generation,generation); +GNDSTK_MAKE_LOOKUP(genre,genre); +GNDSTK_MAKE_LOOKUP(href,href); +GNDSTK_MAKE_LOOKUP(id,id); +GNDSTK_MAKE_LOOKUP(identicalParticles,identicalParticles); +GNDSTK_MAKE_LOOKUP(index,index); +GNDSTK_MAKE_LOOKUP(interaction,interaction); +GNDSTK_MAKE_LOOKUP(interpolation,interpolation); +GNDSTK_MAKE_LOOKUP(interpolationQualifier,interpolationQualifier); +GNDSTK_MAKE_LOOKUP(label,label); +GNDSTK_MAKE_LOOKUP(library,library); +GNDSTK_MAKE_LOOKUP(matrixStartIndex,matrixStartIndex); +GNDSTK_MAKE_LOOKUP(max,max); +GNDSTK_MAKE_LOOKUP(metaStableIndex,metaStableIndex); +GNDSTK_MAKE_LOOKUP(min,min); +GNDSTK_MAKE_LOOKUP(mode,mode); +GNDSTK_MAKE_LOOKUP(muCutoff,muCutoff); +GNDSTK_MAKE_LOOKUP(nParameters,nParameters); +GNDSTK_MAKE_LOOKUP(name,name); +GNDSTK_MAKE_LOOKUP(numberOfProducts,numberOfProducts); +GNDSTK_MAKE_LOOKUP(numberPerMolecule,numberPerMolecule); +GNDSTK_MAKE_LOOKUP(outerDomainValue,outerDomainValue); +GNDSTK_MAKE_LOOKUP(parity,parity); +GNDSTK_MAKE_LOOKUP(path,path); +GNDSTK_MAKE_LOOKUP(pid,pid); +GNDSTK_MAKE_LOOKUP(primaryScatterer,primaryScatterer); +GNDSTK_MAKE_LOOKUP(process,process); +GNDSTK_MAKE_LOOKUP(productFrame,productFrame); +GNDSTK_MAKE_LOOKUP(projectile,projectile); +GNDSTK_MAKE_LOOKUP(projectileFrame,projectileFrame); +GNDSTK_MAKE_LOOKUP(resonanceReaction,resonanceReaction); +GNDSTK_MAKE_LOOKUP(rows,rows); +GNDSTK_MAKE_LOOKUP(shape,shape); +GNDSTK_MAKE_LOOKUP(spin,spin); +GNDSTK_MAKE_LOOKUP(style,style); +GNDSTK_MAKE_LOOKUP(subshell,subshell); +GNDSTK_MAKE_LOOKUP(supportsAngularReconstruction,supportsAngularReconstruction); +GNDSTK_MAKE_LOOKUP(symbol,symbol); +GNDSTK_MAKE_LOOKUP(symmetric,symmetric); +GNDSTK_MAKE_LOOKUP(symmetry,symmetry); +GNDSTK_MAKE_LOOKUP(target,target); +GNDSTK_MAKE_LOOKUP(type,type); +GNDSTK_MAKE_LOOKUP(unit,unit); +GNDSTK_MAKE_LOOKUP(useForSelfShieldingOnly,useForSelfShieldingOnly); +GNDSTK_MAKE_LOOKUP(value,value); +GNDSTK_MAKE_LOOKUP(valueType,valueType); +GNDSTK_MAKE_LOOKUP(version,version); + +#undef 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 alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/CrossSection.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/CrossSection.hpp new file mode 100644 index 000000000..a4d09adc5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/CrossSection.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_REDUCED_CROSSSECTION +#define ALPHA_V2_0_REDUCED_CROSSSECTION + +#include "alpha/v2.0/general/XYs1d.hpp" +#include "alpha/v2.0/general/Regions1d.hpp" +#include "alpha/v2.0/general/Reference.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d, \ + this->reference \ + ) + + // default + CrossSection() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSection( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {}, + const wrapper> + &reference = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d), + reference(this,reference) + { + Component::finish(); + } + + // from node + explicit CrossSection(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSection(const CrossSection &other) : + 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) : + 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 "alpha/v2.0/reduced/CrossSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CrossSection + +} // namespace reduced +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/CrossSection/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/CrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/CrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Distribution.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Distribution.hpp new file mode 100644 index 000000000..d115f69e1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Distribution.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_REDUCED_DISTRIBUTION +#define ALPHA_V2_0_REDUCED_DISTRIBUTION + +#include "alpha/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "alpha/v2.0/general/Uncorrelated.hpp" +#include "alpha/v2.0/general/Unspecified.hpp" +#include "alpha/v2.0/general/XYs2d.hpp" +#include "alpha/v2.0/general/Branching3d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->thermalNeutronScatteringLaw, \ + this->uncorrelated, \ + this->unspecified, \ + this->XYs2d, \ + this->branching3d \ + ) + + // default + Distribution() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Distribution(const Distribution &other) : + 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) : + 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 "alpha/v2.0/reduced/Distribution/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Distribution + +} // namespace reduced +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Distribution/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Distribution/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Distribution/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Double.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Double.hpp new file mode 100644 index 000000000..b392f4ddc --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Double.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_REDUCED_DOUBLE +#define ALPHA_V2_0_REDUCED_DOUBLE + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value \ + ) + + // default + Double() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Double( + const wrapper + &value + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value) + { + Component::finish(); + } + + // from node + explicit Double(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Double(const Double &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value) + { + Component::finish(other); + } + + // move + Double(Double &&other) : + 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 "alpha/v2.0/reduced/Double/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Double + +} // namespace reduced +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Double/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Double/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Double/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Function1ds.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Function1ds.hpp new file mode 100644 index 000000000..4c6c9698c --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Function1ds.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_REDUCED_FUNCTION1DS +#define ALPHA_V2_0_REDUCED_FUNCTION1DS + +#include "alpha/v2.0/general/Legendre.hpp" +#include "alpha/v2.0/general/XYs1d.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Legendre, \ + this->XYs1d \ + ) + + // default + Function1ds() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Function1ds( + const wrapper> + &Legendre, + const wrapper>> + &XYs1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + Legendre(this,Legendre), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit Function1ds(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Function1ds(const Function1ds &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Legendre(this,other.Legendre), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + Function1ds(Function1ds &&other) : + 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 "alpha/v2.0/reduced/Function1ds/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Function1ds + +} // namespace reduced +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Function1ds/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Function1ds/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Function1ds/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Nuclides.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Nuclides.hpp new file mode 100644 index 000000000..8f09a19a5 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Nuclides.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_REDUCED_NUCLIDES +#define ALPHA_V2_0_REDUCED_NUCLIDES + +#include "alpha/v2.0/key.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + static_cast(*this) \ + ) + + // default + Nuclides() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nuclides( + const wrapper> + &href + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Nuclides(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Nuclides(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Nuclides(const Nuclides &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Nuclides(Nuclides &&other) : + 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 "alpha/v2.0/reduced/Nuclides/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Nuclides + +} // namespace reduced +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Nuclides/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Nuclides/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Nuclides/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/OutputChannel.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/OutputChannel.hpp new file mode 100644 index 000000000..2c316ccd7 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/OutputChannel.hpp @@ -0,0 +1,232 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_REDUCED_OUTPUTCHANNEL +#define ALPHA_V2_0_REDUCED_OUTPUTCHANNEL + +#include "alpha/v2.0/general/Q.hpp" +#include "alpha/v2.0/reduced/Products.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Q(),Double); + GNDSTK_SHORTCUT(Q(),constant1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->genre, \ + this->process, \ + this->Q, \ + this->products \ + ) + + // default + OutputChannel() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OutputChannel( + const wrapper + &genre, + const wrapper> + &process = {}, + const wrapper + &Q = {}, + const wrapper> + &products = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + genre(this,genre), + process(this,process), + Q(this,Q), + products(this,products) + { + Component::finish(); + } + + // from node + explicit OutputChannel(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OutputChannel(const OutputChannel &other) : + 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) : + 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 "alpha/v2.0/reduced/OutputChannel/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class OutputChannel + +} // namespace reduced +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/OutputChannel/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/OutputChannel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/OutputChannel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Polynomial1d.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Polynomial1d.hpp new file mode 100644 index 000000000..97efecf0e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Polynomial1d.hpp @@ -0,0 +1,232 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_REDUCED_POLYNOMIAL1D +#define ALPHA_V2_0_REDUCED_POLYNOMIAL1D + +#include "alpha/v2.0/general/Axes.hpp" +#include "alpha/v2.0/general/Values.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->axes, \ + this->values \ + ) + + // default + Polynomial1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Polynomial1d( + const wrapper + &domainMin, + const wrapper + &domainMax = {}, + const wrapper + &axes = {}, + const wrapper + &values = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Polynomial1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Polynomial1d(const Polynomial1d &other) : + 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) : + 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 "alpha/v2.0/reduced/Polynomial1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Polynomial1d + +} // namespace reduced +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Polynomial1d/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Polynomial1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Polynomial1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Product.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Product.hpp new file mode 100644 index 000000000..bc96fd6b1 --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Product.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_REDUCED_PRODUCT +#define ALPHA_V2_0_REDUCED_PRODUCT + +#include "alpha/v2.0/general/Multiplicity.hpp" +#include "alpha/v2.0/reduced/Distribution.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(multiplicity(),XYs1d); + GNDSTK_SHORTCUT(distribution(),XYs2d); + GNDSTK_SHORTCUT(multiplicity(),branching1d); + GNDSTK_SHORTCUT(multiplicity(),constant1d); + GNDSTK_SHORTCUT(multiplicity(),polynomial1d); + GNDSTK_SHORTCUT(multiplicity(),reference); + GNDSTK_SHORTCUT(multiplicity(),regions1d); + GNDSTK_SHORTCUT(distribution(),thermalNeutronScatteringLaw); + GNDSTK_SHORTCUT(distribution(),uncorrelated); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->multiplicity, \ + this->distribution \ + ) + + // default + Product() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Product( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper + &multiplicity = {}, + const wrapper + &distribution = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + multiplicity(this,multiplicity), + distribution(this,distribution) + { + Component::finish(); + } + + // from node + explicit Product(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Product(const Product &other) : + 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) : + 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 "alpha/v2.0/reduced/Product/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Product + +} // namespace reduced +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Product/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Product/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Product/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Products.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Products.hpp new file mode 100644 index 000000000..d1cb8f11f --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Products.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_REDUCED_PRODUCTS +#define ALPHA_V2_0_REDUCED_PRODUCTS + +#include "alpha/v2.0/reduced/Product.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->product \ + ) + + // default + Products() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Products( + const wrapper> + &product + ) : + GNDSTK_COMPONENT(BlockData{}), + product(this,product) + { + Component::finish(); + } + + // from node + explicit Products(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Products(const Products &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + product(this,other.product) + { + Component::finish(other); + } + + // move + Products(Products &&other) : + 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 "alpha/v2.0/reduced/Products/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Products + +} // namespace reduced +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Products/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Products/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/reduced/Products/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/CovarianceSuite.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/CovarianceSuite.hpp new file mode 100644 index 000000000..35fab24fb --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/CovarianceSuite.hpp @@ -0,0 +1,307 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_TOP_COVARIANCESUITE +#define ALPHA_V2_0_TOP_COVARIANCESUITE + +#include "alpha/v2.0/general/ExternalFiles.hpp" +#include "alpha/v2.0/general/Styles.hpp" +#include "alpha/v2.0/general/CovarianceSections.hpp" +#include "alpha/v2.0/general/ParameterCovariances.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(styles(),crossSectionReconstructed); + GNDSTK_SHORTCUT(styles().evaluated(),documentation); + GNDSTK_SHORTCUT(styles(),evaluated); + GNDSTK_SHORTCUT(styles().evaluated(),projectileEnergyDomain); + GNDSTK_SHORTCUT(styles().evaluated(),temperature); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceSuite(const CovarianceSuite &other) : + 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) : + 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 "alpha/v2.0/top/CovarianceSuite/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CovarianceSuite + +} // namespace top +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/CovarianceSuite/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/CovarianceSuite/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/CovarianceSuite/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/FissionFragmentData.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/FissionFragmentData.hpp new file mode 100644 index 000000000..7b8c22cef --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/FissionFragmentData.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_TOP_FISSIONFRAGMENTDATA +#define ALPHA_V2_0_TOP_FISSIONFRAGMENTDATA + +#include "alpha/v2.0/general/ProductYields.hpp" +#include "alpha/v2.0/general/DelayedNeutrons.hpp" +#include "alpha/v2.0/general/FissionEnergyReleases.hpp" + +namespace alpha { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->productYields, \ + this->delayedNeutrons, \ + this->fissionEnergyReleases \ + ) + + // default + FissionFragmentData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionFragmentData( + const wrapper> + &productYields, + const wrapper> + &delayedNeutrons = {}, + const wrapper> + &fissionEnergyReleases = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + productYields(this,productYields), + delayedNeutrons(this,delayedNeutrons), + fissionEnergyReleases(this,fissionEnergyReleases) + { + Component::finish(); + } + + // from node + explicit FissionFragmentData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionFragmentData(const FissionFragmentData &other) : + 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) : + 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 "alpha/v2.0/top/FissionFragmentData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FissionFragmentData + +} // namespace top +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/FissionFragmentData/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/FissionFragmentData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/FissionFragmentData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/PoPs.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/PoPs.hpp new file mode 100644 index 000000000..b180d016b --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/PoPs.hpp @@ -0,0 +1,315 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_TOP_POPS +#define ALPHA_V2_0_TOP_POPS + +#include "alpha/v2.0/general/Aliases.hpp" +#include "alpha/v2.0/general/Baryons.hpp" +#include "alpha/v2.0/general/ChemicalElements.hpp" +#include "alpha/v2.0/general/Styles.hpp" +#include "alpha/v2.0/general/Unorthodoxes.hpp" +#include "alpha/v2.0/general/GaugeBosons.hpp" +#include "alpha/v2.0/general/Leptons.hpp" + +namespace alpha { +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 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PoPs(const PoPs &other) : + 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) : + 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 "alpha/v2.0/top/PoPs/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PoPs + +} // namespace top +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/PoPs/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/PoPs/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/PoPs/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/ReactionSuite.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/ReactionSuite.hpp new file mode 100644 index 000000000..147f5810e --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/ReactionSuite.hpp @@ -0,0 +1,430 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef ALPHA_V2_0_TOP_REACTIONSUITE +#define ALPHA_V2_0_TOP_REACTIONSUITE + +#include "alpha/v2.0/general/Styles.hpp" +#include "alpha/v2.0/top/PoPs.hpp" +#include "alpha/v2.0/general/Reactions.hpp" +#include "alpha/v2.0/general/ApplicationData.hpp" +#include "alpha/v2.0/general/ExternalFiles.hpp" +#include "alpha/v2.0/general/Resonances.hpp" +#include "alpha/v2.0/general/Sums.hpp" +#include "alpha/v2.0/general/Productions.hpp" +#include "alpha/v2.0/general/FissionComponents.hpp" +#include "alpha/v2.0/general/OrphanProducts.hpp" +#include "alpha/v2.0/general/IncompleteReactions.hpp" + +namespace alpha { +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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(PoPs(),aliases); + GNDSTK_SHORTCUT(PoPs(),baryons); + GNDSTK_SHORTCUT(PoPs(),chemicalElements); + GNDSTK_SHORTCUT(styles().evaluated(),documentation); + GNDSTK_SHORTCUT(PoPs(),gaugeBosons); + GNDSTK_SHORTCUT(PoPs(),leptons); + GNDSTK_SHORTCUT(styles().evaluated(),projectileEnergyDomain); + GNDSTK_SHORTCUT(styles().evaluated(),temperature); + GNDSTK_SHORTCUT(PoPs(),unorthodoxes); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define 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() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ReactionSuite(const ReactionSuite &other) : + 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) : + 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 "alpha/v2.0/top/ReactionSuite/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ReactionSuite + +} // namespace top +} // namespace v2_0 +} // namespace alpha + +#endif diff --git a/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/ReactionSuite/src/custom.hpp b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/ReactionSuite/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0-alpha/alpha/src/alpha/v2.0/top/ReactionSuite/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0-alpha/changes.json b/standards/gnds-2.0-alpha/changes.json new file mode 100644 index 000000000..e35c0ecc0 --- /dev/null +++ b/standards/gnds-2.0-alpha/changes.json @@ -0,0 +1,175 @@ +{ + "// 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" : { + "// json spec corrections" : "", + "bodyText" : "std::string", + "attributeValue" : "std::string", + "date" : "std::string", + "checksum" : "std::string", + "Boolean" : "bool", + + "// enumerator types" : "", + "dateType" : "enums::DateType", + "contributorType" : "enums::ContributorType", + "relationType" : "enums::RelationType", + "parity" : "enums::Parity", + "frame" : "enums::Frame", + "interpolation" : "enums::Interpolation", + "interpolationQualifier" : "enums::InterpolationQualifier", + "hashAlgorithm" : "enums::HashAlgorithm", + "algorithm" : "enums::HashAlgorithm", + "decayType" : "enums::DecayType", + "gridStyle" : "enums::GridStyle", + "boundaryCondition" : "enums::BoundaryCondition", + "interaction" : "enums::Interaction" + }, + + "// 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'": "", + + "// json spec corrections" : "", + "\\\\attr{lin-lin}" : "enums::Interpolation::linlin", + + "// 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", + + "// 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", + + "// 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", + + "// parity" : "", + "-1" : "enums::Parity::minus", + "+1" : "enums::Parity::plus", + + "// frame" : "", + "lab" : "enums::Frame::lab", + "centerOfMass" : "enums::Frame::centerOfMass", + + "// 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", + + "// interpolationQualifier" : "", + "direct" : "enums::InterpolationQualifier::direct", + "unitBase" : "enums::InterpolationQualifier::unitBase", + "correspondingEnergies" : "enums::InterpolationQualifier::correspondingEnergies", + "correspondingPoints" : "enums::InterpolationQualifier::correspondingPoints", + + "// hashAlgorithm" : "", + "md5" : "enums::HashAlgorithm::md5", + "sha1" : "enums::HashAlgorithm::sha1", + + "// 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", + + "// gridStyle" : "", + "none" : "enums::GridStyle::none", + "points" : "enums::GridStyle::points", + "boundaries" : "enums::GridStyle::boundaries", + "parameters" : "enums::GridStyle::parameters", + + "// boundaryCondition" : "", + "EliminateShiftFunction" : "enums::BoundaryCondition::EliminateShiftFunction", + "NegativeOrbitalMomentum" : "enums::BoundaryCondition::NegativeOrbitalMomentum", + "Brune" : "enums::BoundaryCondition::Brune", + "Given" : "enums::BoundaryCondition::Given", + + "// interaction" : "", + "nuclear" : "enums::Interaction::nuclear", + "atomic" : "enums::Interaction::atomic", + "thermalNeutronScatteringLaw" : "enums::Interaction::thermalNeutronScatteringLaw" + } + } +} diff --git a/standards/gnds-2.0-alpha/compile b/standards/gnds-2.0-alpha/compile new file mode 100755 index 000000000..62e641d54 --- /dev/null +++ b/standards/gnds-2.0-alpha/compile @@ -0,0 +1,37 @@ +#!/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 + -Ialpha/src + -Ideps/pugixml-adapter-src/src/src + -Ideps/hdf5-src/include + -Ideps/json-src/include + -Ideps/json-src/include/nlohmann + -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/standards/gnds-2.0-alpha/g2d.json b/standards/gnds-2.0-alpha/g2d.json new file mode 100644 index 000000000..6610b0c5d --- /dev/null +++ b/standards/gnds-2.0-alpha/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/standards/gnds-2.0-alpha/g3d.json b/standards/gnds-2.0-alpha/g3d.json new file mode 100644 index 000000000..4083b0162 --- /dev/null +++ b/standards/gnds-2.0-alpha/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/standards/gnds-2.0-alpha/general.json b/standards/gnds-2.0-alpha/general.json new file mode 100644 index 000000000..37484cb7b --- /dev/null +++ b/standards/gnds-2.0-alpha/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/standards/gnds-2.0-alpha/reduced.json b/standards/gnds-2.0-alpha/reduced.json new file mode 100644 index 000000000..dd08b32b9 --- /dev/null +++ b/standards/gnds-2.0-alpha/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/standards/gnds-2.0-alpha/top.json b/standards/gnds-2.0-alpha/top.json new file mode 100644 index 000000000..61db80caf --- /dev/null +++ b/standards/gnds-2.0-alpha/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 + } + } + } +} diff --git a/standards/gnds-2.0/.gitignore b/standards/gnds-2.0/.gitignore new file mode 100644 index 000000000..0a88b3bd1 --- /dev/null +++ b/standards/gnds-2.0/.gitignore @@ -0,0 +1,2 @@ + +json2class.exe diff --git a/standards/gnds-2.0/changes.json b/standards/gnds-2.0/changes.json new file mode 100644 index 000000000..e35c0ecc0 --- /dev/null +++ b/standards/gnds-2.0/changes.json @@ -0,0 +1,175 @@ +{ + "// 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" : { + "// json spec corrections" : "", + "bodyText" : "std::string", + "attributeValue" : "std::string", + "date" : "std::string", + "checksum" : "std::string", + "Boolean" : "bool", + + "// enumerator types" : "", + "dateType" : "enums::DateType", + "contributorType" : "enums::ContributorType", + "relationType" : "enums::RelationType", + "parity" : "enums::Parity", + "frame" : "enums::Frame", + "interpolation" : "enums::Interpolation", + "interpolationQualifier" : "enums::InterpolationQualifier", + "hashAlgorithm" : "enums::HashAlgorithm", + "algorithm" : "enums::HashAlgorithm", + "decayType" : "enums::DecayType", + "gridStyle" : "enums::GridStyle", + "boundaryCondition" : "enums::BoundaryCondition", + "interaction" : "enums::Interaction" + }, + + "// 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'": "", + + "// json spec corrections" : "", + "\\\\attr{lin-lin}" : "enums::Interpolation::linlin", + + "// 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", + + "// 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", + + "// 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", + + "// parity" : "", + "-1" : "enums::Parity::minus", + "+1" : "enums::Parity::plus", + + "// frame" : "", + "lab" : "enums::Frame::lab", + "centerOfMass" : "enums::Frame::centerOfMass", + + "// 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", + + "// interpolationQualifier" : "", + "direct" : "enums::InterpolationQualifier::direct", + "unitBase" : "enums::InterpolationQualifier::unitBase", + "correspondingEnergies" : "enums::InterpolationQualifier::correspondingEnergies", + "correspondingPoints" : "enums::InterpolationQualifier::correspondingPoints", + + "// hashAlgorithm" : "", + "md5" : "enums::HashAlgorithm::md5", + "sha1" : "enums::HashAlgorithm::sha1", + + "// 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", + + "// gridStyle" : "", + "none" : "enums::GridStyle::none", + "points" : "enums::GridStyle::points", + "boundaries" : "enums::GridStyle::boundaries", + "parameters" : "enums::GridStyle::parameters", + + "// boundaryCondition" : "", + "EliminateShiftFunction" : "enums::BoundaryCondition::EliminateShiftFunction", + "NegativeOrbitalMomentum" : "enums::BoundaryCondition::NegativeOrbitalMomentum", + "Brune" : "enums::BoundaryCondition::Brune", + "Given" : "enums::BoundaryCondition::Given", + + "// interaction" : "", + "nuclear" : "enums::Interaction::nuclear", + "atomic" : "enums::Interaction::atomic", + "thermalNeutronScatteringLaw" : "enums::Interaction::thermalNeutronScatteringLaw" + } + } +} diff --git a/standards/gnds-2.0/gnds-2.0.json b/standards/gnds-2.0/gnds-2.0.json new file mode 100644 index 000000000..dc9b64318 --- /dev/null +++ b/standards/gnds-2.0/gnds-2.0.json @@ -0,0 +1,33 @@ +{ + "Path": ".", + "Project": "test", + "Version": "v2.0", + + "JSONDir": ".", + "JSONFiles": [ + "summary_extra.json", + "summary_appData.json", + "summary_atomic.json", + "summary_common.json", + "summary_covariance.json", + "summary_cpTransport.json", + "summary_documentation.json", + "summary_fissionFragmentData.json", + "summary_fissionTransport.json", + "summary_fpy.json", + "summary_gpdc.json", + "summary_mapfile.json", + "summary_pops.json", + "summary_processed.json", + "summary_resonance.json", + "summary_styles.json", + "summary_transport.json", + "summary_tsl.json" + ], + "Remark. The following should NOT now be part of the code generation!": [ + "summary_abstract.json", + "summary_basic.json" + ], + + "Changes": "changes.json" +} diff --git a/standards/gnds-2.0/readme b/standards/gnds-2.0/readme new file mode 100644 index 000000000..5db45e912 --- /dev/null +++ b/standards/gnds-2.0/readme @@ -0,0 +1,46 @@ +GNDS standard version : 2.0 +GNDS specification repository : https://git.oecd-nea.org/science/wpec/gnds/formats +commit hash : 9475a2829505b98a197a6492738bc84901f78d6a + +files : + Conventions/summary_abstract.json + DataContainers/summary_basic.json + DataContainers/summary_gpdc.json + Documentation/summary_documentation.json + PoPs/summary_pops.json + Styles/summary_styles.json + TopLevel/summary_appData.json + TopLevel/summary_atomic.json + TopLevel/summary_common.json + TopLevel/summary_covariance.json + TopLevel/summary_cpTransport.json + TopLevel/summary_fissionFragmentData.json + TopLevel/summary_fissionTransport.json + TopLevel/summary_fpy.json + TopLevel/summary_mapFile.json + TopLevel/summary_processed.json + TopLevel/summary_resonance.json + TopLevel/summary_transport.json + TopLevel/summary_tsl.json + +autogenerator input files : + changes.json + gnds-2.0.json + +changes: + - renamed namespace: gpdc to containers + - defaults specified as "`' (i.e. unitless)" or "`' (no label)" were set to + null since there is no default. + - removed all uncertainty nodes from gpdc, pops and fpy due to circular references + - set the domainMin and domainMax defaults to "1.0" and "-1.0" to not confuse the + autogenerator (parity enum values are "+1" and "-1") + - replaced the appearance of the "functional" abstract child node by the actual + child nodes that can appear using choice+ in the function1ds, function2ds + and function3ds node. regions1d, etc are excluded since regions1d has a + functions1d node containing regions1d too. This is a major restriction but it + is required to get it working. + - removed the MC related nodes for pdf/cdf, etc. + - removed the abstract, title, body, note, executionArguments, endfCompatible, + correctionScript, covarianceScript, version nodes from the documentation + - corrected typo in documentation: "affilation" + - changed type date in exforDataSet to string type diff --git a/standards/gnds-2.0/summary_abstract.json b/standards/gnds-2.0/summary_abstract.json new file mode 100644 index 000000000..6c330da41 --- /dev/null +++ b/standards/gnds-2.0/summary_abstract.json @@ -0,0 +1,252 @@ +{ + "__namespace__":"abstract", + "Specifications":{ + "__class__": "nodes.Node", + "abstractNode": "abstract node's name", + "attributes": { + "attribute1": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Description of attribute.", + "name": "attribute1", + "required": true, + "type": "Integer32" + }, + "attribute2": { + "__class__": "nodes.Attribute", + "default": "1.0", + "description": "Description of attribute.", + "name": "attribute2", + "required": false, + "type": "Float64" + }, + "attribute3": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Description of attribute.", + "name": "attribute3", + "required": false, + "type": "Float64" + } + }, + "bodyText": "Description of body text.", + "childNodes":{ + "childNode1":{ + "__class__": "nodes.ChildNode", + "description": "Description of node.", + "name": "childNode1", + "occurrence": "1+", + "required": true + }, + "childNode2":{ + "__class__": "nodes.ChildNode", + "description": "Description of node.", + "name": "childNode2", + "occurrence": "1", + "required": false + }, + "childNode3":{ + "__class__": "nodes.ChildNode", + "description": "Description of node.", + "name": "childNodeWithChoice1", + "occurrence": "choice", + "required": false + }, + "childNode4":{ + "__class__": "nodes.ChildNode", + "description": "Description of node.", + "name": "childNodeWithChoice2", + "occurrence": "choice", + "required": false + } + }, + "description": [ + "The specification for each container will contain the container's nodeName, abstract node, attributes and body (i.e. child nodes or text).", + "An abstract node\\footnote{In this sense, an abstract node is like an abstract base class in C++ or Python.}", + "describes attributes and/or body common to several containers and, in itself, is not an actual node (container). The general specification looks like" + ], + "name": "node", + "required": false, + "rootNode": false + }, + "labelNode":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The label is used to allow an xlink to uniquely address to the node (container).", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "Many nodes (containers) can reside in other nodes. When more than one node of the same type is embedded in another node,", + "a unique way is needed to address a specific node. The label attribute provides this capability. An xlink can address a", + "child node with a unique label even when embedded in a parent node containing more than one child nodes of the same type." + ], + "name": "label", + "required": false, + "rootNode": false + }, + "functionalNode":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A label is required for a top-level functional node, but not for lower-dimensional functions appearing inside another functional node.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "For an $n$-dimensional function, this is its associated $x_{n+1}$ value. Required for all functional nodes that are nested inside higher-dimension functional nodes.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": "An \\elemlink{axes} node.", + "name": "axes", + "occurrence": "1", + "required": true + }, + "values": { + "__class__": "nodes.ChildNode", + "description": "A list of numeric values. The meaning of the numbers depends on the type of function.", + "name": "values", + "occurrence": "choice", + "required": false + }, + "functional": { + "__class__": "nodes.ChildNode", + "description": "A list of lower-dimensional functions contained inside this function.", + "name": "functional", + "occurrence": "choice2+", + "required": false + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "The \\elemlink{uncertainty} node.", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": "This section lists attributes and child nodes common to functional nodes (containers). These are the `outerDomainValue' attribute and the child node \\elemlink{axes}.", + "name": "functional", + "required": false, + "rootNode": false + }, + "textNode":{ + "__class__": "nodes.Node", + "attributes": { + "encoding": { + "__class__": "nodes.Attribute", + "default": "ascii", + "description": "One of `ascii' or `utf8'. Defines the allowed character set for the body.", + "name": "encoding", + "required": false, + "type": "XMLName" + }, + "markup": { + "__class__": "nodes.Attribute", + "default": "none", + "description": "One of `none', `xml', `xhtml', `latex', or other markups defined by a project.", + "name": "markup", + "required": false, + "type": "attributeValue" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The label for the text node.", + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": ["The list of characters. The value for the encoding attribute defines the allowed character set.", + "If the data are being stored in an XML file and if the body contains XML markup characters ", + "(e.g. '<', '>'), then the characters must wrapped in special XML CDATA\\footnote{An XML CDATA ", + "section is need whenever a string contains characters that are normally reserved for xml ", + "markup, such as `<', `>', `/', and `\\&'.} section."], + "childNodes": {}, + "description": "This node stores a list of characters. This node can be used to store documentation, for example.", + "name": "text", + "required": false, + "rootNode": false + }, + "physicalQuantityNode":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The label is used to allow an xlink to uniquely address to the node (container).", + "name": "label", + "required": true, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": "", + "description": "String name of the unit for this quantity. The unit can be omitted if the quantity is unitless.", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Determined by the sub-class. Value is usually a Float64, but may also be Integer32, Fraction32 or String.", + "name": "value", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation specific to the physical quantity.", + "name": "documentation", + "occurrence": "1", + "required": false + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "The \\elemlink{uncertainty} node.", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": ["Within, for example, a particle property, each possible assignment is a physical quantity", + "with a value, a unit, and optional documentation and uncertainty information.", + "Each physical quantity is assigned a label, so that if the database contains multiple", + "possible assignments for a particle's property one can uniquely identify each possible", + "assignment by the corresponding label.\n\nFor most properties in the particle database,", + "the \\attr{value} is a floating-point number. However, the database also supports storing", + "values that are integers (e.g. for parity), fractions (for spin) and strings", + "(for values like `stable'). Since slightly different rules apply to each type of quantity,", + "they are given unique abstract node names: \\element{Float64}, \\element{Integer32}, \\element{Fraction32}", + "and \\element{String}. This section defines the abstract node used by the physical quantities."], + "name": "physicalQuantity", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_appData.json b/standards/gnds-2.0/summary_appData.json new file mode 100644 index 000000000..fe08cc8e9 --- /dev/null +++ b/standards/gnds-2.0/summary_appData.json @@ -0,0 +1,97 @@ +{ + "__namespace__":"appData", +"applicationData":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "institution": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "institution", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "applicationData", + "required": false, + "rootNode": false +}, +"institution":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "ENDFconversionFlags": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "ENDFconversionFlags", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "institution", + "required": false, + "rootNode": false +}, +"ENDFconversionFlags":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "conversion": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "conversion", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "ENDFconversionFlags", + "required": false, + "rootNode": false +}, +"conversion":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "flags": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "flags", + "required": false, + "type": "XMLName" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "href", + "required": false, + "type": "bodyText" + } + }, + "bodyText": null, + "childNodes": {}, + "description": null, + "name": "conversion", + "required": false, + "rootNode": false +} +} diff --git a/standards/gnds-2.0/summary_atomic.json b/standards/gnds-2.0/summary_atomic.json new file mode 100644 index 000000000..3268971ef --- /dev/null +++ b/standards/gnds-2.0/summary_atomic.json @@ -0,0 +1,331 @@ +{ + "__namespace__":"atomic", + "coherentPhotonScattering":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "When \\element{coherentPhotonScattering} is used in place of an actual distribution ", + "this link is used to refer back to the parameterisation that defines the distribution." + ], + "name": "href", + "required": false, + "type": "bodyText" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Style label for this cross section.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The particle identifier of the outgoing particle.", + "name": "pid", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "frame" + } + }, + "bodyText": null, + "childNodes": { + "formFactor": { + "__class__": "nodes.ChildNode", + "description": "The form factor $F(x,Z)$.", + "name": "formFactor", + "occurrence": "1", + "required": false + }, + "realAnomalousFactor": { + "__class__": "nodes.ChildNode", + "description": "$F'(E)$, the real part of the anomalous scattering factor.", + "name": "realAnomalousFactor", + "occurrence": "1", + "required": false + }, + "imaginaryAnomalousFactor": { + "__class__": "nodes.ChildNode", + "description": ["$F''(E)$, the imaginary part of the anomalous scattering factor."], + "name": "imaginaryAnomalousFactor", + "occurrence": "1", + "required": false + } + }, + "description": [ + "The double differential cross section for coherent (a.k.a. elastic) scattering is given by \\cite{Hubbell1975,Kissel1995}:", + "\\begin{equation}", + "\\frac{d^2\\sigma_{\\rm coh} ( E, E' ,\\mu) }{d\\mu \\; dE'} = \\frac{d\\sigma_{\\rm coh} ( E, \\mu ) }{d\\mu} \\ \\delta( E' - E ).", + "\\end{equation}", + "Here $\\delta(x)$ is the Dirac delta function and the differential cross section", + "$d\\sigma_{\\rm coh} ( E, \\mu ) / d\\mu$ is given by", + "\\begin{equation}", + "\\frac{d\\sigma _{\\rm coh} ( E,\\mu )}{d\\mu} = \\frac{d\\sigma_{T}(E)}{d\\mu}", + "\\left\\{ \\left[ F( x,Z ) + F'( E ) \\right]^2 + F''( E )^2 \\right\\} \\;", + "\\label{27:coherent}", + "\\end{equation}", + "where", + "\\begin{varlist}", + "\n", + "\\item[$d\\sigma_{T}/d\\mu$]", + "the Thompson cross section [2] which can be written in a closed form as", + "\\begin{equation}", + "\\frac{d\\sigma_{T}(E)}{d\\mu} = \\pi r_e^2 \\left( 1 + \\mu^2 \\right)", + "\\end{equation}", + "\n", + "\\item[$F(x,Z)$] a form factor, which can be easily ", + "tabulated. At high $x$, $F$ approaches zero. In the ", + "other limit $F(0,Z)$ tends to $Z$.,", + "\n", + "\\item[$F'(E)$] the real part of the anomalous scattering factor.,", + "\n", + "\\item[$F''(E)$] the imaginary part of the anomalous scattering factor.,", + "\\end{varlist}", + "\n", + "Using \\ref{27:coherent}, the total cross section and angular distribution can then easily be calculated. ", + "The incoherent and coherent scattering data should always be presented as scattering functions and form factors, respectively, whether or not data are included. ", + "The anomalous scattering factors are assumed to be isotropic. ", + "In addition, they smoothly approach zero at 1.0 MeV and can be assumed to be zero at higher energies,", + "\\cite{Cullen1997,Cullen1989}." + ], + "name": "coherentPhotonScattering", + "required": false, + "rootNode": false + }, + "imaginaryAnomalousFactor":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": ["The imaginary part of the anomalous scattering factor given as an interpolation table of $F''$ vs. $E$"], + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": "The imaginary part of the anomalous scattering factor given as several regions", + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": ["$F''(E)$, the imaginary part of the anomalous scattering factor."], + "name": "imaginaryAnomalousFactor", + "required": false, + "rootNode": false + }, + "incoherentPhotonScattering":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "When \\element{incoherentPhotonScattering} is used in place of an actual distribution ", + "this link is used to refer back to the parameterisation that defines the distribution." + ], + "name": "href", + "required": false, + "type": "bodyText" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Style label for this cross section.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The particle identifier of the outgoing particle.", + "name": "pid", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "frame" + } + }, + "bodyText": null, + "childNodes": { + "scatteringFactor" : { + "__class__": "nodes.ChildNode", + "description": "$S(x,Z)$, the incoherent scattering function.", + "name": "scatteringFactor", + "occurrence": "1", + "required": false + } + }, + "description": [ + "The double differential cross section for incoherent (a.k.a. inelastic) scattering is given by:", + "\n", + "\\begin{equation}", + "\\frac{d^2\\sigma_{\\rm incoh} ( E, E' ,\\mu) }{d\\mu \\; dE'} = \\frac{d\\sigma_{\\rm incoh} ( E, \\mu ) }{d\\mu} \\ \\delta( E' - E'(E,\\mu) )", + "\\end{equation}", + "where $\\delta(x)$ is the Dirac delta function, $E'(E,\\mu)$ is the energy of the scattered photon ", + "(see definition of $k' \\equiv k'(k,\\mu)$ below), and the differential cross section ", + "$d\\sigma_{\\rm incoh} ( E, \\mu ) / d\\mu$ is given by", + "\\begin{equation}", + "\\frac{d\\sigma_{\\rm incoh} ( E, \\mu ) }{d\\mu} = S( x, Z )\\frac{d\\sigma_{KN} (E,\\mu )}{d\\mu} \\;", + "\\label{27:incoherent}", + "\\end{equation}", + "here", + "\\begin{varlist}", + "\n", + "\\item[$d\\sigma_{KN}/d\\mu$]", + "the Klein-Nishina cross section \\cite{KleinNishina1929,Hubbell1975} which can be written in a closed ", + "form as", + "\\begin{equation}", + "\\frac{d\\sigma_{KN} (E,E',\\mu )}{d\\mu} = \\pi r_e^2 \\left(\\frac{k'}{k}\\right)^{2}\\left[1+\\mu^2+kk'(1-\\mu)^2\\right]", + "\\end{equation}", + "\n", + "\\item[$S(x,Z)$] the incoherent", + "scattering function. For large $x$, $S$ approaches $Z$.", + "For small $x$, $S(0,Z) = 0$.", + "\n", + "\\item[$x$] a quantity related to the momentum of the recoil electron. ", + "$x$ is an inverse length, given in inverse {\\AA}ngstr\\\"{o}ms as customarily reported in the literature.", + "\n", + "\\begin{equation}", + "x = \\frac{E}{h c}\\sin(\\theta/2)=\\frac{E}{h c} \\left[ \\frac{(1 - \\mu )}{2} \\right]^{1/2}", + "\\end{equation}", + "\n", + "\\item[$r_{e}$] the classical radius of the electron, $e^{2}/m_{e}c^{2}$.", + "\n", + "\\item[$k$] the incident photon energy, in units of the electron rest mass, $E/m_{e}c^2$", + "\n", + "\\item[$k'$] the scattered photon energy, in units of the electron rest mass, $E'/m_{e}c^2 = k/(1+k(1-\\mu))$", + "\n", + "\\item[$E'$] scattered photon energy,", + "\n", + "\\item[$\\mu$] $\\cos\\theta$ of the scattered photon.", + "\\end{varlist}", + "\n", + "Using \\ref{27:incoherent}, the total cross section and angular distribution can then easily be calculated. ", + "Values of $S(x,Z)$ are tabulated as a function of $x$. ", + "The user presumably will have subroutines available for calculating $x$ ", + "for energies and angles of interest and for calculating Klein-Nishina ", + "cross sections. The user will then generate the cross sections for the ", + "appropriate cases by calculating $x$'s, looking up the appropriate values ", + "of $S$, and substituting them in the above formula.", + "\n", + "The quantity $x$ is related to the the momentum of the ", + "recoil electron $q$. In units of $m_e c$, the recoil momentum is ", + "\\begin{equation}", + "q = k' \\left[ 1 + \\left(", + "\\frac{k}{k'} \\right) ^2 - 2\\mu \\left(", + "\\frac{k}{k'} \\right)", + "\\right] ^{1/2}.", + "\\end{equation}", + "In the limit of coherent (elastic) scattering, $E=E'$ and $\\theta$ is small so one has", + "\\begin{equation}", + "q = k \\left[ 2(1 - \\mu ) \\right]^{1/2} = 2hx/m_ec.", + "\\end{equation}" + ], + "name": "incoherentPhotonScattering", + "required": false, + "rootNode": false + }, + "realAnomalousFactor":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": ["The real part of the anomalous scattering factor given as an interpolation table of $F''$ vs. $E$"], + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": "The real part of the anomalous scattering factor given as several regions.", + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": ["$F'(E)$, the real part of the anomalous scattering factor."], + "name": "realAnomalousFactor", + "required": false, + "rootNode": false + }, + "scatteringFactor":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "The incoherent scattering function given as a function of incident energy as an interpolation table.", + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": "The incoherent scattering function given as multiple regions.", + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": "$S(x,Z)$, the incoherent scattering function. For large $x$, $S$ approaches $Z$. For small $x$, $S(0,Z) = 0$.", + "name": "scatteringFactor", + "required": false, + "rootNode": false + }, + "formFactor":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "The form factor given as a function of incident energy as an interpolation table.", + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": "The form factor given as multiple regions.", + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": "A form factor $F(x,Z)$, which can be tabulated. At high $x$, $F$ approaches zero. In the other limit $F(0, Z)$ tends to $Z$.", + "name": "formFactor", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_basic.json b/standards/gnds-2.0/summary_basic.json new file mode 100644 index 000000000..e1882563d --- /dev/null +++ b/standards/gnds-2.0/summary_basic.json @@ -0,0 +1,311 @@ +{ + "__namespace__":"basic", + "XMLName":{ + "__class__": "nodes.ElementaryTypeNode", + "description": [ + "XMLName represents the set and sequence of characters that are allowed for node and attribute ", + "names. Some meta-languages and programming languages (e.g. C and Python) allow a name to start ", + "with the underscore character. While other programming languages (e.g. FORTRAN) do not. For maximum ", + "compatibility an XMLName text shall not start with an underscore character."], + "name": "XMLName", + "allowedValueDescription": [ + "XMLNames shall begin with a character from the ISO basic Latin alphabet. All other ", + "characters shall be from the following: ISO basic Latin alphabet, Arabic numerals, and/or an underscore. ", + "There is no limit on the length of a name, except that it shall contain at least 1 character."] + }, + + "attributeValue": { + "__class__": "nodes.ElementaryTypeNode", + "description": ["This represents the set and sequence of characters that are allowed for attribute values."], + "name": "attributeValue", + "allowedValueDescription": ["The allowed values for", + "an attribute will depend on the attribute/node and, in general, should be specified by the ", + "project defining the attribute/node. A project can use any UTF-8 character in a value deemed necessary. ", + "However, some general rules apply: ", + "\\begin{itemize}", + "\\item If a value of an attribute is an Integer32, UInteger32, ", + "Float64 or other defined type then it shall follow the specification for an ", + "Integer32, UInteger32, Float64 or the other defined type, respectively", + "(see Sections~\\ref{format:basic:Integer32}, \\ref{format:basic:UInteger32} and \\ref{format:basic:Float64}).", + "\\item If any part of the value of an attribute is an Integer32, UInteger32, ", + "Float64 or other defined type then that part shall follow the specification for an ", + "Integer32, UInteger32, Float64 or the other defined type, respectively.", + "\\noindent For example, if an attribute value contains a Float64 with units, as in `mass=``3.2 kg''', ", + "the numeric part of the attribute value shall follow the Float64 specification.", + "\\end{itemize}"]}, + + "bodyText": { + "__class__": "nodes.ElementaryTypeNode", + "description": [ + "In general, any UTF-8 character is allowed. However, the allowed characters ", + "for a node's body can be limited by its parent node's specifications."], + "name": "bodyText", + "allowedValueDescription": ["Any UTF-8 character is allowed."]}, + + "UTF8Text": { + "__class__": "nodes.ElementaryTypeNode", + "description": ["This is text composed of any sequence of UTF-8 characters."], + "name": "UTF8Text", + "allowedValueDescription": ["Any sequence of 0 or more UTF-8 characters."]}, + + "printableText": { + "__class__": "nodes.ElementaryTypeNode", + "description": ["This is text composed of only the printable ascii characters."], + "name": "printableText", + "allowedValueDescription": [ + "Any sequence of the ascii characters ", + "between the space character (decimal 32) to the tilde character ", + "('\\textasciitilde' or decimal 126) inclusive."]}, + + "quotedText": { + "__class__": "nodes.ElementaryTypeNode", + "description": "This represents a UTF8Text string that is contained between two matching quote characters. The allowed quote characters are the ascii double quote character (i.e. \" or decimal 34) and the ascii single quote character (i.e. ' or decimal 39).", + "name": "quotedText", + "allowedValueDescription": ["A UTF8Text string contained between matching single or double quote characters. ", + "\\noindent For example, the quoted string ``abc 123 xyz'' is expressed as", + "\\begin{verbatim}", + "\"abc 123 xyz\"", + "\\end{verbatim}", + "or", + "\\begin{verbatim}", + "'abc 123 xyz'", + "\\end{verbatim}", + "\\noindent", + "This is not the same as", + "\\begin{verbatim}", + "'abc 123 xyz '", + "\\end{verbatim}", + "\\noindent as leading and trailing spaces are part of the string."]}, + + "tdText": { + "__class__": "nodes.ElementaryTypeNode", + "description": "This represents a UTF8Text string that is contained between the XML start and end elements that define a standard html table cell (i.e. ``'' and ``'').", + "name": "tdText", + "allowedValueDescription": ["The XML element ``'' and the UTF8Text string it contains.", + "\\noindent For example, the quoted string ``abc 123 xyz'' is expressed as", + "\\begin{verbatim}", + "abc 123 xyz", + "\\end{verbatim}", + "\\noindent This is not the same as", + "\\begin{verbatim}", + " abc 123 xyz", + "\\end{verbatim}", + "\\noindent as leading and trailing spaces are part of the string."]}, + + "IntegerTuple": { + "__class__": "nodes.ElementaryTypeNode", + "description": "This is text node composed of a comma-delimited list of integers. It is used to denote starting indices within an array. The integer type is Integer32.", + "name": "IntegerTuple", + "allowedValueDescription": [ + "A list of Integer32 values separated by a comma (i.e., ‘,’). ", + "Any number of printable white spaces are allow before and after each Integrer32 value.", + "\n\n \\noindent For example, the array index [3][4][7] can be represented as the IntegerTuple `3, 4, 7'."] + }, + + "Integer32": { + "__class__": "nodes.ElementaryTypeNode", + "description": [ + "\\texttt{Integer32} represents the allowed set and sequence of characters, and values that are allowed for a ", + "32-bit signed integer."], + "name": "Integer32", + "allowedValueDescription": [ + "Any integer in the range [ $-2^{31}$ to $2^{31}$ ) --", + "note that the lower limit is inclusive and the upper limit is exclusive. The minimum allowed", + "value (i.e. $-2^{31} = -2147483648$) is defined to be \\textbf{Integer32$\\_$Min} and the maximum allowed", + "value (i.e. $2^{31} - 1 = 2147483647$) is defined to be \\textbf{Integer32$\\_$Max}.", + "The Python regular expression (see Section~\\ref{sec:pres}) for an \\textbf{Integer32} shall be", + "\\begin{verbatim}", + "`[+-]?([1-9][0-9]*|0+)'", + "\\end{verbatim}", + "with the restriction that the value shall be in the range [\\textbf{Integer32$\\_$Min},", + "\\textbf{Integer32$\\_$Max]}."], + "C_equivalent": "int32$\\_$t"}, + + "UInteger32": { + "__class__": "nodes.ElementaryTypeNode", + "description": "This represents the allowed set and sequence of characters, and values that are allowed for a 32-bit unsigned integer.", + "name": "UInteger32", + "allowedValueDescription": ["Any integer in the range [ 0 to $2^{32}$ ).", + "An unsigned integer is represented in the", + "same way as a signed integer, with the exception that a minus sign (e.g. `-' is not allowed).", + "The minimum allowed value (i.e. 0) is defined to be \\textbf{UInteger32\\_Min} and the maximum allowed", + "value (i.e. $2^{32} - 1$) is defined to be \\textbf{UInteger32\\_Max}.", + "The Python regular expression (see Section~\\ref{sec:pres}) for an \\textbf{UInteger32} shall be", + " \\begin{verbatim}", + " `+?([1-9][0-9]*|0+)'", + " \\end{verbatim}"], + "C_equivalent": "uint32$\\_$t"}, + + "Float64": { + "__class__": "nodes.ElementaryTypeNode", + "description": "This represents the allowed set and sequence of characters, and values for a 64-bit floating point number.", + "name": "Float64", + "allowedValueDescription": ["Any normalised or denormalised IEEE-754 binary64~\\cite{IEEEFloats}", + "value. The Python regular expression (see Section~\\ref{sec:pres}) for a Float64 shall be", + "\\begin{verbatim}", + "'[+-]?([0-9]+\\.?[0-9]*|\\.[0-9]+)([eE][+-]?[0-9]+)?'", + "\\end{verbatim}", + "\\noindent", + "with the restriction that the value shall only be in the range for a normalised or denormalised IEEE-754", + "binary64 value. The number of significant digits (base 10) in a normalised IEEE-754 binary64 value is", + "about 16, and is fewer for a denormalised value. The string representation of a Float64 value can have", + "more significant digits than are supported by a normalised or denormalised IEEE-754 binary64 value;", + "however, these additional digits will generally be ignored when the value is read into a Float64 variable."], + "C_equivalent": "double"}, + + "Fraction32": { + "__class__": "nodes.ElementaryTypeNode", + "description": "This represents the allowed set and sequence of characters, and values that are allowed for a faction given as the ratio of two Integer32 values.", + "name": "Fraction32", + "allowedValueDescription": "All Fraction32 are represented as `i1 / i2' or `i3' where i1, i2 and i3 are Integer32s. Spaces are allowed around all Integer32 values. Example are `1/2', ` 1 / 2 ', `5 / 32 ' and `2'."}, + + "Boolean": { + "__class__": "nodes.ElementaryTypeNode", + "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{}'.", + "remark": "the standard XML attribute value representation for Boolean values true and false are `true' and `false' respectively.", + "C_equivalent": "bool"}, + + "whiteSpace": { + "__class__": "nodes.ElementaryTypeNode", + "description": "This represents the allowed set and sequence of characters for a white space.", + "name": "whiteSpace", + "allowedValueDescription": "Any of the characters shown in Table~\\ref{table:ValidWhiteSpaces}"}, + + "Empty": { + "__class__": "nodes.ElementaryTypeNode", + "description": "This is the token that states that the value of the cell in a table is empty.", + "name": "Empty", + "allowedValueDescription": "The ASCII string `\\texttt{}'."}, + + "date": { + "__class__": "nodes.ElementaryTypeNode", + "description": [ + "This represents the allowed formats for a date which may also include a time or a time with offset from UTC information.", + "The allowed formats are a subset of the ISO-8061 `extended' formats \\cite{datetime}." + ], + "name": "date", + "allowedValueDescription": ["One of the following ISO-8061 'extended' formats", + "\\vskip 0.1 in", + "\\begin{itemize}", + "\\item date only as `YYYY-MM-DD' (e.g. `2015-02-01'),", + "\\item date and time as `YYYY-MM-DDThh:mm:ss' (e.g. '2015-02-01T16:55:18') and", + "\\item date and time with offset from UTC as `YYYY-MM-DDThh:mm:ss$\\pm$hh:mm' (e.g. '2015-02-01T16:55:18+01:00')", + "\\end{itemize}", + "\\vskip 0.1 in", + "where", + "\\vskip 0.1 in", + "\\begin{itemize}", + "\\item YYYY represents the year and must be in the range [0000,9999],", + "\\item MM represents the month and must be in the range [01,12],", + "\\item DD represents the day of the month and must be in the range [01,28], [01,29], [01,30] or [01,31], depending on the value specified for YYYY-MM,", + "\\item hh represents the hour and must be in the range [00,23],", + "\\item mm represents the minute and must be in the range [00,59] and", + "\\item ss represents the second and must be in the range [00,60] where 60 is only allowed to denote an added leap second.", + "\\end{itemize}", + "\\vskip 0.1 in", + "All characters must be ASCII. In particular, the 'minus sign', for representing a negative offset from UTC, must be the ASCII ", + "hyphen-minus character (i.e. 45 decimal).", + "All other ISO-8601 formats are not allowed. For example, `YYYYMMDD' (e.g. '20150201') is not allowed. Date ranges are not supported." + ]}, + "dateType": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "Metadata describing important dates in the generation or maintainance of a dataset. See Table \\ref{table:dateType} for a description of the allowed values.", + "name": "dateType", + "allowedValues":["accepted", "available", "copyrighted", "collected", "created", "issued", "submitted", "updated", "valid", "withdrawn"]}, + + "contributorType": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "Metadata describing various contributions to a maintainance/distribution/etc. of a dataset which are not strictly authorship contributions. See Table \\ref{table:contributorType} for a description of the allowed values.", + "name": "contributorType", + "allowedValues":["ContactPerson", "DataCollector", "DataCurator", "DataManager", "Distributor", "Editor", "HostingInstitution", "Producer", "ProjectLeader", "ProjectManager", "ProjectMember", "RegistrationAgency", "RegistrationAuthority", "RelatedPerson", "Researcher", "ResearchGroup", "RightsHolder", "Sponsor", "Supervisor", "WorkPackageLeader", "Other"]}, + + "relationType": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "Metadata describing how one dataset is related to another. See Table \\ref{table:relationType} for a description of the allowed values.", + "name": "relationType", + "allowedValues":["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"]}, + + "checksum": { + "__class__": "nodes.ElementaryTypeNode", + "description": ["A checksum (also called a `hash') is a hexadecimal number computed from a file, string or other data.", + "The checksum serves as a unique digital `fingerprint' that can be used to detect whether data has changed since it was computed." + ], + "name": "checksum", + "allowedValueDescription": ["Any combination of digits 0-9 and letters a-f. The length depends on the algorithm", + "used to compute the checksum: 32 characters for MD5, 40 for SHA-1. The following regular expression can be used to", + "check for a valid MD5 or SHA-1 checksum: `[0-9a-f]\\{40\\}|[0-9a-f]\\{32\\}'."] + }, + + "parity": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "Parity is a particle property related to the (anti)-symmetry of the wave function to reflection.", + "name": "parity", + "allowedValues":["+1", "-1"]}, + + "frame": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "Tells what reference frame a projectile, product, distribution or double-differential cross section is given in.", + "name": "frame", + "allowedValues":["lab", "centerOfMass"]}, + + "interpolation": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "Rule for interpolating between two points used to specify a function.", + "name": "interpolation", + "allowedValues":["flat", "charged-particle", "lin-lin", "lin-log", "log-lin", "log-log"]}, + + "interpolationQualifier": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "Additional rule for interpolating between two N-dimensional functions inside an (N+1)-dimensional function.", + "name": "interpolationQualifier", + "allowedValues":["direct", "unitBase", "correspondingEnergies", "correspondingPoints"]}, + + "hashAlgorithm": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "Two algorithms for computing hash sums are currently supported: the MD5 and SHA-1 algorithms.", + "name": "algorithm", + "allowedValues": ["md5", "sha1"]}, + + "Float32": { + "__class__": "nodes.ElementaryTypeNode", + "description": "Floating point number that can be stored at reduced precision", + "name": "Float32", + "allowedValueDescription": "n/a", + "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": { + "__class__": "nodes.ElementaryTypeNode", + "description": "This represents the allowed set and sequence of characters, and values for a 64-bit signed integer.", + "name": "Integer64", + "allowedValueDescription": ["Any integer in the range [ $-2^{63}$ to $2^{63}$ ). The minimum ", + "allowed value (i.e. $-2^{63}$) is defined to be \\textbf{Integer64\\_Min} and the maximum allowed", + "value (i.e. $2^{63} - 1$) is defined to be \\textbf{Integer64\\_Max}.", + "The Python regular expression (see Section~\\ref{sec:pres}) for an \\textbf{Integer64} shall be", + "\\begin{verbatim}", + "`[+-]?([1-9][0-9]*|0+)'", + "\\end{verbatim}", + "\\noindent with the restriction that the value shall be in the range ", + "[\\textbf{Integer64\\_Min}, \\textbf{Integer64\\_Max}]."], + "C_equivalent": "int64\\_t", + "remark": "Currently not needed so not defined.", + "implementationStatus": "Not implemented as of GNDS-1.9"}, + + "Hexadecimal": { + "__class__": "nodes.ElementaryTypeNode", + "description": "Typical hexadecimal number", + "name": "Hexadecimal", + "allowedValueDescription": "n/a", + "remark": "Currently not needed so not defined.", + "implementationStatus": "Not implemented as of GNDS-1.9"}, + + "Octal": { + "__class__": "nodes.ElementaryTypeNode", + "description": "Typical octal number", + "name": "Octal", + "allowedValueDescription": "n/a", + "remark": "Currently not needed so not defined.", + "implementationStatus": "Not implemented as of GNDS-1.9"} +} diff --git a/standards/gnds-2.0/summary_common.json b/standards/gnds-2.0/summary_common.json new file mode 100644 index 000000000..d0b530685 --- /dev/null +++ b/standards/gnds-2.0/summary_common.json @@ -0,0 +1,368 @@ +{ + "__namespace__":"common", + "Q":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "name": "value", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique":"yesLabel", + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "containers", + "occurrence": "1", + "required": false + }, + "constant1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "constant1d", + "occurrence": "choice", + "required": false + }, + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs1d", + "occurrence": "choice", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "regions1d", + "occurrence": "choice", + "required": false + }, + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "choice", + "required": false + }, + "gridded1d": { + "__class__": "nodes.ChildNode", + "description": "Grouped Q-value, weighted by the cross-section and optionally by the flux. Appears in processed files only.", + "name": "gridded1d", + "occurrence": "choice", + "required": false + } + }, + "description": null, + "name": "Q", + "required": false, + "rootNode": false + }, + "product":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Product label. Must be unique within the list of \\texttt{products}", + "name": "label", + "required": true, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Particle id, must correspond to the id of a particle in the particle database.", + "name": "pid", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "multiplicity": { + "__class__": "nodes.ChildNode", + "description": "Component containing the multiplicity of the product.", + "name": "multiplicity", + "occurrence": "1", + "required": true + }, + "distribution": { + "__class__": "nodes.ChildNode", + "description": "Component containing the energy/angle distribution of the product.", + "name": "distribution", + "occurrence": "1", + "required": true + }, + "// outputChannel": { + "__class__": "nodes.ChildNode", + "description": "Used if the product breaks up into fragments (e.g. \\attrval{Be8 -> He4 + He4})", + "name": "outputChannel", + "occurrence": "1", + "required": false + } + }, + "description": "A product is a particle that is the result of a reaction or decay. More than one particle of the same type can be released in a single reaction (e.g. (n, 2n)). A multiplicity (how many are produced) must be defined for each product. A distribution describing the outgoing energy and angle of the product is also required, although it may have a value of \\attrval{unspecified}.", + "name": "product", + "required": false, + "rootNode": false + }, + "products":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "product": { + "__class__": "nodes.ChildNode", + "description": "One or more \\element{product} child element.", + "namespace": "common", + "name": "product", + "occurrence": "1+", + "required": false + } + }, + "description": "There are three ``types'' of product lists:\n\\begin{itemize}[nosep]\n\\item reaction\\item orphaned\n\\item decay\n\\end{itemize}\nEach type has the same structure; a constant for the $Q$-value, one or more child \\element{product} elements, and optional \\element{documentations} child element. Some of the child \\element{product} elements may be unstable and decay further. The decay products of the unstable product are not given here, but are given explicitly in the particle database.", + "name": "products", + "required": false, + "rootNode": false + }, + "mass":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "containers", + "occurrence": "1", + "required": false + }, + "double": { + "__class__": "nodes.ChildNode", + "description": null, + "namespace": "containers", + "name": "double", + "occurrence": "1+", + "required": true + } + }, + "description": null, + "name": "mass", + "required": false, + "rootNode": false + }, + "energy":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "containers", + "occurrence": "1", + "required": false + }, + "double": { + "__class__": "nodes.ChildNode", + "description": null, + "namespace": "containers", + "name": "double", + "occurrence": "1+", + "required": true + } + }, + "description": null, + "name": "energy", + "required": false, + "rootNode": false + }, + "probability":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": null, + "namespace": "containers", + "name": "double", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "probability", + "required": false, + "rootNode": false + }, + "temperature":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "value", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "containers", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "temperature", + "required": false, + "rootNode": false + }, + "externalFiles":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "externalFile": { + "__class__": "nodes.ChildNode", + "description": "A file", + "name": "externalFile", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "The \\element{externalFiles} node is a suite that stores a list of \\element{externalFile} nodes. ", + "An \\element{externalFile} node establishes the link between a \\element{reactionSuite} file and one or more corresponding \\element{covarianceSuite} files. "], + "name": "externalFiles", + "required": false, + "rootNode": false + }, + "externalFile":{ + "__class__": "nodes.Node", + "abstractNode": "labelNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "unique string that can be used to identify this external file.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "path": { + "__class__": "nodes.Attribute", + "default": null, + "description": "relative path to the external file, using unix-style path separators to maintain compatability with existing xPath tools.", + "name": "path", + "required": true, + "type": "XMLName" + }, + "checksum": { + "__class__": "nodes.Attribute", + "default": null, + "description": "hexadecimal checksum for the external file. Can be used to check that whether an external file has been modified.", + "name": "checksum", + "required": false, + "type": "checksum" + }, + "algorithm": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Algorithm used to compute the `checksum'. Allowed values are `md5' and `sha1'.", + "name": "algorithm", + "required": false, + "type": "algorithm" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Stores a single external file, including a unique label and file path and optionally a checksum to help ensure file integrity.", + "name": "externalFile", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_covariance.json b/standards/gnds-2.0/summary_covariance.json new file mode 100644 index 000000000..c91fc19ce --- /dev/null +++ b/standards/gnds-2.0/summary_covariance.json @@ -0,0 +1,1034 @@ +{ + "__namespace__":"covariance", + "covarianceSuite":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "evaluation": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the evaluation, e.g. `ENDF-VIII.0'", + "name": "evaluation", + "required": false, + "type": "XMLName" + }, + "projectile": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Projectile particle id for the most of the covariances matrices in this suite.", + "name": "projectile", + "required": false, + "type": "XMLName" + }, + "target": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Target particle id for most of the covariance matrices in this suite.", + "name": "target", + "required": false, + "type": "XMLName" + }, + "interaction": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "Defines the type of interaction for the reaction data linked from within the covarianceSuite.", + "Options are `nuclear', `atomic' and `thermalNeutronScatteringLaw'. For example,", + "a covarianceSuite containing covariances for photo-nuclear reactions has a value of `nuclear'", + "while a covarianceSuite for photo-atomic reactions has a value of `atomic'. In principal", + "a covarianceSuite could contain cross-terms between two different types of interaction,", + "but such cross-terms are not present in any current libraries. If the need arises, they", + "could be handled by allowing the interaction to be `mixed'." ], + "name": "interaction", + "required": true, + "type": "interaction" + }, + "format": { + "__class__": "nodes.Attribute", + "default": null, + "description": "GNDS format version, e.g. `2.1'", + "name": "version", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "externalFiles": { + "__class__": "nodes.ChildNode", + "description": ["Stores a list of external files related to this \\elemlink{covarianceSuite}.", + "Often used to link a \\elemlink{reactionSuite} to one or more \\elemlink{covarianceSuite} files."], + "name": "externalFiles", + "occurrence": "1", + "required": false + }, + "styles": { + "__class__": "nodes.ChildNode", + "description": ["Element containing a list of styles inside this covarinceSuite. Each style describes", + "information about the evalualated data (e.g. library, version) representation and each processed data representation."], + "name": "styles", + "occurrence": "1", + "required": false + }, + "covarianceSections": { + "__class__": "nodes.ChildNode", + "description": ["Stores covariance matrices for continuous data."], + "name": "covarianceSections", + "occurrence": "1", + "required": false + }, + "parameterCovariances": { + "__class__": "nodes.ChildNode", + "description": ["contains covariance for paramters.", + "This may be resoanance parameters or covariance matrices for other ", + " nuclear data described by parameters"], + "name": "parameterCovariances", + "occurrence": "1", + "required": false + } + }, + "description": ["Stores covariance data for various reaction and materials.", + "Covariance matrix data my be given for the combination of a projectile and target given,", + "as well as for any other combination. Therefore, one or more", + "\\elemlink{reactionSuite} elements and other related files may be listed", + "in the \\elemlink{externalFiles} link."], + "name": "covarianceSuite", + "required": false, + "rootNode": true + }, + "covarianceSections":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "covarianceSection": { + "__class__": "nodes.ChildNode", + "description": ["Each covarianceSection represents either the covariance for a single quantity,", + " or a cross-term between two different quantities. "], + "name": "covarianceSection", + "occurrence": "1+", + "required": false + } + }, + "description": ["Stores covariance matrices for continuous data. ", + "The grid on which the covariance data are given will usually be different from the one ", + " the orignal data are given on. Therefore the axes data will most often be given as ", + "\\elemlink{grid} elements.", + "This element can contain covariance matrices and cross covariance matrices for many different types of data." ], + "name": "covarianceSections", + "required": false, + "rootNode": false + }, + + "covarianceMatrix":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["If \\elemlink{covarianceMatrix} is a direct child of \\elemlink{covarianceSection}, ", + " the label refers to the style of the evalutions this covariance matrix refers to.", + " In this case, the label is required, otherwise if \\elemlink{covarianceMatrix} is a ", + " child of \\elemlink{mixed}, it is optional. In the latter case it may be used to ensure ", + " that each \\elemlink{covarianceMatrix} in \\elemlink{mixed} has a unique label by which ", + " it can be refered to in a link"], + "name": "label", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in. Required for covariances on energy/angular distributions.", + "name": "productFrame", + "required": false, + "type": "frame" + }, + "type": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Options are `relative' or `absolute'", + "name": "type", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "gridded2d": { + "__class__": "nodes.ChildNode", + "description": ["A two-dimensional array that gives the actual covariance data."], + "name": "gridded2d", + "occurrence": "choice", + "childUnique": "yes", + "required": false + }, + "sandwichProduct": { + "__class__": "nodes.ChildNode", + "description": "Covariance matrix decomposed into a matrix sandwich product.", + "name": "sandwichProduct", + "occurrence": "choice", + "childUnique": "yes", + "required": false + } + }, + "description": ["A covariance matrix can be either absolute or relative with the respect to the ", + " data it referes to. Choices are: ", + "\\begin{description}[font=\\ttfamily,labelindent=1cm] ", + " \\item[absolute:] the covariance matrix data are given absolute. ", + " \\item[relative:] the covariance matrix data are given relative to the data it refers to.", + "\\end{description}" ], + "name": "covarianceMatrix", + "required": false, + "rootNode": false + }, + + "sandwichProduct":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": ["An \\element{axes} element containing the \\element{grid} elements.", + "The grid applies to the final matrix after computing the matrix product"], + "name": "axes", + "occurrence": "1", + "required": true + }, + "covariance": { + "__class__": "nodes.ChildNode", + "description": "Array containing the inner portion of the sandwich product.", + "namespace": "covariance", + "name": "covariance", + "occurrence": "1", + "required": true + }, + "rowSensitivity": { + "__class__": "nodes.ChildNode", + "description": "Array containing the left-hand side of the sandwich product.", + "name": "rowSensitivity", + "occurrence": "1", + "required": true + }, + "columnSensitivity": { + "__class__": "nodes.ChildNode", + "description": ["Array containing the right-hand side of the sandwich product.", + "May be omitted if the right-hand side is equal to", + "the transpose of the \\element{rowSensitivity}.", + "If a columnSensitivity is supplied, its dimensions must be consistent with", + "the transpose of the rowSensitivity."], + "name": "columnSensitivity", + "occurrence": "1", + "required": false + } + }, + "description": ["Contains a matrix decomposed into the sandwich product $R \\times c \\times C$.", + "In many cases C is equal to the transpose of R and need not be stored explicitly.", + "This representation can be used to store covariances more compactly.", + "For example, if eigenvalue decomposition reveals that only a few eigenvalues", + "are significant, this representation can be used to store only those eigenvalues", + "and their corresponding eigenvectors. If a covariance was computed by varying some", + "parameters and determining the sensitivity of a final quantity to each parameter,", + "this representation permits storing the parameter covariance and sensitivity explicitly."], + "name": "sandwichProduct", + "required": false, + "rootNode": false + }, + "covariance":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "array": { + "__class__": "nodes.ChildNode", + "description": ["Array storing the central term in a sandwich product.", + "The array must be square and may be symmetric or diagonal."], + "name": "array", + "occurrence": "1", + "required": true + } + }, + "description": null, + "name": "covariance", + "required": false, + "rootNode": false + }, + "rowSensitivity":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "array": { + "__class__": "nodes.ChildNode", + "description": ["Array storing the left-hand term in a sandwich product.", + "The array is generally rectangular, with the number of columns equal to", + "the dimension of the corresponding \\element{covariance} array."], + "name": "array", + "occurrence": "1", + "required": true + } + }, + "description": null, + "name": "rowSensitivity", + "required": false, + "rootNode": false + }, + "columnSensitivity":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "array": { + "__class__": "nodes.ChildNode", + "description": ["Array storing the right-hand term in a sandwich product.", + "The array is generally rectangular, with the number of rows equal to", + "the dimension of the corresponding \\element{covariance} array."], + "name": "array", + "occurrence": "1", + "required": true + } + }, + "description": ["Required only if the right-hand term in the sandwich product is not equal to the transpose", + "of the left-hand term."], + "name": "columnSensitivity", + "required": false, + "rootNode": false + }, + + "parameterCovariances":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "averageParameterCovariance": { + "__class__": "nodes.ChildNode", + "description": ["Gives the covariance matrix data on average parameters, for example ", + " average resonance parameters in the resolved range"], + "name": "averageParameterCovariance", + "occurrence": "1+", + "required": false + }, + "parameterCovariance": { + "__class__": "nodes.ChildNode", + "description": ["Gives the covariance matrix for parameters, for example resonance parameters in ", + " the resolved range."], + "name": "parameterCovariance", + "occurrence": "1+", + "required": false + } + }, + "description": null, + "name": "parameterCovariances", + "required": false, + "rootNode": false + }, + "parameters":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "parameterLink": { + "__class__": "nodes.ChildNode", + "description": ["Links the indices in the ", + "parameter covariance matrix to the correct parameter." ], + "name": "parameterLink", + "occurrence": "1+", + "required": false + } + }, + "description": ["Collects the elemlink{parameterLink} elements that allow to link the indices in the ", + "parameter covariance matrix to the correct parameters."], + "name": "parameters", + "required": false, + "rootNode": false + }, + "parameterCovariance":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Used to make the \\element{covariance}{parameterCovariance} unique within ", + "\\elemlink{parameterCovariances}. No other restrictions on the label exist."], + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique" : "yesLabel", + "childNodes": { + "rowData": { + "__class__": "nodes.ChildNode", + "description": ["Gives a reference to the resonance parameters to which this matrix applies."], + "name": "rowData", + "occurrence": "1", + "required": true + }, + "parameterCovarianceMatrix": { + "__class__": "nodes.ChildNode", + "description": ["Contains the parameter covariance matrix itself."], + "name": "parameterCovarianceMatrix", + "occurrence": "1+", + "required": true + } + }, + "description": ["Container for \\elemlink{parameterCovarianceMatrix} containing the actual parameter covariance matrix.", + "Storing the data in the container, allows to give different parameter covariance matrices, ", + "depending on the evaluation."], + "name": "parameterCovariance", + "required": false, + "rootNode": false + }, + "parameterCovarianceMatrix":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The label refers to the style of the evalutions this covariance matrix refers to."], + "name": "label", + "required": true, + "type": "XMLName" + }, + "type": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Options 'absolute', 'absoluteCovariance', or 'relative'."], + "name": "type", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "parameters": { + "__class__": "nodes.ChildNode", + "description": "Cross references the matrix indices to the parameter they refer to.", + "name": "parameters", + "occurrence": "1", + "required": true + }, + "array": { + "__class__": "nodes.ChildNode", + "description": ["The two-dimensional array containing the actual parameter covariance data."], + "name": "array", + "occurrence": "1", + "required": true + } + }, + "description": ["The parameter covariance matrix can be either absolute or relative with the respect to the ", + " . Choices are: ", + "\\begin{description}[font=\\ttfamily,labelindent=1cm] ", + " \\item[absolute:] the parameters covariance matrix data is given absolute. ", + " \\item[absoluteCovariance:] the parameters covariance matrix data is given absolute. ", + " \\item[relative:] the parameter covariance matrix data are given relative to the parameters.", + "\\end{description}" ], + "name": "parameterCovarianceMatrix", + "required": false, + "rootNode": false + }, + "parameterLink":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Link to the data container (usually a table) where the parameters are defined."], + "name": "href", + "required": false, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The link is used to make each \\element{covariance}{parameterLink} unique within ", + "\\elemlink{parameters}. No other restrictions are put on the value."], + "name": "label", + "required": false, + "type": "XMLName" + }, + "matrixStartIndex": { + "__class__": "nodes.Attribute", + "default": 0, + "description": ["The starting index for this set of parameters in the covariance matrix given in ", + " the \\element{array} element of the \\elemlink{parameterCovarianceMatrix}"], + "name": "matrixStartIndex", + "required": false, + "type": "Integer32" + }, + "nParameters": { + "__class__": "nodes.Attribute", + "default": "1", + "description": ["The number of parameters that are refered to in this link"], + "name": "nParameters", + "required": false, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": {}, + "description": ["The reference given can be of several different types. Depending on the type, ", + " the numbering of the parameters is as follows: ", + "\\begin{description}[font=\\ttfamily,labelindent=1cm] ", + " \\item[table:] The table is counted row-major and all entries are counted. In this case ", + " \\texttt{nParameters} should be equal to row count times column count. For example, ", + " the table object for \\elemlink{BreitWigner} resonance parameters lists L and J values, which ", + " are not usually referenced in the covariance matrix. However, the covariance matrix must list ", + " a zero entry for all terms involving L and J. This allows for easy referencing of an entire table ", + " object, rather than having to give an explicit reference to each individual resonance parameter.", + " \\item[scatteringRadius:] It is aassumed that the scattering radius contains only ", + " a \\elemlink{constant1d} element for the selected evaluation. In this case \\texttt{nParameters} ", + " should be 1", + " \\item Any references that references exactly one value, for example a \\elemlink{constant1d} ", + "\\end{description}"], + "name": "parameterLink", + "required": false, + "rootNode": false + }, + "shortRangeSelfScalingVariance":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "dependenceOnProcessedGroupWidth": { + "__class__": "nodes.Attribute", + "default": null, + "description": [], + "name": "dependenceOnProcessedGroupWidth", + "required": false, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Only used to ensure that the \\element{shortRangeSelfScalingVarianc} is ", + "unique within \\elemlink{mixed}. No other restrictions are put on the label."], + "name": "label", + "required": false, + "type": "XMLName" + }, + "type": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Options are `relative' or `absolute' to indicate whether the data ", + " are given absolute or relative with respect to the underlying data."], + "name": "type", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "gridded2d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "gridded2d", + "occurrence": "1", + "required": false + } + }, + "description":["Gives a covariance matrix for a short-range self-scaling variance.", + "The matrix will only have elements on the diagonal given on an evalutor grid ", + "$\\Delta E_{k}$ with diagonal elements $F_{k}$.", + " In order to calculate the covariance matrix on the user energy grid of $\\Delta E_{kj}$ ", + "there are two options:", + "\\begin{itemize}", + "\\item The variance contribution $\\textrm{Var}(X_{jj})$ to the processed group ", + "variance for the energy group ", + "$(E_{j},E_{j+1})$ is inversely proportional to its width $\\Delta E_{j}$ when ", + "$(E_{j},E_{j+1})$ lies within $(E_{k},E_{k+1})$ and is obtained from the relation:", + "$$\\textrm{Var}(X_{jj} )= F_{k} \\frac{\\Delta E_{k}} {\\Delta E_{j}}$$", + "where $E_{k} \\leq E_{j} \\leq E_{j+1} \\leq E_{k+1}$.", + " This form is applicable in the resonance range where the covariances in the other sub-subsections ", + "define ``average'' coarse energy-grid uncertainties, while the actual pointwise cross-section ", + "values may fluctuate by orders of magnitude. The evaluator must be aware that the actual ", + "uncertainty in the cross sections depends on the user's energy-grid. The user should be ", + "aware of possible processing problems, for example when the union grid of the user's ", + "energy group structure and the covariance grid nearly coincide at some energy. ", + "This form should not be used to specify the uncertainty on the actual value of pointwise cross sections.", + "\\item The variance contribution $\\textrm{Var}(X_{jj})$ to the processed group variance for ", + "the energy group $(E_{j},E_{j+1})$ is directly proportional to the width $\\Delta E_{j}$ when ", + "$(E_{j},E_{j+1})$ lies within $(E_{k},E_{k+1})$. It is obtained from the relation:", + "$$ \\textrm{Var}(X_{jj}) = F_{k} \\left [ 1 - ", + " \\frac{\\Delta E_{j}} {\\Delta E_{k}} \\right ]$$", + " where $E_{k} \\leq E_{j} < E_{j+1} \\leq E_{k+1}$. ", + " This form is applicable in cases when experimental evidence suggests the possibility of structure ", + "in the cross sections, but the experimental resolution is not sufficient to determine the ", + "detailed shape, which is then approximated by a smooth curve. It describes the maximum uncertainty ", + "in the cross section due to possible fine-structure, which vanishes when the user's energy grid ", + "is equal or coarser than the covariance grid. The physical consequence of this property is that ", + "it increases the absolute variance when the user defines an energy grid more refined than the ", + "covariance grid (thus avoiding zero-eigenvalue problems), but will not affect any coarse energy-group ", + "uncertainties. The increase in the variance remains finite (limited to $F_{k})$ and is ", + "applicable to defining the uncertainties of pointwise cross sections.", + "\\end{itemize}\n\n", + "Note that the $\\textrm{Var}(X_{jj})$ are variances in average cross sections. ", + "This rule suffices for arbitrary group boundaries if subgroup boundaries are chosen to include all ", + " the $E_{k}$. No contributions to off-diagonal multigroup covariance matrix elements are ", + "generated by this covariance section."], + "name": "shortRangeSelfScalingVariance", + "required": false, + "rootNode": false + }, + "mixed":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": [" The label refers to the style of the evalutions this covariance matrix refers to and", + " it is required."], + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "covarianceMatrix": { + "__class__": "nodes.ChildNode", + "description": ["Partial explicit covariance matrix"], + "name": "covarianceMatrix", + "occurrence": "1+", + "required": false + }, + "shortRangeSelfScalingVariance": { + "__class__": "nodes.ChildNode", + "description": ["Short range scaling data for this covariance data"], + "name": "shortRangeSelfScalingVariance", + "occurrence": "1+", + "required": false + }, + "sum": { + "__class__": "nodes.ChildNode", + "description": ["Sum relationship for the underlying data to be used in some range of the covariance domain." ], + "name": "sum", + "occurrence": "1+", + "required": false + } + }, + "description": ["If more than one explicit covariance matrix, short term scaling data or ", + "different sum relationships are needed to describe the covariance information, ", + "the data needs to be put into a \\element{mixed} container. ", + "All child elements of \\element{mixed} can be processed separately but need ", + " to be added together to yield the covariance matrix for the covarianceSection."], + "name": "mixed", + "required": false, + "rootNode": false + }, + "averageParameterCovariance":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "crossTerm": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "crossTerm", + "required": false, + "type": "Boolean" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique":"yesLabel", + "childNodes": { + "columnData": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "columnData", + "occurrence": "1", + "required": false + }, + "covarianceMatrix": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "covarianceMatrix", + "occurrence": "choice", + "required": false + }, + "rowData": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "rowData", + "occurrence": "1", + "required": false + } + }, + "description": ["Covariance data are given for average parameters, as used in the unresolved resonance range.", + "Even so the unresolved resonance parameters may be given as energy dependent values, ", + " the covariance data are given for energy indedependent, i.e. energy averaged, parameters."], + "name": "averageParameterCovariance", + "required": false, + "rootNode": false + }, + "covarianceSection":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "crossTerm": { + "__class__": "nodes.Attribute", + "default": false, + "description": ["Indicates whether the covariance is a cross term connecting two different quantities." ], + "name": "crossTerm", + "required": false, + "type": "Boolean" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description":["The label must be unique among all \\elemlink{covarianceSection} elements in a \\elemlink{crossSections} element.", + "No other restrictions are placed on the label."], + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique":"yesLabel", + "childNodes": { + "rowData": { + "__class__": "nodes.ChildNode", + "description": ["defines what data lie along the rows of the covariance"], + "name": "rowData", + "occurrence": "1", + "required": true + }, + "columnData": { + "__class__": "nodes.ChildNode", + "description":["Defines what data lie along the columns of the covariance.", + "Required if crossTerm is true.", + "Otherwise it is assumed to be the same as rowData."], + "name": "columnData", + "occurrence": "1", + "required": false + }, + "covarianceMatrix": { + "__class__": "nodes.ChildNode", + "description": ["Contains the covariance data if only one \\elemlink{covarianceMatrix} element is needed", + " to describe the covariance data for this covarianceSection and the desired style."], + "name": "covarianceMatrix", + "occurrence": "choice", + "required": false + }, + "sum": { + "__class__": "nodes.ChildNode", + "description": ["The data references by this covariance matrix are given as a sum of other data."], + "name": "sum", + "occurrence": "choice", + "required": false + }, + "mixed": { + "__class__": "nodes.ChildNode", + "description": ["Contains more than one covariance matrix. ", + "All matrices need to be added in order to get the full covariance matrix."], + "name": "mixed", + "occurrence": "choice", + "required": false + } + }, + "description": ["Within the \\elemlink{covarianceSections}, most covariance data are organised into covarianceSection nodes. ", + "Each covarianceSection represents either the covariance for a single quantity, or a cross-term between two ", + "different quantities."], + "name": "covarianceSection", + "required": false, + "rootNode": false + }, + "rowData":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "ENDF_MFMT": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["the ENDF MF and MT numbers, stored as a comma-joined list (i.e. ``MF,MT'')"], + "name": "ENDF_MFMT", + "required": false, + "type": "XMLName" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["An xPath expression linking to the covariant quantity. ", + "The link may contain a reference to an external file referenced in \\elemlink{externalFiles}.", + " For some covariance matrices, such as a \\elemlink{parameterCovariance} this attribute may be omitted,", + " as more explicit references are given for the parameters." ], + "name": "href", + "required": false, + "type": "XMLName" + }, + "dimension": { + "__class__": "nodes.Attribute", + "default": null, + "description": [" If the href values is refering to a multi-dimensional ", + "object, (\\elemlink{array} or \\elemlink{regions2d} for example), ", + "the dimension to which this row refers. The number should be the same index as the axis,", + "for which this dimension is indexed."], + "name": "dimension", + "required": false, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "slices": { + "__class__": "nodes.ChildNode", + "description": ["If the href values is refering to a multi-dimensional object, ", + "list of slices along the fixed dimensions."], + "name": "slices", + "occurrence": "1", + "required": false + } + }, + "description": ["The rowData contains a link to the quantity (cross section, multiplicity, etc.) ", + "corresponding to the rows of the covariance matrix. One or more \\elemlink{slice} child nodes", + "are necessary when a higher-dimensional covariance ", + "such as for the outgoing energy", + "spectrum $P(E' | E)$ is divided into multiple \\elemlink{covarianceSection} nodes, each of which applies to part", + "of the incident energy domain. Each \\elemlink{slice} must contain a \\attr{dimension} attribute,", + "along with an optional \\texttt{domainUnit} and either a \\texttt{domainValue} or both \\texttt{domainMin} and \\texttt{domainMax}."], + "name": "rowData", + "required": false, + "rootNode": false + }, + "columnData":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "ENDF_MFMT": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Same as for \\elemlink{rowData}."], + "name": "ENDF_MFMT", + "required": false, + "type": "XMLName" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Same as for \\elemlink{rowData}."], + "name": "href", + "required": false, + "type": "XMLName" + }, + "dimension": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Same as for \\elemlink{rowData}."], + "name": "dimension", + "required": false, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "slices": { + "__class__": "nodes.ChildNode", + "description": ["If the href values is refering to a multi-dimensional object, ", + "list of slices along the fixed dimensions."], + "name": "slices", + "occurrence": "1", + "required": false + } + }, + "description": ["The columnData contains a link to the quantity (cross section, multiplicity, etc.) ", + "corresponding to the columns of the covariance matrix. ", + "The element \\elemlink{columnData} is only needed if this is a ", + "cross term connecting two different quantities."], + "name": "columnData", + "required": false, + "rootNode": false + }, + "slices":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "childNodes": { + "slice": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "slice", + "occurrence": "1+", + "required": true + } + }, + "description": ["List of \\element{slice} nodes, one for each fixed dimension of a covariance", + "for a multi-dimensional function."], + "name": "slices", + "required": false, + "rootNode": false + }, + "slice":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "domainMin": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The upper end of the domain" ], + "name": "domainMin", + "required": false, + "type": "Float64" + }, + "domainMax": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The lower end of the domain."], + "name": "domainMax", + "required": false, + "type": "Float64" + }, + "domainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Value of the domain (e.g. Legendre coefficient for an angular distribution covariance).", + "This attribute should be used instead of \\attr{domainMin} and \\attr{domainMax} if", + "the covariance applies to a single point in the given domain."], + "name": "domainValue", + "required": false, + "type": "Float64" + }, + "domainUnit": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The unit for \\texttt{domainMin}, \\texttt{domainMax} or \\texttt{domainValue}."], + "name": "domainUnit", + "required": false, + "type": "XMLName" + }, + "dimension": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The fixed dimension to which this dimension object refers. ", + "The number should be the same index as the axis, for which this dimension is indexed"], + "name": "dimension", + "required": true, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": {}, + "description": ["If giving a covariance matrix for a multidimensional object, each \\element{slice}", + "describes one dimension that is kept constant, along with the value or range of values", + "along that dimension to which the covariance applies."], + "name": "slice", + "required": false, + "rootNode": false + }, + "sum":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "domainMin": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The lower end of the domain the sum applies to."], + "name": "domainMin", + "required": true, + "type": "Float64" + }, + "domainMax": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The upper end of the domain the sum applies to."], + "name": "domainMax", + "required": true, + "type": "Float64" + }, + "domainUnit": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The unit for \\texttt{domainMin} and \texttt{domainMax}"], + "name": "domainUnit", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["If \\elemlink{sum} is a direct child of \\elemlink{covarianceSection}, ", + " the label refers to the style of the evalutions this sum relationship refers to.", + " In this case, the label is required, otherwise if \\elemlink{sum} is a ", + " child of \\elemlink{mixed}, it is optional. In the latter case it may be used to ensure ", + " that each \\elemlink{sum} in \\elemlink{mixed} has a unique label by which ", + " it can refered to in a link"], + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "summand": { + "__class__": "nodes.ChildNode", + "description": ["Identifies one of the summands to calculate the covariance data."], + "name": "summand", + "occurrence": "1+", + "required": false + } + }, + "description": ["If, in a given range, the underlying data can be described by a sum over a different set of data, ", + " then the covariance matrix can be calculated from the covariance information of this set of data.", + " This implies cross correlation between these different sets of data."], + "name": "sum", + "required": false, + "rootNode": false + }, + "summand":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "ENDF_MFMT": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "ENDF_MFMT", + "required": false, + "type": "XMLName" + }, + "coefficient": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The coefficient by which to weigh this reaction data in this range to ", + " calculate the final covariance data."], + + "name": "coefficient", + "required": false, + "type": "Float64" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "href", + "required": false, + "type": "bodyText" + } + }, + "bodyText": null, + "childNodes": {}, + "description": ["Indicates how the constituents for this covariance matrix data are to be summed."], + "name": "summand", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_cpTransport.json b/standards/gnds-2.0/summary_cpTransport.json new file mode 100644 index 000000000..b92acddd1 --- /dev/null +++ b/standards/gnds-2.0/summary_cpTransport.json @@ -0,0 +1,307 @@ +{ + "__namespace__":"cpTransport", + "RutherfordScattering":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": {}, + "description": [ + "Although strictly speaking the Rutherford scattering cross section is the Coulomb scattering cross section ", + "for two non-identical charged particles (see equation (\\ref{eq:6.7})), this markup is also used to ", + "describe the case of identical charged particle Coulomb scattering (see equation (\\ref{eq:6.8})). ", + "In either case, the Coulomb scattering cross section is analytic." + ], + "name": "RutherfordScattering", + "required": false, + "rootNode": false + }, + "CoulombPlusNuclearElastic":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "When \\element{CoulombPlusNuclearElastic} is used in place of an actual distribution ", + "this link is used to refer back to the parameterisation that defines the distribution." + ], + "name": "href", + "required": false, + "type": "XMLName" + }, + "identicalParticles": { + "__class__": "nodes.Attribute", + "default": false, + "description": [ + "If both outgoing products are the same type of particle, for example ", + "in the reaction `\\texttt{p + p -> p + p}'. If true, the angular dependence is ", + "symmetric and only applies to $0 \\le \\mu \\le \\mu_{cutoff}$.", + "Otherwise, the angular dependence is not symmetric and applies $-1 \\le \\mu \\le \\mu_{cutoff}$." + ], + "name": "identicalParticles", + "required": false, + "type": "Boolean" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Style label for this cross section.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The particle identifier of the outgoing particle.", + "name": "pid", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": false, + "type": "frame" + } + }, + "bodyText": null, + "childNodes": { + "RutherfordScattering": { + "__class__": "nodes.ChildNode", + "description": "This differential cross section is given by the Rutherford scattering cross section.", + "name": "RutherfordScattering", + "occurrence": "1", + "required": false + }, + "nuclearAmplitudeExpansion": { + "__class__": "nodes.ChildNode", + "description": "This differential cross section is given by the nuclear amplitude expansion.", + "name": "nuclearAmplitudeExpansion", + "occurrence": "1", + "required": false + }, + "// nuclearPlusInterference": { + "__class__": "nodes.ChildNode", + "description": "This differential cross section is given by the nuclear plus interference approach.", + "name": "nuclearPlusInterference", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This is either a container holding the differential charged particle scattering cross section or a reference to said container. ", + "It may appear inside a \\texttt{doubleDifferentialCrossSection}, \\texttt{crossSection} or \\texttt{distribution} node." + ], + "name": "CoulombPlusNuclearElastic", + "required": false, + "rootNode": false + }, + "nuclearPlusInterference":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "muCutoff": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Cosine of the cutoff angle. Above the cutoff angle, the distribution is assumed to be pure Coulomb scattering.", + "name": "muCutoff", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "crossSection": { + "__class__": "nodes.ChildNode", + "description": "The effective cross section $\\sigma_{NI}(E)$", + "name": "crossSection", + "occurrence": "1", + "required": true + }, + "distribution": { + "__class__": "nodes.ChildNode", + "description": "The effective angular distribution $P_{NI}(\\mu, E)$.", + "name": "distribution", + "occurrence": "1", + "required": true + } + }, + "description": [ + "It is possible to represent experimental data using the ``nuclear ", + "plus interference'' cross section and angular distribution in the CM ", + "system defined by:", + "\\begin{equation}", + " \\sigma _{NI} (E) = \\int\\limits_{\\mu_{\\min } }^{\\mu_{\\max } } {\\left[ \\rule{0ex}{2ex} {\\sigma _e (\\mu ,E) - \\sigma _c (\\mu ,E)}", + " \\right],d\\mu } \\label{eq:6.17}", + "\\end{equation}", + "and", + "\\begin{equation}", + " P_{NI} (\\mu ,E) = \\left\\{", + " \\begin{array}{ll}", + " \\displaystyle\\frac{{\\sigma _e (\\mu ,E) - \\sigma _c (\\mu ,E)}}{{\\sigma _{NI} (E)}}", + " & \\mu _{\\min } \\le \\mu \\le \\mu _{\\max } \\\\", + " 0 & \\mbox{otherwise}", + " \\end{array}", + " \\right.", + " \\label{eq:6.18}", + "\\end{equation}", + "where $\\mu_{min}=-1$ for different particles and 0 for ", + "identical particles. The maximum cosine should be as close to 1.0 as ", + "possible, especially at high energies where Coulomb scattering is less ", + "important. The Coulomb cross section ", + "$\\sigma_{c}(\\mu ,E)$ is to be computed using equations~(\\ref{eq:6.7}) ", + "or (\\ref{eq:6.8}) for different or identical particles, respectively." + ], + "name": "nuclearPlusInterference", + "required": false, + "rootNode": false + }, + "nuclearAmplitudeExpansion":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "nuclearTerm": { + "__class__": "nodes.ChildNode", + "description": "The coefficients $b_l(E)$ in the nuclear term of equations (\\ref{eq:6.11}) or (\\ref{eq:6.12})", + "name": "nuclearTerm", + "occurrence": "1", + "required": true + }, + "realInterferenceTerm": { + "__class__": "nodes.ChildNode", + "description": "The coefficients $\\texttt{Re}(a_l(E))$ in the interference term of equations (\\ref{eq:6.11}) or (\\ref{eq:6.12})", + "name": "realInterferenceTerm", + "occurrence": "1", + "required": true + }, + "imaginaryInterferenceTerm": { + "__class__": "nodes.ChildNode", + "description": "The coefficients $\\texttt{Im}(a_l(E))$ in the interference term of equations (\\ref{eq:6.11}) or (\\ref{eq:6.12})", + "name": "imaginaryInterferenceTerm", + "occurrence": "1", + "required": true + } + }, + "description": [ + "The net elastic scattering cross section for distinguishable particles may be written as:", + "\n", + "\\begin{eqnarray}", + "\\sigma_{ed} (\\mu ,E) = \\sigma_{cd} (\\mu ,E) &-& \\frac{2\\eta}{1-\\mu}", + "{\\mathop{\\rm Re}\\nolimits} \\left\\{ {\\exp \\left( {i\\eta \\ln", + "\\frac{{1 - \\mu }}{2}} \\right)\\sum\\limits_{l = 0}^{\\rm NL} {\\frac{{2l +", + "1}}{2}a_l (E)P_l (\\mu )} } \\right\\} \\nonumber \\\\", + "&+& \\sum_{l=0}^{2\\rm NL} {\\frac{{2l + 1}}{2}b_l (E)P_l (\\mu )} \\label{eq:6.11}", + "\\end{eqnarray}", + "\n", + "\\noindent and the cross section for identical particles is:", + "\n", + "\\begin{eqnarray}", + "\\sigma _{ei} (\\mu ,E) &=& \\sigma _{ci} (\\mu ,E) \\nonumber \\\\", + "&-& \\frac{{2\\eta }}{{1 - \\mu ^2 }} \\; {\\mathop{\\rm Re}\\nolimits} \\left\\{", + "{\\sum_{l=0}^{\\rm NL} {\\left[ \\begin{array}{r}", + "(1 + \\mu )\\exp \\left( {i\\eta \\ln \\frac{{1 - \\mu }}{2}} \\right) \\\\", + "+ ( - 1)^l (1 - \\mu )\\exp \\left( {i\\eta \\ln \\frac{{1 + \\mu }}{2}}", + "\\right) \\\\", + "\\end{array} \\right]\\frac{{2l + 1}}{2}a_l (E)P_l (\\mu )} } \\right\\} \\nonumber \\\\", + "&+& \\sum\\limits_{l=0}^{\\rm NL} {\\frac{{4l + 1}}{2} \\; b_l (E)P_{2l} (\\mu )} \\label{eq:6.12}", + "\\end{eqnarray}", + "\\noindent where the $a_{l}$ are complex coefficients for expanding the trace of ", + "the nuclear scattering amplitude matrix and the $b_{l}$ are real ", + "\n", + "coefficients for expanding the nuclear scattering cross section. The ", + "value of NL represents the highest partial wave contributing to nuclear ", + "scattering. Note that $\\sigma_{ei}(-\\mu ,E) = \\sigma_{ei}(\\mu ,E)$. ", + "\n", + "The three terms in Equations (\\ref{eq:6.11}) and (\\ref{eq:6.12}) are ", + "Coulomb, interference, and nuclear scattering, respectively." + ], + "name": "nuclearAmplitudeExpansion", + "required": false, + "rootNode": false + }, + "nuclearTerm":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": "The coefficients $b_l(E)$ given as a Legendre moment expansion inside an \\element{XYs2d}", + "name": "XYs2d", + "occurrence": "1", + "required": false + }, + "regions2d": { + "__class__": "nodes.ChildNode", + "description": "The coefficients $b_l(E)$ given as a Legendre moment expansion inside an \\element{regions2d}", + "name": "regions2d", + "occurrence": "1", + "required": false + } + }, + "description": "The coefficients $b_l(E)$ in the nuclear term of equations (\\ref{eq:6.11}) or (\\ref{eq:6.12})", + "name": "nuclearTerm", + "required": false, + "rootNode": false + }, + "realInterferenceTerm":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": "The coefficients $\\texttt{Re}(a_l(E))$ given as a Legendre moment expansion inside an \\element{XYs2d}", + "name": "XYs2d", + "occurrence": "1", + "required": false + }, + "regions2d": { + "__class__": "nodes.ChildNode", + "description": "The coefficients $\\texttt{Re}(a_l(E))$ given as a Legendre moment expansion inside an \\element{regions2d}", + "name": "regions2d", + "occurrence": "1", + "required": false + } + }, + "description": "The coefficients $\\texttt{Re}(a_l(E))$ in the interference term of equations (\\ref{eq:6.11}) or (\\ref{eq:6.12})", + "name": "realInterferenceTerm", + "required": false, + "rootNode": false + }, + "imaginaryInterferenceTerm":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": "The coefficients $\\texttt{Im}(a_l(E))$ given as a Legendre moment expansion inside an \\element{XYs2d}", + "name": "XYs2d", + "occurrence": "1", + "required": false + }, + "regions2d": { + "__class__": "nodes.ChildNode", + "description": "The coefficients $\\texttt{Im}(a_l(E))$ given as a Legendre moment expansion inside an \\element{regions2d}", + "name": "regions2d", + "occurrence": "1", + "required": false + } + }, + "description": "The coefficients $\\texttt{Im}(a_l(E)$) in the interference term of equations (\\ref{eq:6.11}) or (\\ref{eq:6.12})", + "name": "imaginaryInterferenceTerm", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_documentation.json b/standards/gnds-2.0/summary_documentation.json new file mode 100644 index 000000000..246c04c6d --- /dev/null +++ b/standards/gnds-2.0/summary_documentation.json @@ -0,0 +1,1301 @@ +{ + "__namespace__": "documentation", + "documentation": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "doi": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "The Digital Object Identifier (DOI) is a unique identifier affixed to a document or dataset \\cite{doi}.", + "A DOI is a character string that uniquely identifies a piece of information and is associated with the URL", + "where the information may be found." + ], + "name": "doi", + "required": false, + "type": "UTF8Text" + }, + "publicationDate": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "The evaluation date in the form specified in section~\\ref{format:basic:date}. ", + "This is equivalent to the DataCite.org \\attr{PublicationYear} or the ENDF-6 format's ENDATE field.", + "If the evaluation is not published, this attribute is optional." + ], + "name": "publicationDate", + "required": false, + "type": "date" + }, + "version": { + "__class__": "nodes.Attribute", + "default":null, + "description": "Version of the current evaluation or document, using whatever scheme is appropriate for the library to which the (partial) evaluation belongs", + "name": "version", + "required": false, + "type": "UTF8Text" + } + }, + "bodyText": null, + "childNodes": { + "authors": { + "__class__": "nodes.ChildNode", + "description": "The list of authors", + "name": "authors", + "occurrence": "1", + "required": true + }, + "contributors": { + "__class__": "nodes.ChildNode", + "description": "The list of additional contributors", + "name": "contributors", + "occurrence": "1", + "required": false + }, + "collaborations": { + "__class__": "nodes.ChildNode", + "description": "The name(s) of the collaboration(s) of the author(s) (e.g. CIELO or n\\_TOF)", + "name": "collaborations", + "occurrence": "1", + "required": false + }, + "dates": { + "__class__": "nodes.ChildNode", + "description": "The list of important dates in the development of the present evaluation.", + "name": "dates", + "occurrence": "1", + "required": true + }, + "copyright": { + "__class__": "nodes.ChildNode", + "description": "Copyright information", + "name": "copyright", + "occurrence": "1", + "required": false + }, + "acknowledgements": { + "__class__": "nodes.ChildNode", + "description": "Statements acknowledging contributions of some other sort (e.g. funding) not otherwise covered here", + "name": "acknowledgements", + "occurrence": "1", + "required": false + }, + "keywords": { + "__class__": "nodes.ChildNode", + "description": "A collection of NSR, PACS or PhySH keywords associated with this evaluation", + "name": "keywords", + "occurrence": "1", + "required": false + }, + "relatedItems": { + "__class__": "nodes.ChildNode", + "description": "A list of datasets related to the current one.", + "name": "relatedItems", + "occurrence": "1", + "required": false + }, + "title": { + "__class__": "nodes.ChildNode", + "description": "The title of the evaluation", + "name": "title", + "occurrence": "1", + "required": true + }, + "abstract": { + "__class__": "nodes.ChildNode", + "description": "An abstract summarizing the evaluation", + "name": "abstract", + "occurrence": "1", + "required": false + }, + "body": { + "__class__": "nodes.ChildNode", + "description": "The main body of text describing the evaluation. For translated ENDF-6 data, the entire MF1/MT451 text goes here.", + "name": "body", + "occurrence": "1", + "required": true + }, + "computerCodes": { + "__class__": "nodes.ChildNode", + "description": "The list of programs used to perform this evaluation", + "name": "computerCodes", + "occurrence": "1", + "required": false + }, + "experimentalDataSets": { + "__class__": "nodes.ChildNode", + "description": "List of references to the experimental data sets used and any corrections/rescalings used in the evaluation process", + "name": "experimentalDataSets", + "occurrence": "1", + "required": false + }, + "bibliography": { + "__class__": "nodes.ChildNode", + "description": "The list of references used in the evaluation documentation", + "name": "bibliography", + "occurrence": "1", + "required": false + }, + "endfCompatible": { + "__class__": "nodes.ChildNode", + "description": "Documentation restricted to plain ascii with 66 characters per line, for backwards compatibility with ENDF-6.", + "name": "endfCompatible", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "documentation", + "rootNode": false + }, + "authors": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "author": { + "__class__": "nodes.ChildNode", + "description": "Each author has their own \\element{author} node providing contact information, etc.", + "name": "author", + "occurrence": "1+", + "required": true + } + }, + "description": null, + "name": "authors", + "rootNode": false + }, + "author": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "name": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of author", + "name": "name", + "required": true, + "type": "UTF8Text" + }, + "orcid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The author's 16-digit ORCID ID number.", + "name": "orcid", + "required": false, + "type": "UTF8Text" + }, + "email": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Email address of author", + "name": "email", + "required": false, + "type": "UTF8Text" + } + }, + "bodyText": null, + "childNodes": { + "affiliations": { + "__class__": "nodes.ChildNode", + "description": "Institutional affiliation(s) of the author", + "name": "affiliations", + "occurrence": "1", + "required": false + }, + "note": { + "__class__": "nodes.ChildNode", + "description": "Any special note pertaining to the author", + "name": "note", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "author", + "rootNode": false + }, + "contributors": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "author": { + "__class__": "nodes.ChildNode", + "description": "Each contributor has their own \\element{contributor} node providing contact information, etc.", + "name": "contributor", + "occurrence": "1+", + "required": true + } + }, + "description": null, + "name": "contributors", + "rootNode": false + }, + "contributor": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "name": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of contributor", + "name": "name", + "required": true, + "type": "UTF8Text" + }, + "contributorType":{ + "__class__": "nodes.Attribute", + "default": null, + "description": "An enumeration describing the nature of the contribution", + "name": "contributorType", + "required": true, + "type": "contributorType" + }, + "orcid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The contributor's 16-digit ORCID ID number.", + "name": "orcid", + "required": false, + "type": "UTF8Text" + }, + "email": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Email address of contributor", + "name": "email", + "required": false, + "type": "UTF8Text" + } + }, + "bodyText": null, + "childNodes": { + "affiliations": { + "__class__": "nodes.ChildNode", + "description": "Institutional affiliation(s) of the contributor", + "name": "affiliations", + "occurrence": "1", + "required": false + }, + "note": { + "__class__": "nodes.ChildNode", + "description": "Any special note pertaining to the contributor", + "name": "note", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "contributor", + "rootNode": false + }, + "affiliations": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "affiliation": { + "__class__": "nodes.ChildNode", + "description": "Each affiliation is described in an \\element{affiliation} element.", + "name": "affiliation", + "occurrence": "1+", + "required": true + } + }, + "description": null, + "name": "affiliations", + "rootNode": false + }, + "affiliation": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "name": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The name of the affiliate.", + "name": "name", + "required": true, + "type": "UTF8Text" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The URL of the affiliate.", + "name": "href", + "required": false, + "type": "UTF8Text" + } + }, + "bodyText": null, + "childNodes": { }, + "description": null, + "name": "affiliation", + "rootNode": false + }, + "collaborations": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "collaboration": { + "__class__": "nodes.ChildNode", + "description": [ + "Each collaboration is specified using a \\element{collaboration} node." + ], + "name": "collaboration", + "occurrence": "1+", + "required": true + } + }, + "description": null, + "name": "collaborations", + "rootNode": false + }, + "collaboration": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "name": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The name of the collaboration.", + "name": "name", + "required": true, + "type": "UTF8Text" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The URL of the collaboration web page.", + "name": "href", + "required": false, + "type": "UTF8Text" + } + }, + "bodyText": null, + "childNodes": { }, + "description": null, + "name": "collaboration", + "rootNode": false + }, + "dates": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "date": { + "__class__": "nodes.ChildNode", + "description": "Each event in the lifecycle of the evaluation has its own \\element{date} entry.", + "name": "date", + "occurrence": "1+", + "required": true + } + }, + "description": "List of important dates in the development of the current evaluation.", + "name": "dates", + "rootNode": false + }, + "date": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "dateType": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An enumeration describing the nature of the date in question.", + "name": "dateType", + "required": true, + "type": "dateType" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The evaluation date in the form specified in section~\\ref{format:basic:date}. Date ranges are not supported.", + "name": "value", + "required": true, + "type": "date" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "An important date in the development of the current evaluation.", + "name": "date", + "rootNode": false + }, + "title": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": "Use this markup to provide the title of the evaluation/document.", + "name": "title", + "rootNode": false + }, + "abstract": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": "If needed, use this markup to provide a short summary of the documentation.", + "name": "abstract", + "rootNode": false + }, + "body": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": "Use this markup for the main text of the documentation. An ENDF-6's entire MF1/MT451 file is equivalent to this element.", + "name": "body", + "rootNode": false + }, + "copyright": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A link to the text of the copyright statement", + "name": "href", + "required": false, + "type": "UTF8Text" + } + }, + "bodyText": "", + "childNodes": {}, + "description": "The \\element{copyright} element provides a way for evaluators to add or link to a copyright statement for the (partial) evaluation.", + "name": "copyright", + "rootNode": false + }, + "version": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": [ + "Used to state the version of a document or code using whatever markup is appropriate.", + "Usually versions are simple numbers (e.g. subversion revision numbers),", + "but they can be much more complex (MacOS Sierra for instance). Given this, a", + "\\element{text} low level container is used to store the version information itself.", + "When used at the \\element{documentation} level, it refers to the version of the evaluation", + "and is thus equivalent to ENDF-6's NMOD flag." + ], + "name": "version", + "rootNode": false + }, + "acknowledgements": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "acknowledgement": { + "__class__": "nodes.ChildNode", + "description": "Statement acknowledging contributions of some other sort (e.g. funding) not otherwise covered.", + "name": "acknowledgement", + "occurrence": "1+", + "required": true + } + }, + "description": "A collection of acknowledgement statements.", + "name": "acknowledgements", + "rootNode": false + }, + "acknowledgement": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "type": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The {\\em unique} reference to the acknowledgement.", + "name": "type", + "required": true, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": [ + "This element allows one to acknowledge contributions of some other sort (e.g. funding) not otherwise covered.", + "All United States Department of Energy funded work require a statement of the funding used and this statement should be placed here." + ], + "name": "acknowledgement", + "rootNode": false + }, + "relatedItems": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "relatedItem": { + "__class__": "nodes.ChildNode", + "description": "A dataset related to the present one.", + "name": "relatedItem", + "occurrence": "1+", + "required": true + } + }, + "description": "List of datasets related to the present one.", + "name": "relatedItems", + "rootNode": false + }, + "relatedItem": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "name": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The name of the related item.", + "name": "name", + "required": true, + "type": "UTF8Text" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The URL of the related item.", + "name": "href", + "required": false, + "type": "UTF8Text" + }, + "relationType":{ + "__class__": "nodes.Attribute", + "default": null, + "description": "The nature of the relationship of the present set with the related item.", + "name": "relationType", + "required": false, + "type": "relationType" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "A dataset related to the present one.", + "name": "relatedItem", + "rootNode": false + }, + "keywords": { + "__class__": "nodes.Node", + "description": + [ + "Both the American Physical Society and the National Nuclear Data Center use keywording systems to categorise documents. ", + "The \\element{keywords} element allows us to collect these keywords together. \n\n", + "The National Nuclear Data Center uses the Nuclear Science References (NSR) keywording system. ", + "The American Physical Society's Physics and Astronomy Classification Scheme (PACS) system is another keywording ", + "system for categorising documents. ", + "The APS has stated that this keyword system is obsolete and will be replaced with the Physics Subject Headings (PhySH)", + "system~\\cite{PhySH}.\\footnote{For more information, see \\url{https://journals.aps.org/PACS} and ", + "\\url{https://journals.aps.org/authors/physh}.} Note that it is unlikely that older papers will be recoded or that", + "older papers will have their PACS codes removed. Therefore one expects that the present markup will be relevant for ", + "the forseeable future." + ], + "name": "keywords", + "attributes":{}, + "childNodes": { + "keyword": { + "__class__": "nodes.ChildNode", + "description": "A NSR, PACS or PhySH keyword associated with this evaluation", + "name": "keyword", + "occurrence": "1+", + "required": true + } + }, + "occurrence": "1", + "required": false + }, + "keyword": { + "__class__": "nodes.Node", + "abstractNode": "text", + "description": "A NSR, PACS or PhySH keyword associated with this evaluation", + "name": "keyword", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "type": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The name of the keywording scheme used, either ``NSR'', ``PACS'' or ``PhySH''", + "name": "type", + "required": true, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "occurrence": "1", + "required": false + }, + "computerCodes": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "computerCode": { + "__class__": "nodes.ChildNode", + "description": "Each set of code and inputs has a \\element{computerCode} node.", + "name": "computerCode", + "occurrence": "1+", + "required": true + } + }, + "description": "Lists the programs used while preparing the evaluation, along with code inputs.", + "name": "computerCodes", + "rootNode": false + }, + "computerCode": { + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "name": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "The name of the code, using all the same restrictions, etc. as the \\hyperlink{sec:name}{\\element{name}} markup introduced above in the", + "\\hyperlink{sec:author}{\\element{author}} markup. This includes allowing unicode program names (such as CEA's GALILE\\'E processing code \\cite{galilee})." + ], + "name": "name", + "required": true, + "type": "UTF8Text" + }, + "version": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "The version of the code, with all the restrictions and allowances of the \\hyperlink{sec:version}{\\element{version}} markup introduced above." + ], + "name": "version", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "executionArguments": { + "__class__": "nodes.ChildNode", + "description": [ + "The command line arguments used when invoking this code." + ], + "name": "executionArguments", + "occurrence": "1", + "required": false + }, + "codeRepo": { + "__class__": "nodes.ChildNode", + "description": [ + "Information for accessing the source code repository for this program." + ], + "name": "codeRepo", + "occurrence": "1", + "required": false + }, + "note": { + "__class__": "nodes.ChildNode", + "description": [ + "Any note describing extra information needed to run the code in the manner needed to reproduce the evaluation." + ], + "name": "note", + "occurrence": "1", + "required": false + }, + "inputDecks": { + "__class__": "nodes.ChildNode", + "description": "The list of input files for the code used.", + "name": "inputDecks", + "occurrence": "1", + "required": false + }, + "outputDecks": { + "__class__": "nodes.ChildNode", + "description": "The list of output files generated by the code.", + "name": "outputDecks", + "occurrence": "1", + "required": false + } + }, + "description": "Contains the information pertaining to a code used in the evaluation process and the inputs for that code.", + "name": "computerCode", + "rootNode": false + }, + "codeRepo": { + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "revisionSystem": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The source control format (e.g. \\attrval{git}, \\attrval{subversion} or \\attrval{mercurial}).", + "name": "revisionSystem", + "required": true, + "type": "XMLName" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Hyperlink to the source code repository.", + "name": "href", + "required": true, + "type": "XMLName" + }, + "revisionID": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Revision identifier. Could be a tag, svn revision number or git commit hash for example.", + "name": "revisionID", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "The \\element{codeRepo} element provides a mechanism for referencing the exact version of a computer code used in the evaluation.", + "This markup is meant to point to the exact revision of a code in a generally available code repository." + ], + "name": "codeRepo", + "rootNode": false + }, + "inputDecks": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "inputDeck": { + "__class__": "nodes.ChildNode", + "description": "Inputs for a \\element{computerCode} node.", + "name": "inputDeck", + "occurrence": "1+", + "required": true + } + }, + "description": "Lists the inputs for a given code.", + "name": "inputDecks", + "rootNode": false + }, + "inputDeck": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "filename": { + "__class__": "nodes.Attribute", + "default": null, + "description": "File name (possibly including relative path) for this input deck.", + "name": "filename", + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": "The \\element{inputDeck} contains the actual code inputs. The name of the element was chosen to avoid any confusion with other uses of the word ``input'' while evoking the mental image of a stack of punch cards such as used in the early days of nuclear data.", + "name": "inputDeck", + "rootNode": false + }, + "outputDecks": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "outputDeck": { + "__class__": "nodes.ChildNode", + "description": "Inputs for a \\element{computerCode} node.", + "name": "outputDeck", + "occurrence": "1+", + "required": true + } + }, + "description": "Lists the output files for a given code.", + "name": "outputDecks", + "rootNode": false + }, + "outputDeck": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "filename": { + "__class__": "nodes.Attribute", + "default": null, + "description": "File name (possibly including relative path) for this output file.", + "name": "filename", + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": "The \\element{outputDeck} contains the actual code outputs.", + "name": "outputDeck", + "rootNode": false + }, + "executionArguments": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": "Use this markup to list any special command line specifics used to invoke this code.", + "name": "executionArguments", + "rootNode": false + }, + "experimentalDataSets": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "exforDataSets": { + "__class__": "nodes.ChildNode", + "description": "Node to contain all the exfor experimental datasets.", + "name": "exforDataSets", + "occurrence": "1", + "required": true + } + }, + "description": [ + "Container for experimental data sets. Each type of experimental data will have its own top-level node. Currently, the only top-level node ", + "is the (\\element{exforDataSets}) node. This top-level tag is so-named so that other child nodes can be added, say for XUNDL ", + "datasets or for simple tables of XYdY pairs for raw experimen without distorting the meaning of the top-level tag." + ], + "name": "experimentalDataSets", + "rootNode": false + }, + "exforDataSets": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "exforDataSet": { + "__class__": "nodes.ChildNode", + "description": "One for each EXFOR data set.", + "name": "exforDataSet", + "occurrence": "1+", + "required": true + } + }, + "description": "Container storing a list of EXFOR datasets.", + "name": "exforDataSets", + "rootNode": false + }, + "exforDataSet": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "subentry": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "The EXFOR `SUBENT' (subentry) is an 8 character ascii string comprised of integers only.", + "Each subentry corresponds to a unique dataset within the experiment detailed in the EXFOR entry." + ], + "name": "subentry", + "required": true, + "type": "XMLName" + }, + "retrievalDate": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "The date the EXFOR subentry was retrieved.", + "The date must be in the form specified in the section~\\ref{format:basic:date}." + ], + "name": "retrievalDate", + "required": true, + "type": "date" + } + }, + "bodyText": null, + "childNodes": { + "covarianceScript": { + "__class__": "nodes.ChildNode", + "description": "The script describing the generation of covariance data..", + "name": "covarianceScript", + "occurrence": "1", + "required": false + }, + "correctionScript": { + "__class__": "nodes.ChildNode", + "description": "The script describing any modifications to the data.", + "name": "correctionScript", + "occurrence": "1", + "required": false + }, + "note": { + "__class__": "nodes.ChildNode", + "description": [ + "A note describing extra information needed to reproduce the evaluation." + ], + "name": "note", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Contains a reference to a specific EXFOR subentry (specified with the \\attr{SUBENT} attribute) and details of the retrieval and any corrections, rescalings, etc.", + "This markup does not contain the full EXFOR entry or subentry -- these are already stored in the master EXFOR database at the IAEA. This markup provides a scheme to reference the datasets only.", + "", + "Note that only the covariance generation and correction scripts provided by V. Zerkin in his EXFOR Web application \\cite{exforApp} are supported.", + "Other schemes could be designed but for the present none have been enumerated. If the current markup is insufficient to describe modifications/corrections to a data set,", + "the evaluator should consider documenting it in the main \\element{body} element." + ], + "name": "exforDataSet", + "rootNode": false + }, + "covarianceScript": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": [ + "V. Zerkin's EXFOR retrieval web application \\cite{exforApp} provides a mechanism for computing covariance matrices based off the statistical and systematic errors presented in an EXFOR entry.", + "This markup provides the means to place this script directly in the documentation for future reference and for reconstructing the covariance used at a later date." + ], + "name": "covarianceScript", + "rootNode": false + }, + "correctionScript": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": [ + "V. Zerkin's EXFOR retrieval web application \\cite{exforApp} provides a mechanism for rudimentary data correction of an EXFOR entry.", + "This markup provides the means to place this script directly in the documentation for future reference and for reconstructing the covariance used at a later date." + ], + "name": "correctionScript", + "rootNode": false + }, + "note": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": "Extra note that the authors may want to include.", + "name": "note", + "rootNode": false + }, + "bibliography": { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "bibitem": { + "__class__": "nodes.ChildNode", + "description": "Each entry in the bibliography has a unique \\element{bibitem}.", + "name": "bibitem", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "The bibliography markup gives the evaluator the tools to provide references for this evaluation with a system as flexible as \\LaTeX\\ or as simple as plain text.", + "Our notation here is clearly inspired by \\LaTeX\\ and should be familiar to many scientists and engineers. The \\element{bibliography} element is the outer container", + "for all of the \\element{bibitem}s (in keeping with \\LaTeX\\ notation)." + ], + "name": "bibliography", + "rootNode": false + }, + "bibitem": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "xref": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "The {\\em unique} reference to this bibitem. When using \\LaTeX markup, it is natural to use this as the key used when cross referencing with \\LaTeX's \\verb+\\cite{}+ command." + ], + "name": "xref", + "required": true, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": [ + "The \\element{bibitem} element contains the actual bibliographic reference.", + "The \\attr{label} attribute provides the landing point for hyperreferences to a \\element{bibitem} and must be unique." + ], + "name": "bibitem", + "rootNode": false + }, + "endfCompatible": { + "__class__": "nodes.Node", + "abstractNode": "text", + "attributes": { + "encoding": { + "default": "ascii", + "required": false, + "type": "XMLName" + }, + "markup": { + "default": "none", + "required": false, + "type": "attributeValue" + }, + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": "", + "childNodes": {}, + "description": [ + "Documentation in ENDF-6 is stored in MF1 MT451. This section contains free-form text which cannot be", + "broken up into the various sections supported by the \\element{documentation} node without manual intervention.", + "The \\element{endfCompatible} node is provided to support backwards compatibility and translating back to ENDF-6.", + "This node is expected to eventually be deprecated, but in the meantime evaluators should consider providing a short", + "summary of the documentation in ENDF-6 compatible form." + ], + "name": "endfCompatible", + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_extra.json b/standards/gnds-2.0/summary_extra.json new file mode 100644 index 000000000..311c0b3f6 --- /dev/null +++ b/standards/gnds-2.0/summary_extra.json @@ -0,0 +1,110 @@ +{ + "__namespace__":"extra", + + "// ALTERNATIVE double" : [ + "Without uncertainty" + ], + "double":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": "`' (no label)", + "description": "e.g. `kg' or `m'", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "numeric value", + "name": "value", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Stores a \texttt{Float64} quantity along with an optional unit and optional label", + "name": "double", + "required": false, + "rootNode": false + }, + + "// ALTERNATIVE uncertainty" : [ + "Without pdf", + "Without XYs1d", + "Without polynomial1d" + ], + "uncertainty":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "standard": { + "__class__": "nodes.ChildNode", + "description": "Stores a normally-distributed uncertainty.", + "namespace": "containers", + "name": "standard", + "occurrence": "1", + "required": false + }, + "logNormal": { + "__class__": "nodes.ChildNode", + "description": "Stores a log-normal-distributed uncertainty.", + "namespace": "containers", + "name": "logNormal", + "occurrence": "1", + "required": false + }, + "confidenceIntervals": { + "__class__": "nodes.ChildNode", + "description": "Stores a list of intervals along with the confidence that the `true value' lies within each interval.", + "namespace": "containers", + "name": "confidenceIntervals", + "occurrence": "1", + "required": false + }, + "covariance": { + "__class__": "nodes.ChildNode", + "description": [ + "Stores a covariance matrix (or a link to a covariance matrix),", + "usually for a 1-dimensional function." + ], + "namespace": "containers", + "name": "covariance", + "occurrence": "1", + "required": false + }, + "listOfCovariances": { + "__class__": "nodes.ChildNode", + "description": [ + "Stores a list of covariance matrices (or a list of links to covariance matrices).", + "This option is generally used for higher-dimensional functions. For example,", + "if an angular distribution $P(\\mu|E)$ is stored as an energy-dependent list of", + "\\element{Legendre} expansions, the full covariance may be decomposed into energy-dependent", + "covariance matrices for each combination of $L_i$ and $L_j$. The \\element{listOfCovariances}", + "lists all of these covariances." + ], + "name": "listOfCovariances", + "occurrence": "1", + "required": false + } + }, + "description": "Stores the uncertainty for a scalar quantity or a functional data container.", + "name": "uncertainty", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_fissionFragmentData.json b/standards/gnds-2.0/summary_fissionFragmentData.json new file mode 100644 index 000000000..d217ad64d --- /dev/null +++ b/standards/gnds-2.0/summary_fissionFragmentData.json @@ -0,0 +1,120 @@ +{ + "__namespace__":"fissionFragmentData", + "fissionFragmentData":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "delayedNeutrons": { + "__class__": "nodes.ChildNode", + "description": "List of delayed neutrons. Each has an associated decay rate, multiplicity and energy distribution.", + "name": "delayedNeutrons", + "occurrence": "1", + "required": false + }, + "fissionEnergyReleased": { + "__class__": "nodes.ChildNode", + "description": "Describes how energy released during fission is partitioned between various products.", + "name": "fissionEnergyReleased", + "occurrence": "1", + "required": false + }, + "productYields": { + "__class__": "nodes.ChildNode", + "description": "Container to hold lists of \\element{productYield}, including evaluated or processed yields.", + "name": "productYields", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Nuclear fission generally produces some prompt neutrons and gammas and occasionally light ions,", + "plus two large fission fragments. These fragments may then decay and emit additional radiation", + "including delayed neutrons / gammas, betas, etc. The fissionFragmentData section describes the", + "heavy (A > 4) fragments and their subsequent decay.", + "When used for particle-induced fission, this node appears inside the \\element{outputChannel}", + "node of a fission reaction. When used for spontaneous fission, this node appears in the", + "\\element{nuclide} node inside the \\element{PoPs} database." + ], + "name": "fissionFragmentData", + "required": true, + "rootNode": false + }, + + "delayedNeutrons":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "delayedNeutron": { + "__class__": "nodes.ChildNode", + "description": "Information about neutrons emitted at the specified `decay rate' after fission.", + "name": "delayedNeutron", + "occurrence": "1+", + "required": true + } + }, + "description": "Stores a list of delayed neutrons, each with an associated decay rate, multiplicity and energy distribution.", + "name": "delayedNeutrons", + "required": false, + "rootNode": false + }, + "delayedNeutron":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label for this delayed neutron group.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "rate": { + "__class__": "nodes.ChildNode", + "description": "Decay rate (in decays/second or equivalent) for this delayed neutron group.", + "name": "rate", + "occurrence": "1", + "required": true + }, + "product": { + "__class__": "nodes.ChildNode", + "description": "Product describing this delayed neutron. Includes average multiplicity and distribution info.", + "namespace": "common", + "name": "product", + "occurrence": "1", + "required": true + } + }, + "description": "Stores a delayed neutron product, representing an average multiplicity and distribution for neutrons emitted with the specified decay rate.", + "name": "delayedNeutron", + "required": false, + "rootNode": false + }, + "rate":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": "Defines the decay rate. Recommended units are `1/s' or equivalent.", + "namespace": "containers", + "name": "double", + "occurrence": "1", + "required": true + } + }, + "description": "Defines the decay rate for the parent \\element{delayedNeutron}.", + "name": "rate", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_fissionTransport.json b/standards/gnds-2.0/summary_fissionTransport.json new file mode 100644 index 000000000..cc090c639 --- /dev/null +++ b/standards/gnds-2.0/summary_fissionTransport.json @@ -0,0 +1,625 @@ +{ + "__namespace__":"fissionTransport", + "fissionComponents":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "fissionComponent": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "fissionComponent", + "occurrence": "1+", + "required": false + } + }, + "description": [ + "Nuclear data evaluations sometimes break a reaction up into multiple components,", + "but only supply a cross section (not outgoing products) for each component.", + "For example, cross sections for first-chance, second-chance, etc. fission", + "may be stored, even though product distributions are only given for total fission.", + "The \\element{fissionComponent} node supports storing this type of incomplete", + "reaction. " + ], + "name": "fissionComponents", + "required": false, + "rootNode": false + }, + "fissionComponent":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "ENDF_MT": { + "__class__": "nodes.Attribute", + "default": null, + "description": "integer MT number (e.g. `20' for 2$^{nd}$-chance fission).", + "name": "ENDF_MT", + "required": false, + "type": "Integer32" + }, + "fissionGenre": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "fissionGenre", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "crossSection": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "crossSection", + "occurrence": "1", + "required": false + }, + "outputChannel": { + "__class__": "nodes.ChildNode", + "description": "Describes the secondary particle emissions from the reaction", + "name": "outputChannel", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Fission without pre-fission particle emission is known as first chance fission, while the emission of ", + "one (n,nf) or two neutrons (n,2nf) are known as second and third chance fission, respectively. ", + "It can be advantageous to separate out these as distinct components.", + "The \\element{fissionComponent} supports storing", + "each of these fission chances. The \\element{fissionComponent} node is similar to a \\element{reaction}:", + "it contains a cross section and an outputChannel along with a Q-value.", + "The list of reaction products is generally empty, however."], + "name": "fissionComponent", + "required": false, + "rootNode": false + }, + "fissionEnergyReleased":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "delayedBetaEnergy": { + "__class__": "nodes.ChildNode", + "description": "Total energy released by delayed $\\beta$'s.", + "name": "delayedBetaEnergy", + "occurrence": "1", + "required": false + }, + "delayedGammaEnergy": { + "__class__": "nodes.ChildNode", + "description": "Total energy released by the emission of delayed $\\gamma$ rays.", + "name": "delayedGammaEnergy", + "occurrence": "1", + "required": false + }, + "delayedNeutronKE": { + "__class__": "nodes.ChildNode", + "description": "Kinetic energy of the delayed fission neutrons.", + "name": "delayedNeutronKE", + "occurrence": "1", + "required": false + }, + "neutrinoEnergy": { + "__class__": "nodes.ChildNode", + "description": "Energy carried away by neutrinos.", + "name": "neutrinoEnergy", + "occurrence": "1", + "required": false + }, + "nonNeutrinoEnergy": { + "__class__": "nodes.ChildNode", + "description": "Total energy less the energy of the neutrinos {\\tt (ET - ENU)}", + "name": "nonNeutrinoEnergy", + "occurrence": "1", + "required": false + }, + "promptGammaEnergy": { + "__class__": "nodes.ChildNode", + "description": "Total energy released by the emission of prompt $\\gamma$ rays.", + "name": "promptGammaEnergy", + "occurrence": "1", + "required": false + }, + "promptNeutronKE": { + "__class__": "nodes.ChildNode", + "description": "Kinetic energy of the prompt fission neutrons.", + "name": "promptNeutronKE", + "occurrence": "1", + "required": false + }, + "promptProductKE": { + "__class__": "nodes.ChildNode", + "description": "Kinetic energy of the fission products (following prompt neutron emission from the fission fragments).", + "name": "promptProductKE", + "occurrence": "1", + "required": false + }, + "totalEnergy": { + "__class__": "nodes.ChildNode", + "description": "Sum of the partial energies. This sum is the total energy release\nper fission and by definition is the fission $Q$-value.", + "name": "totalEnergy", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "fissionEnergyReleased", + "required": false, + "rootNode": false + }, + "delayedBetaEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "1", + "required": false + } + }, + "description": "Total energy released by delayed $\\beta$'s. This corresponds to ENDF's \\texttt{EB}.", + "name": "delayedBetaEnergy", + "required": false, + "rootNode": false + }, + "totalEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "1", + "required": false + } + }, + "description": "Sum of the partial energies. This sum is the total energy release\nper fission and by definition is the fission $Q$-value. This corresponds to ENDF's \\texttt{ET}.", + "name": "totalEnergy", + "required": false, + "rootNode": false + }, + "delayedGammaEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "1", + "required": false + } + }, + "description": "Total energy released by the emission of delayed $\\gamma$ rays. This corresponds to ENDF's \\texttt{EGD}.", + "name": "delayedGammaEnergy", + "required": false, + "rootNode": false + }, + "nonNeutrinoEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "1", + "required": false + } + }, + "description": "Total energy less the energy of the neutrinos {\\tt (ET - ENU)}.", + "name": "nonNeutrinoEnergy", + "required": false, + "rootNode": false + }, + "promptGammaEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "1", + "required": false + } + }, + "description": "Total energy released by the emission of prompt $\\gamma$ rays. This corresponds to ENDF's \\texttt{EGP}.", + "name": "promptGammaEnergy", + "required": false, + "rootNode": false + }, + "neutrinoEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "1", + "required": false + } + }, + "description": "Energy carried away by neutrinos. This corresponds to ENDF's \\texttt{ENU}.", + "name": "neutrinoEnergy", + "required": false, + "rootNode": false + }, + "promptProductKE":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "1", + "required": false + } + }, + "description": "Kinetic energy of the fission products (following prompt neutron emission from the fission fragments). This corresponds to ENDF's \\texttt{EFR}.", + "name": "promptProductKE", + "required": false, + "rootNode": false + }, + "promptNeutronKE":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "1", + "required": false + } + }, + "description": "Kinetic energy of the prompt fission neutrons. This corresponds to ENDF's \\texttt{ENP}.", + "name": "promptNeutronKE", + "required": false, + "rootNode": false + }, + "delayedNeutronKE":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "1", + "required": false + } + }, + "description": "Kinetic energy of the delayed fission neutrons. This corresponds to ENDF's \\texttt{END}.", + "name": "delayedNeutronKE", + "required": false, + "rootNode": false + }, + "Watt" : { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "U": { + "__class__": "nodes.ChildNode", + "description": "A constant introduced to define the proper upper limit for the final particle energy such that $0 \\leq E' \\leq (E - U)$., discussed in section \\ref{format:transport:U}", + "name": "U", + "occurrence": "1", + "required": true + }, + "a": { + "__class__": "nodes.ChildNode", + "description": "Contains one \\XYsOneD\\ or \\regionsOneD\\ functional data container that represents a valid $a(E)$.", + "namespace": "fissionTransport", + "name": "a", + "occurrence": "1", + "required": true + }, + "b": { + "__class__": "nodes.ChildNode", + "description": "Contains one \\XYsOneD\\ or \\regionsOneD\\ functional data container that represents a valid $b(E)$.", + "name": "b", + "occurrence": "1", + "required": true + } + }, + "description": [ + "This subsection provides the specification for the \\element{Watt} energy representation ", + "(equivalent to the ENDF-6 format's MF=5, LF=11 format). This is essentially a Lorentz-boosted Maxwellian.", + "\\begin{displaymath}", + " P(E'|E) = \\frac{{e^{ - E'/a} }}{I}\\sinh \\left( {\\sqrt{bE'} } \\right)", + "\\end{displaymath}", + "where", + "\\begin{varlist}", + "\\item[$I$] is the normalisation constant:", + " \\begin{eqnarray*}", + " I &= &\\frac{1}{2}\\sqrt {\\frac{{\\pi a^3 b}}{4}} \\exp \\left(", + " {\\frac{{ab}}{4}} \\right)", + " \\left[ {\\mbox{erf} {\\left( {\\sqrt {\\frac{{E - U}}{a}}", + " - \\sqrt {\\frac{{ab}}{4}} } \\right) + \\mbox{erf}\\left( {\\sqrt", + " {\\frac{{E - U}}{a}} + \\sqrt {\\frac{{ab}}{4}} } \\right)}} \\right] \\\\", + " &-& a\\exp \\left[ { - \\left( {\\frac{{E - U}}{a}} \\right)} \\right]\\sinh", + " \\sqrt {b(E - U)} \\\\", + " \\end{eqnarray*}", + "\\item[$a$ and $b$] are tabulated energy-dependent parameters;", + "\\item[$U$] is a constant introduced to", + " define the proper upper limit for the final particle energy such that", + " $0 \\leq E' \\leq (E - U)$.", + "\\end{varlist}" + ], + "name": "Watt", + "required": false, + "rootNode": false + }, + "a":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": {}, + "description": "a for Watt spectrum", + "name": "a", + "required": false, + "rootNode": false + }, + "b":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": {}, + "description": "b for Watt spectrum", + "name": "b", + "required": false, + "rootNode": false + }, + "simpleMaxwellianFission":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "U": { + "__class__": "nodes.ChildNode", + "description": "A constant introduced to define the proper upper limit for the final particle energy such that $0 \\leq E' \\leq (E - U)$.", + "name": "U", + "occurrence": "1", + "required": false + }, + "theta": { + "__class__": "nodes.ChildNode", + "description": "The effective emission temperature.", + "name": "theta", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This element is the format for ENDF-6's Simple Maxwellian Fission Spectrum (MF=5, LF=7).\n", + "\\begin{displaymath}\n", + " f(E \\to E') = \\frac{\\sqrt{E'}}{I} e^{{ - E'} / {\\theta (E)}}\n", + "\\end{displaymath}\n", + "where the parameters $U$ and $\\theta$ are given in sections \\ref{format:transport:U} and \\ref{format:transport:theta} respectively and $I$ is given by", + "\\begin{displaymath}\n", + " I = \\theta^{3/2}", + " \\left[ \\frac{\\sqrt \\pi }{2} \\mbox{erf} \\left(", + " \\sqrt{(E - U) / \\theta } \\right) - \\sqrt{(E - U) / \\theta }", + " \\; e^{ {-(E - U)/\\theta }}", + " \\right]", + "\\end{displaymath}\n" + ], + "name": "simpleMaxwellianFission", + "required": false, + "rootNode": false + }, + "MadlandNix":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "EFH": { + "__class__": "nodes.ChildNode", + "description": "The $E_F(H)$ value.", + "name": "EFH", + "occurrence": "1", + "required": true + }, + "EFL": { + "__class__": "nodes.ChildNode", + "description": "The $E_F(L)$ value.", + "name": "EFL", + "occurrence": "1", + "required": true + }, + "T_M": { + "__class__": "nodes.ChildNode", + "description": "Temperature like parameter tabulated as a function of incident neutron energy, given as an \\element{XYs1d}. The $y$-axis unit must be an energy unit.", + "name": "T_M", + "occurrence": "1", + "required": true + } + }, + "description": [ + "The \\element{MadlandNix} element encodes the energy-dependent fission neutron spectrum using Madland and", + "Nix's parameterisation. This format is equivalent to ENDF-6's MF=5, LF=12. ", + "The distribution is parametrically given by,", + "\\begin{eqnarray*}", + " P(E'|E) &=&\\frac{1}{2}\\left[ {g(E',E_{F}(L)) + g(E',E_{F}(H))}\\right] \\\\", + " g(E',E_{F}) &=&\\frac{1}{3\\sqrt{(E_{F} \\; T_{M})}}", + " \\left[ {u_2^{3/2} \\mbox{E}_1 (u_2 ) - u_1^{3/2} \\mbox{E}_1 (u_1 ) +", + " \\gamma \\left(\\frac{3}{2}, u_2 \\right) -", + " \\gamma \\left(\\frac{3}{2}, u_1 \\right)} \\right] \\\\", + " u_1 &= &{\\left( {\\sqrt {E'} - \\sqrt {E_{F}} } \\right)^2 } / T_{M} \\\\", + " u_2 &= &{\\left( {\\sqrt {E'} + \\sqrt {E_{F}} } \\right)^2 } / T_{M}", + "\\end{eqnarray*}", + "where:", + "\\begin{varlist}", + "\\item[$E_{F}(X)$] are constant, which", + " represent the average kinetic energy per nucleon of the", + " fission fragment; arguments $L$ and $H$ refer to the average light", + " fragment (given by the parameter \\attr{EFL} in the file) and the average heavy fragment", + " (given by the parameter \\attr{EFH} in the file), respectively.", + "\\item[$T_{M}$] parameter tabulated as a function of incident neutron energy", + "\\item[E$_{1}(x)$] is the exponential integral", + "\\item[$\\gamma (a,x)$] is the incomplete gamma function.", + " The integral of this spectrum between zero and infinity", + " is one.", + "\\end{varlist}", + "Note the range of $E'$ is such that $0\\le E'\\le\\infty$. Physically, energy conservation", + "cuts off the integral at finite $E'_{\\max }$ but the dependence of $g(E',E_F)$ on $E'$ ensures", + "that the contribution from large values of $E'$ is negligible." + ], + "name": "MadlandNix", + "required": false, + "rootNode": false + }, + "T_M":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "The table of \\attr{T{\\textunderscore}M} values vs. incident energy.", + "name": "XYs1d", + "occurrence": "1", + "required": true + } + }, + "description": "Temperature-like parameter tabulated as a function of incident neutron energy, given as an \\element{XYs1d}. ", + "name": "T_M", + "required": true, + "rootNode": false + }, + "EFL":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An energy unit.", + "name": "unit", + "required": true, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The value of $E_F(L)$ itself.", + "name": "value", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "The $E_F(L)$ value.", + "name": "EFL", + "required": true, + "rootNode": false + }, + "EFH":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An energy unit.", + "name": "unit", + "required": true, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The value of $E_F(H)$ itself.", + "name": "value", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "The $E_F(H)$ value.", + "name": "EFH", + "required": true, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_fpy.json b/standards/gnds-2.0/summary_fpy.json new file mode 100644 index 000000000..7eb90e48d --- /dev/null +++ b/standards/gnds-2.0/summary_fpy.json @@ -0,0 +1,293 @@ +{ + "__namespace__":"fpy", + "productYields":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "productYield": { + "__class__": "nodes.ChildNode", + "description": "One `style' of product yield data.", + "name": "productYield", + "occurrence": "1+", + "required": true + } + }, + "description": "Container to hold lists of \\element{productYield}, including evaluated or processed yields.", + "name": "productYields", + "required": true, + "rootNode": false + }, + "productYield":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Denotes the \\attr{style} of the evaluated data.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "nuclides": { + "__class__": "nodes.ChildNode", + "description": "List of nuclide id's. For spontaneous yields, all \\element{elapsedTimes} use the same list of nuclides.", + "namespace": "fpy", + "name": "nuclides", + "occurrence": "1", + "required": false + }, + "elapsedTimes": { + "__class__": "nodes.ChildNode", + "description": "Container to hold lists of \\element{elapsedTime} elements.", + "name": "elapsedTimes", + "occurrence": "1", + "required": true + } + }, + "description": "This element actually contains the yields, broken out by the time at which the yield is considered.", + "name": "productYield", + "required": true, + "rootNode": false + }, + "nuclides":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "xPath link to another \\element{nuclides} node, indicating to use the same list of nuclides.", + "name": "href", + "required": false, + "type": "bodyText" + } + }, + "bodyText": ["A space delimited list of nuclide id's (e.g. \\attrval{Cu79 Cu80 ...}), arranged in the same order as the appropriate values", + "tabulated in the \\element{values} container(s). For particle induced yields, the \\element{values} container is co-located", + "with this \\element{nuclide} container. For spontaneous yields, the \\element{values} container is inside the appropriate \\element{yields} container.", + "If the 'href' attribute is present, the body text must be empty."], + "childNodes": {}, + "description": ["List of nuclide id's, or href pointing to another \\element{nuclides} node.", + "GNDS permits using a different list of nuclides for different incident energies and/or elapsed times, but also supports linking if the evaluator wishes to", + "use the same list of nuclides throughout."], + "name": "nuclides", + "required": true, + "rootNode": false + }, + "elapsedTimes":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "elapsedTime": { + "__class__": "nodes.ChildNode", + "description": "The collection of yield data corresponding to one time point.", + "name": "elapsedTime", + "occurrence": "1+", + "required": true + } + }, + "description": "Container to hold lists of \\element{elapsedTime} elements.", + "name": "elapsedTimes", + "required": false, + "rootNode": false + }, + "elapsedTime":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "This labels what the time element corresponds to, namely \\attrval{initial} (e.g. independent) or \\attrval{unspecified} (e.g. cumulative)", + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique": "yesLabel", + "childNodes": { + "time": { + "__class__": "nodes.ChildNode", + "description": "Time corresponding to yields in question. ", + "name": "time", + "occurrence": "1", + "required": true + }, + "yields": { + "__class__": "nodes.ChildNode", + "description": "For spontaneous fission, this collects the yields.", + "name": "yields", + "occurrence": "choice", + "required": false + }, + "incidentEnergies": { + "__class__": "nodes.ChildNode", + "description": "For induced fission, this collects the data for each of the projectile's incident energies. Contains the list of \\element{incidentEnergy} elements.", + "name": "incidentEnergies", + "occurrence": "choice", + "required": false + } + }, + "description": [ + "The collection of yield data at a given time after fission. For spontaneous fission, ", + "the \\element{elapsedTime} node contains a \\element{time} and a \\element{yields} section. ", + "For induced fission, each \\element{elapsedTime} contains a \\element{time} and ", + "an \\element{incidentEnergies}." + ], + "name": "elapsedTime", + "required": true, + "rootNode": false + }, + "time":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childUnique": "yesLabelOmitted", + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": null, + "namespace": "containers", + "name": "double", + "occurrence": "choice", + "required": false + }, + "string": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "string", + "occurrence": "choice", + "required": false + } + }, + "description": [ + "Time corresponding to the yields in question. Generally yields with time of 0 s are scission yields,", + "times between 0 s and $10^{-14}$ s are independent fission yields and", + "those with longer times are cumulative yields. Cumulative yields with an unspecified time are denoted ", + "with a \\element{string} child node containing ``unspecified''." + ], + "name": "time", + "required": true, + "rootNode": false + }, + "yields":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "nuclides": { + "__class__": "nodes.ChildNode", + "description": "List of nuclide id's or href pointing to another \\element{nuclides} node.", + "namespace": "fpy", + "name": "nuclides", + "occurrence": "1", + "required": true + }, + "values": { + "__class__": "nodes.ChildNode", + "description": "The actual values, in the order given by the corresponding \\element{nuclides} element.", + "name": "values", + "occurrence": "1", + "required": true + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty/covariance on the actual values, in the order given by the corresponding \\element{nuclides} element.", + "namespace": "containers", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": "Container for the nuclides and corresponding yield values. This node appears inside either a \\element{elapsedTime} node (spontaneous fission) or \\element{incidentEnergy} node (induced fission).", + "name": "yields", + "required": false, + "rootNode": false + }, + "incidentEnergies":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "incidentEnergy": { + "__class__": "nodes.ChildNode", + "description": "Yield data from one incident energy.", + "name": "incidentEnergy", + "occurrence": "1+", + "required": true + } + }, + "description": "For induced fission, this collects the data for each of the projectile's incident energies. Contains the list of \\element{incidentEnergy} elements.", + "name": "incidentEnergies", + "required": false, + "rootNode": false + }, + "incidentEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The index of this element.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "energy": { + "__class__": "nodes.ChildNode", + "description": "The projectile's incident energy.", + "namespace": "fpy", + "name": "energy", + "occurrence": "1", + "required": true + }, + "yields": { + "__class__": "nodes.ChildNode", + "description": "Nuclides, yields and uncertainties for this elapsed time / incident energy.", + "name": "yields", + "occurrence": "1", + "required": true + } + }, + "description": "Stores yield data for a single incident energy.", + "name": "incidentEnergy", + "required": false, + "rootNode": false + }, + "energy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": "The actual energy.", + "namespace": "containers", + "name": "double", + "occurrence": "1", + "required": true + } + }, + "description": "The projectile's incident energy.", + "name": "energy", + "required": true, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_gpdc.json b/standards/gnds-2.0/summary_gpdc.json new file mode 100644 index 000000000..4a3c707a1 --- /dev/null +++ b/standards/gnds-2.0/summary_gpdc.json @@ -0,0 +1,1973 @@ +{ + "__namespace__":"containers", + "double":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": "`' (no label)", + "description": "e.g. `kg' or `m'", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "numeric value", + "name": "value", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Stores the uncertainty on the parent \\element{double}.", + "namespace": "containers", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": "Stores a \texttt{Float64} quantity along with a unit, optional label and uncertainty", + "name": "double", + "required": false, + "rootNode": false + }, + "integer":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": "`' (no label)", + "description": "Unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": "`' (i.e. unitless)", + "description": "e.g. `kg' or `m'", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "value", + "required": true, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "The \\element{integer} physical quantity is used to store quantities that can only be integers. ", + "It is similar to the \\element{double}, except that the value must be an integer ", + "(e.g. value=`1' rather than value=`1.0'). ", + "Uncertainties are also treated differently: rather than an \\element{uncertainty} node, ", + "tentative assignments are indicated by storing each possible assignment along with a likelihood." + ], + "name": "integer", + "required": false, + "rootNode": false + }, + "fraction":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": "`' (no label)", + "description": "Unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": "`' (i.e. unitless)", + "description": "e.g. `J/s'", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "numeric value", + "name": "value", + "required": true, + "type": "Fraction32" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "The \\element{fraction} physical quantity is used to store values that can only be ", + "integers or fractions. It is nearly identical to the \\element{integer}, ", + "but the value in this case may either be an integer or a ratio of integers separated ", + "by the `/' character, as in `3/2'. Values like `1.5' are not allowed. " + ], + "name": "fraction", + "required": false, + "rootNode": false + }, + "string":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid unit", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "contains a string composed of printable ascii characters (e.g. `stable').", + "name": "value", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "The \\element{string} physical quantity is used to store quantities that cannot be represented numerically. The main examples are half-lives for\nstable particles, which are best represented as the string `stable'.", + "name": "string", + "required": false, + "rootNode": false + }, + "link":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The URL or xpath-like string pointing to the referred-to element", + "name": "href", + "required": true, + "type": "bodyText" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "Used to explicitly link to another part of the GNDS document (or an external document).", + "For example, if both axis grids in a \\elemlink{gridded2d}", + "container are identical, the \\element{link} can be used rather than repeating the grid values." + ], + "name": "link", + "required": false, + "rootNode": false + }, + + "uncertainty":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "standard": { + "__class__": "nodes.ChildNode", + "description": "Stores a normally-distributed uncertainty.", + "namespace": "containers", + "name": "standard", + "occurrence": "1", + "required": false + }, + "logNormal": { + "__class__": "nodes.ChildNode", + "description": "Stores a log-normal-distributed uncertainty.", + "namespace": "containers", + "name": "logNormal", + "occurrence": "1", + "required": false + }, + "confidenceIntervals": { + "__class__": "nodes.ChildNode", + "description": "Stores a list of intervals along with the confidence that the `true value' lies within each interval.", + "namespace": "containers", + "name": "confidenceIntervals", + "occurrence": "1", + "required": false + }, + "pdf": { + "__class__": "nodes.ChildNode", + "description": "Stores a probability distribution as a 1-dimensional function.", + "namespace": "containers", + "name": "pdf", + "occurrence": "1", + "required": false + }, + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": [ + "Store the uncertainty for a 1-dimensional function.", + "Uncertainties are assumed to be normally distributed. If uncertainties are correlated,", + "use the \\element{covariance} option instead." + ], + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": [ + "Stores uncertainties for each coefficient in a polynomial expansion.", + "Uncertainties are assumed to be normally distributed. If coefficients are correlated,", + "use the \\element{covariance} option instead." + ], + "name": "polynomial1d", + "occurrence": "1", + "required": false + }, + "covariance": { + "__class__": "nodes.ChildNode", + "description": [ + "Stores a covariance matrix (or a link to a covariance matrix),", + "usually for a 1-dimensional function." + ], + "namespace": "containers", + "name": "covariance", + "occurrence": "1", + "required": false + }, + "listOfCovariances": { + "__class__": "nodes.ChildNode", + "description": [ + "Stores a list of covariance matrices (or a list of links to covariance matrices).", + "This option is generally used for higher-dimensional functions. For example,", + "if an angular distribution $P(\\mu|E)$ is stored as an energy-dependent list of", + "\\element{Legendre} expansions, the full covariance may be decomposed into energy-dependent", + "covariance matrices for each combination of $L_i$ and $L_j$. The \\element{listOfCovariances}", + "lists all of these covariances." + ], + "name": "listOfCovariances", + "occurrence": "1", + "required": false + } + }, + "description": "Stores the uncertainty for a scalar quantity or a functional data container.", + "name": "uncertainty", + "required": false, + "rootNode": false + }, + "listOfCovariances":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "covariance": { + "__class__": "nodes.ChildNode", + "description": "Covariance matrix (or link to a covariance matrix).", + "namespace": "containers", + "name": "covariance", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "Stores a list of covariance matrices (or a list of links to covariance matrices).", + "This option is generally used for higher-dimensional functions. For example,", + "if an angular distribution $P(\\mu|E)$ is stored as an energy-dependent list of", + "\\element{Legendre} expansions, the full covariance may be decomposed into energy-dependent", + "covariance matrices for each combination of $L_i$ and $L_j$. The \\element{listOfCovariances}", + "lists all of these covariances." + ], + "name": "listOfCovariances", + "required": false, + "rootNode": false + }, + "covariance":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label for this covariance (required if it resides in a \\elemlink{listOfCovariances}).", + "name": "label", + "required": false, + "type": "XMLName" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The URL or xpath-like string pointing to the referred-to element. Often points to a covariance inside the \\elemlink{covarianceSuite}.", + "name": "href", + "required": false, + "type": "bodyText" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "Stores a covariance matrix (or a link to a covariance matrix),", + "usually for a 1-dimensional function." + ], + "name": "covariance", + "required": false, + "rootNode": false + }, + + "standard":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": "Stores $\\sigma$ for the normal distribution.", + "namespace": "extra", + "name": "double", + "occurrence": "1", + "required": true + } + }, + "description": [ + "Used to store the standard deviation of a standard Gaussian uncertainty distribution. The mean value and unit are ", + "stored higher up in the hierarchy, for example in the parent \\element{double} node." + ], + "name": "standard", + "required": false, + "rootNode": false + }, + "logNormal":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": "Stores $\\sigma$ for the log-normal distribution.", + "namespace": "extra", + "name": "double", + "occurrence": "1", + "required": true + } + }, + "description": [ + "Used to store the standard deviation $\\sigma$ of a log-normal uncertainty distribution, $X = e^{\\mu + \\sigma Z}$. The mean value and unit are ", + "stored higher up in the hierarchy, for example in the parent \\element{double} or \\element{averageEnergy} node." + ], + "name": "logNormal", + "required": false, + "rootNode": false + }, + "confidenceIntervals":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "interval": { + "__class__": "nodes.ChildNode", + "description": "Stores one confidence interval.", + "namespace": "containers", + "name": "interval", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "Stores a list of intervals along with the confidence that the `true value' lies within each interval. The mean value and unit are ", + "stored higher up in the hierarchy, for example in the parent \\element{double} or \\element{averageEnergy} node." + ], + "name": "confidenceIntervals", + "required": false, + "rootNode": false + }, + "interval":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "confidence": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A value between 0 and 1, indicating how confident the evaluator is that the `true' value lies between mean - lower and mean + upper.", + "name": "confidence", + "required": true, + "type": "Float64" + }, + "lower": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Value to subtract from the mean to obtain the lower limit for this interval.", + "name": "lower", + "required": true, + "type": "Float64" + }, + "upper": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Value to add to the mean to obtain the upper limit for this interval.", + "name": "upper", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Stores a list of intervals along with the confidence that the `true value' lies within each interval.", + "name": "interval", + "required": false, + "rootNode": false + }, + "pdf":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "Probability distribution stored as an \\element{XYs1d}.", + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": "Probability distribution stored as a \\element{regions1d}.", + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": "Stores an explicit probability distribution for the parent quantity.", + "name": "pdf", + "required": false, + "rootNode": false + }, + + "axes":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A the URL, in xpath syntax, of another \\element{axes} element", + "name": "href", + "required": false, + "type": "UTF8Text" + } + }, + "bodyText": null, + "childNodes": { + "axis": { + "__class__": "nodes.ChildNode", + "description": "This node stores an \\element{index}, \\element{label} and \\element{unit} for an axis.", + "name": "axis", + "occurrence": "1+", + "required": false + }, + "grid": { + "__class__": "nodes.ChildNode", + "description": "Stores a list of boundaries or points along this axis, e.g. to define group boundaries for grouped data.", + "name": "grid", + "occurrence": "1+", + "required": false + } + }, + "description": [ + "Many of the data containers represent functions that have independent and dependent axes. ", + "The \\element{axes} node provides a way to assign a label and unit to each axis. ", + "If an \\element{axes} node is present, each independent and dependent axis must have an ", + "\\element{axis} or \\element{grid} node. ", + "The \\element{axis} or \\element{grid} nodes are indexed 0 to $n$ where $n$ is the number of independent axes. ", + "For the function $x_0(x_n, ..., x_1)$, index 0 is for dependent axis $x_0$, 1 is for ", + "independent axis $x_1$, ... and $n$ is for the independent axis $x_n$. ", + "Note: Two types of axes nodes are allowed: ", + "\\begin{itemize}", + "\\item One type gives an xlink to another axes node ", + "\\item The other lists the axes explicitly.", + "\\end{itemize}" + ], + "name": "axes", + "required": false, + "rootNode": false + }, + "axis":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "index": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "An integer that indicates which independent/dependent axis this \\element{axis} ", + "node belongs to as defined in Section~\\ref{format:gpdc:axes}." + ], + "name": "index", + "required": false, + "type": "Integer32" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique label", + "name": "label", + "required": true, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The unit for the axis.", + "name": "unit", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "This node stores an \\element{index}, \\element{label} and \\element{unit} for an axis.", + "name": "axis", + "required": false, + "rootNode": false + }, + "grid":{ + "__class__": "nodes.Node", + "abstractNode": "axis", + "attributes": { + "index": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "An integer that indicates which independent/dependent axis this \\element{grid} ", + "node belongs to." + ], + "name": "index", + "required": false, + "type": "Integer32" + }, + "interpolation": { + "__class__": "nodes.Attribute", + "default": "\\attr{lin-lin}", + "description": [ + "Defines the interpolation to be used between consecutive domain points along this axis. ", + "Note, this attribute is required when \\element{style} is \\attr{points} or \\attr{boundaries} and ", + "interpolation is other than \\attr{lin-lin}." + ], + "name": "interpolation", + "required": false, + "type": "interpolation" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "style": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "A string denoting the type of grid associated with this axis. Allowed values are `none', `points', ", + "`boundaries' and `parameters'." + ], + "name": "style", + "required": false, + "type": "UTF8Text" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The unit for the axis.", + "name": "unit", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique" : "yes", + "childNodes": { + "values": { + "__class__": "nodes.ChildNode", + "description": "List of values defining the grid.", + "name": "values", + "occurrence": "choice", + "required": false + }, + "link": { + "__class__": "nodes.ChildNode", + "description": "Link to a list of values defining the grid.", + "name": "link", + "occurrence": "choice", + "required": false + } + }, + "description": [ + "The \\element{grid} node is like the \\element{axis} but adds a list of values that the function is evaluated at for the ", + "independent axis defined by the \\element{grid}. The \\element{grid} has the same three attributes (\\element{index}, ", + "\\element{label}, and \\element{unit}) as the \\element{axis} node and adds the attributes \\element{style} ", + "and \\element{interpolation}. In addition, the \\element{grid} node has a \\element{values} child node ", + "that contains the list of values the function is evaluated at or parameters the function is specified at as ", + "indicated by the \\element{style} attribute. " + ], + "name": "grid", + "required": false, + "rootNode": false + }, + "values":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "valueType": { + "__class__": "nodes.Attribute", + "default": "Float64", + "description": [ + "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." + ], + "name": "valueType", + "required": false, + "type": "UTF8Text" + }, + "start": { + "__class__": "nodes.Attribute", + "default": "0", + "description": "For start=``N'', the first N values are zero and are not stored.", + "name": "start", + "required": false, + "type": "Integer32" + }, + "length": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "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 \\attr{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. " + ], + "name": "length", + "required": false, + "type": "Integer32" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "Link to another \\element{values} node or to a dataset in an external file such as HDF5.", + "If the href points to an external file, the link should be of the form `href=``FileID\\#/path/in/external/file''', ", + "where `FileID' is the label of one of the external files listed in the \\element{externalFiles} section." + ], + "name": "href", + "required": false, + "type": "UTF8Text" + }, + "startIndex": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "Optionally used along with an \\attr{href} to indicate that a subset ", + "of the externally-defined dataset should be used. ", + "This option must only be used if an \\attr{href} and \\attr{count} are also defined. ", + "Data from the external dataset between startIndex (inclusive) and startIndex + count (exclusive) are selected." + ], + "name": "startIndex", + "required": false, + "type": "Integer32" + }, + "count": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "Optionally used along with an \\attr{href} to indicate that a subset ", + "of the externally-defined dataset should be used. ", + "This option must only be used if an \\attr{href} and \\attr{startIndex} are also defined. ", + "Data from the external dataset between startIndex (inclusive) and startIndex + count (exclusive) are selected." + ], + "name": "count", + "required": false, + "type": "Integer32" + } + }, + "bodyText": "Contains a space-delimited ordered list of data for the parent node, or an href pointing to the data.", + "childNodes": {}, + "description": [ + "Data containers have meta-data and data. In most cases the data have one common piece of meta-data, ", + "which is the \\element{type} of data. For, this reason, many of the containers ", + "store their data in a \\element{values} node where, if needed, \\element{type} is stored. ", + "This node also allows for compressing leading and trailing zero data. If the \\element{start} attribute ", + "is defined, it specifies the first non-zero data value. If the sum of the \\element{start} ", + "and the number of data values is less than the value of the \\element{length} attribute, then the ", + "the \\element{length} value represents the total number of data values including the ", + "non-specified leading and trailing zeros. ", + "All data in this node must be of the same type and separated by one or more white spaces." + ], + "name": "values", + "required": false, + "rootNode": false + }, + "array":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "shape": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "a comma-separated list of integers representing the length of ", + "the array along each dimension. The integer type is Integer32." + ], + "name": "shape", + "required": true, + "type": "IntegerTuple" + }, + "compression": { + "__class__": "nodes.Attribute", + "default": "`none'", + "description": [ + "A flag indicating whether a sparse storage scheme is being used, ", + "and if so which scheme is used. Allowed value is either ", + "`none', `diagonal', `flattened' or `embedded'. Projects can also define their own", + "compression schemes." + ], + "name": "compression", + "required": false, + "type": "UTF8Text" + }, + "symmetry": { + "__class__": "nodes.Attribute", + "default": "`none'", + "description": [ + "Allows for storing values in only ", + "the upper- or lower-diagonal hyper-triangle. Allowed values are `none', `lower' and `upper'.", + "If \\attrval{permutation} is `none', non-stored values are zero.", + "Otherwise, they are determine by the \\attrval{permutation} attribute." + ], + "name": "symmetry", + "required": false, + "type": "UTF8Text" + }, + "permutation": { + "__class__": "nodes.Attribute", + "default": "`none'", + "description": [ + "If \\attrval{symmetry} is other then `none', ", + "this attribute specifies whether the permutation of two indices is +1 or -1. Allowed ", + "values are `none', `+1' and `-1'." + ], + "name": "permutation", + "required": false, + "type": "UTF8Text" + }, + "storageOrder": { + "__class__": "nodes.Attribute", + "default": "row-major", + "description": [ + "Indicates whether the data are stored in row-major ", + "or column-major order (i.e. whether the last or first index is varying the fastest). ", + "Allowed values are `row-major' or `column-major'." + ], + "name": "storageOrder", + "required": false, + "type": "UTF8Text" + }, + "offset": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "Required if this array is nested inside an \\attrval{embedded} array; not allowed otherwise; ", + "Gives the starting indices for a sub-array nested inside an array that uses \\attrval{embedded} compression. ", + "A comma-separated list of integers equal in dimension to the parent array. The integer type is Integer32." + ], + "name": "offset", + "required": false, + "type": "IntegerTuple" + } + }, + "bodyText": null, + "childNodes": { + "values": { + "__class__": "nodes.ChildNode", + "description": [ + "Containers holding the array values. The number of \\element{values} nodes depends on the \\attr{compression}", + "attribute. For compression of `embedded', `none', or `flattened' the number of \\element{values}", + "nodes are 0, 1, or 3 respectively. For `diagonal' compression, either 1 or 2 \\element{values} nodes may be present." + ], + "name": "values", + "occurrence": "0+", + "required": false + }, + "array": { + "__class__": "nodes.ChildNode", + "description": [ + "Containers holding sub-arrays embedded in a larger array. The number of \\element{array} nodes depends on the", + "\\attr{compression} attribute. For compression of `embedded', 0 or more are allowed. For compression of `none',", + "`diagonal' or `flattened' no \\element{array} nodes are allowed." + ], + "name": "array", + "occurrence": "0+", + "required": false + } + }, + "description": [ + "An array consists of attributes indicating the dimension, compression strategy, etc. and ", + "a list of one or more \\element{values} nodes that depend on the value of the \\attr{compression} attribute. ", + "The \\attr{label} attribute of each \\element{values} node designates the type of data stored in ", + "that node. For the \\element{values} node containing the data of the array, no label shall ", + "be specified. The allowed \\textbf{values} nodes for different compressions are: ", + "", + "\\begin{description}", + "\\item[compression=`none':] in this case the array only contains a single \\element{values} node that", + " contains the array data. The \\attr{label} attribute of the \\element{values} node shall", + " not be used. The number of data in the \\element{values} node", + " depends on the array shape and the values of the \\attr{symmetry} and \\attr{storageOrder} attributes.", + "", + "\\item[compression=`diagonal':] if all off-diagonal nodes are zero, then the", + "diagonal array only needs to contain a \\element{values} node, ", + "with size = N (the smallest array dimension). ", + "If some off-diagonal nodes are included, then the array contains two \\element{values} ", + "nodes. One node has label=``startingIndices'' and contains the starting indices. The ", + "other node contains the array data and its \\attr{label} attribute must ", + "not be used. ", + "", + "\\item[compression=`flattened':] in this case the array contains three \\element{values} nodes.", + " One node contains a list of starting indices in the flattened array and has \\attr{label}=``starts''. Another node", + " contains the number of values given after each `start' and has \\attr{label}=``lengths''.", + " The third node contains the array data and its \\attr{label} attribute shall", + " not be used. The \\attr{starts} and \\attr{lengths} both shall have data", + " type Integer32, and must have the same number of values.", + "", + "\\item[compression=`embedded':] contains 0 or more child \\element{array} nodes.", + " Each child array shall have the same data type as the parent array,", + " must have an \\attr{offset} attribute, and must obey size restrictions as described in", + " Section~\\ref{embeddeddef}.", + "\\end{description}" + ], + "name": "array", + "required": false, + "rootNode": false + }, + "table":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "columns": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The number of columns of the table.", + "name": "columns", + "required": true, + "type": "Integer32" + }, + "rows": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The number of rows of the table.", + "name": "rows", + "required": true, + "type": "Integer32" + }, + "storageOrder": { + "__class__": "nodes.Attribute", + "default": "row-major", + "description": "Allowed value is one of `row-major' and `column-major'", + "name": "storageOrder", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "columnHeaders": { + "__class__": "nodes.ChildNode", + "description": "Contains a list of N `header' nodes where N is the number of columns.", + "name": "columnHeaders", + "occurrence": "1", + "required": true + }, + "data": { + "__class__": "nodes.ChildNode", + "description": "The data for the table, consisting of M $\\times$ N cells.", + "name": "data", + "occurrence": "1", + "required": true + } + }, + "description": null, + "name": "table", + "required": false, + "rootNode": false + }, + "columnHeaders":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "column": { + "__class__": "nodes.ChildNode", + "description": "Container which holds the name, units, etc. describing a column of data.", + "name": "column", + "occurrence": "1+", + "required": true + } + }, + "description": "Contains a list of N `header' nodes where N is the number of columns.", + "name": "columnHeaders", + "required": true, + "rootNode": false + }, + "column":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "index": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An integer value in the range 0 to (N-1) that represents the order of the column.", + "name": "index", + "required": true, + "type": "Integer32" + }, + "name": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string representing the name of the column.", + "name": "name", + "required": true, + "type": "XMLName" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": "", + "description": "The unit of the data in the column.", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "types": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Comma separated list of valid GNDS types denoting what types of elements are allowed in each cell in the column.", + "name": "types", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "Container which holds the attributes that describe a column of data including the name, units, etc." + ], + "name": "column", + "required": true, + "rootNode": false + }, + "data":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "sep": { + "__class__": "nodes.Attribute", + "default": "whiteSpace", + "description": [ + "Valid options are ``whiteSpace'', ``,'', ", + "``td'', ``tr'' or ``tc''. The standard rules for ``whiteSpace'' and ``comma'' separators ", + "apply. The other separator options are described below." + ], + "name": "sep", + "required": false, + "type": "UTF8Text" + } + }, + "bodyText": [ + "The layout of the table data depends on the values of the \\attr{storageOrder} and \\attr{sep} attributes. ", + "\\begin{description}", + "\\item[sep=`whiteSpace' or `,']", + " In this case the table has no child node, and the body of the table consists of a", + " \\textbf{sep}-separated list containing M $\\times$ N values. The order of data depends on the \\attr{storageOrder}.", + " This option can only be used if all data in the table are numeric types.", + "\\item[sep=`td']", + " In this case every cell in the table is explicitly contained inside `' and `' (or `', ", + " to indicate an empty cell). The order of data depends on the \\attr{storageOrder}. This option can handle", + " multiple data types, but if only a few cells contain non-numeric data the following two options may", + " be more concise.", + "\\item[storageOrder=`row-major', sep=`tr']", + " In this case each row of the table is stored inside `' and `'. Each row can define", + " its own separator, which may be `whiteSpace' (the default), `td' or `,'. Any row containing non-numeric", + " data must have `sep=``td'''.", + "\\item[storageOrder=`column-major', sep=`tc']", + " In this case each column of the table is stored inside `' and `'.", + " Each column can define its own separator, which may be `whiteSpace' (the default),", + " `td' or `,'. Any column containing non-numeric data must have `sep=``td'''. This storage", + " is recommended whenever some columns contain only numeric data while", + " others contain mixed data types, since it helps reduce the size of the numeric columns.", + "\\end{description}" + ], + "childNodes": {}, + "description": "The data for the table, consisting of M $\\times$ N cells.", + "name": "data", + "required": true, + "rootNode": false + }, + + "XYs1d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "index": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Integer index, used when the \\element{XYs1d} appears inside a \\element{regions1d}.", + "name": "index", + "required": false, + "type": "Integer32" + }, + "interpolation": { + "__class__": "nodes.Attribute", + "default": "lin-lin", + "description": "The rule for interpolating $y$ along the $x$ axis.", + "name": "interpolation", + "required": false, + "type": "interpolation" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label. When the \\element{XYs1d} appears as a form, the label indicates the associated style.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "When an XYs1d appears inside a higher-dimensional container, the outerDomainValue corresponds to the next higher dimension.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": "The \\element{axes} element describing the $x$ and $y$ directions.", + "name": "axes", + "occurrence": "1", + "required": false + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty and/or covariance for this one-dimensional function.", + "namespace": "extra", + "name": "uncertainty", + "occurrence": "1", + "required": false + }, + "values": { + "__class__": "nodes.ChildNode", + "description": "Contains the list of the $n$ pairs of $x_i, y_i$ as the list $x_0\\ y_0\\ x_1\\ y_1\\ ...\\ x_{n-1}\\ y_{n-1}$.", + "name": "values", + "occurrence": "1", + "required": true + } + }, + "description": [ + "This node stores a single-valued function $x_0(x_1)$ (i.e. $y(x)$) as a tabulated list of $(x_i,y_i)$ pairs with $x_i < x_{i+1}$. ", + "It may appear on its own (i.e. when storing an energy-dependent cross section or multiplicity), or it may appear inside ", + "of another functional data container such as \\element{regions1d} or \\element{XYs2d}." + ], + "name": "XYs1d", + "required": false, + "rootNode": false + }, + "Ys1d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "interpolation": { + "__class__": "nodes.Attribute", + "default": "lin-lin", + "description": "The rule for interpolating $y$ rule along the $x$ axis.", + "name": "interpolation", + "required": false, + "type": "interpolation" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label. When the \\element{Ys1d} appears as a form, the label indicates the associated style.", + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": "The \\element{axes} element describing the $x$ and $y$ directions.", + "name": "axes", + "occurrence": "1", + "required": true + }, + "values": { + "__class__": "nodes.ChildNode", + "description": "Contains the list of $y_i$ values.", + "name": "values", + "occurrence": "1", + "required": true + } + }, + "description": [ + "This node stores a tabulated representation of the single-valued function $x_0(x_1)$. This is like the ", + "\\element{XYs1d} node (see Section~\\ref{format:gpdc:XYs1d}) except that the independent axis must be a ", + "\\element{grid} node (see Section~\\ref{format:gpdc:grid}) that either stores a list of $x_i$ values or links to another grid that stores the list. ", + "This node is useful when many tabulated $x_0(x_1)$'s contain the same $x_i$ points. Only one of the \\element{Ys1d} node ", + "needs to store the $x_i$ values and the others can link to it, allowing for reduced redundancy and storage. ", + "The $x_i$ values must statisfy $x_i < x_{i+1}$. The $y_i$ are stored in the \\element{values} child node. " + ], + "name": "Ys1d", + "required": false, + "rootNode": false + }, + "Legendre":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "When a Legendre series appears inside a higher-dimensional container, the outerDomainValue corresponds to the next higher dimension.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + }, + "lowerIndex": { + "__class__": "nodes.Attribute", + "default": "0", + "description": [ + "Used if the first \\attr{lowerIndex} coefficients are all zero. The upperIndex is equal to lowerIndex plus the number of coefficients ", + "in the \\element{values} node, so it is not stored." + ], + "name": "lowerIndex", + "required": false, + "type": "Integer32" + }, + "domainMin": { + "__class__": "nodes.Attribute", + "default": "-1.0", + "description": "$y(x_1)$ is only valid (i.e. defined) over the domain \\attr{domainMin} $\\le x_1 \\le$ \\attr{domainMax}. \\attr{domainMin} must be less than or equal to \\attr{domainMax}.", + "name": "domainMin", + "required": false, + "type": "Float64" + }, + "domainMax": { + "__class__": "nodes.Attribute", + "default": "1.0", + "description": "See \\attr{domainMin}.", + "name": "domainMax", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "values": { + "__class__": "nodes.ChildNode", + "description": [ + "The specifications of the \\element{values} node are given in Section~\\ref{format:gpdc:values}. ", + "The numeric values are the coefficients $C_i$ listed by consecutive order $i$ starting with \\attr{lowerIndex}." + ], + "name": "values", + "occurrence": "1", + "required": true + } + }, + "description": null, + "name": "Legendre", + "required": false, + "rootNode": false + }, + "polynomial1d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "When a polynomial1d appears inside a higher-dimensional container, the outerDomainValue corresponds to the next higher dimension.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + }, + "lowerIndex": { + "__class__": "nodes.Attribute", + "default": "0", + "description": [ + "Used if the first \\attr{lowerIndex} coefficients are all zero. The upperIndex is equal to lowerIndex plus the number of coefficients ", + "in the \\element{values} node, so it is not stored." + ], + "name": "lowerIndex", + "required": false, + "type": "Integer32" + }, + "domainMin": { + "__class__": "nodes.Attribute", + "default": null, + "description": "$y(x_1)$ is only valid (i.e. defined) over the domain \\attr{domainMin} $\\le x_1 \\le$ \\attr{domainMax}. \\attr{domainMin} must be less than or equal to \\attr{domainMax}.", + "name": "domainMin", + "required": true, + "type": "Float64" + }, + "domainMax": { + "__class__": "nodes.Attribute", + "default": null, + "description": "See \\attr{domainMin}.", + "name": "domainMax", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": "The \\element{axes} element describing the $x$ and $y$ directions.", + "name": "axes", + "occurrence": "1", + "required": true + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty and/or covariance for this one-dimensional function.", + "namespace": "containers", + "namespace": "extra", + "name": "uncertainty", + "occurrence": "1", + "required": false + }, + "values": { + "__class__": "nodes.ChildNode", + "description": [ + "The specifications of the \\element{values} node are given in Section~\\ref{format:gpdc:values}. ", + "The numeric values are the coefficients $C_i$ listed by consecutive order $i$ starting with lowerIndex." + ], + "name": "values", + "occurrence": "1", + "required": true + } + }, + "description": null, + "name": "polynomial1d", + "required": false, + "rootNode": false + }, + "constant1d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The value of the data.", + "name": "value", + "required": false, + "type": "Float64" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "When a constant1d appears inside a higher-dimensional container, the outerDomainValue corresponds to the next higher dimension.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + }, + "domainMin": { + "__class__": "nodes.Attribute", + "default": null, + "description": "$y(x_1)$ is only valid (i.e. defined) over the domain \\attr{domainMin} $\\le x_1 \\le$ \\attr{domainMax}. \\attr{domainMin} must be less than or equal to \\attr{domainMax}.", + "name": "domainMin", + "required": true, + "type": "Float64" + }, + "domainMax": { + "__class__": "nodes.Attribute", + "default": null, + "description": "See \\attr{domainMin}.", + "name": "domainMax", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": "The \\element{axes} element describing the $x$ and $y$ directions.", + "name": "axes", + "occurrence": "1", + "required": true + } + }, + "description": "Describes a constant one-dimensional function, $f(x) = C$.", + "name": "constant1d", + "required": false, + "rootNode": false + }, + + "xs_pdf_cdf1d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "When the xs\\_pdf\\_cdf1d container appears inside a higher-dimensional container, the outerDomainValue corresponds to the next higher dimension.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "xs_in_xs_pdf_cdf1d": { + "__class__": "nodes.ChildNode", + "description": "Defines the common list of $x$ values for the pdf and cdf.", + "name": "xs", + "occurrence": "1", + "required": true + }, + "pdf": { + "__class__": "nodes.ChildNode", + "description": "Stores the pdf evaluated at each corresponding $x$ value.", + "namespace": "containers", + "name": "pdf", + "occurrence": "1", + "required": true + }, + "cdf_in_xs_pdf_cdf1d": { + "__class__": "nodes.ChildNode", + "description": "Stores the cdf evaluated at each corresponding $x$ value.", + "name": "cdf", + "occurrence": "1", + "required": true + } + }, + "description": [ + "For Monte-Carlo sampling it is often useful to store both the probability density (pdf) and cumulative probability density (cdf)", + "on the same grid. The sampling routine can then draw a random number in the range [0,1), do a bisection search through the cdf", + "to determine which interval the random number lies in, and then use the pdf to sample within that interval. The \\element{xs\\_pdf\\_cdf1d}", + "container provides a way to store these three related quantities together. The number of values in the \\element{xs}, \\element{pdf}", + "and \\element{cdf} must be the same." + ], + "name": "xs_pdf_cdf1d", + "required": false, + "rootNode": false + }, + "xs_in_xs_pdf_cdf1d":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "values": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "values", + "occurrence": "1", + "required": true + } + }, + "description": "Stores the common list of $x$ values for use in an \\element{xs\\_pdf\\_cdf1d}.", + "name": "xs", + "required": false, + "rootNode": false + }, + "pdf_in_xs_pdf_cdf1d":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "values": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "values", + "occurrence": "1", + "required": true + } + }, + "description": "Stores the value of the pdf at each $x$ in an \\element{xs\\_pdf\\_cdf1d}.", + "name": "pdf", + "required": false, + "rootNode": false + }, + "cdf_in_xs_pdf_cdf1d":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "values": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "values", + "occurrence": "1", + "required": true + } + }, + "description": "Stores the value of the cdf at each $x$ in an \\element{xs\\_pdf\\_cdf1d}.", + "name": "cdf", + "required": false, + "rootNode": false + }, + + "XYs2d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "index": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Integer index, required when the \\element{XYs2d} appears inside a \\element{regions2d}.", + "name": "index", + "required": false, + "type": "Integer32" + }, + "interpolation": { + "__class__": "nodes.Attribute", + "default": "lin-lin", + "description": "The rule for interpolating $x_0$ along the $x_2$ axis.", + "name": "interpolation", + "required": false, + "type": "interpolation" + }, + "interpolationQualifier": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The interpolation qualifier.", + "name": "interpolationQualifier", + "required": false, + "type": "XMLName" + }, + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "When an XYs2d appears inside a higher-dimensional container, the outerDomainValue corresponds to the next higher dimension.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "axes", + "occurrence": "1", + "required": false + }, + "function1ds": { + "__class__": "nodes.ChildNode", + "description": "Contains the list of 1-dimensional functions $x_0(x_1)$ that represent $x_0(x_2, x_1)$ at various points along $x_2$.", + "name": "function1ds", + "occurrence": "1", + "required": true + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty and/or covariance for this two-dimensional function.", + "namespace": "containers", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": [ "This node stores a 2-dimensional function $x_0(x_2, x_1)$ as a list of 1-dimensional functions at various $x_2$ values. Each 1-dimensional ", + "function stores its $x_2$ point in its \\attr{value} attribute. The attributes \\attr{interpolation} and \\attr{interpolationQualifier}", + " instruct how to interpolate $x_2$ and $x_1$ between two adjacent 1-dimensional functions." ], + "name": "XYs2d", + "required": false, + "rootNode": false + }, + + "function1ds" : { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "XYs1d", + "occurrence": "choice+", + "required": false + }, + "constant1d": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "constant1d", + "occurrence": "choice+", + "required": false + }, + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "polynomial1d", + "occurrence": "choice+", + "required": false + }, + "Legendre": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "Legendre", + "occurrence": "choice+", + "required": false + }, + "gridded1d": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "gridded1d", + "occurrence": "choice+", + "required": false + } + }, + "description": "This node stores a list of 1-dimensional functions.", + "name": "function1ds", + "required": 1, + "rootNode": false + }, + + "XYs3d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "interpolation": { + "__class__": "nodes.Attribute", + "default": "lin-lin", + "description": "The rule for interpolating $x_0$ along the $x_3$ axis.", + "name": "interpolation", + "required": false, + "type": "interpolation" + }, + "interpolationQualifier": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The interpolation qualifier.", + "name": "interpolationQualifier", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "axes", + "occurrence": "1", + "required": false + }, + "function2ds": { + "__class__": "nodes.ChildNode", + "description": "Contains the list of 2-dimensional functions that represent $x_0(x_3, x_2, x_1)$ at various points along $x_3$ as a $x_0(x_2, x_1)$ functions.", + "name": "function2ds", + "occurrence": "1", + "required": true + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty and/or covariance for this three-dimensional function.", + "namespace": "containers", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": [ "This node stores a 3-dimensional function $x_0(x_3, x_2, x_1)$ as a list of 2-dimensional functions at various $x_3$ values. Each 2-dimensional ", + "function stores its $x_3$ point in its \\attr{value} attribute. The attributes \\attr{interpolation} and \\attr{interpolationQualifier}", + " instruct how to interpolate $x_3$ and $x_0$ between two adjacent 2-dimensional functions." ], + "name": "XYs3d", + "required": false, + "rootNode": false + }, + + "function2ds" : { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "XYs2d", + "occurrence": "choice+", + "required": false + }, + "gridded2d": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "gridded2d", + "occurrence": "choice+", + "required": false + } + }, + "description": "This node stores a list of 2-dimensional functions.", + "name": "function2ds", + "required": 1, + "rootNode": false + }, + + "regions1d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "When an \\element{regions1d} appears inside a higher-dimensional container, the \\attr{outerDomainValue} corresponds to the next higher dimension.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "axes", + "occurrence": "1", + "required": false + }, + "function1ds": { + "__class__": "nodes.ChildNode", + "description": [ "Contains the list of 1-dimensional functions that represent $x_0(x_1)$. The upper $x_1$ value for a function ", + "in the list must be equal to the lower $x_1$ value for the next function in the list." ], + "name": "function1ds", + "occurrence": "1", + "required": true + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty and/or covariance for this one-dimensional function.", + "namespace": "extra", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "regions1d", + "required": false, + "rootNode": false + }, + + "regions2d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "When a regions2d appears inside a higher-dimensional container, the outerDomainValue corresponds to the next higher dimension.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "axes", + "occurrence": "1", + "required": false + }, + "function2ds": { + "__class__": "nodes.ChildNode", + "description": [ "Contains the list of 2-dimensional functions that represent $x_0(x_2, x_1)$. The upper $x_2$ value for a function ", + "in the list must be equal to the lower $x_2$ value for the next function in the list." ], + "name": "function2ds", + "occurrence": "1", + "required": true + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty and/or covariance for this two-dimensional function.", + "namespace": "containers", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "regions2d", + "required": false, + "rootNode": false + }, + + "regions3d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique label", + "name": "label", + "required": false, + "type": "XMLName" + }, + "outerDomainValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": "When a regions3d appears inside a higher-dimensional container, the outerDomainValue corresponds to the next higher dimension.", + "name": "outerDomainValue", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "axes", + "occurrence": "1", + "required": false + }, + "function3ds": { + "__class__": "nodes.ChildNode", + "description": [ "Contains the list of 3-dimensional functions that represent $x_0(x_3, x_2, x_1)$. The upper $x_3$ value for a function ", + "in the list must be equal to the lower $x_3$ value for the next function in the list." ], + "name": "function3ds", + "occurrence": "1", + "required": true + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty and/or covariance for this three-dimensional function.", + "namespace": "containers", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "regions3d", + "required": false, + "rootNode": false + }, + + "function3ds" : { + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs3d": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "XYs3d", + "occurrence": "choice+", + "required": false + }, + "gridded3d": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "gridded3d", + "occurrence": "choice+", + "required": false + } + }, + "description": "This node stores a list of 3-dimensional functions.", + "name": "function3ds", + "required": 1, + "rootNode": false + }, + + "gridded1d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique identifier.", + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "array": { + "__class__": "nodes.ChildNode", + "description": "An \\element{array} node representing the $x_0$ values.", + "name": "array", + "occurrence": "1", + "required": true + }, + "axes": { + "__class__": "nodes.ChildNode", + "description": "An \\element{axes} element containing the \\element{grid} elements.", + "name": "axes", + "occurrence": "1", + "required": true + } + }, + "description": "A one-dimensional function defined on a grid or set of groups.", + "name": "gridded1d", + "required": false, + "rootNode": false + }, + "gridded2d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An unique identifier.", + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "array": { + "__class__": "nodes.ChildNode", + "description": "An \\element{array} node representing the $x_0$ values.", + "name": "array", + "occurrence": "1", + "required": true + }, + "axes": { + "__class__": "nodes.ChildNode", + "description": "An \\element{axes} element containing the \\element{grid} elements for the independent axes and an axis node for the dependent axis.", + "name": "axes", + "occurrence": "1", + "required": true + } + }, + "description": "A two-dimensional function defined on a grid or set of groups.", + "name": "gridded2d", + "required": false, + "rootNode": false + }, + "gridded3d":{ + "__class__": "nodes.Node", + "abstractNode": "functional", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An unique identifier.", + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "array": { + "__class__": "nodes.ChildNode", + "description": "An \\element{array} node representing the $x_0$ values.", + "name": "array", + "occurrence": "1", + "required": true + }, + "axes": { + "__class__": "nodes.ChildNode", + "description": "An \\element{axes} element containing the \\element{grid} elements.", + "name": "axes", + "occurrence": "1", + "required": true + } + }, + "description": "A three-dimensional function defined on a grid or set of groups.", + "name": "gridded3d", + "required": false, + "rootNode": false + } + +} diff --git a/standards/gnds-2.0/summary_mapfile.json b/standards/gnds-2.0/summary_mapfile.json new file mode 100644 index 000000000..55454675e --- /dev/null +++ b/standards/gnds-2.0/summary_mapfile.json @@ -0,0 +1,258 @@ +{ + "__namespace__":"map", + "map":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "library": { + "__class__": "nodes.Attribute", + "default": null, + "description": "String identifier for the library defined in this map file, e.g. 'ENDF/B-VIII.0'.", + "name": "library", + "required": true, + "type": "XMLName" + }, + "format": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Map file format version id.", + "name": "format", + "required": true, + "type": "XMLName" + }, + "checksum": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Checksum for the map file, computed by string-concatenating all checksums inside", + "the file (in the order they appear) and computing the checksum of the resulting string."], + "name": "checksum", + "required": true, + "type": "checksum" + }, + "algorithm": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Algorithm used to compute the checksum.", + "name": "algorithm", + "required": true, + "type": "algorithm" + } + }, + "bodyText": null, + "childNodes": { + "import": { + "__class__": "nodes.ChildNode", + "description": "Imports another map file using a path (relative or absolute).", + "name": "import", + "occurrence": "0+", + "required": false + }, + "protare": { + "__class__": "nodes.ChildNode", + "description": "Adds one evaluation to the map file, using relative or absolute path.", + "name": "protare", + "occurrence": "0+", + "required": false + }, + "TNSL": { + "__class__": "nodes.ChildNode", + "description": "Adds a thermal neutron scattering law evaluation to the map file, using relative or absolute paths.", + "name": "TNSL", + "occurrence": "0+", + "required": false + } + }, + "description": "A map file organises multiple files into a library. Individual files are called `protares': PROjectile + TARget + Evaluation.", + "name": "map", + "required": false, + "rootNode": true + }, + "import":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "path": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Path to another map file imported by this file.", + "name": "path", + "required": true, + "type": "XMLName" + }, + "checksum": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Checksum of the imported map file, identical to the \\attr{checksum} attribute in the top node of that file.", + "name": "checksum", + "required": true, + "type": "checksum" + }, + "algorithm": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Algorithm used to compute the checksum. Defaults to the \\attr{algorithm} of the parent \\element{map} file.", + "name": "algorithm", + "required": false, + "type": "algorithm" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Imports contents of another map file into this map file. Care must be taken to avoid circular imports.", + "name": "import", + "required": false, + "rootNode": false + }, + "protare":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "projectile": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Particle id of the projectile.", + "name": "projectile", + "required": true, + "type": "XMLName" + }, + "target": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Particle id of the target.", + "name": "target", + "required": true, + "type": "XMLName" + }, + "evaluation": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Evaluation label, usually equal to the library name e.g. `ENDF/B-8.0`.", + "name": "evaluation", + "required": true, + "type": "XMLName" + }, + "path": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Path (absolute or relative) to the reactionSuite associated with this protare.", + "name": "path", + "required": true, + "type": "XMLName" + }, + "interaction": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Type of interaction. Options are: `nuclear', `atomic' and `TNSL'.", + "name": "interaction", + "required": true, + "type": "XMLName" + }, + "checksum": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Checksum for the protare file located at the given \\attr{path}.", + "name": "checksum", + "required": true, + "type": "checksum" + }, + "algorithm": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Algorithm used to compute the checksum. Defaults to the \\attr{algorithm} of the parent \\element{map} file.", + "name": "algorithm", + "required": false, + "type": "algorithm" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Adds a single reactionSuite (or `ProTarE') to the map file.", + "name": "protare", + "required": false, + "rootNode": false + }, + "TNSL":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "projectile": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Particle id of the projectile.", + "name": "projectile", + "required": true, + "type": "XMLName" + }, + "target": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Particle id of the target.", + "name": "target", + "required": true, + "type": "XMLName" + }, + "evaluation": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Evaluation label, usually equal to the library name e.g. `ENDF/B-8.0`.", + "name": "evaluation", + "required": true, + "type": "XMLName" + }, + "path": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Path (absolute or relative) to the reactionSuite associated with this protare.", + "name": "path", + "required": true, + "type": "XMLName" + }, + "interaction": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Type of interaction. Only option in this case is `TNSL'.", + "name": "interaction", + "required": false, + "type": "XMLName" + }, + "checksum": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Checksum for the TNSL file located at the given \\attr{path}.", + "name": "checksum", + "required": true, + "type": "checksum" + }, + "algorithm": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Algorithm used to compute the checksum. Defaults to the \\attr{algorithm} of the parent \\element{map} file.", + "name": "algorithm", + "required": false, + "type": "algorithm" + }, + "standardTarget": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Particle id of the protare to use for reactions / incident energies outside the range of this TNSL target.", + "name": "standardTarget", + "required": true, + "type": "XMLName" + }, + "standardEvaluation": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Evaluation label for the protare to use for reactions / incident energies outside the range of this TNSL target.", + "name": "standardEvaluation", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "A thermal neutron scattering law (TNSL) target to add to the map file. Requires also listing the `standard' protare to be used outside the limits of the TNSL data.", + "name": "TNSL", + "required": true, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_pops.json b/standards/gnds-2.0/summary_pops.json new file mode 100644 index 000000000..2280a393b --- /dev/null +++ b/standards/gnds-2.0/summary_pops.json @@ -0,0 +1,2234 @@ +{ + "__namespace__":"pops", +"PoPs_database":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "name": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the PoPs library, e.g. `ENDF-VIII'", + "name": "name", + "required": true, + "type": "XMLName" + }, + "version": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Library version / release number, e.g. `VIII.1' or `8.1\\_beta'"], + "name": "version", + "required": true, + "type": "XMLName" + }, + "format": { + "__class__": "nodes.Attribute", + "default": null, + "description": "PoPs format version, e.g. `1.0.1'", + "name": "format", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "styles": { + "__class__": "nodes.ChildNode", + "description": "Defines the styles of data appearing in the database. Only required in stand-alone databases.", + "name": "styles", + "occurrence": "1", + "required": false + }, + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Top-level documentation applying to the entire PoPs database.", + "name": "documentation", + "occurrence": "1", + "required": false + }, + "aliases": { + "__class__": "nodes.ChildNode", + "description": "Defines `alias particles' that point to other particles. Often used to identify metastable states, for example.", + "name": "aliases", + "occurrence": "1", + "required": false + }, + "gaugeBosons": { + "__class__": "nodes.ChildNode", + "description": "Contains definitions for gauge bosons, notably the photon.", + "name": "gaugeBosons", + "occurrence": "1", + "required": false + }, + "leptons": { + "__class__": "nodes.ChildNode", + "description": "Contains definitions for leptons, notably the electron and electron anti-neutrino", + "name": "leptons", + "occurrence": "1", + "required": false + }, + "baryons": { + "__class__": "nodes.ChildNode", + "description": "Contains definitions of baryons such as the neutron and proton.", + "name": "baryons", + "occurrence": "1", + "required": false + }, + "chemicalElements": { + "__class__": "nodes.ChildNode", + "description": "Contains definitions for chemical elements, which in turn contain a list of isomers, nuclides and nuclei", + "name": "chemicalElements", + "occurrence": "1", + "required": false + }, + "unorthodoxes": { + "__class__": "nodes.ChildNode", + "description": "Contains definitions for `unorthodox' particles, such as representative fission products.", + "name": "unorthodoxes", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This is the root node for a full particle database. Within the database, particles are organised into different families and/or groups. ", + "Each particle in the database must have a unique `id'. A PoPs database may be a stand-alone file, or it may appear ", + "inside a reactionSuite." + ], + "name": "PoPs", + "required": false, + "rootNode": true +}, + +"aliases":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "alias": { + "__class__": "nodes.ChildNode", + "description": "Defines an alias pointing to another particle in the database.", + "name": "alias", + "occurrence": "0+", + "required": false + }, + "metaStable": { + "__class__": "nodes.ChildNode", + "description": ["Defines a metastable particle, with a particle id like `Al26\\_m1'."], + "name": "metaStable", + "occurrence": "0+", + "required": false + } + }, + "description": [ + "Particles may sometimes be known by more than one name. Examples include the $\\alpha$ particle, ", + "which is synonymous with the nucleus of a He4 atom, the photon which goes by several names including ", + "`gamma' and `x-ray', and isomeric nuclear states which can be referred to either by isomer index or by nuclear level index. ", + "The \\element{aliases} node contains a list of \\element{alias} and \\element{metastable} nodes ", + "that allow for alternate ids to be assigned to a particle." + ], + "name": "aliases", + "required": false, + "rootNode": false +}, +"alias":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "id": { + "__class__": "nodes.Attribute", + "default": null, + "description": "alias id. For example, alias `gamma' and/or `x-ray' may be used to refer to the photon.", + "name": "id", + "required": true, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Equal to the `id' of the nuclide this alias points to, for example `photon' for alias `gamma'.", + "name": "pid", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Alias particle. The alias `id' must not match the id of any other particle or alias in the database.", + "name": "alias", + "required": false, + "rootNode": false +}, +"metaStable":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "id": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Metastable id, e.g. `Am242\\_m1'."], + "name": "id", + "required": true, + "type": "XMLName" + }, + "metaStableIndex": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Index for metastable states, equal to `1' for lowest-energy metastable, `2' for second metastable, etc.", + "name": "metaStableIndex", + "required": true, + "type": "Integer32" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Equal to the `id' of the nuclide this metastable points to, for example `Am242\\_e2' for metastable `Am242\\_m1'."], + "name": "pid", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "A \\element{metaStable} node is a special type of alias pointing to a relatively long-lived excited nuclear level. ", + "In addition to the \\textbf{id} and \\textbf{pid}, it also defines a meta-stable index that shall be `1' ", + "for the lowest-energy metastable state, `2' for the second-lowest, etc.\n", + "Metastables are a useful way to identify nuclear levels that live long enough to accumulate and potentially ", + "change reaction rates during a radiation transport calculation. The definition of metastable states is often ", + "problem-specific. For some applications such as inertial confinement fusion, a micro-second half-life can be ", + "long enough to qualify a state as meta-stable, while for other applications much longer half-lives are required. ", + "A particle database allows users to define their own \\element{metaStable} nodes for more flexible control over ", + "what nuclear states to consider as meta-stable." + ], + "name": "metaStable", + "required": false, + "rootNode": false +}, + +"gaugeBosons":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "gaugeBoson": { + "__class__": "nodes.ChildNode", + "description": "Defines one gauge boson particle.", + "name": "gaugeBoson", + "occurrence": "1+", + "required": false + } + }, + "description": "Collection of gauge bosons.", + "name": "gaugeBosons", + "required": false, + "rootNode": false +}, +"gaugeBoson":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "id": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Particle id, e.g. `photon' or `gluon'.", + "name": "id", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "charge": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "charge", + "occurrence": "1", + "required": false + }, + "halflife": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "halflife", + "occurrence": "1", + "required": false + }, + "mass": { + "__class__": "nodes.ChildNode", + "description": "", + "namespace": "pops", + "name": "mass", + "occurrence": "1", + "required": false + }, + "spin": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "spin", + "occurrence": "1", + "required": false + }, + "parity": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "parity", + "occurrence": "1", + "required": false + }, + "decayData": { + "__class__": "nodes.ChildNode", + "description": "Description of nuclide decay.", + "name": "decayData", + "occurrence": "1", + "required": false + } + }, + "description": "Defines a gauge boson, notably including the photon.", + "name": "gaugeBoson", + "required": false, + "rootNode": false +}, + +"leptons":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "lepton": { + "__class__": "nodes.ChildNode", + "description": "Defines one lepton particle.", + "name": "lepton", + "occurrence": "1+", + "required": true + } + }, + "description": "Collection of leptons.", + "name": "leptons", + "required": false, + "rootNode": false +}, +"lepton":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "generation": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Lepton generation, i.e. `1' for the electron and `2' for muon.", + "name": "generation", + "required": false, + "type": "XMLName" + }, + "id": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Particle id, e.g. `e-' for the electron.", + "name": "id", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "charge": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "charge", + "occurrence": "1", + "required": false + }, + "halflife": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "halflife", + "occurrence": "1", + "required": false + }, + "mass": { + "__class__": "nodes.ChildNode", + "description": "", + "namespace": "pops", + "name": "mass", + "occurrence": "1", + "required": false + }, + "spin": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "spin", + "occurrence": "1", + "required": false + }, + "parity": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "parity", + "occurrence": "1", + "required": false + }, + "decayData": { + "__class__": "nodes.ChildNode", + "description": "Description of nuclide decay.", + "name": "decayData", + "occurrence": "1", + "required": false + } + }, + "description": "Defines a lepton, including the electron, muon, tau, neutrinos and their anti-particles.", + "name": "lepton", + "required": false, + "rootNode": false +}, + +"baryons":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "baryon": { + "__class__": "nodes.ChildNode", + "description": "Defines a baryon (a composite particle made up of three quarks)", + "name": "baryon", + "occurrence": "1+", + "required": false + } + }, + "description": "Contains definitions of baryons such as the neutron and proton.", + "name": "baryons", + "required": false, + "rootNode": false +}, +"baryon":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "id": { + "__class__": "nodes.Attribute", + "default": null, + "description": "", + "name": "id", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "charge": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "charge", + "occurrence": "1", + "required": false + }, + "halflife": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "halflife", + "occurrence": "1", + "required": false + }, + "mass": { + "__class__": "nodes.ChildNode", + "description": "", + "namespace": "pops", + "name": "mass", + "occurrence": "1", + "required": false + }, + "spin": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "spin", + "occurrence": "1", + "required": false + }, + "parity": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "parity", + "occurrence": "1", + "required": false + }, + "decayData": { + "__class__": "nodes.ChildNode", + "description": "Description of nuclide decay.", + "name": "decayData", + "occurrence": "1", + "required": false + } + }, + "description": "Defines a baryon (a composite particle made up of three quarks)", + "name": "baryon", + "required": false, + "rootNode": false +}, + +"chemicalElements":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "chemicalElement": { + "__class__": "nodes.ChildNode", + "description": "Defines a chemical element (i.e. a group of particles with the same proton number Z).", + "name": "chemicalElement", + "occurrence": "1+", + "required": false + } + }, + "description": "Contains definitions for chemical elements, which in turn contain a list of isomers, nuclides and nuclei", + "name": "chemicalElements", + "required": false, + "rootNode": false +}, +"chemicalElement":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "symbol": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Standard chemical symbol, e.g. `Au' or `C'", + "name": "symbol", + "required": true, + "type": "XMLName" + }, + "Z": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Proton number `Z'", + "name": "Z", + "required": true, + "type": "Integer32" + }, + "name": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Full name, e.g. `Gold' or `Carbon'", + "name": "name", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "atomic": { + "__class__": "nodes.ChildNode", + "description": "Atomic properties of a chemical element (assumed to be independent of neutron number N).", + "name": "atomic", + "occurrence": "1", + "required": false + }, + "isotopes": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "isotopes", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Defines a chemical element (i.e. a group of particles with the same proton number Z). ", + "A chemicalElement is not a particle and does not define a mass or decay properties. ", + "If a `natural abundance' particle is required, it shall be entered in the database as a \\element{nuclide} ", + "node with A = 0, as in `Fe0'." + ], + "name": "chemicalElement", + "required": false, + "rootNode": false +}, + +"atomic":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "configurations": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "configurations", + "occurrence": "1", + "required": false + } + }, + "description": "Stores atomic properties of a chemicalElement, including electron subshells and decay properties.", + "name": "atomic", + "required": false, + "rootNode": false +}, +"configurations":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "configuration": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "configuration", + "occurrence": "1+", + "required": true + } + }, + "description": "List of atomic electron configurations.", + "name": "configurations", + "required": false, + "rootNode": false +}, +"configuration":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "subshell": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Electron subshell indicator, e.g. `1s1/2'.", + "name": "subshell", + "required": true, + "type": "attributeValue" + }, + "electronNumber": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Effective number of electrons in the given subshell.", + "name": "electronNumber", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "bindingEnergy": { + "__class__": "nodes.ChildNode", + "description": "Electron binding energy.", + "name": "bindingEnergy", + "occurrence": "1", + "required": true + }, + "decayData": { + "__class__": "nodes.ChildNode", + "description": "Decay properties for electron vacancies in this subshell (i.e. atomic relaxation).", + "name": "decayData", + "occurrence": "1", + "required": false + } + }, + "description": "", + "name": "configuration", + "required": false, + "rootNode": false +}, +"bindingEnergy":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "pops", + "occurrence": "1", + "required": false + }, + "double": { + "__class__": "nodes.ChildNode", + "description": "Binding energy. Recommended unit: `eV', or `keV'", + "namespace": "containers", + "name": "double", + "occurrence": "1+", + "required": false + } + }, + "description": "Binding energy for an atomic or nuclear sub-shell.", + "name": "bindingEnergy", + "required": false, + "rootNode": false +}, + +"isotopes":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "isotope": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "isotope", + "occurrence": "1+", + "required": true + } + }, + "description": "List of isotopes for a chemicalElement", + "name": "isotopes", + "required": false, + "rootNode": false +}, +"isotope":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "A": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Nucleon number `A'", + "name": "A", + "required": true, + "type": "Integer32" + }, + "symbol": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Chemical element symbol + nucleon number A, e.g. `Fe56'", + "name": "symbol", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "nuclides": { + "__class__": "nodes.ChildNode", + "description": "", + "namespace": "pops", + "name": "nuclides", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Defines the total nucleon number `A', and contains a list of nuclides with the ", + "same number of protons (Z) and neutrons (A)." + ], + "name": "isotope", + "required": false, + "rootNode": false +}, + +"nuclides":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "nuclide": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "nuclide", + "occurrence": "1+", + "required": true + } + }, + "description": "List of `nuclide' nodes, including ground state and excited states", + "name": "nuclides", + "required": false, + "rootNode": false +}, +"nuclide":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "id": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["Nuclide id, of the form `Th232' (ground state) or `Th232\\_e4' (4th excited state)"], + "name": "id", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "charge": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "charge", + "occurrence": "1", + "required": false + }, + "mass": { + "__class__": "nodes.ChildNode", + "description": "", + "namespace": "pops", + "name": "mass", + "occurrence": "1", + "required": false + }, + "spin": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "spin", + "occurrence": "1", + "required": false + }, + "parity": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "parity", + "occurrence": "1", + "required": false + }, + "nucleus": { + "__class__": "nodes.ChildNode", + "description": "Particle corresponding to this nuclide with all electrons removed.", + "name": "nucleus", + "occurrence": "1", + "required": false + }, + "decayData": { + "__class__": "nodes.ChildNode", + "description": "Description of nuclide decay.", + "name": "decayData", + "occurrence": "1", + "required": false + }, + "fissionFragmentData": { + "__class__": "nodes.ChildNode", + "description": "Description of products, delayed neutrons, etc. produced by spontaneous fission.", + "name": "fissionFragmentData", + "occurrence": "1", + "required": false + } + }, + "description": [ + "A nuclide is a particle consisting of a nucleus (in ground or excited state) ", + "plus a full complement of Z electrons." + ], + "name": "nuclide", + "required": false, + "rootNode": false +}, +"nucleus":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "id": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["nucleus id, of the form `th232' (ground state) or `th232\\_e4' (4th excited state)"], + "name": "id", + "required": true, + "type": "XMLName" + }, + "index": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Excited state index. `0' = ground state, `1' = 1st excited, etc.", + "name": "index", + "required": true, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "charge": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "charge", + "occurrence": "1", + "required": false + }, + "energy": { + "__class__": "nodes.ChildNode", + "description": "", + "namespace": "pops", + "name": "energy", + "occurrence": "1", + "required": false + }, + "halflife": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "halflife", + "occurrence": "1", + "required": false + }, + "spin": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "spin", + "occurrence": "1", + "required": false + }, + "parity": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "parity", + "occurrence": "1", + "required": false + }, + "decayData": { + "__class__": "nodes.ChildNode", + "description": "Description of nucleus decay.", + "name": "decayData", + "occurrence": "1", + "required": false + }, + "fissionFragmentData": { + "__class__": "nodes.ChildNode", + "description": "Description of products, delayed neutrons, etc. produced by spontaneous fission.", + "name": "fissionFragmentData", + "occurrence": "1", + "required": false + } + }, + "description": "Particle definition for a bare nucleus (no electrons).", + "name": "nucleus", + "required": false, + "rootNode": false +}, + +"unorthodoxes":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "nuclide": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "unorthodox", + "occurrence": "1+", + "required": true + } + }, + "description": "List of `unorthodox' particles, such as representative fission products.", + "name": "unorthodoxes", + "required": false, + "rootNode": false +}, +"unorthodox":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "id": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unorthodox particle id.", + "name": "id", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "charge": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "charge", + "occurrence": "1", + "required": false + }, + "mass": { + "__class__": "nodes.ChildNode", + "description": "", + "namespace": "pops", + "name": "mass", + "occurrence": "1", + "required": false + } + }, + "description": [ + "An unorthodox particle is particle-like but often cannot be assigned specific particle properties like spin and parity. ", + "Such particles show up in thermal neutron scattering law files (describing molecules with bulk properties like porosity) ", + "and as representative fission products. They usually only contain a \\element{mass}, although some other properties may also be pertinent." + ], + "name": "unorthodox", + "required": false, + "rootNode": false +}, + +"mass":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "pops", + "occurrence": "1", + "required": false + }, + "double": { + "__class__": "nodes.ChildNode", + "description": "Particle mass. Recommended units are `amu' or `MeV/c/c'.", + "namespace": "containers", + "name": "double", + "occurrence": "1", + "required": false + } + }, + "description": "Particle mass.", + "name": "mass", + "required": false, + "rootNode": false +}, +"spin":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique":"yesLabel", + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "pops", + "occurrence": "1", + "required": false + }, + "fraction": { + "__class__": "nodes.ChildNode", + "description": "Spin assignment. Recommended unit is `hbar'. Multiple `fraction' entries may be used to indicate uncertain spin assignments.", + "name": "fraction", + "occurrence": "1+", + "required": false + } + }, + "description": "Particle spin. Recommended unit is `hbar'.", + "name": "spin", + "required": false, + "rootNode": false +}, +"parity":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique":"yesLabel", + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "pops", + "occurrence": "1", + "required": false + }, + "integer": { + "__class__": "nodes.ChildNode", + "description": "Parity assignment (unitless). Multiple `integer' entries may be used to indicate uncertain parity assignment.", + "name": "integer", + "occurrence": "1+", + "required": false + } + }, + "description": "Particle parity (unitless).", + "name": "parity", + "required": false, + "rootNode": false +}, +"charge":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "pops", + "occurrence": "1", + "required": false + }, + "integer": { + "__class__": "nodes.ChildNode", + "description": "Net charge. Recommended unit is the elementary charge `e'.", + "name": "integer", + "occurrence": "choice", + "required": false + }, + "fraction": { + "__class__": "nodes.ChildNode", + "description": "Fractional net charge. Recommended unit is the elementary charge `e'.", + "name": "fraction", + "occurrence": "choice", + "required": false + } + }, + "description": "Particle charge, may be integer or fraction.", + "name": "charge", + "required": false, + "rootNode": false +}, +"energy":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "pops", + "occurrence": "1", + "required": false + }, + "double": { + "__class__": "nodes.ChildNode", + "description": "Excitation energy. Recommended unit: `eV', `MeV', etc.", + "namespace": "containers", + "name": "double", + "occurrence": "1+", + "required": false + } + }, + "description": "Excitation energy (for excited-state particles).", + "name": "energy", + "required": false, + "rootNode": false +}, +"halflife":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique":"yesLabel", + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "pops", + "occurrence": "1", + "required": false + }, + "string": { + "__class__": "nodes.ChildNode", + "description": "Mainly used for stable particles, i.e. halflife = `stable'.", + "name": "string", + "occurrence": "choice", + "required": false + }, + "double": { + "__class__": "nodes.ChildNode", + "description": "Numeric value of halflife. Recommended unit = `s'.", + "namespace": "containers", + "name": "double", + "occurrence": "choice", + "required": false + } + }, + "description": ["Choices for the the string element are `stable' or `unstable', otherwise a halflife is given in the double element"], + "name": "halflife", + "required": false, + "rootNode": false +}, + +"decayType": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "Within the decay data section, the \\attr{mode} attribute indicates the type of decay. This attribute can take from an enumerated set of values.", + "name": "decayType", + "allowedValues":["SF", "beta-", "beta+", "EC", "electroMagnetic", "IT", "n", "p", "d", "t", "alpha", "atomicRelaxation"]}, + +"decayData":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "decayModes": { + "__class__": "nodes.ChildNode", + "description": "List of decay modes.", + "name": "decayModes", + "occurrence": "1", + "required": false + }, + "averageEnergies": { + "__class__": "nodes.ChildNode", + "description": "List of average energies for each type of emitted particle.", + "name": "averageEnergies", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Unstable particles undergo decay, emitting other particles in the process. The \\element{decayData} node ", + "stores details about possible ways that a particle can decay. This node is designed to be flexible enough ", + "to describe decays with varying levels of detail. This flexibility is useful since some decays are ", + "very well known (including all the details of what particles and excited nucleus energy levels are involved), ", + "while other decays are more difficult to measure and may include a `continuum' portion ", + "in addition to discrete particle emission." + ], + "name": "decayData", + "required": false, + "rootNode": false +}, + +"decayModes":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "decayMode": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "decayMode", + "occurrence": "1+", + "required": true + } + }, + "description": "List of decay modes, each containing a probability and list of decay products.", + "name": "decayModes", + "required": false, + "rootNode": false +}, +"decayMode":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label for this decay mode.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "mode": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Type of decay, e.g. `electroMagnetic', `beta+', etc.", + "name": "mode", + "required": true, + "type": "decayType" + } + }, + "bodyText": null, + "childNodes": { + "probability": { + "__class__": "nodes.ChildNode", + "description": "Probability that this decay mode occurs. Probability of all `decayMode' nodes should sum to 1.0.", + "namespace": "pops", + "name": "probability", + "occurrence": "1", + "required": true + }, + "internalConversionCoefficients": { + "__class__": "nodes.ChildNode", + "description": "Proportional to the probability that the decay proceeds through internal conversion.", + "name": "internalConversionCoefficients", + "occurrence": "1", + "required": false + }, + "photonEmissionProbabilities": { + "__class__": "nodes.ChildNode", + "description": "Probability that photons are emitted as part of the decay.", + "namespace": "pops", + "name": "photonEmissionProbabilities", + "occurrence": "1", + "required": false + }, + "Q": { + "__class__": "nodes.ChildNode", + "description": "Decay Q-value.", + "namespace": "pops", + "name": "Q", + "occurrence": "1", + "required": false + }, + "decayPath": { + "__class__": "nodes.ChildNode", + "description": "Lists specific decay products including excited states where possible.", + "name": "decayPath", + "occurrence": "1", + "required": false + }, + "spectra": { + "__class__": "nodes.ChildNode", + "description": "Contains a list of outgoing energy spectra for various types of decay products.", + "name": "spectra", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Description of a single decay mode. Lists the type of decay, a probability, an optional decay Q-value, ", + "a `decay path' showing how the decay proceeds and optionally a list of spectra for different types of decay products." + ], + "name": "decayMode", + "required": false, + "rootNode": false +}, + +"probability":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": "Numeric value of the probability (unitless). Should be in the range (0, 1]", + "namespace": "containers", + "name": "double", + "occurrence": "1+", + "required": true + } + }, + "description": "Probability that a particular \\element{decayMode} occurs.", + "name": "probability", + "required": false, + "rootNode": false +}, + +"internalConversionCoefficients":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "shell": { + "__class__": "nodes.ChildNode", + "description": "Internal conversion coefficient for a single electron shell.", + "name": "shell", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "Contains a list of coefficients corresponding to the probability that the decay proceeds by converting an ", + "electron from a particular electron shell." + ], + "name": "internalConversionCoefficients", + "required": false, + "rootNode": false +}, +"photonEmissionProbabilities":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "shell": { + "__class__": "nodes.ChildNode", + "description": "Photon emission probabilities for internal conversion in specified electron shell.", + "name": "shell", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "Contains a list of probabilities that internal conversion for a particular electron shell will be ", + "accompanied by photon emission." + ], + "name": "photonEmissionProbabilities", + "required": false, + "rootNode": false +}, +"positronEmissionIntensity":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Intensity of positron emission.", + "name": "value", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": null, + "namespace": "pops", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Contains a list of intensities for transitions in which internal conversion for a particular electron shell is ", + "accompanied by photon emission." + ], + "name": "positronEmissionIntensity", + "required": false, + "rootNode": false +}, +"shell":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Label of the shell, e.g. `1s1/2'. This matches the Python regular expression `[0-9+][spdf][13579]+/2'.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Probability associated with this shell (e.g. internal conversion coefficient or pair-production coefficient).", + "name": "value", + "required": true, + "type": "Float64" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": " \\kern-1ex", + "description": "Internal conversion or pair production coefficient unit and is usually dimensionless.", + "name": "unit", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "Defines the probability that a process like internal conversion or pair production occurs ", + "through a particular electron shell." + ], + "name": "shell", + "required": false, + "rootNode": false +}, + +"Q":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "default": null, + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "pops", + "occurrence": "1", + "required": false + }, + "double": { + "__class__": "nodes.ChildNode", + "description": "Numeric value of the decay Q-value, recommended unit `eV' or `MeV'.", + "namespace": "containers", + "name": "double", + "occurrence": "1+", + "required": true + } + }, + "description": "Q-value for this decay mode.", + "name": "Q", + "required": false, + "rootNode": false + +}, + +"decayPath":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "decay": { + "__class__": "nodes.ChildNode", + "description": "", + "name": "decay", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "Shows how a decay proceeds. It contains one or more \\element{decay} nodes, ", + "each representing one step in the decay. For example, the \\element{decayPath} node for the beta-decay of a light, ", + "neutron-rich nucleus could contain multiple \\element{decay} nodes, each representing a single beta-decay towards stability. ", + "\nIn general only using one \\element{decay} node per \\element{decayPath} is recommended, then looking up each of the ", + "resulting products in PoPs to determine whether and how they decay. However, the \\element{decayPath} is meant to ", + "also be general enough to handle data like the ENDF decay sub-library where the exact identity (including excitation energy) ", + "of each intermediate state may not be specified." + ], + "name": "decayPath", + "required": false, + "rootNode": false +}, +"decay":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "index": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Index, must be unique within the parent \\element{decayPath} node.", + "name": "index", + "required": true, + "type": "Integer32" + }, + "mode": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Type of decay, e.g. `electroMagnetic'.", + "name": "mode", + "required": false, + "type": "decayType" + }, + "complete": { + "__class__": "nodes.Attribute", + "default": "false", + "description": "Whether the decay scheme is considered complete by the evaluator.", + "name": "complete", + "required": false, + "type": "Boolean" + } + }, + "bodyText": null, + "childNodes": { + "products": { + "__class__": "nodes.ChildNode", + "description": "List of decay products.", + "namespace": "pops", + "name": "products", + "occurrence": "1", + "required": false + } + }, + "description": "Single step in a decay. Includes a decay type and a list of products.", + "name": "decay", + "required": false, + "rootNode": false +}, +"products":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "product": { + "__class__": "nodes.ChildNode", + "description": "Single decay product.", + "namespace": "pops", + "name": "product", + "occurrence": "1+", + "required": true + } + }, + "description": "List of decay products.", + "name": "products", + "required": false, + "rootNode": false +}, +"product":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique decay product label.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Decay product particle id.", + "name": "pid", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Single decay product.", + "name": "product", + "required": false, + "rootNode": false +}, + +"spectra":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "spectrum": { + "__class__": "nodes.ChildNode", + "description": "Spectrum for one type of outgoing particle.", + "name": "spectrum", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "Used to store outgoing energy probability distributions for each type of emitted particle. ", + "The use of \\element{decayMode} elements is preferred where possible since that supports decays to ", + "specific final states, but the spectra node is still important for cases when specific ", + "decay paths are too complicated to measure." + ], + "name": "spectra", + "required": false, + "rootNode": false +}, +"spectrum":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label for this spectrum. Usually identical to the pid attribute value.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "id of the particle corresponding to this decay spectrum.", + "name": "pid", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "continuum": { + "__class__": "nodes.ChildNode", + "description": "Spectrum for continuum emission of particles.", + "name": "continuum", + "occurrence": "1", + "required": false + }, + "discrete": { + "__class__": "nodes.ChildNode", + "description": "List of particles emitted with a specific `discrete' energy.", + "name": "discrete", + "occurrence": "1+", + "required": false + } + }, + "description": [ + "Stores the outgoing spectrum for one type of emitted particle. The spectrum can be broken down into a sum ", + "of \\element{discrete} and \\element{continuum} nodes. The sum of all \\element{discrete} node intensities ", + "plus the integral of the \\element{continuum} node contribution should equal 1.0." + ], + "name": "spectrum", + "required": false, + "rootNode": false +}, +"continuum":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "Continuum energy spectrum stored as a 1-dimensional function.", + "name": "XYs1d", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Stores the smooth part of the emitted particle spectrum as a 1-dimensional function of outgoing particle energy. ", + "If no discrete emission is present, the continuum portion is a probability density function and should integrate to one. ", + "If discrete emissions are present, the continuum should integrate to (1 - sum of discrete intensities)." + ], + "name": "continuum", + "required": false, + "rootNode": false +}, +"discrete":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "type": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Type of transition for beta and electron capture. For example, `allowed', `first-forbidden', etc.", + "name": "type", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "discreteEnergy": { + "__class__": "nodes.ChildNode", + "description": "Emitted particle energy.", + "namespace": "pops", + "name": "energy", + "occurrence": "1", + "required": true + }, + "intensity": { + "__class__": "nodes.ChildNode", + "description": "Relative intensity of discrete radiation (usually normalised such that most intense branch = 1.0).", + "name": "intensity", + "occurrence": "1", + "required": true + }, + "internalConversionCoefficients": { + "__class__": "nodes.ChildNode", + "description": "Proportional to the probability that the decay proceeds through internal conversion.", + "name": "internalConversionCoefficients", + "occurrence": "1", + "required": false + }, + "internalPairFormationCoefficient": { + "__class__": "nodes.ChildNode", + "description": "Proportional to the probability that an electron/positron pair are formed as part of the decay.", + "name": "internalPairFormationCoefficient", + "occurrence": "1", + "required": false + }, + "photonEmissionProbabilities": { + "__class__": "nodes.ChildNode", + "description": "Probability that photons are emitted as part of the decay.", + "namespace": "pops", + "name": "photonEmissionProbabilities", + "occurrence": "1", + "required": false + }, + "positronEmissionIntensity": { + "__class__": "nodes.ChildNode", + "description": "Intensity of transitions in which positrons are emitted as part of the decay.", + "name": "positronEmissionIntensity", + "occurrence": "1", + "required": false + } + }, + "description": "Stores a single discrete particle emission, including the energy of the emitted particle and the intensity of emission.", + "name": "discrete", + "required": false, + "rootNode": false +}, + +"discreteEnergy":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "", + "name": "value", + "required": true, + "type": "Float64" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "", + "name": "unit", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty on the intensity.", + "namespace": "pops", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": "This is the energy of the discrete emitted particle.", + "name": "discreteEnergy", + "required": false, + "rootNode": false +}, +"intensity":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "unit": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "", + "name": "value", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "Uncertainty on the intensity.", + "namespace": "pops", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": "Relative intensity of this decay branch (usually normalised so the most intense branch has intenisty = 1).", + "name": "intensity", + "required": false, + "rootNode": false +}, +"internalPairFormationCoefficient":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "", + "name": "value", + "required": true, + "type": "Float64" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": " \\kern-1ex", + "description": "Usually dimensionless", + "name": "unit", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "namespace": "pops", + "occurrence": "1", + "required": false + } + }, + "description": "Related to the probability of forming an electron/positron pair.", + "name": "internalPairFormationCoefficient", + "required": false, + "rootNode": false +}, + +"averageEnergies":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "averageEnergy": { + "__class__": "nodes.ChildNode", + "description": "Mean energy for one type of decay product.", + "name": "averageEnergy", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "For complex decays such as spontaneous fission, it is sometimes useful to store information about the ", + "average energy for each category of outgoing particle." + ], + "name": "averageEnergies", + "required": false, + "rootNode": false +}, +"averageEnergy":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of outgoing particle.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "value", + "required": true, + "type": "Float64" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Energy unit, e.g. `eV' or `MeV'.", + "name": "unit", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "occurrence": "1", + "required": false + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": null, + "namespace": "pops", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Stores the mean outgoing energy for one type of decay product, e.g. `n', `photon' or `e-'. ", + "Note that the type of product is identified by the `label' attribute, but in the future this may change to a `pid'." + ], + "name": "averageEnergy", + "required": false, + "rootNode": false +}, +"uncertainty":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "standard": { + "__class__": "nodes.ChildNode", + "description": "Stores a normally-distributed uncertainty.", + "namespace": "pops", + "name": "standard", + "occurrence": "1", + "required": false + }, + "logNormal": { + "__class__": "nodes.ChildNode", + "description": "Stores a log-normal-distributed uncertainty.", + "namespace": "pops", + "name": "logNormal", + "occurrence": "1", + "required": false + }, + "confidenceIntervals": { + "__class__": "nodes.ChildNode", + "description": "Stores a list of intervals along with the confidence that the `true value' lies within each interval.", + "namespace": "pops", + "name": "confidenceIntervals", + "occurrence": "1", + "required": false + }, + "pdf": { + "__class__": "nodes.ChildNode", + "description": "Stores a probability distribution as a 1-dimensional function.", + "namespace": "pops", + "name": "pdf", + "occurrence": "1", + "required": false + } + }, + "description": "Stores the uncertainty for a scalar quantity, e.g. probability or mean energy.", + "name": "uncertainty", + "required": false, + "rootNode": false +}, +"standard":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": "Stores $\\sigma$ for the normal distribution.", + "namespace": "extra", + "name": "double", + "occurrence": "1", + "required": true + } + }, + "description": [ + "Used to store the standard deviation of a standard Gaussian uncertainty distribution. The mean value and unit are ", + "stored higher up in the hierarchy, for example in the parent \\element{double} or \\element{averageEnergy} node." + ], + "name": "standard", + "required": false, + "rootNode": false +}, +"logNormal":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": "Stores $\\sigma$ for the log-normal distribution.", + "namespace": "extra", + "name": "double", + "occurrence": "1", + "required": true + } + }, + "description": [ + "Used to store the standard deviation $\\sigma$ of a log-normal uncertainty distribution, $X = \\exp{\\mu + \\sigma Z}$. The mean value and unit are ", + "stored higher up in the hierarchy, for example in the parent \\element{double} or \\element{averageEnergy} node." + ], + "name": "logNormal", + "required": false, + "rootNode": false +}, +"confidenceIntervals":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "interval": { + "__class__": "nodes.ChildNode", + "description": "Stores one confidence interval.", + "namespace": "pops", + "name": "interval", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "Stores a list of intervals along with the confidence that the `true value' lies within each interval. The mean value and unit are ", + "stored higher up in the hierarchy, for example in the parent \\element{double} or \\element{averageEnergy} node." + ], + "name": "confidenceIntervals", + "required": false, + "rootNode": false +}, +"interval":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "confidence": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A value between 0 and 1, indicating how confident the evaluator is that the `true' value lies between mean - lower and mean + upper.", + "name": "confidence", + "required": true, + "type": "Float64" + }, + "lower": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Value to subtract from the mean to obtain the lower limit for this interval.", + "name": "lower", + "required": true, + "type": "Float64" + }, + "upper": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Value to add to the mean to obtain the upper limit for this interval.", + "name": "upper", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Stores a list of intervals along with the confidence that the `true value' lies within each interval.", + "name": "interval", + "required": false, + "rootNode": false +}, +"pdf":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "Probability distribution stored as an XYs1d.", + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": "Probability distribution stored as a regions1d.", + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": "Stores an explicit probability distribution for the parent quantity.", + "name": "pdf", + "required": false, + "rootNode": false +} + +} diff --git a/standards/gnds-2.0/summary_processed.json b/standards/gnds-2.0/summary_processed.json new file mode 100644 index 000000000..e4a5ab114 --- /dev/null +++ b/standards/gnds-2.0/summary_processed.json @@ -0,0 +1,256 @@ +{ + "__namespace__":"processed", + "multiGroup3d":{ + "__class__": "nodes.Node", + "abstractNode": "distributionNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data assoicated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "gridded3d": { + "__class__": "nodes.ChildNode", + "description": "Stores the multi-group transfer array with the first axis being the projectile energy, the second axis being the outgoing particle's energy and the thirds axis the Legendre order.", + "name": "gridded3d", + "occurrence": "1", + "required":true + } + }, + "description": "A multi-group transfer array.", + "name": "multiGroup3d", + "required": false, + "rootNode": false + }, + "angularEnergyMC":{ + "__class__": "nodes.Node", + "abstractNode": "distributionNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the element associated with these data.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame in which the product data are defined.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "angular_uncorrelated": { + "__class__": "nodes.ChildNode", + "description": "The outgoing particle $\\mu$ distribution $P(\\mu|E)$ give the projectile energy using a \\element{XYs2d} or \\element{regions2d} is a list of \\element{xs\\_pdf\\_cdf1d} for its function1d's.", + "name": "angular", + "occurrence": "1", + "required": true + }, + "angularEnergy": { + "__class__": "nodes.ChildNode", + "description": [ + "The outgoing particle energy distribution $P(E'|E,\\mu)$ give the projectile energy and outgoing particle $\\mu$ using a \\element{XYs3d}", + "or \\element{regions3d} with a list of \\element{XYs2d} for its function2d's. Each \\element{XYs2d} is a list \\element{xs\\_pdf\\_cdf1d} for its function1d's." + ], + "name": "angularEnergy", + "occurrence": "1", + "required": true + } + }, + "description": [ + "This distribution is processed for Monte Carlo transport. The outgoing particle distribution $P(\\mu,E'|E)$ is the projectile energy E", + "stored as $P(\\mu|E) \\times P(E'|E,\\mu)$. Each function1d must be a \\element{xs\\_pdf\\_cdf1d} node." + ], + "name": "angularEnergyMC", + "required": false, + "rootNode": false + }, + "energyAngularMC":{ + "__class__": "nodes.Node", + "abstractNode": "distributionNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the element associated with these data.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "energy": { + "__class__": "nodes.ChildNode", + "description": "The outgoing particle $E'$ distribution $P(E'|E)$ give the projectile energy using a \\element{XYs2d} or \\element{regions2d} with a list of \\element{xs\\_pdf\\_cdf1d} for its function1d's.", + "namespace": "common", + "name": "energy", + "occurrence": "1", + "required": true + }, + "energyAngular": { + "__class__": "nodes.ChildNode", + "description": [ + "The outgoing particle $\\mu$ distribution $P(\\mu|E,E')$ give the projectile energy and outgoing particle $E'$ using a \\element{XYs3d}", + "or \\element{regions3d} with a list of \\element{XYs2d} for its function2d's. Each \\element{XYs2d} as a list \\element{xs\\_pdf\\_cdf1d} for its function1d's." + ], + "name": "energyAngular", + "occurrence": "1", + "required": true + } + }, + "description": [ + "This distribution is processed for Monte Carlo transport. The outgoing particle distribution $P(\\mu,E'|E)$ given the projectile energy E", + "stored as $P(E'|E) \\times P(\\mu|E,E')$. Each function1d must be a \\element{xs\\_pdf\\_cdf1d} node." + ], + "name": "energyAngularMC", + "required": false, + "rootNode": false + }, + "averageProductEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "A function1d representing the lab-frame, average energy for an outgoing particle integrated over outgoing $\\mu$ and energy $E'$.", + "name": "XYs1d", + "occurrence": "1", + "required": true + }, + "gridded1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "gridded1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": "A component function1d representing the lab-frame, average energy for an outgoing particle integrated over outgoing $\\mu$ and energy $E'$. This is needed to, for example, calculate KERMA.", + "name": "averageProductEnergy", + "required": false, + "rootNode": false + }, + "averageProductMomentum":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "gridded1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "gridded1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": "A component function1d representing the lab-frame, average momentum for an outgoing particle integrated over outgoing $\\mu$ and energy $E'$.", + "name": "averageProductMomentum", + "required": false, + "rootNode": false + }, + "availableMomentum":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "gridded1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "gridded1d", + "occurrence": "1", + "required": false + } + }, + "description": "For a reaction this is the total available momentum for all outgoing particle along the direction of the projectile. This is the momentum of the projectile.", + "name": "availableMomentum", + "required": false, + "rootNode": false + }, + "availableEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "gridded1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "gridded1d", + "occurrence": "1", + "required": false + } + }, + "description": "For a reaction this is the total available energy for all outgoing particle. It is calculated as the energy of the projectile plus the final Q-value.", + "name": "availableEnergy", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_resonance.json b/standards/gnds-2.0/summary_resonance.json new file mode 100644 index 000000000..c9443a7a2 --- /dev/null +++ b/standards/gnds-2.0/summary_resonance.json @@ -0,0 +1,1370 @@ +{ + "__namespace__":"resonances", + "resonances":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "href", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "scatteringRadius": { + "__class__": "nodes.ChildNode", + "description": "The scattering radius to be used by default.", + "name": "scatteringRadius", + "occurrence": "1", + "required": true + }, + "hardSphereRadius": { + "__class__": "nodes.ChildNode", + "description": "The channel radius to be used for calculating the phase shift.", + "name": "hardSphereRadius", + "occurrence": "1", + "required": false + }, + "resolved": { + "__class__": "nodes.ChildNode", + "description": [ "The resolved resonance parameters. The use of more than one ", + "\\texttt{resolved} node is deprecated. It is allowed for ", + "historic reasons but should not be used for new evaluations." ], + "name": "resolved", + "occurrence": "0+", + "required": false + }, + "unresolved": { + "__class__": "nodes.ChildNode", + "description": "The unresolved resonance parameters.", + "name": "unresolved", + "occurrence": "0+", + "required": false + } + }, + "description": [ "The \\texttt{resonances} node contains the scattering radius for the ", + "potential scattering, along with resolved and/or unresolved resonance ", + "parameter data (if they are given)." ], + "name": "resonances", + "required": false, + "rootNode": false + }, + "scatteringRadius":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childUnique": "yesLabelOmitted", + "childNodes": { + "constant1d": { + "__class__": "nodes.ChildNode", + "description": "The scattering radius is a constant value.", + "name": "constant1d", + "occurrence": "choice", + "required": false + }, + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": [ "The scattering radius is an energy dependent function with ", + "a single interpolation range." ], + "name": "XYs1d", + "occurrence": "choice", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": [ "The scattering radius is an energy dependent function with ", + "multiple interpolation range." ], + "name": "regions1d", + "occurrence": "choice", + "required": false + } + }, + "description": [ "The \\texttt{scatteringRadius} node provides the scattering radius ", + "for potential scattering. This scattering radius is also to be used ", + "as the default channel radius for all channels in the resolved and ", + "unresolved resonance range when calculating the penetrability $P$, ", + "the shift function $S$ and the phase shift $\\phi$.", + " ", + "The scattering radius should be given in length units (the ", + "recommended unit is fm) and can be given as either a constant value ", + "or an energy dependent function of the same style. The use of an ", + "energy dependent function for the scattering radius is deprecated.", + " ", + "For a given evaluation label there can only be one \\element{XYs1d}, \\element{regions1d} or \\element{constant1d}"], + "name": "scatteringRadius", + "required": true, + "rootNode": false + }, + "hardSphereRadius":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "constant1d": { + "__class__": "nodes.ChildNode", + "description": "The hard-sphere radius.", + "name": "constant1d", + "occurrence": "1", + "required": true + } + }, + "description": [ "The \\texttt{hardSphereRadius} node provides the channel radius ", + "to be used in the calculation of the phase shift instead of the ", + "radius given in a \\texttt{scatteringRadius} node.", + " ", + "The \\texttt{hardSphereRadius} is deprecated and should not be used in new", + "evaluations. Evaluators wishing to modify the phase shift should consider using", + "a background R-Matrix term instead."], + "name": "hardSphereRadius", + "required": false, + "rootNode": false + }, + "externalRMatrix":{ + "__class__":"nodes.Node", + "abstractNode": null, + "attributes": { + "type": { + "__class__": "nodes.Attribute", + "default": "Froehner", + "description": [ "The statistical approximation for the resonances external to ", + "the observed R-matrix resonances using one of the following ", + "formalisms: \\texttt{Froehner}, \\texttt{SAMMY}. " ], + "name": "type", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique": "yesLabel", + "childNodes": { + "double": { + "__class__": "nodes.ChildNode", + "description": "Each of the terms in the Froehner or SAMMY formalisms", + "namespace": "containers", + "name": "double", + "occurrence": "1+", + "required": true + } + }, + "description": [ "The statistical approximation for the resonances external to ", + "the observed R-matrix resonances using one of the following ", + "formalisms: \\texttt{Froehner}, \\texttt{SAMMY}. ", + "For the Froehner formalism, a \\element{double} should be provided for", + "each of the following terms, with the \\attr{label} attribute specified below:", + "\\begin{description}[font=\\ttfamily,labelindent=1cm] ", + " \\item[averageRadiationWidth:] Average Radiation Width. Recommended ", + "unit: `eV', `MeV', etc.", + " \\item[constantExternalR:] Constant term for the external ", + "contribution to the R-matrix. Recommended unit: unitless", + " \\item[poleStrength:] Pole strength as defined by Fr\\\"ohner. Recommended ", + " unit: unitless", + " \\item[singularityEnergyBelow:] Energy below the energy range of observed ", + "resonances at which the Froehner and SAMMY R-external equations ", + " produce infinite terms. Recommended unit: `eV', `MeV', etc.", + " \\item[singularityEnergyAbove:] Energy above the energy range of observed ", + "resonances at which the Froehner and SAMMY R-external equations ", + " produce infinite terms. Recommended unit: `eV', `MeV', etc.", + "\\end{description}", + "For the SAMMY formalism, a \\element{double} should be provided for", + "each of the following terms, with the \\attr{label} attribute specified below:", + "\\begin{description}[font=\\ttfamily,labelindent=1cm] ", + " \\item[constantExternalR:] Constant term for the external ", + "contribution to the R-matrix. Recommended unit: unitless", + " \\item[linearExternalR:] Linear term for the external ", + "contribution to the R-matrix. Recommended unit: `eV$^{-1}$'", + " \\item[quadraticExternalR:] Quadratic term for the external ", + "contribution to the R-matrix. Recommended unit: `eV$^{-2}$'", + " \\item[constantLogarithmicCoefficient:] Constant multiplicative coefficient ", + "on the logarithmic term in the SAMMY equation. Recommended ", + " unit: unitless", + " \\item[linearLogarithmicCoefficient:] Constant multiplicative coefficient ", + "on the logarithmic term in the SAMMY equation. Recommended ", + " unit: `eV$^{-1}$'", + " \\item[singularityEnergyBelow:] Energy below the energy range of observed ", + "resonances at which the Froehner and SAMMY R-external equations ", + " produce infinite terms. Recommended unit: `eV', `MeV', etc.", + " \\item[singularityEnergyAbove:] Energy above the energy range of observed ", + "resonances at which the Froehner and SAMMY R-external equations ", + " produce infinite terms. Recommended unit: `eV', `MeV', etc.", + "\\end{description}" ], + "name": "externalRMatrix", + "required": false, + "rootNode": false + }, + "resolved":{ + "__class__": "nodes.Node", + "abstractNode": null, + "childUnique" : "yesLabel", + "attributes": { + "domainMin": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The lower energy limit of the resolved resonance range.", + "name": "domainMin", + "required": true, + "type": "Float64" + }, + "domainMax": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The upper energy limit of the resolved resonance range.", + "name": "domainMax", + "required": true, + "type": "Float64" + }, + "domainUnit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The energy unit used for the lower and upper energy limits.", + "name": "domainUnit", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "RMatrix": { + "__class__": "nodes.ChildNode", + "description": ["The resonance parameters are given using the R-matrix formalism.", + "More than one is only allowed if they are different in the style label"], + "name": "RMatrix", + "occurrence": "choice", + "required": false + }, + "BreitWigner": { + "__class__": "nodes.ChildNode", + "description": [ "The resonance parameters are given using the deprecated ", + "ENDF Breit-Wigner formalism.", + "More than one is only allowed if they are different in the style label"], + "name": "BreitWigner", + "occurrence": "choice", + "required": false + }, + "energyIntervals": { + "__class__": "nodes.ChildNode", + "description": [ "Resonance parameters are broken up into several sections, with interference", + "between sections ignored. This option is deprecated but appears in older evaluations." + ], + "name": "energyIntervals", + "occurrence": "choice", + "required": false + } + }, + "description": [ "The \\texttt{resolved} node provides a resolved resonance region ", + "over a given energy range. The energy domain of this resolved ", + "resonance region should not overlap with any of the other resonance ", + "regions defined in the \\texttt{resonances} node. ", + " ", + "The \\texttt{resolved} node defines the following formalisms for ", + "the resonance reconstruction: ", + "\\begin{description}[font=\\ttfamily,labelindent=1cm] ", + " \\item[RMatrix:] the R-matrix formalism using the single-level ", + " Breit-Wigner (SLBW), the multi-level Breit-Wigner ", + " (MLBW), the Reich-Moore approximation or the full ", + " R-matrix formalism. ", + " \\item[BreitWigner:] the deprecated ENDF Breit-Wigner formalisms ", + " (LRF=1 and 2). ", + "\\end{description}" ], + "name": "resolved", + "required": false, + "rootNode": false + }, + + "energyIntervals":{ + "__class__": "nodes.Node", + "abstractNode": null, + "childUnique" : "yesLabel", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Identifier label. Must be unique within the parent \\element{resolved} node.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "energyInterval": { + "__class__": "nodes.ChildNode", + "description": "A single energy interval including domain limits and resonance parameterisation.", + "name": "energyInterval", + "occurrence": "2+", + "required": true + } + }, + "description": [ + "Used to break the resolved resonance region into multiple independant sub-regions.", + "This was done in some older evaluations (notably the ENDF-VII.1 n + $^{239}$Pu evaluation)", + "to reduce the computational load of summing over all resonances when reconstructing the cross section.", + "This option is deprecated and should not be used for new evaluations." + ], + "name": "energyIntervals", + "required": false, + "rootNode": false + }, + "energyInterval":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "index": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Index of this \\element{energyInterval} within the parent \\element{energyIntervals}.", + "name": "index", + "required": true, + "type": "Integer32" + }, + "domainMin": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The lower energy limit of the resolved resonance range.", + "name": "domainMin", + "required": true, + "type": "Float64" + }, + "domainMax": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The upper energy limit of the resolved resonance range.", + "name": "domainMax", + "required": true, + "type": "Float64" + }, + "domainUnit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The energy unit used for the lower and upper energy limits.", + "name": "domainUnit", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "RMatrix": { + "__class__": "nodes.ChildNode", + "description": "The resonance parameters in this interval are given using the R-matrix formalism.", + "name": "RMatrix", + "occurrence": "choice", + "required": false + }, + "BreitWigner": { + "__class__": "nodes.ChildNode", + "description": [ "The resonance parameters in this interval are given using the deprecated ", + "ENDF Breit-Wigner formalism."], + "name": "BreitWigner", + "occurrence": "choice", + "required": false + } + }, + "description": "A single energy interval, including domain limits and a resonance parameterisation.", + "name": "energyInterval", + "required": false, + "rootNode": false + }, + + "boundaryCondition":{ + "__class__": "nodes.EnumeratedTypeNode", + "description": [ "Allowed values for the \\attr{boundaryCondition} attribute.", + "The R-matrix formalism requires a choice in the boundary condition ", + "used in the calculation of the scattering matrix. This boundary condition ", + "is used in the term $S - B + iP$ for each channel in each spin group (in ", + "which $S$ is the shift function, $B$ is the boundary condition and $P$ is ", + "the penetrability). The following options for the boundary condition are ", + "currently defined: ", + "\\begin{description}[font=\\ttfamily,labelindent=1cm] ", + " \\item[EliminateShiftFunction]: the boundary condition cancels out ", + " the shift factor ($S - B = 0$) so that the shift factor ", + " never has to be calculated. ", + " \\item[NegativeOrbitalMomentum]: the boundary condition is set to be ", + " equal to the minus the orbital momentum $L$.", + " \\item[Brune]: the boundary condition follows the Brune parametrisation.", + " \\item[Given]: the boundary condition is given for each channel.", + "\\end{description}", + " ", + "When the boundary condition option is \\texttt{Brune}, the resonance energies ", + "and widths given will be the Brune parameters, i.e. not the regular energies and widths ", + "for the traditional R-matrix defined by Lane and Thomas but the transformed ones defined by ", + "the Barker transform. Physical observables such as cross sections can be calculated from ", + "the Brune parameters using the level matrix, or by converting the parameters back to the ", + "the traditional R-matrix.", + " ", + "When the \\texttt{Given} option is selected, boundary condition values ", + "must be given for all channels, either by providing a global default value on ", + "the \\element{RMatrix} node or by providing a value for each individual ", + "resonance reaction or channel. The \\texttt{boundaryConditionValue} can also be used ", + "to override a \\texttt{NegativeOrbitalMomentum} boundary condition for specific resonance reactions, ", + "but cannot be used when the \\texttt{Brune} or \\texttt{EliminateShiftFunction} option is chosen." ], + "name": "boundaryCondition", + "allowedValues":["EliminateShiftFunction", "NegativeOrbitalMomentum", "Brune", "Given"] + }, + "RMatrix":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": true, + "type": "XMLName" + }, + "approximation": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The approximation to the R-matrix resonance formalism to be ", + "used for the resonance reconstruction (one of ", + "\\texttt{SingleLevelBreitWigner}, ", + "\\texttt{MultiLevelBreitWigner}, \\texttt{ReichMoore} or ", + "\\texttt{FullRMatrix})." ], + "name": "approximation", + "required": true, + "type": "XMLName" + }, + "boundaryCondition": { + "__class__": "nodes.Attribute", + "default": "EliminateShiftFunction", + "description": [ "The boundary condition option to be used." ], + "name": "boundaryCondition", + "required": false, + "type": "boundaryCondition" + }, + "boundaryConditionValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "A global default value of the boundary condition $B$ in $L = S - B + iP$ ", + "when the boundary condition option selected on the RMatrix node is \\attrval{Given}. ", + "This value can be overridden in the \\element{resonanceReaction} or \\element{channel} ", + "nodes." ], + "name": "boundaryConditionValue", + "required": false, + "type": "Float64" + }, + "calculateChannelRadius": { + "__class__": "nodes.Attribute", + "default": "false", + "description": [ "An optional flag to indicate whether or not the channel ", + "radius should be calculated for the calculation of the ", + "penetrability $P$ and shift function $S$." ], + "name": "calculateChannelRadius", + "required": false, + "type": "Boolean" + }, + "calculatePenetrability": { + "__class__": "nodes.Attribute", + "default": true, + "description": [ "A flag to indicate whether or not the penetrability should be ", + "calculated. If false, the penetrability is assumed to be 1." ], + "name": "calculatePenetrability", + "required": false, + "type": "Boolean" + }, + "useForSelfShieldingOnly": { + "__class__": "nodes.Attribute", + "default": false, + "description": [ "Flag indicating that resonance parameters are only meant for use in", + "computing self-shielding, not for calculating the cross section." ], + "name": "useForSelfShieldingOnly", + "required": false, + "type": "Boolean" + }, + "supportsAngularReconstruction": { + "__class__": "nodes.Attribute", + "default": "false", + "description": [ "A flag to indicate whether or not the resonance parameters ", + "may be used to compute angular distributions for the reactions." ], + "name": "supportsAngularReconstruction", + "required": false, + "type": "Boolean" + } + }, + "bodyText": null, + "childNodes": { + "PoPs_database": { + "__class__": "nodes.ChildNode", + "description": [ "Particle database to be used for the resonance reconstruction. ", + "This element only needs to be given if mass or spin values ", + "different from the particle database used in the parent ", + "\\texttt{reactionSuite} are to be used in the calculations. ", + "The use of this element is deprecated." ], + "name": "PoPs", + "occurrence": "1", + "required": false + }, + "resonanceReactions": { + "__class__": "nodes.ChildNode", + "description": "The reactions for which resonance parameters will be provided.", + "name": "resonanceReactions", + "occurrence": "1", + "required": true + }, + "spinGroups": { + "__class__": "nodes.ChildNode", + "description": "The spin groups with resonance parameters.", + "name": "spinGroups", + "occurrence": "1", + "required": true + } + }, + "description": [ "The \\texttt{RMatrix} node is used to specify resonance parameters using ", + "the R-matrix formalism, which can be given in multiple approximations. ", + "The following approximations for the resonance reconstruction using the ", + "R-matrix formalism are currently defined: ", + "\\begin{description}[font=\\ttfamily,labelindent=1cm] ", + " \\item[SingleLevelBreitWigner]: the Single-level Breit-Wigner approximation", + " \\item[MultiLevelBreitWigner]: the Multi-level Breit-Wigner approximation", + " \\item[ReichMoore]: the Reich-Moore approximation", + " \\item[FullRMatrix]: full R-matrix formalism", + "\\end{description} " ], + "name": "RMatrix", + "required": false, + "rootNode": false + }, + "resonanceReactions":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "resonanceReaction": { + "__class__": "nodes.ChildNode", + "description": "A single reaction for which resonances are specified.", + "name": "resonanceReaction", + "occurrence": "1+", + "required": true + } + }, + "description": [ "The \\texttt{resonanceReactions} node provides data on all reactions ", + "for which resonance data is provided. Each reaction that is used in ", + "the description of the resonance parameters must be described here." ], + "name": "resonanceReactions", + "required": true, + "rootNode": false + }, + "resonanceReaction":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": true, + "type": "XMLName" + }, + "ejectile": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "A string identifying the ejectile of the reaction (e.g. n). ", + "This attribute is required because the sign on the channel spin ", + "depends on which outgoing particle is the ejectile, and which ", + "the residual." ], + "name": "ejectile", + "required": true, + "type": "XMLName" + }, + "boundaryConditionValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "A value of the boundary condition $B$ in $L = S - B + iP$ to be used for every channel ", + "that points to this resonance reaction. This value overrides the ", + "boundary condition option and/or value given in the \\element{RMatrix} node. This attribute ", + "cannot be used if the boundary condition option is set to \\texttt{Brune} or", + "\\texttt{EliminateShiftFunction} on the \\element{RMatrix} node.", + "The boundary condition value given here can be overriden in a \\texttt{channel} node ", + "that points to this resonance reaction." ], + "name": "boundaryConditionValue", + "required": false, + "type": "Float64" + }, + "eliminated": { + "__class__": "nodes.Attribute", + "default": false, + "description": [ "A flag to indicate whether or not a reaction is eliminated. ", + "This is used for the Reich-Moore approximation for the neutron ", + "radiative capture reaction. At most one reaction can be treated ", + "as eliminated." ], + "name": "eliminated", + "required": false, + "type": "Boolean" + } + }, + "bodyText": null, + "childNodes": { + "Q": { + "__class__": "nodes.ChildNode", + "description": [ "An optional override for the Q value of the reaction given ", + "in the \\texttt{reaction} node." ], + "namespace": "common", + "name": "Q", + "occurrence": "1", + "required": false + }, + "scatteringRadius": { + "__class__": "nodes.ChildNode", + "description": [ "An optional override for the scattering radius for this ", + "reaction." ], + "name": "scatteringRadius", + "occurrence": "1", + "required": false + }, + "hardSphereRadius": { + "__class__": "nodes.ChildNode", + "description": [ "An optional override for the channel radius used in the ", + "calculation of the phase shift $\\phi$ for this reaction." ], + "name": "hardSphereRadius", + "occurrence": "1", + "required": false + }, + "link": { + "__class__": "nodes.ChildNode", + "description": "A link to the corresponding \\texttt{reaction} node.", + "name": "link", + "occurrence": "1", + "required": true + } + }, + "description": [ "The \\texttt{resonanceReaction} node gives information on a single ", + "reaction for which resonances will be given. It contains a link ", + "to the corresponding \\texttt{reaction} node. It also defines some ", + "additional information for use when reconstructing cross sections. ", + "This includes override values for the channel radii to be used for ", + "the calculation of the penetrability $P$, the shift function $S$ ", + "and the phase shift $\\phi$ and whether or not the reaction is ", + "eliminated (as would be the case for neutron capture in the ", + "Reich-Moore approximation)." ], + "name": "resonanceReaction", + "required": true, + "rootNode": false + }, + "spinGroups":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "spinGroup": { + "__class__": "nodes.ChildNode", + "description": [ "The resolved resonance data for a given value of the total ", + "angular momentum and associated parity $J^\\pi$ as well as ", + "the contributing channels." ], + "name": "spinGroup", + "occurrence": "1+", + "required": true + } + }, + "description": [ "The \\texttt{spinGroups} node provides data on all spin groups for which ", + "resonance data is provided." ], + "name": "spinGroups", + "required": true, + "rootNode": false + }, + "spinGroup":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A label string identifying the spin group.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "spin": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The value of the total angular momentum $J$ for the spin ", + "group in units of hbar, given as a fraction, e.g. \\texttt{0}, ", + "\\texttt{1/2}, \\texttt{1}, \\texttt{3/2}, etc." ], + "name": "spin", + "required": true, + "type": "Fraction32" + }, + "parity": { + "__class__": "nodes.Attribute", + "default": 1, + "description": "The parity for the spin group, either \\texttt{1} or \\texttt{-1}.", + "name": "parity", + "required": false, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "channels": { + "__class__": "nodes.ChildNode", + "description": "The channels that are available in this spin group.", + "name": "channels", + "occurrence": "1", + "required": true + }, + "resonanceParameters": { + "__class__": "nodes.ChildNode", + "description": "The resonance parameter table for this spin group.", + "name": "resonanceParameters", + "occurrence": "1", + "required": true + } + }, + "description": [ "The \\texttt{spinGroup} node contains the resolved resonance data for ", + "a given value of the total angular momentum and associated parity ", + "$J^\\pi$." ], + "name": "spinGroup", + "required": true, + "rootNode": false + }, + "channels":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "channel": { + "__class__": "nodes.ChildNode", + "description": [ "A node used to identify the channel and the resonance reaction ", + "to which the channel contributes as well as the override values ", + "to be used for channel related data." ], + "name": "channel", + "occurrence": "1+", + "required": true + } + }, + "description": [ "The \\texttt{channels} section provides data on all reaction channels ", + "for which resonance data is provided in the current spin group. If no ", + "resonance parameters are given (i.e. the ", + "\\texttt{resonanceParameters} node contains an empty table), the ", + "contribution of the potential scattering is still present in the elastic ", + "channel. In this case, only the elastic channel must be specified in the ", + "\\texttt{channels} node." ], + "name": "channels", + "required": false, + "rootNode": false + }, + "channel":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique string identifying the channel in the spin group.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "resonanceReaction": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The label of the resonance reaction (as defined in the ", + "\\texttt{resonanceReaction} nodes) that the channel contributes to." ], + "name": "resonanceReaction", + "required": true, + "type": "bodyText" + }, + "L": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The value of the orbital momentum quantum number $\\ell$ in units of hbar.", + "name": "L", + "required": true, + "type": "Integer32" + }, + "channelSpin": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The value of the channel spin $s$ in units of hbar, given as a ", + "fraction, e.g. \\texttt{0}, \\texttt{1/2}, ", + "\\texttt{1}, \\texttt{3/2}, etc.." ], + "name": "channelSpin", + "required": true, + "type": "Fraction32" + }, + "boundaryConditionValue": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "A value of the boundary condition $B$ in $L = S - B + iP$ to be used for this channel. ", + "This value overrides the boundary condition option and/or value given in the \\element{RMatrix} node ", + "or the boundary condition value in the \\element{resonanceReaction} node. This attribute ", + "cannot be used if the boundary condition option is set to \\texttt{Brune} or", + "\\texttt{EliminateShiftFunction} on the \\element{RMatrix} node." ], + "name": "boundaryConditionValue", + "required": false, + "type": "Float64" + }, + "columnIndex": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The index of the column of the table in the ", + "\\texttt{resonanceParameters} that contains the resonance widths ", + "for this channel." ], + "name": "columnIndex", + "required": true, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "externalRMatrix": { + "__class__": "nodes.ChildNode", + "description": [ "An optional external R-matrix element that needs to be added to ", + "the Reich-Moore R matrix." ], + "name": "externalRMatrix", + "occurrence": "1", + "required": false + }, + "scatteringRadius": { + "__class__": "nodes.ChildNode", + "description": [ "An optional override for the scattering radius for this ", + "channel in the current spin group." ], + "name": "scatteringRadius", + "occurrence": "1", + "required": false + }, + "hardSphereRadius": { + "__class__": "nodes.ChildNode", + "description": [ "An optional override for the channel radius used in the ", + "calculation of the phase shift $\\phi$ for this channel ", + "in the current spin group." ], + "name": "hardSphereRadius", + "occurrence": "1", + "required": false + } + }, + "description": [ "The \\element{channel} node identifies the reaction to which the channel ", + "contributes and can be used to provide channel dependendent override values ", + "for the \\texttt{scatteringRadius} and \\texttt{hardSphereRadius} nodes.", + " ", + "The \\texttt{channel} node can also be used to set a boundary condition ", + "value. This boundary condition value will then override any previously ", + "defined value (defined on the \\element{RMatrix} or \\element{resonanceReaction} ", + "node) and will even override the \\texttt{boundaryCondition} option.", + " ", + "For example: the \\texttt{boundaryCondition} option can be set to ", + "\\texttt{NegativeOrbitalMomentum} which means that the boundary condition ", + "value is set to be equal to minus l for each channel. Setting a ", + "\\texttt{boundaryConditionValue} on a given channel overrides that option." ], + "name": "channel", + "required": false, + "rootNode": false + }, + "resonanceParameters":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "table": { + "__class__": "nodes.ChildNode", + "description": "A table of resonance widths.", + "name": "table", + "occurrence": "1", + "required": true + } + }, + "description": [ "The \\texttt{resonanceParameters} node provides a table of resonance ", + "parameters for the current spin group. The number of columns of the ", + "table is equal to the number of channels that have at least one non ", + "zero width in the current spin group plus one column for the energy ", + "values (column index 0). The number of rows in the table is equal to ", + "the number of resonances that are defined for this spin group. ", + "The column indices used in this table must be given in the ", + "corresponding \\texttt{channel} node in the \\texttt{channels} node of ", + "the current spin group.", + " ", + "The table may be empty to indicate that the spin group only contributes ", + "to potential scattering.", + " ", + "The \\texttt{BreitWigner} node also has a \\texttt{resonanceParameters} ", + "but the structure of the table is different." ], + "name": "resonanceParameters", + "required": true, + "rootNode": false + }, + "BreitWigner":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": true, + "type": "XMLName" + }, + "approximation": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The approximation to the R-matrix resonance formalism to be ", + "used for the resonance reconstruction (either ", + "\\texttt{SingleLevel} or \\texttt{MultiLevel})." ], + "name": "approximation", + "required": true, + "type": "XMLName" + }, + "calculateChannelRadius": { + "__class__": "nodes.Attribute", + "default": "false", + "description": [ "An optional flag to indicate whether or not the channel ", + "radius should be calculated for the calculation of the ", + "penetrability $P$ and shift function $S$." ], + "name": "calculateChannelRadius", + "required": false, + "type": "Boolean" + }, + "useForSelfShieldingOnly": { + "__class__": "nodes.Attribute", + "default": "false", + "description": [ "An optional flag to indicate that resonance parameters are", + "only intended for self-shielding, not for reconstructing a cross section." ], + "name": "useForSelfShieldingOnly", + "required": false, + "type": "Boolean" + } + }, + "bodyText": null, + "childNodes": { + "PoPs_database": { + "__class__": "nodes.ChildNode", + "description": [ "Particle database to be used for the resonance reconstruction. ", + "This element only needs to be given if mass or spin values ", + "different from the particle database used in the parent ", + "\\texttt{reactionSuite} are to be used in the calculations. ", + "The use of this element is deprecated." ], + "name": "PoPs", + "occurrence": "1", + "required": false + }, + "scatteringRadius": { + "__class__": "nodes.ChildNode", + "description": [ "An optional override for the scattering radius for the ", + "resolved resonance region." ], + "name": "scatteringRadius", + "occurrence": "1", + "required": false + }, + "hardSphereRadius": { + "__class__": "nodes.ChildNode", + "description": [ "An optional override for the channel radius used in the ", + "calculation of the phase shift $\\phi$ for the resolved ", + "resonance region." ], + "name": "hardSphereRadius", + "occurrence": "1", + "required": false + }, + "resonanceParameters": { + "__class__": "nodes.ChildNode", + "description": "The resonance parameter table.", + "name": "resonanceParameters", + "occurrence": "1", + "required": false + } + }, + "description": [ "The \\texttt{BreitWigner} node is used to specify the resonance ", + "parameters in the Single-Level or Multi-Level Breit-Wigner approximation. ", + "The use of this element is deprecated in favour of using an ", + "\\texttt{RMatrix} node with the appropriate approximation selected." ], + "name": "BreitWigner", + "required": false, + "rootNode": false + }, + "unresolved":{ + "__class__": "nodes.Node", + "abstractNode": null, + "childUnique" : "yesLabel", + "attributes": { + "domainMin": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The lower energy limit of the resolved resonance range.", + "name": "domainMin", + "required": true, + "type": "Float64" + }, + "domainMax": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The upper energy limit of the resolved resonance range.", + "name": "domainMax", + "required": true, + "type": "Float64" + }, + "domainUnit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The energy unit used for the lower and upper energy limits.", + "name": "domainUnit", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "tabulatedWidths": { + "__class__": "nodes.ChildNode", + "description": ["The unresolved resonance parameters.", + " ", + "Only one instance per evaluation label is allowed."], + "name": "tabulatedWidths", + "occurrence": "choice", + "required": false + } + }, + "description": [ "The \\texttt{unresolved} node provides an unresolved resonance region ", + "over a given energy range. The energy domain of this unresolved ", + "resonance region should not overlap with any of the other resonance ", + "regions defined in the \\texttt{resonances} node." ], + "name": "unresolved", + "required": false, + "rootNode": false + }, + "tabulatedWidths":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": true, + "type": "XMLName" + }, + "approximation": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The approximation to the R-matrix resonance formalism ", + "for resonance reconstruction (currently only ", + "\\attrval{SingleLevelBreitWigner} is supported by ENDF-6 and hence GNDS)." ], + "name": "approximation", + "required": true, + "type": "XMLName" + }, + "useForSelfShieldingOnly": { + "__class__": "nodes.Attribute", + "default": "false", + "description": [ "An optional flag to indicate whether or not the resonance ", + "parameters are provided for self-shielding or scattering ", + "radius purposes only." ], + "name": "useForSelfShieldingOnly", + "required": false, + "type": "Boolean" + } + }, + "bodyText": null, + "childNodes": { + "PoPs_database": { + "__class__": "nodes.ChildNode", + "description": [ "Particle database to be used for the resonance reconstruction. ", + "This element only needs to be given if mass or spin values ", + "different from the particle database used in the parent ", + "\\texttt{reactionSuite} are to be used in the calculations. ", + "The use of this element is deprecated." ], + "name": "PoPs", + "occurrence": "1", + "required": false + }, + "scatteringRadius": { + "__class__": "nodes.ChildNode", + "description": [ "An optional override for the scattering radius for the ", + "unresolved resonance region." ], + "name": "scatteringRadius", + "occurrence": "1", + "required": false + }, + "hardSphereRadius": { + "__class__": "nodes.ChildNode", + "description": [ "An optional override for the channel radius used in the ", + "calculation of the phase shift $\\phi$ for the unresolved ", + "resonance region." ], + "name": "hardSphereRadius", + "occurrence": "1", + "required": false + }, + "resonanceReactions": { + "__class__": "nodes.ChildNode", + "description": "The reactions for which resonance parameters will be provided.", + "name": "resonanceReactions", + "occurrence": "1", + "required": true + }, + "Ls": { + "__class__": "nodes.ChildNode", + "description": [ "The average unresolved resonance parameters for all values ", + "of the orbital angular momentum $\\ell$." ], + "name": "Ls", + "occurrence": "1", + "required": true + } + }, + "description": [ "The \\texttt{tabulatedWidths} node is used to describe average ", + "parameters in the unresolved range. Currently parameters can only ", + "be given in the single-level Breit-Wigner approximation." ], + "name": "tabulatedWidths", + "required": true, + "rootNode": false + }, + "Ls":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "L": { + "__class__": "nodes.ChildNode", + "description": [ "The average unresolved resonance parameters for a given value ", + "of the orbital angular momentum $\\ell$." ], + "name": "L", + "occurrence": "1+", + "required": true + } + }, + "description": [ "The \\texttt{Ls} node is gives the average unresolved resonance ", + "parameters for the values of the orbital angular momentum $\\ell$." ], + "name": "Ls", + "required": true, + "rootNode": false + }, + "L":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": true, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The value of the orbital angular momentum $\\ell$ in units of hbar.", + "name": "value", + "required": true, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "Js": { + "__class__": "nodes.ChildNode", + "description": [ "The average unresolved resonance parameters for all values of the ", + "total angular momentum $J$ allowed by the current orbital angular ", + "momentum $\\ell$."] , + "name": "Js", + "occurrence": "1", + "required": true + } + }, + "description": [ "The \\texttt{L} node is gives the average unresolved resonance ", + "for a given value of the orbital angular momentum $\\ell$. It ", + "contains data for all associated values of the total angular ", + "momentum $J$" ], + "name": "L", + "required": true, + "rootNode": false + }, + "Js":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "J": { + "__class__": "nodes.ChildNode", + "description": [ "The average unresolved resonance parameters for a given value ", + "of the total angular momentum $J$ allowed by the current orbital ", + "angular momentum $\\ell$." ], + "name": "J", + "occurrence": "1+", + "required": true + } + }, + "description": [ "The \\texttt{Js} node gives the average unresolved resonance ", + "parameters for all values of the total angular momentum $J$ ", + "allowed by the current orbital angular momentum $\\ell$." ], + "name": "Js", + "required": true, + "rootNode": false + }, + "J":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": true, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The value of the total angular momentum $J$ for the spin ", + "group in units of hbar, given as a fraction, e.g. \\texttt{0}, ", + "\\texttt{1/2}, \\texttt{1}, \\texttt{3/2}, etc." ], + "name": "value", + "required": true, + "type": "Fraction32" + } + }, + "bodyText": null, + "childNodes": { + "levelSpacing": { + "__class__": "nodes.ChildNode", + "description": [ "The average level spacing for the current orbital angular ", + "momentum $\\ell$ and the current total angular momentum $J$." ], + "name": "levelSpacing", + "occurrence": "1", + "required": true + }, + "widths": { + "__class__": "nodes.ChildNode", + "description": [ "The average resonance parameters for the current orbital angular ", + "momentum $\\ell$ and the current total angular momentum $J$." ], + "name": "widths", + "occurrence": "1", + "required": true + } + }, + "description": [ "The \\texttt{J} node gives the unresolved resonance data for the current ", + "orbital angular momentum $\\ell$ and the current total angular ", + "momentum $J$. It contains level spacing information and resonance widths." ], + "name": "J", + "required": true, + "rootNode": false + }, + "levelSpacing":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "constant1d": { + "__class__": "nodes.ChildNode", + "description": "The level spacing is a constant value.", + "name": "constant1d", + "occurrence": "1", + "required": false + }, + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": [ "The level spacing is an energy dependent function with ", + "a single interpolation range." ], + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": [ "The level spacing is an energy dependent function with ", + "multiple interpolation range." ], + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": [ "The \\texttt{levelSpacing} node gives the average level spacing $D$ ", + "for the current orbital angular momentum $\\ell$ and the current total ", + "angular momentum $J$." ], + "name": "levelSpacing", + "required": true, + "rootNode": false + }, + "widths":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "width": { + "__class__": "nodes.ChildNode", + "description": "The average resonance width for a given channel.", + "name": "width", + "occurrence": "1+", + "required": true + } + }, + "description": [ "The \\texttt{widths} node gives the average resonance widths for each ", + "channel listed in the \\texttt{resonanceReactions} node for the current ", + "orbital angular momentum $\\ell$ and the current total angular ", + "momentum $J$.", + " ", + "If the single Level Breit Wigner aproximation is used, an optional ", + "competitive width can also be given. In this case, the associated ", + "resonance reaction should have its label set to \\texttt{competitive}." ], + "name": "widths", + "required": true, + "rootNode": false + }, + "width":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "resonanceReaction": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The label of the resonance reaction (as defined in the ", + "\\texttt{resonanceReaction} nodes) that the channel contributes to." ], + "name": "resonanceReaction", + "required": true, + "type": "bodyText" + }, + "degreesOfFreedom": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "The number of degrees of freedom to be used to sample the ", + "average width." ], + "name": "degreesOfFreedom", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "constant1d": { + "__class__": "nodes.ChildNode", + "description": "The average width is a constant value.", + "name": "constant1d", + "occurrence": "1", + "required": false + }, + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": [ "The average width is an energy dependent function with ", + "a single interpolation range." ], + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": [ "The average width is an energy dependent function with ", + "multiple interpolation range." ], + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": [ "The \\texttt{width} node gives the average resonance width for a ", + "given channel." ], + "name": "width", + "required": true, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_styles.json b/standards/gnds-2.0/summary_styles.json new file mode 100644 index 000000000..487473ecb --- /dev/null +++ b/standards/gnds-2.0/summary_styles.json @@ -0,0 +1,1206 @@ +{ + "__namespace__":"styles", + "styles":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "evaluated": { + "__class__": "nodes.ChildNode", + "description": "Style for original data created by the evaluator(s).", + "name": "evaluated", + "occurrence": "1+", + "required": false + }, + "crossSectionReconstructed": { + "__class__": "nodes.ChildNode", + "description": "Style for pointwise cross sections produced by reconstructing resonance parameters and combining results with background (if any).", + "name": "crossSectionReconstructed", + "occurrence": "1+", + "required": false + }, + "angularDistributionReconstructed": { + "__class__": "nodes.ChildNode", + "description": "Style for angular distributions produced by reconstructing resonance parameters.", + "name": "angularDistributionReconstructed", + "occurrence": "1+", + "required": false + }, + "CoulombPlusNuclearElasticMuCutoff": { + "__class__": "nodes.ChildNode", + "description": "Style for Coulomb elastic scattering, avoiding divergence at small scattering angles.", + "name": "CoulombPlusNuclearElasticMuCutoff", + "occurrence": "1+", + "required": false + }, + "heated": { + "__class__": "nodes.ChildNode", + "description": "Style for cross sections that have been Doppler broadened to account for thermal motion in the target.", + "name": "heated", + "occurrence": "1+", + "required": false + }, + "averageProductData": { + "__class__": "nodes.ChildNode", + "description": "Style for average outgoing product energy and/or momentum data computed from the original (evaluated) distributions.", + "name": "averageProductData", + "occurrence": "1+", + "required": false + }, + "MonteCarlo_cdf": { + "__class__": "nodes.ChildNode", + "description": "Style for data where cumulative probability densities (cdfs) have been pre-computed and stored alongside pdfs for faster Monte Carlo sampling.", + "name": "MonteCarlo_cdf", + "occurrence": "1+", + "required": false + }, + "griddedCrossSection": { + "__class__": "nodes.ChildNode", + "description": "Style for data where all reaction cross sections are put on a union grid for more efficient Monte Carlo sampling.", + "name": "griddedCrossSection", + "occurrence": "1+", + "required": false + }, + "URR_probabilityTables": { + "__class__": "nodes.ChildNode", + "description": "Style for data cross section probability tables were generated for the unresolved resonance region.", + "name": "URR_probabilityTables", + "occurrence": "1+", + "required": false + }, + "heatedMultiGroup": { + "__class__": "nodes.ChildNode", + "description": "This style specifies parameters used for generating multi-grouped data. Some of the parameters specified include the multi-group boundaries for each particle processed via the \\element{transportables} node, and the \\element{flux} weight and \\element{inverseSpeed} for the projectile.", + "name": "heatedMultiGroup", + "occurrence": "1+", + "required": false + }, + "SnElasticUpScatter": { + "__class__": "nodes.ChildNode", + "description": "Style for data where a multi-group upscatter correction is applied to elastic scattering.", + "name": "SnElasticUpScatter", + "occurrence": "1+", + "required": false + } + }, + "description": [ "The \\element{styles} node contains a list of \\element{style} nodes. Each style describes either information about its ", + "evaluated data or information about its processed data. For example, the \\element{heated} style (see ", + "Section~\\ref{format:styles:heated}) defines cross sections that have been heated (i.e. Doppler broadened) to a ", + "temperature $T$. The following is an example of a \\element{heated} style: ", + "\n\\begin{minted}[frame=single,fontsize=\\small]{xml}\n", + " \n", + " \n", + "\\end{minted}\n", + "In this example, all cross section forms (i.e. representations) with their style attribute equal to \\attrval{heated1}", + "have been heated to 600 K on the date 2016-01-01. The \\attr{derivedFrom} attribute indicates the style before heating.", + "In addition, the code that heated the cross sections and its input should be listed under a \\code\\ element.\n"], + "name": "styles", + "required": true, + "rootNode": false + }, + + "evaluated":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were last released.", + "name": "date", + "required": true, + "type": "date" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from. For example, multi-group data are often derived from a \\element{heated} style.", + "name": "derivedFrom", + "required": false, + "type": "XMLName" + }, + "library": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The name of the library for this evaluation (e.g. ``ENDF/B'', ``JEFF'', ``JENDL'').", + "name": "library", + "required": true, + "type": "XMLName" + }, + "version": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The version of this library's release (e.g. ``8.0'', ``3.3'').", + "name": "version", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "projectileEnergyDomain": { + "__class__": "nodes.ChildNode", + "description": "Lower and upper limits of projectile incident energy included in the evaluation.", + "name": "projectileEnergyDomain", + "occurrence": "1", + "required": true + }, + "temperature": { + "__class__": "nodes.ChildNode", + "description": "The temperature the data are evaluated at.", + "namespace": "styles", + "name": "temperature", + "occurrence": "1", + "required": true + }, + "documentation": { + "__class__": "nodes.ChildNode", + "description": [ + "Documentation as described in document~\\cite{Documentation}.", + "As the \\element{evaluated} style describes the source of all derived data styles in this \\element{reactionSute},", + "this element contains main documentation for the entire \\element{reactionSuite}.", + "The \\element{documentation} element provides the metadata needed for external citation of the present dataset."], + "name": "documentation", + "occurrence": "1", + "required": true + } + }, + "description": [ + "This style denotes evaluated data (i.e. data created by the evaluator(s)). ", + "More than one \\element{evaluated} style is allowed.", + "Each \\element{evaluated} style represents a revision of the evaluated data. ", + "If a style represents a revision,", + "its \\element{derivedFrom} must point to the prior \\element{evaluated} style." + ], + "name": "evaluated", + "required": false, + "rootNode": false + }, + + "projectileEnergyDomain":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + }, + "max": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The maximum projectile energy for the evaluation.", + "name": "max", + "required": true, + "type": "Float64" + }, + "min": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The minimum projectile energy for the evaluation.", + "name": "min", + "required": true, + "type": "Float64" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The unit for the projectile energy minimum and maximum.", + "name": "unit", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "This element stores the energy domain of the projectile (in the lab frame) along with a unit.", + "All \\element{reaction} nodes in the evaluation should span \\textit{at least} this domain, although some may extend past the domain." + ], + "name": "projectileEnergyDomain", + "required": true, + "rootNode": false + }, + "temperature":{ + "__class__": "nodes.Node", + "abstractNode": "physicalQuantity", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Floating-point value of the temperature.", + "name": "value", + "required": true, + "type": "Float64" + }, + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Temperature unit, e.g. `K' or `eV/k'.", + "name": "unit", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation specific to the physical quantity.", + "name": "documentation", + "occurrence": "1", + "required": false + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": "The \\elemlink{uncertainty} node.", + "namespace": "pops", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Specifies the average temperature of the target. In general the `evaluated' style has a temperature of `0 K', while derived data", + "are Doppler broadened to higher temperature." + ], + "name": "temperature", + "required": true, + "rootNode": false + }, + + "crossSectionReconstructed":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string indicating the last time the data for this style were last updated.", + "name": "date", + "required": true, + "type": "date" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique string identifier for the style.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Contains the label of another style from which reconstructed cross sections were derived. The derivedFrom style is usually `evaluated'.", + "name": "derivedFrom", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "temperature": { + "__class__": "nodes.ChildNode", + "description": "The temperature the data are evalauted at.", + "namespace": "styles", + "name": "temperature", + "occurrence": "1", + "required": false + }, + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "This style denotes cross section data that have been reconstructed from resonance parameters.", + "name": "crossSectionReconstructed", + "required": false, + "rootNode": false + }, + + "angularDistributionReconstructed":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string indicating the last time the data for this style were last updated.", + "name": "date", + "required": true, + "type": "date" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique string identifier for the style.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Contains the label of another style from which reconstructed angular distribution were derived. The derivedFrom style is usually `evaluated'.", + "name": "derivedFrom", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "temperature": { + "__class__": "nodes.ChildNode", + "description": "The temperature the data are evalauted at.", + "namespace": "styles", + "name": "temperature", + "occurrence": "1", + "required": false + }, + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "This style denotes angular distribution data that have been reconstructed from resonance parameters.", + "name": "angularDistributionReconstructed", + "required": false, + "rootNode": false + }, + + "CoulombPlusNuclearElasticMuCutoff":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "muCutoff": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The upper limit of $\\mu$.", + "name": "muCutoff", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": [ + "For Coulomb interactions the cross section is infinite due to a singularity at $\\mu = 1.0$.", + "Because of this, a cross section for Coulomb interactions only represents the integral of the $d\\sigma(E,\\mu)/d\\mu$ from $\\mu = -1.0$ to \\attrval{muCutoff}." + ], + "name": "CoulombPlusNuclearElasticMuCutoff", + "required": false, + "rootNode": false + }, + + "heated":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "temperature": { + "__class__": "nodes.ChildNode", + "description": "The temperature the data for this style were heated to.", + "namespace": "styles", + "name": "temperature", + "occurrence": "1", + "required": true + }, + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "This style represents data that have been heated to a particular temperature. For example, cross section may be heated (i.e. Doppler broadened).", + "name": "heated", + "required": false, + "rootNode": false + }, + + "averageProductData":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string indicating the last time the data for this style were last updated.", + "name": "date", + "required": true, + "type": "date" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A unique string identifier for the style.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Contains the label of another style from which reconstructed cross sections were derived. The derivedFrom style is usually `evaluated'.", + "name": "derivedFrom", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "temperature": { + "__class__": "nodes.ChildNode", + "description": "The temperature the data for this style were heated to.", + "namespace": "styles", + "name": "temperature", + "occurrence": "1", + "required": true + }, + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "This style signifies data calulated for the \\element{averageProductEnergy} and \\element{averageProductMomentum} components.", + "name": "averageProductData", + "required": false, + "rootNode": false + }, + + "MonteCarlo_cdf":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This style represents data that have distributions processed for use in Monte Carlo transport codes. Distribution $P(\\mu,E'|E)$ must be converted", + "to $P(\\mu|E) \\times P(E'|E,\\mu)$, distribution $P(E',\\mu|E)$ must be converted to $P(E'|E) \\times P(\\mu|E,E')$. Each function1d of $P(E'|E)$, $P(\\mu,E)$, $P(E'|E,\\mu)$ and $P(\\mu|E,E')$ (including the $P(E'|E)$ in Kalbach-Mann) must be a \\element{xs\\_pdf\\_cdf1d} node." + ], + "name": "MonteCarlo_cdf", + "required": false, + "rootNode": false + }, + + "griddedCrossSection":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "grid": { + "__class__": "nodes.ChildNode", + "description": "The common energy grid as used in Monte Carlo transport. See section~\\ref{format:gpdc:grid}.", + "name": "grid", + "occurrence": "1", + "required":true + }, + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This style signifies that cross section data have been put on a common energy grid as used in Monte Carlo transport. ", + "The grid is given in the \\element{grid} child node. ", + "Each \\element{griddedCrossSection} node represents the reaction data for one temperature. ", + "The temperature is specified by a \\element{heated} style which must be in the \\element{derivedFrom} lineage."] + , + "name": "griddedCrossSection", + "required": false, + "rootNode": false + }, + + "heatedMultiGroup":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "transportables": { + "__class__": "nodes.ChildNode", + "description": "Contains a list of \\elemlink{transportable} nodes. Each \\element{transportable} specifies the multi-group boundaries for a specified particle. There can be at most one \\element{transportable} per particle id.", + "name": "transportables", + "occurrence": "1", + "required": true + }, + "flux": { + "__class__": "nodes.ChildNode", + "description": "The flux used when multi-grouping.", + "name": "flux", + "occurrence": "1", + "required": true + }, + "inverseSpeed": { + "__class__": "nodes.ChildNode", + "description": "The multi-group inverse speeds $v_g$ for group $g$. That is, $v_g = \\int_g dE \\, f(E) / v(E)$, where $E$ is the projectile's energy, $f(E)$ is a flux, $v(E)$ is the projectile's velocity and the integral is over group $g$.", + "name": "inverseSpeed", + "occurrence": "1", + "required": true + }, + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This style represents data that have been heated and multi-grouped. The temperature is inherited from the \\attr{derivedFrom} lineage.", + "The multi-group boundaries are specified under a \\elemlink{transportables} node. The flux, which can be at a temperature relevant for the reaction data, ", + "is specified by the \\element{flux} child node." + ], + "name": "heatedMultiGroup", + "required": false, + "rootNode": false + }, + + "transportables":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "transportable": { + "__class__": "nodes.ChildNode", + "description": "Each \\elemlink{transportable} specifies multi-group parameters for each particle processed for multi-group transport.", + "name": "transportable", + "occurrence": "1+", + "required": true + } + }, + "description": "Contains a list of particles (i.e. \\elemlink{transportable} nodes) for which multi-group processing was performed. Each particle's id is specified via the \\attr{label} attribute which must be unique for each transportable.", + "name": "transportables", + "required": false, + "rootNode": false + }, + + "transportable":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "conserve": { + "__class__": "nodes.Attribute", + "default": "number", + "description": "Defines the outgoing particle's energy weight used when calculating a product's transfer matrices. Allowed values are \\attrval{number} with a weight of 1 and \\attrval{energy} with a weight of the product's outgoing energy.", + "name": "conserve", + "required": false, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The transportable particle id.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "multiGroup": { + "__class__": "nodes.ChildNode", + "description": "Contains the multi-group boundaries for the specified particle.", + "name": "multiGroup", + "occurrence": "1", + "required": true + } + }, + "description": "Contains a particle id and its associated multi-group boundaries.", + "name": "transportable", + "required": true, + "rootNode": false + }, + + "multiGroup":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An identifier for the multi-group boundaries.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "grid": { + "__class__": "nodes.ChildNode", + "description": "The axes information for the multi-group boundaries. See Section~\\ref{format:gpdc:grid}. The grid values are the multi-group boundaries.", + "name": "grid", + "occurrence": "1", + "required": true + } + }, + "description": "Contains a multi-group identifier and its multi-group boundaries.", + "name": "multiGroup", + "required": true, + "rootNode": false + }, + + "flux":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An identifier string for the flux.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": [ + "The flux $f(E,\\mu)$.", + "The axes are incident particle energy, Legendre order and flux. See section~\\ref{format:gpdc:XYs2d}." + ], + "name": "XYs2d", + "occurrence": "1", + "required": true + } + }, + "description": "For \\element{heatedMultiGroup} data, this node specifies the flux used to multi-group the data.", + "name": "flux", + "required": true, + "rootNode": false + }, + + "inverseSpeed":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "gridded1d": { + "__class__": "nodes.ChildNode", + "description": "Contains the inverse speeds for each group (group boundaries are listed in the \\element{multiGroup} ancestor).", + "name": "gridded1d", + "occurrence": "1", + "required": true + } + }, + "description": "The multi-group inverse speeds $v_g$ for group $g$. That is, $v_g = \\int_g dE \\, f(E) / v(E)$ where $E$ is the projectile's energy, $f(E)$ is a flux, $v(E)$ the projectile's velocity and the integral is over group $g$.", + "name": "inverseSpeed", + "required": true, + "rootNode": false + }, + + "SnElasticUpScatter":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "upperCalculatedGroup": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Index of the highest-energy group (counting from 0) impacted by the upscatter correction.", + "name": "upperCalculatedGroup", + "required": false, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "Like style \\element{heatedMultiGroup} but with an upscatter correction included for elastic scattering.", + "name": "SnElasticUpScatter", + "required": false, + "rootNode": false + }, + + "URR_probabilityTables":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "Indicates that cross section probability tables ($P(\\sigma | E)$) were generated for use in Monte Carlo transport.", + "name": "URR_probabilityTables", + "required": false, + "rootNode": false + }, + + "Bondarenko":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "sigmaZeros": { + "__class__": "nodes.ChildNode", + "description": "Contains a list of `sigma-0' values at which Bondarko factors were computed.", + "name": "sigmaZeros", + "occurrence": "1", + "required": true + }, + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "Data style for Bondarenko self-shielding factors for deterministic transport.", + "name": "Bondarenko", + "required": false, + "rootNode": false + }, + "sigmaZeros":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "values": { + "__class__": "nodes.ChildNode", + "description": "List of sigma-zero values (stored as Float64).", + "name": "values", + "occurrence": "1", + "required": true + } + }, + "description": "Data style for Bondarenko self-shielding factors for deterministic transport.", + "name": "sigmaZeros", + "required": false, + "rootNode": false + }, + + "multiBand":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "numberOfBands": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Integer for the number of bands per group.", + "name": "numberOfBands", + "required": true, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "Data style for a proposed alternative to Bondarenko factors for self-shielding in deterministic transport.", + "name": "multiBand", + "required": false, + "rootNode": false + }, + + "equalProbableBins":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "numberOfBins": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Integer for the number of equal-probable bins.", + "name": "numberOfBins", + "required": true, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "Style for distributions that have been converted to equal-probable bins for faster Monte Carlo sampling.", + "name": "equalProbableBins", + "required": false, + "rootNode": false + }, + + "realization":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "date": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid date string representing when the data for this style were processed.", + "name": "date", + "required": true, + "type": "date" + }, + "derivedFrom": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The style that the data associated with this style were derived from.", + "name": "derivedFrom", + "required": true, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A string identifier for the style and all data associated with it. The identifier must be unique among all the styles.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "documentation": { + "__class__": "nodes.ChildNode", + "description": "Documentation for the style.", + "name": "documentation", + "occurrence": "1", + "required": false + } + }, + "description": "Style indicating that data were generated by randomly sampling from a covariance matrix, e.g. for uncertainty quantification.", + "name": "realization", + "required": false, + "rootNode": false + } + +} diff --git a/standards/gnds-2.0/summary_transport.json b/standards/gnds-2.0/summary_transport.json new file mode 100644 index 000000000..76a1da8a2 --- /dev/null +++ b/standards/gnds-2.0/summary_transport.json @@ -0,0 +1,2327 @@ +{ + "__namespace__":"transport", + "reactionSuite":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "evaluation": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the evaluation, e.g. `ENDF-VIII.0'", + "name": "evaluation", + "required": true, + "type": "XMLName" + }, + "format": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["GNDS format version, e.g. `2.1'. ", "See Appendix \\ref{append:versioning} for an extended discussion of the GNDS version numbering."], + "name": "format", + "required": true, + "type": "XMLName" + }, + "projectile": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Projectile particle id.", + "name": "projectile", + "required": true, + "type": "XMLName" + }, + "projectileFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Options are `lab' or `centerOfMass'", + "name": "projectileFrame", + "required": true, + "type": "frame" + }, + "target": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Target particle id.", + "name": "target", + "required": true, + "type": "XMLName" + }, + "interaction": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ "Defines the type of interaction for the reaction data contained within the reactionSuite. Options are `nuclear', `atomic' and `thermalNeutronScatteringLaw'. ", + "For example, a photo-nuclear reactionSuite must have a value of `nuclear' while a photo-atomic reactionSuite must have a value of `atomic'." ], + "name": "interaction", + "required": true, + "type": "interaction" + } + }, + "bodyText": null, + "childNodes": { + "externalFiles": { + "__class__": "nodes.ChildNode", + "description": "stores a list of external files related to this \\element{reactionSuite}. Often used to link a \\element{reactionSuite} to one or more \\element{covarianceSuite} files.", + "name": "externalFiles", + "occurrence": "1", + "required": false + }, + "styles": { + "__class__": "nodes.ChildNode", + "description": ["Element containing a list of styles inside this covarinceSuite. Each style describes", + "information about the evalualated data (e.g. library, version) representation and each processed data representation."], + "name": "styles", + "occurrence": "1", + "required": true + }, + "PoPs_database": { + "__class__": "nodes.ChildNode", + "description": "Particle database, as described in document~\\cite{PoPs}. The database describes all particles involved in the reactionSuite, including projectile, target and reaction products.", + "name": "PoPs", + "occurrence": "1", + "required": true + }, + "resonances": { + "__class__": "nodes.ChildNode", + "description": "Describes resonance parameters.", + "name": "resonances", + "occurrence": "1", + "required": false + }, + "reactions": { + "__class__": "nodes.ChildNode", + "description": "List of all exclusive reaction nodes. The sum of the cross sections from each reaction must sum to the total cross section for neutral incident particles.", + "name": "reactions", + "occurrence": "1", + "required": false + }, + "orphanProducts": { + "__class__": "nodes.ChildNode", + "description": "Collection of products not associated with a particlar reaction. In legacy evaluations, this element is used to store gamma-rays that are observed in experiment but whose provenance is unknown.", + "name": "orphanProducts", + "occurrence": "1", + "required": false + }, + "sums": { + "__class__": "nodes.ChildNode", + "description": "The \\elemlink{sums} node contains cross sections that are summations over two or more reaction cross sections, and also multiplicities that are summations over two or more reaction product multiplicities.", + "name": "sums", + "occurrence": "1", + "required": false + }, + "fissionComponents": { + "__class__": "nodes.ChildNode", + "description": "List of partial fission cross sections, often used to give first-chance, second-chance, etc. fission without supplying distributions for each chance. ", + "name": "fissionComponents", + "occurrence": "1", + "required": false + }, + "productions": { + "__class__": "nodes.ChildNode", + "description": "List of production reactions.", + "name": "productions", + "occurrence": "1", + "required": false + }, + "incompleteReactions": { + "__class__": "nodes.ChildNode", + "description": "List of reactions where only some data are available. May be used to store very small cross sections (i.e. sub-actinide fission) or for sharing evaluations where some reactions are still not complete.", + "name": "incompleteReactions", + "occurrence": "1", + "required": false + }, + "applicationData": { + "__class__": "nodes.ChildNode", + "description": "List of application-specific data.", + "name": "applicationData", + "occurrence": "1", + "required": false + } + }, + "description": "This element stores an evaluation of the reactions involving the combination of a projectile and target.", + "name": "reactionSuite", + "required": false, + "rootNode": true + }, + + "interaction": { + "__class__": "nodes.EnumeratedTypeNode", + "description": "", + "name": "interaction", + "allowedValues":["nuclear", "atomic", "thermalNeutronScatteringLaw"] + }, + + "reactions":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "reaction": { + "__class__": "nodes.ChildNode", + "description": "A \\texttt{reaction}", + "name": "reaction", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "The \\element{reactions} section collects all of the \\element{reaction} elements.", + "The sum of the cross sections from all \\element{reaction} elements inside \\element{reactions} should", + "be equal to the total cross section (note that the total cross section is \\textit{not} stored in", + "\\element{reactions} but rather inside \\element{sums} (see section~\\ref{format:transport:sums})." + ], + "name": "reactions", + "required": false, + "rootNode": false + }, + "reaction":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "ENDF_MT": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The ENDF MT number for this reaction. This attribute is currently required, ", + "but should be considered deprecated. Future evaluations may include reactions ", + "with no MT equivalent, so codes should not rely on the \\texttt{ENDF\\_MT}."], + "name": "ENDF_MT", + "required": true, + "type": "Integer32" + }, + "fissionGenre": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Identifies the type of fission. Must be one of `total', `firstChance', `secondChance', etc.", + "name": "fissionGenre", + "required": false, + "type": "XMLName" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Arbitrary string identifier. It must be unique among all other \\element{reaction} elements.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "doubleDifferentialCrossSection": { + "__class__": "nodes.ChildNode", + "description": "Differential cross section $d\\sigma(E)/dE'd\\Omega$ or $d\\sigma(E)/d\\Omega$ if using two-body kinematics.", + "name": "doubleDifferentialCrossSection", + "occurrence": "1", + "required": false + }, + "crossSection": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "crossSection", + "occurrence": "1", + "required": true + }, + "outputChannel": { + "__class__": "nodes.ChildNode", + "description": "Describes the secondary particle emissions from the reaction", + "name": "outputChannel", + "occurrence": "1", + "required": true + } + }, + "description": "A nuclear reaction is a process in which nucleus or nuclear particles changes by producing a set of products, either through spontaneous decay or particle collision. The \\element{reaction} element collects the information pertaining to the final state of the reaction.", + "name": "reaction", + "required": false, + "rootNode": false + }, + "sums":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "crossSectionSums": { + "__class__": "nodes.ChildNode", + "description": "Contains one or more sums of partial cross sections.", + "name": "crossSectionSums", + "occurrence": "1", + "required": true + }, + "multiplicitySums": { + "__class__": "nodes.ChildNode", + "description": [ + "Contains one or more sums of product multiplicites. Each sum should only include multiplicities for a single type of particle. Most often used for outgoing photons", + "and fission neutrons (e.g. to store `total nubar' as the sum of prompt + delayed nubar)." + ], + "name": "multiplicitySums", + "occurrence": "1", + "required": false + } + }, + "description": [ + "The \\element{sums} node contains two child nodes: ", + "cross section nodes, which are summations over two or more reaction cross sections, and ", + "multiplicities, which are summations over two or more reaction product multiplicities."], + "name": "sums", + "required": false, + "rootNode": false + }, + "outputChannel":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "genre": { + "__class__": "nodes.Attribute", + "default": null, + "description": "This can have a value of either \\element{twoBody} or \\element{NBody}", + "name": "genre", + "required": false, + "type": "XMLName" + }, + "process": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "process", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "Q": { + "__class__": "nodes.ChildNode", + "description": "The $Q$-value of the reaction. Fission reactions have a different format than other reactions.", + "namespace": "common", + "name": "Q", + "occurrence": "1", + "required": false + }, + "products": { + "__class__": "nodes.ChildNode", + "description": "A list of secondary products from the reaction", + "namespace": "common", + "name": "products", + "occurrence": "1", + "required": false + }, + "fissionFragmentData": { + "__class__": "nodes.ChildNode", + "description": "For use in fission reactions only. Contains information about delayed neutrons, fission product yields and energy partition.", + "name": "fissionFragmentData", + "occurrence": "1", + "required": false + } + + }, + "description": "The \\element{outputChannel} node contains all the data for the results of a reaction, including the Q-value and all outgoing products.", + "name": "outputChannel", + "required": false, + "rootNode": false + }, + "crossSectionSums":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "crossSectionSum": { + "__class__": "nodes.ChildNode", + "description": "The \\element{crossSectionSum} is similar to the \\element{crossSection}, but is a sum of the cross section for multiple partial reactions.", + "name": "crossSectionSum", + "occurrence": "1+", + "required": false + } + }, + "description": null, + "name": "crossSectionSums", + "required": false, + "rootNode": false + }, + "crossSection":{ + "__class__": "nodes.Node", + "abstractNode": "label", + "attributes": { + "label": { + "default": null, + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childUnique" : "yesLabel", + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "For pointwise data using a single interpolation everywhere.", + "name": "XYs1d", + "occurrence": "choice", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": "Cross section stored in multiple regions, with different interpolations and/or discontinuities.", + "name": "regions1d", + "occurrence": "choice", + "required": false + }, + "resonancesWithBackground": { + "__class__": "nodes.ChildNode", + "description": "Indicates that resonance parameters need to be reconstructed and added to the background to obtain the cross section.", + "name": "resonancesWithBackground", + "occurrence": "choice", + "required": false + }, + "CoulombPlusNuclearElastic": { + "__class__": "nodes.ChildNode", + "description": "This is either a container holding the differential charged particle scattering cross section or a reference to said container.", + "name": "CoulombPlusNuclearElastic", + "occurrence": "choice", + "required": false + }, + "thermalNeutronScatteringLaw1d": { + "__class__": "nodes.ChildNode", + "description": "This contains a reference to the double-differential thermal neutron scattering law cross section.", + "name": "thermalNeutronScatteringLaw1d", + "occurrence": "choice", + "required": false + }, + "reference": { + "__class__": "nodes.ChildNode", + "description": "Link to another cross section form, e.g. in another reaction.", + "name": "reference", + "occurrence": "choice", + "required": false + }, + "gridded1d": { + "__class__": "nodes.ChildNode", + "description": "Grouped (and possibly flux-weighted) cross section. Appears in processed files only.", + "name": "gridded1d", + "occurrence": "choice", + "required": false + }, + "Ys1d": { + "__class__": "nodes.ChildNode", + "description": "Y-values, used when a common grid is used for multiple reaction cross sections for more efficient Monte Carlo sampling. Appears in processed files only.", + "name": "Ys1d", + "occurrence": "choice", + "required": false + }, + "URR_probabilityTables1d": { + "__class__": "nodes.ChildNode", + "description": "Stores cross section probability tables $P(\\sigma | E)$ to better capture the rapid cross section fluctuations possible in the unresolved resonance region. This element appears in processed files only.", + "name": "URR_probabilityTables1d", + "occurrence": "choice", + "required": false + } + }, + "description": [ + "The effective target area for a particular reaction or reaction-like quantity on a given target, ", + "$\\sigma(E)$. Child elements of a \\element{crossSection} correspond to various representations of ", + "the cross section. At least one element that describes the dependance of the cross section as a ", + "function of energy is required. For evaluated files, one element must contain the \\attr{label}=\\attrval{eval} attribute." + ], + "name": "crossSection", + "required": false, + "rootNode": false + }, + "resonancesWithBackground":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} node associated with these data.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "resonancesLink": { + "__class__": "nodes.ChildNode", + "description": "Link to the resonance parameters that have to be combined with the background.", + "name": "resonances", + "occurrence": "1", + "required": true + }, + "background": { + "__class__": "nodes.ChildNode", + "description": "The background cross section to be applied.", + "name": "background", + "occurrence": "1", + "required": true + }, + "uncertainty": { + "__class__": "nodes.ChildNode", + "description": null, + "namespace": "containers", + "name": "uncertainty", + "occurrence": "1", + "required": false + } + }, + "description": [ "The \\element{resonancesWithBackground} node describes the cross ", + "sections as a set of resonance parameters with associated ", + "background cross sections." ], + "name": "resonancesWithBackground", + "required": false, + "rootNode": false + }, + "resonancesLink":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Label for this link.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "xPath link to the \\element{resonances} section.", + "name": "href", + "required": true, + "type": "bodyText" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Links to the \\element{resonances} section defined under the \\element{reactionSuite}.", + "name": "resonances", + "required": false, + "rootNode": false + }, + "background":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "resolvedRegion": { + "__class__": "nodes.ChildNode", + "description": "The background cross section in the resolved resonance region.", + "name": "resolvedRegion", + "occurrence": "1", + "required": false + }, + "unresolvedRegion": { + "__class__": "nodes.ChildNode", + "description": "The background cross section in the unresolved resonance region.", + "name": "unresolvedRegion", + "occurrence": "1", + "required": false + }, + "fastRegion": { + "__class__": "nodes.ChildNode", + "description": "The cross section in the fast region beyond the resolved and unresolved resonance region.", + "name": "fastRegion", + "occurrence": "1", + "required": false + } + }, + "description": [ "The \\element{background} gives the background cross sections that ", + "have to be added to the resonance parameters to obtain the full set ", + "of cross sections." ], + "name": "background", + "required": false, + "rootNode": false + }, + "resolvedRegion":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childUnique" : "yes", + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": [ "The background cross section is an energy dependent function with ", + "a single interpolation range." ], + "name": "XYs1d", + "occurrence": "choice", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": [ "The background cross section is an energy dependent function with ", + "multiple interpolation ranges." ], + "name": "regions1d", + "occurrence": "choice", + "required": false + } + }, + "description": [ "The \\element{resolvedRegion} gives the background cross section in ", + "the resolved resonance region." ], + "name": "resolvedRegion", + "required": false, + "rootNode": false + }, + "unresolvedRegion":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childUnique" : "yes", + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": [ "The background cross section is an energy dependent function with ", + "a single interpolation range." ], + "name": "XYs1d", + "occurrence": "choice", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": [ "The background cross section is an energy dependent function with ", + "multiple interpolation ranges." ], + "name": "regions1d", + "occurrence": "choice", + "required": false + } + }, + "description": [ "The \\element{unresolvedRegion} gives the background cross section in ", + "the unresolved resonance region." ], + "name": "unresolvedRegion", + "required": false, + "rootNode": false + }, + "fastRegion":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childUnique" : "yes", + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": [ "The cross section as an energy dependent function with ", + "a single interpolation range." ], + "name": "XYs1d", + "occurrence": "choice", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": [ "The cross section as an energy dependent function with ", + "multiple interpolation ranges." ], + "name": "regions1d", + "occurrence": "choice", + "required": false + } + }, + "description": [ "The \\element{fastRegion} gives the entire cross section in the fast region,", + "beyond the resolved and unresolved resonance region." ], + "name": "fastRegion", + "required": false, + "rootNode": false + }, + "URR_probabilityTables1d":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} node associated with these data.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": "Probability distribution stored as an \\element{XYs2d}.", + "name": "XYs2d", + "occurrence": "choice", + "required": false + }, + "regions2d": { + "__class__": "nodes.ChildNode", + "description": "Probability distribution stored as a \\element{regions2d}.", + "name": "regions2d", + "occurrence": "choice", + "required": false + } + }, + "description": [ "The \\element{URR\\_probabilityTables1d} gives probability distributions for the", + "cross section as a function of incident energy, $P(\\sigma | E)$. It is derived from the", + "average widths and level spacings in the \\element{unresolved} resonance section, and is used in", + "in Monte Carlo transport codes. The child \\element{XYs2d} or \\element{regions2d} should", + "generally use an \\attr{interpolationQualifier} like `unitBase' since the cross section domain", + "varies with incident energy." + ], + "name": "URR_probabilityTables1d", + "required": false, + "rootNode": false + }, + "crossSectionSum":{ + "__class__": "nodes.Node", + "abstractNode": "labelNode", + "attributes": { + "ENDF_MT": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The corresponding ENDF MT number.", + "name": "ENDF_MT", + "required": false, + "type": "Integer32" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An arbitrary, but unique identifier for the summed cross section.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "Q": { + "__class__": "nodes.ChildNode", + "description": "The $Q$-value of the summed reaction.", + "namespace": "common", + "name": "Q", + "occurrence": "1", + "required": true + }, + "crossSection": { + "__class__": "nodes.ChildNode", + "description": "The summed cross section values.", + "name": "crossSection", + "occurrence": "1", + "required": true + }, + "summands": { + "__class__": "nodes.ChildNode", + "description": "A list of links to the partial cross sections that are the summands (hence the name of the element) of the summed reaction.", + "name": "summands", + "occurrence": "1", + "required": true + } + }, + "description": "The \\element{crossSectionSum} is similar to the \\element{crossSection}, but is a sum of the cross section for multiple partial reactions.", + "name": "crossSectionSum", + "required": false, + "rootNode": false + }, + "doubleDifferentialCrossSection":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childUnique": true, + "childNodes": { + "regions3d": { + "__class__": "nodes.ChildNode", + "description": "For a differential cross section broken up into incident energy regions. Regions may contain different interpolations, or different representations (i.e. a reference for one incident energy range followed by a CoulombPlusNuclearElastic in another energy range). ", + "name": "regions3d", + "occurrence": "1", + "required": false + }, + "XYs3d": { + "__class__": "nodes.ChildNode", + "description": "A pointwise table of $\\sigma(\\mu, E' | E)$ or $\\sigma(E', \\mu | E)$ values.", + "name": "XYs3d", + "occurrence": "1", + "required": false + }, + "CoulombPlusNuclearElastic": { + "__class__": "nodes.ChildNode", + "description": "This is either a container holding the differential charged particle scattering cross section or a reference to said container.", + "name": "CoulombPlusNuclearElastic", + "occurrence": "1", + "required": false + }, + "reference": { + "__class__": "nodes.ChildNode", + "description": "A link to resonance data, from which\n the differential cross section should be derived.", + "name": "reference", + "occurrence": "1", + "required": false + }, + "coherentPhotonScattering": { + "__class__": "nodes.ChildNode", + "description": "This is either a container holding the coherent photon scattering cross section or a reference to said container.", + "name": "coherentPhotonScattering", + "occurrence": "1", + "required": false + }, + "incoherentPhotonScattering": { + "__class__": "nodes.ChildNode", + "description": "This is either a container holding the incoherent photon scattering cross section or a reference to said container.", + "name": "incoherentPhotonScattering", + "occurrence": "1", + "required": false + }, + "thermalNeutronScatteringLaw_coherentElastic": { + "__class__": "nodes.ChildNode", + "description": "Contains the coherent elastic double-differential cross section for thermal neutrons.", + "name": "thermalNeutronScatteringLaw_coherentElastic", + "occurrence": "1", + "required": false + }, + "thermalNeutronScatteringLaw_incoherentElastic": { + "__class__": "nodes.ChildNode", + "description": "Contains the incoherent elastic double-differential cross section for thermal neutrons.", + "name": "thermalNeutronScatteringLaw_incoherentElastic", + "occurrence": "1", + "required": false + }, + "thermalNeutronScatteringLaw_incoherentInelastic": { + "__class__": "nodes.ChildNode", + "description": "Contains the incoherent inelastic double-differential cross section for thermal neutrons.", + "name": "thermalNeutronScatteringLaw_incoherentInelastic", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This node represents multi-dimensional differential cross section data, ", + "e.g. $d\\sigma(E)/d\\mu$ or $d\\sigma(E)/d\\mu dE'$. In most cases, such as in ", + "charged particle, thermal neutron or (in)coherent x-ray scattering, ", + "a parameterised form of the data exists to simplify the representation of the tabulated data." + ], + "name": "doubleDifferentialCrossSection", + "required": false, + "rootNode": false + }, + "coherentPhoton":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": {}, + "description": "coherentPhoton for doubleDifferentialCrossSection", + "name": "coherentPhoton", + "required": false, + "rootNode": false + }, + "incoherentPhoton":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": {}, + "description": "incoherentPhoton for doubleDifferentialCrossSection", + "name": "incoherentPhoton", + "required": false, + "rootNode": false + }, + "multiplicitySums":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "multiplicitySum": { + "__class__": "nodes.ChildNode", + "description": "Sums over the multiplicity of multiple products of the same type of particle.", + "name": "multiplicitySum", + "occurrence": "1+", + "required": false + } + }, + "description": null, + "name": "multiplicitySums", + "required": false, + "rootNode": false + }, + "multiplicity":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childUnique":"yesLabel", + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs1d", + "occurrence": "choice", + "required": false + }, + "constant1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "constant1d", + "occurrence": "choice", + "required": false + }, + "polynomial1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "polynomial1d", + "occurrence": "choice", + "required": false + }, + "branching1d": { + "__class__": "nodes.ChildNode", + "description": "Multiplicity is computed from decay branching ratios listed in the \\elemlink{PoPs} database.", + "name": "branching1d", + "occurrence": "choice", + "required": false + }, + "reference": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "reference", + "occurrence": "choice", + "required": false + }, + "gridded1d": { + "__class__": "nodes.ChildNode", + "description": "Grouped multiplicy, weighted by the cross-section and optionally by the flux. Appears in processed files only.", + "name": "gridded1d", + "occurrence": "choice", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "regions1d", + "occurrence": "choice", + "required": false + } + }, + "description": null, + "name": "multiplicity", + "required": false, + "rootNode": false + }, + "branching1d":{ + "__class__": "nodes.Node", + "abstractNode": "labelNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unique label for the multiplicity form.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": ["Indicates that the multiplicity can be computed from decay information in the \\elemlink{PoPs} database. ", + "Mainly used for photons emitted from discrete excited states. Also see Section~\\ref{sec:dcfdbrfcead}." ], + "name": "branching1d", + "required": false, + "rootNode": false + }, + + "orphanProducts":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "orphanProduct": { + "__class__": "nodes.ChildNode", + "description": "A reaction container to group together groups of correlated `orphan' products.", + "name": "orphanProduct", + "occurrence": "1+", + "required": true + } + }, + "description": [ + "The \\element{orphanProducts} node is similar to the \\element{reactions} node described in", + "section~\\ref{format:transport:reactions}, containing a list of \\element{orphanProduct} nodes", + "each with a \\element{crossSection} and \\element{outputChannel}.", + "However, products inside the \\element{orphanProducts} section are not associated with a", + "particular reaction. This section is most often used to store gamma-rays that are observed", + "during reaction experiments but whose provenance is unknown.", + "", + "The \\element{crossSection} inside an orphan product reaction should be a link to one of the", + "summed cross sections inside the \\element{sums} section (see section~\\ref{format:transport:sums})." + ], + "name": "orphanProducts", + "required": false, + "rootNode": false + }, + "orphanProduct":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "ENDF_MT": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["The ENDF MT number for this orphanProduct. This attribute is currently required, ", + "but should be considered deprecated. Future evaluations may include reactions ", + "with no MT equivalent, so codes should not rely on the \\texttt{ENDF\\_MT}."], + "name": "ENDF_MT", + "required": true, + "type": "Integer32" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Arbitrary string identifier. It must be unique among all other \\element{orphanProduct} elements.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "crossSection": { + "__class__": "nodes.ChildNode", + "description": ["Cross section for emission of this orphan product. The cross section is typically a reference", + "to one of the summed cross sections defined in the \\element{sums} section of the \\element{reactionSuite}."], + "name": "crossSection", + "occurrence": "1", + "required": true + }, + "outputChannel": { + "__class__": "nodes.ChildNode", + "description": "Describes the outgoing energy/angular distributions for this orphanProduct.", + "name": "outputChannel", + "occurrence": "1", + "required": true + } + }, + "description": ["An orphanProduct is observed to be emitted during the interaction between a given projectile/target,", + "but cannot be associated with a particular reaction."], + "name": "orphanProduct", + "required": false, + "rootNode": false + }, + "multiplicitySum":{ + "__class__": "nodes.Node", + "abstractNode": "labelNode", + "attributes": { + "ENDF_MT": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The corresponding ENDF MT number.", + "name": "ENDF_MT", + "required": false, + "type": "Integer32" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An arbitrary, but unique identifier for the summed cross section.", + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "multiplicity": { + "__class__": "nodes.ChildNode", + "description": "The summed multiplicity", + "name": "multiplicity", + "occurrence": "1", + "required": true + }, + "summands": { + "__class__": "nodes.ChildNode", + "description": "A list of links to the partial cross sections that are the summands (hence the name of the element) of the summed reaction.", + "name": "summands", + "occurrence": "1", + "required": true + } + }, + "description": "The \\element{multiplicitySum} sums over the multiplicity of multiple products of the same type of particle.", + "name": "multiplicitySum", + "required": false, + "rootNode": false + }, + "distribution":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childUnique" : "yesLabel", + "childNodes": { + "angularTwoBody": { + "__class__": "nodes.ChildNode", + "description": "This format is used to describe the distribution in energy and angle of particles described by two-body kinematics. Since the energy of a particle emitted with a particular scattering cosine $\\mu$ is determined by kinematics, it is only necessary to give $P(\\mu|E)$.", + "name": "angularTwoBody", + "occurrence": "choice", + "required": false + }, + "uncorrelated": { + "__class__": "nodes.ChildNode", + "description": "The outgoing energy and angular data are uncorrelated with respect to the projectile's energy and can thus be written as a product of the outgoing energy probability times the outgoing angular probability as $P(\\mu,E'|E) = P(E'|E) \\, P(\\mu|E)$. Both $P(\\mu,E'|E)$ and $P(E'|E)$ must be normalised to 1.", + "name": "uncorrelated", + "occurrence": "choice", + "required": false + }, + "angularEnergy": { + "__class__": "nodes.ChildNode", + "description": "The distribution is a hierarchy in $E$, then $\\mu$ and finally $E',P$. That is, the data are given at a list of $E$ values. For each $E$, there is an associated $P(\\mu,E')$. Each $P(\\mu,E')$ is given as a list $\\mu$ values. For each $\\mu$, there is an associated $f(E')$. The $f(E')$ can be an \\XYsOneD\\ or \\regionsOneD\\ functional data container.", + "name": "angularEnergy", + "occurrence": "choice", + "required": false + }, + "energyAngular": { + "__class__": "nodes.ChildNode", + "description": "The distribution is stored as a hierarchy in $E$, then $E'$ and finally $\\mu,P$. That is, the data are given at a list of $E$ values. For each $E$, there is an associated $P(E',\\mu)$. Each $P(E',\\mu)$ is given as a list $E'$ values. For each $E'$, there is an associated $f(\\mu)$. The $f(\\mu)$ can be an \\XYsOneD, \\regionsOneD\\ or \\LegendreOneD\\ functional data container.", + "name": "energyAngular", + "occurrence": "choice", + "required": false + }, + "KalbachMann": { + "__class__": "nodes.ChildNode", + "description": " The distribution is defined using Kalbach-Mann systematics.", + "name": "KalbachMann", + "occurrence": "choice", + "required": false + }, + "reference": { + "__class__": "nodes.ChildNode", + "description": "Contains a link to another \\element{distribution} form.", + "name": "reference", + "occurrence": "choice", + "required": false + }, + "branching3d": { + "__class__": "nodes.ChildNode", + "description": [ + "Indicates that the distribution can be computed from the decay information listed in the", + "\\element{PoPs} database. Currently only used for photon distributions from the decay", + "of discrete excited states (e.g. after inelastic scattering)." + ], + "name": "branching3d", + "occurrence": "choice", + "required": false + }, + "CoulombPlusNuclearElastic": { + "__class__": "nodes.ChildNode", + "description": "This is either a container holding the differential charged particle scattering cross section or a reference to said container.", + "name": "CoulombPlusNuclearElastic", + "occurrence": "choice", + "required": false + }, + "thermalNeutronScatteringLaw": { + "__class__": "nodes.ChildNode", + "description": "This contains a reference to the double-differential thermal neutron scattering law cross section.", + "name": "thermalNeutronScatteringLaw", + "occurrence": "choice", + "required": false + }, + "coherentPhotonScattering": { + "__class__": "nodes.ChildNode", + "description": "Describes coherent photon scattering off of an atom.", + "name": "coherentPhotonScattering", + "occurrence": "choice", + "required": false + }, + "incoherentPhotonScattering": { + "__class__": "nodes.ChildNode", + "description": "Describes incoherent photon scattering off of an atom.", + "name": "incoherentPhotonScattering", + "occurrence": "choice", + "required": false + }, + "unspecified": { + "__class__": "nodes.ChildNode", + "description": "The distribution is not specified\\footnote{This often happens for reactions with a heavy product, often called the residual, where the evaluator does not give the heavy product's distribution information. It also happens in legacy ENDF files where only the neutron and maybe the gamma distributions are given by the evaluator.}.", + "name": "unspecified", + "occurrence": "choice", + "required": false + }, + "multiGroup3d": { + "__class__": "nodes.ChildNode", + "description": "(appears only in processed data files). This is a multi-group Legendre expanded representation with grouped integration over $E$ and $E'$. The representation is used by deterministic transport codes.", + "namespace": "transport", + "name": "multiGroup3d", + "occurrence": "choice", + "required": false + }, + "angularEnergyMC": { + "__class__": "nodes.ChildNode", + "description": "(appears only in processed data files). The distribution is the product of $P(\\mu,E) \\times P(E' | E,\\mu)$. This representation is used by Monte Carlo transport codes.", + "name": "angularEnergyMC", + "occurrence": "choice", + "required": false + }, + "energyAngularMC": { + "__class__": "nodes.ChildNode", + "description": "(appears only in processed data files). The distribution is the product of $P(E',E) \\times P(\\mu | E,E')$. This representation is used by Monte Carlo transport codes.", + "name": "energyAngularMC", + "occurrence": "choice", + "required": false + }, + "XYs2d": { + "occurrence": "choice", + "required": false + } + }, + "description": "Container for all (un)correlated energy-angle distributions.", + "name": "distribution", + "required": false, + "rootNode": false + }, + "branching3d":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} element associated with these data.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Used when a distribution (typically for photons emitted from a discrete excited state) can be computed from decay branching ratios listed in \\elemlink{PoPs}.", + "name": "branching3d", + "required": false, + "rootNode": false + }, + "multiGroup3d":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} element associated with these data.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "gridded3d": { + "__class__": "nodes.ChildNode", + "description": [ + "Transfer matrices for each Legendre order, stored in a 3-dimensional array with axes 1) incident energy group, 2) outgoing energy group and 3) Legendre order.", + "Depending on the associated data \\element{style}, the transfer matrices may include corrections for thermal upscattering." + ], + "name": "gridded3d", + "occurrence": "1", + "required": true + } + }, + "description": "This is a multi-group Legendre expanded representation with groups integrated over $E$ and $E'$. The representation is used by deterministic transport codes.", + "name": "scatteringMatrix", + "required": false, + "rootNode": false + }, + "NBodyPhaseSpace":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "numberOfProducts": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The number of products being treated by this distribution.", + "name": "numberOfProducts", + "required": false, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "mass": { + "__class__": "nodes.ChildNode", + "description": "The total mass of the products being treated by this distribution.", + "namespace": "tsl", + "name": "mass", + "occurrence": "1", + "required": false + } + }, + "description": "Outgoing particles using the n-body phase-space formalism", + "name": "NBodyPhaseSpace", + "required": false, + "rootNode": false + }, + "angular_uncorrelated":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": "$P(\\mu|E)$ given as a 2d interpolation table.", + "name": "XYs2d", + "occurrence": "1", + "required": false + }, + "isotropic2d": { + "__class__": "nodes.ChildNode", + "description": "The angular distribution is isotropic so $P(\\mu|E)=1/2$.", + "name": "isotropic2d", + "occurrence": "1", + "required": false + }, + "forward": { + "__class__": "nodes.ChildNode", + "description": "The angular distribution is pure forward-peaked so $P(\\mu|E)=\\delta(\\mu-1)$.", + "name": "forward", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "angular", + "required": false, + "rootNode": false + }, + "energy_uncorrelated":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": "$P(E'|E)$ given as a 2d interpolation table.", + "name": "XYs2d", + "occurrence": "1", + "required": false + }, + "regions2d": { + "__class__": "nodes.ChildNode", + "description": "$P(E'|E)$ given in multiple regions.", + "name": "regions2d", + "occurrence": "1", + "required": false + }, + "generalEvaporation": { + "__class__": "nodes.ChildNode", + "description": "$P(E'|E)$ stored as a general evapouration spectrum.", + "name": "generalEvaporation", + "occurrence": "1", + "required": false + }, + "discreteGamma": { + "__class__": "nodes.ChildNode", + "description": "$P(E'|E)=\\delta(E_\\gamma)$.", + "name": "discreteGamma", + "occurrence": "1", + "required": false + }, + "primaryGamma": { + "__class__": "nodes.ChildNode", + "description": "Energy distribution for a `primary capture gamma'. Unlike discrete gammas, the primary gamma energy varies with incident energy E.", + "name": "primaryGamma", + "occurrence": "1", + "required": false + }, + "NBodyPhaseSpace": { + "__class__": "nodes.ChildNode", + "description": "$P(E'|E)$ represented using N-body phase space (must be in the centre of mass).", + "name": "NBodyPhaseSpace", + "occurrence": "1", + "required": false + }, + "evaporation": { + "__class__": "nodes.ChildNode", + "description": "$P(E'|E)$ stored as an evapouration spectrum.", + "name": "evaporation", + "occurrence": "1", + "required": false + }, + "weightedFunctionals": { + "__class__": "nodes.ChildNode", + "description": "$P(E'|E)$ stored as the weighted sum of 2 or more other energy spectra.", + "name": "weightedFunctionals", + "occurrence": "1", + "required": false + }, + "simpleMaxwellianFission": { + "__class__": "nodes.ChildNode", + "description": "Maxwellian representation for $P(E'|E)$, primarily for fission neutrons.", + "name": "simpleMaxwellianFission", + "occurrence": "1", + "required": false + }, + "Watt": { + "__class__": "nodes.ChildNode", + "description": "Watt spectrum representation for $P(E'|E)$, primarily for fission neutrons.", + "name": "Watt", + "occurrence": "1", + "required": false + }, + "MadlandNix": { + "__class__": "nodes.ChildNode", + "description": "Madland-Nix parameterisation for $P(E'|E)$, primarily for fission neutrons.", + "name": "MadlandNix", + "occurrence": "1", + "required": false + } + + }, + "description": null, + "name": "energy", + "required": false, + "rootNode": false + }, + "angularEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} element associated with these data.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "XYs3d": { + "__class__": "nodes.ChildNode", + "description": "Distribution given as $P(\\mu, E'|E)$ using a $\\mu$ major ordering.", + "name": "XYs3d", + "occurrence": "1", + "required": true + } + }, + "description": "A valid $P(\\mu,E'|E)$ represented with either a \\XYsThreeD\\ or \\regionsThreeD\\ functional data container. A \\regionsThreeD\\ must contain one or more \\XYsThreeD. Each \\XYsThreeD\\ must contain a list of \\XYsTwoD\\ and/or \\regionsTwoD\\ functional data container. A \\regionsTwoD\\ must contain one or more \\XYsTwoD. Each \\XYsTwoD\\ must contain a list of \\XYsOneD\\ and/or \\regionsOneD\\ functional data container. Each \\regionsOneD\\ must contain one or more \\XYsOneD\\ functional data container.", + "name": "angularEnergy", + "required": false, + "rootNode": false + }, + "energyAngular":{ + "__class__": "nodes.Node", + "abstractNode": "distributionNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} element associated with these data.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "XYs3d": { + "__class__": "nodes.ChildNode", + "description": "Distribution given as $P(E', \\mu|E)$ using a $E'$ major ordering.", + "name": "XYs3d", + "occurrence": "1", + "required": true + } + }, + "description": null, + "name": "energyAngular", + "required": false, + "rootNode": false + }, + "angularTwoBody":{ + "__class__": "nodes.Node", + "abstractNode": "distributionNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} element associated with these data.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": "$P(\\mu|E)$ given as a 2d interpolation table.", + "name": "XYs2d", + "occurrence": "1", + "required": false + }, + "regions2d": { + "__class__": "nodes.ChildNode", + "description": "The angular distribution is composed of multiple regions contained within this container.", + "name": "regions2d", + "occurrence": "1", + "required": false + }, + "isotropic2d": { + "__class__": "nodes.ChildNode", + "description": "The angular distribution is isotropic so $P(\\mu|E)=1/2$.", + "name": "isotropic2d", + "occurrence": "1", + "required": false + }, + "recoil": { + "__class__": "nodes.ChildNode", + "description": "The particle in question is recoiling from the rest of the system and it's angular distribution can be determined by kinematics.", + "name": "recoil", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This form is used to describe the distribution in energy and angle of", + "particles described by two-body kinematics. ", + "It corresponds to ENDF's File 6, LAW=2 and is very similar to ENDF's File~4.", + "Since the energy of a particle emitted", + "with a particular scattering cosine $\\mathrm{\\mu}$ is determined by", + "kinematics, it is only necessary to specify the angular distribution which is easiest to do using Legendre polynomials:", + "\\begin{eqnarray}", + " p_i (\\mu ,E) &=& \\int {dE' \\; f_i (\\mu ,E,E')} \\nonumber \\\\", + " &=& \\frac{1}{2} + \\sum_{l = 1}^{\\rm NL} {\\frac{{2l + 1}}{2} \\; a_l (E) \\; P_l (\\mu),}", + "\\end{eqnarray}", + "where the $P_{l}$ are the Legendre polynomials with maximum,", + "order NL. Note that the angular distribution $p_{i}$ is normalised." + ], + "name": "angularTwoBody", + "required": false, + "rootNode": false + }, + "uncorrelated":{ + "__class__": "nodes.Node", + "abstractNode": "distributionNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} element associated with these data.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "angular_uncorrelated": { + "__class__": "nodes.ChildNode", + "description": "Any valid $P(\\mu|E)$ as defined in Section~\\ref{format:transport:angular}.", + "name": "angular", + "occurrence": "1", + "required": true + }, + "energy_uncorrelated": { + "__class__": "nodes.ChildNode", + "description": "Any valid $P(E'|E)$ as defined in Sections~\\ref{sec:edr}, \\ref{sec:edgbeem}, \\ref{sec:edfdg}, or \\ref{sec:edffn}.", + "name": "energy", + "occurrence": "1", + "required": true + } + }, + "description": "The outgoing energy and angular data are uncorrelated with respect to the projectile's energy and can thus be written as a product of the outgoing energy probability times the outgoing angular probability as $P(\\mu,E'|E) = P(E'|E) \\, P(\\mu|E)$. Note, both $P(\\mu,E'|E)$ and $P(E'|E)$ must be normalised to 1.", + "name": "uncorrelated", + "required": false, + "rootNode": false + }, + "recoil":{ + "__class__": "nodes.Node", + "abstractNode": "link", + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A link to the other product's distribution representation in a two-body channel.", + "name": "href", + "required": true, + "type": "bodyText" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "In \\element{recoil} scattering, the angular distribution is the reflection in all axes of the other emitted particle's two-body product. Hence, $f(E,\\mu) = f_{\\textrm{other}}(E,-\\mu)$ where $f_{\\textrm{other}}(E,\\mu)$ is the other product's angular distribution.", + "name": "recoil", + "required": false, + "rootNode": false + }, + "KalbachMann":{ + "__class__": "nodes.Node", + "abstractNode": "distributionNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} element associated with these data.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in. Must always be \\centerOfMass.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "f": { + "__class__": "nodes.ChildNode", + "description": "Kalbach-Mann $f$ parameter.", + "name": "f", + "occurrence": "1", + "required": true + }, + "r": { + "__class__": "nodes.ChildNode", + "description": "Kalbach-Mann $r$ parameter.", + "name": "r", + "occurrence": "1", + "required": true + }, + "a": { + "__class__": "nodes.ChildNode", + "description": "Kalbach-Mann $a$ parameter.", + "namespace": "transport", + "name": "a", + "occurrence": "1", + "required": false + } + }, + "description": "Kalbach-Mann distribution for outgoing particles.", + "name": "KalbachMann", + "required": false, + "rootNode": false + }, + "generalEvaporation":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "U": { + "__class__": "nodes.ChildNode", + "description": "The U value.", + "name": "U", + "occurrence": "1", + "required": false + }, + "g": { + "__class__": "nodes.ChildNode", + "description": "Container that represents a valid $g(x)$ where $x = E' / \\theta(E)$", + "name": "g", + "occurrence": "1", + "required": false + }, + "theta": { + "__class__": "nodes.ChildNode", + "description": "Data container that represents a valid $\\theta(E)$", + "name": "theta", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This defines the energy distribution for", + "\\begin{displaymath}", + " P(E'|E) = g\\left( E' / \\theta (E) \\right)", + "\\end{displaymath}", + "and is equivalent to ENDF-6's format's $f(E \\to E')$ in MF=5, LF=5." + ], + "name": "generalEvaporation", + "required": false, + "rootNode": false + }, + "weightedFunctionals":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "weighted": { + "__class__": "nodes.ChildNode", + "description": [ + "The partial energy distributions $f_{k}(E\\rightarrow E')$ are represented by various analytical formulations.", + "Each formulation is also an energy distribution." + ], + "name": "weighted", + "occurrence": "1", + "required": true + } + }, + "description": [ + "The energy distributions $P(E'|E)$ can be broken down into partial energy distributions $f_{k}(E\\rightarrow E')$,", + "where each of the partial distributions can be described by a different analytic representation;\n", + "\\begin{equation}\n", + " P(E'|E) = \\sum\\limits_{k = 1}^{\\rm NK} p_k (E)f_k (E \\to E')\n", + "\\end{equation}\n", + "and at a particular incident energy $E$,", + "\\begin{equation}\n", + " \\sum\\limits_{k = 1}^{\\rm NK} p_k (E) = 1\n", + "\\end{equation}\n", + "where $p_{k}(E)$ is the fractional probability", + "that the distribution $f_{k}(E\\rightarrow E')$ can be used at energy $E$.", + "The partial energy distributions $f_{k}(E\\rightarrow E')$ are represented by various analytical formulations.", + "Each formulation is also an energy distribution." + ], + "name": "weightedFunctionals", + "required": false, + "rootNode": false + }, + "evaporation":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "U": { + "__class__": "nodes.ChildNode", + "description": "The U value.", + "name": "U", + "occurrence": "1", + "required": false + }, + "theta": { + "__class__": "nodes.ChildNode", + "description": "Data container that represents a valid $\\theta(E)$", + "name": "theta", + "occurrence": "1", + "required": false + } + }, + "description": [ + "This element allows one to store a ``fixed temperature'' thermal spectrum and is equivalent to ENDF-6's MF=6, LF=9 format.", + "\\begin{displaymath}", + " P(E'|E) = \\frac{{E'}}{I}e^{ - E'/\\theta (E)}", + "\\end{displaymath}", + "where $I$ is the normalisation constant:", + "\\begin{displaymath}", + " I = \\theta ^2 \\left[ {1 - e^{ - (E - U)/\\theta } \\left(", + " {1 + \\frac{{E - U}}{\\theta }} \\right)} \\right]", + "\\end{displaymath}"], + "name": "evaporation", + "required": false, + "rootNode": false + }, + "unspecified":{ + "__class__": "nodes.Node", + "abstractNode": "distributionNode", + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Name of the style in the \\element{styles} element associated with these data.", + "name": "label", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "The distribution is not specified\\footnote{This often happens for reactions with a heavy product, (the heavy product is often called the residual) where the evaluator does not give the heavy product's distribution information. It also happens in legacy ENDF files where only the neutron and maybe the gamma distributions are given by the evaluator.}.", + "name": "unspecified", + "required": false, + "rootNode": false + }, + "discreteGamma":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "domainMax": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "domainMax", + "required": false, + "type": "Float64" + }, + "domainMin": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "domainMin", + "required": false, + "type": "Float64" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": ["$E_\\gamma$, the outgoing gammma energy (in eV)"], + "name": "value", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "axes", + "occurrence": "1", + "required": false + } + }, + "description": ["This format is to store the discrete energy of a photon from a bound level-bound ", + "level transition in which either the initial or final level is unspecified. ", + "The photon energy is simply $E_\\gamma'$.\n"], + "name": "discreteGamma", + "required": false, + "rootNode": false + }, + "photonEmissionProbabilities":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "shell": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "shell", + "occurrence": "1", + "required": false + } + }, + "description": null, + "name": "photonEmissionProbabilities", + "required": false, + "rootNode": false + }, + "primaryGamma":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "domainMax": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "domainMax", + "required": false, + "type": "Float64" + }, + "domainMin": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "domainMin", + "required": false, + "type": "Float64" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "$E^0_\\gamma$, the parameter needed to define the outgoing gammma energy as a function of the incident particle energy (in eV).", + "If not given, then a \\attr{finalState} must be specified." + ], + "name": "value", + "required": false, + "type": "Float64" + }, + "finalState": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "The pid of the final state for this primary gamma ray transition. ", + "This should be a valid \\element{nuclide}'s \\attr{id}. ", + "If known, then modeling the coincidence gamma emission following this primary gamma can be done."], + "name": "finalState", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "axes": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "axes", + "occurrence": "1", + "required": false + } + }, + "description": ["This format is to store the discrete energy of a photon from an unbound level-bound level transition. ", + "The unbound level is above the target+projectile separation energy. ", + "The photon energy depends on the incident projectile energy $E$ and an optional parameter $E^0_\\gamma$.", + "Ignoring the recoil of the residual nucleus, ", + "\n\\begin{displaymath}\n\tE_\\gamma' = E^0_\\gamma + E \\; \\frac{M_{\\scriptsize{\\textrm{target}}}}{M_{\\scriptsize{\\textrm{target}}} + M_{\\scriptsize{\\textrm{projectile}}}}.\n\\end{displaymath}\n", + "Including the recoil, one finds ", + "\n\\begin{displaymath}\n\tE_\\gamma' = E^0_\\gamma + E \\; \\frac{M_{\\scriptsize{\\textrm{target}}}}{M_{\\scriptsize{\\textrm{target}}} + M_{\\scriptsize{\\textrm{projectile}}}} \\left(1-\\frac{Q}{(M_{\\scriptsize{\\textrm{target}}} + M_{\\scriptsize{\\textrm{projectile}}})c^2}\\right).\n\\end{displaymath}\n", + "where $Q=M_{\\scriptsize{\\textrm{target}}} + M_{\\scriptsize{\\textrm{projectile}}} - M_{\\scriptsize{\\textrm{residual}}}$.", + "The optional parameter $E^0_\\gamma$ is", + "\n\\begin{displaymath}\n\tE^0_\\gamma = Q \\; \\left(1-\\frac{Q}{2(M_{\\scriptsize{\\textrm{target}}} + M_{\\scriptsize{\\textrm{projectile}}})c^2}\\right).\n\\end{displaymath}\n", + "Thus, if the final state of the residual nucleus is known, then $M_{\\scriptsize{\\textrm{residual}}}$ is known, enabling both the recoil corrections and complete specification of $E^0_\\gamma$.", + "Furthermore, one has the additional information needed to continue the secondary cascade induced in the residual nucleus by the present primary gamma." + ], + "name": "primaryGamma", + "required": false, + "rootNode": false + }, + "production":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "ENDF_MT": { + "__class__": "nodes.Attribute", + "default": null, + "description": "An integer MT number (e.g. `3' for the non-elastic cross section which may produce gamma products).", + "name": "ENDF_MT", + "required": false, + "type": "Integer32" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "crossSection": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "crossSection", + "occurrence": "1", + "required": false + }, + "outputChannel": { + "__class__": "nodes.ChildNode", + "description": "Describes the secondary particle emissions from the reaction", + "name": "outputChannel", + "occurrence": "1", + "required": false + } + }, + "description": [ + "A \\elemlink{production} node defines a single production reaction.", + "Like the \\elemlink{reaction} it contains a cross section and an outputChannel.", + "Unlike a \\elemlink{reaction}, the \\elemlink{production} does not force the evaluator to", + "differentiate between different ways of getting to the same residual. For example,", + "the `n,d' `n,n+p' and `n,p+n' reactions all end up at the same residual. Inside the", + "\\elemlink{reactions} section, evaluators may choose to store each one separately.", + "In the \\elemlink{productions} section the three methods can be combined into a single", + "reaction that produces the final residual." + ], + "name": "production", + "required": false, + "rootNode": false + }, + "productions":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "production": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "production", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Production reactions are used for inventory applications (such as dosimetry, decay heat, and activity) ", + "and for calculating the amount of ", + "material accreted and/or depleted during radiation exposure." + ], + "name": "productions", + "required": false, + "rootNode": false + }, + "incompleteReactions":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "reaction": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "reaction", + "occurrence": "1", + "required": false + } + }, + "description": [ + "The \\element{incompleteReactions} section allows evaluators to include information about reactions ", "without providing complete information. For example, some sub-actinide fission reaction cross sections ", + "may be included as only a total fission cross section. This allows simulations to account for the ", + "reaction while not considering all of the reaction process (e.g. neutron production and fission ", + "products) or allows the evaluator to provide other information. It is strongly recommended that", + "this be used only in cases where the reaction cross sections are negligible. " + ], + "name": "incompleteReactions", + "required": false, + "rootNode": false + }, + "summands":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "add": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "add", + "occurrence": "1+", + "required": false + } + }, + "description": null, + "name": "summands", + "required": false, + "rootNode": false + }, + "add":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "href", + "required": false, + "type": "bodyText" + } + }, + "bodyText": null, + "childNodes": {}, + "description": null, + "name": "add", + "required": false, + "rootNode": false + }, + "f":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs2d", + "occurrence": "choice", + "required": false + }, + "regions2d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "regions2d", + "occurrence": "choice", + "required": false + } + }, + "description": "Kalbach-Mann $f(E,E')$ parameter, stored either as an \\XYsTwoD\\ or \\regionsTwoD\\ functional data container.", + "name": "f", + "required": false, + "rootNode": false + }, + "g":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "The $g(x)$ given as an interpolation table.", + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": "The $g(x)$ given as a few interpolation tables.", + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": "An arbitrary energy dependent weighting, tabulated as a function of $x$, and $x = E'/\\theta (E)$.", + "name": "g", + "required": false, + "rootNode": false + }, + "r":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs2d", + "occurrence": "choice", + "required": false + }, + "regions2d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "regions2d", + "occurrence": "choice", + "required": false + } + }, + "description": "Kalbach-Mann $r(E,E')$ parameter, stored either as an \\XYsTwoD\\ or \\regionsTwoD\\ functional data container.", + "name": "r", + "required": false, + "rootNode": false + }, + "a":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "XYs2d", + "occurrence": "choice", + "required": false + }, + "regions2d": { + "__class__": "nodes.ChildNode", + "description": null, + "name": "regions2d", + "occurrence": "choice", + "required": false + } + }, + "description": "Kalbach-Mann $a(E,E')$ parameter, stored either as an \\XYsTwoD\\ or \\regionsTwoD\\ functional data container.", + "name": "a", + "required": false, + "rootNode": false + }, + "theta":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "The $\\theta(E)$ given as an interpolation table.", + "name": "XYs1d", + "occurrence": "1", + "required": false + }, + "regions1d": { + "__class__": "nodes.ChildNode", + "description": "The $\\theta(E)$ given as a few interpolation tables.", + "name": "regions1d", + "occurrence": "1", + "required": false + } + }, + "description": "$\\theta$ is an effective emission temperature.", + "name": "theta", + "required": false, + "rootNode": false + }, + "U":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "A valid energy unit for U", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The value of U given as a Float64", + "name": "value", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "$U$ is a constant introduced to define the proper upper limit for the final particle energy such that $0 \\leq E' \\leq (E - U)$.", + "name": "U", + "required": false, + "rootNode": false + }, + "forward":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": {}, + "description": "In forward scattering, the product goes in the same direction as the projectile. As the distributions is always normalised to 1, $f(E,\\mu) = P(\\mu|E) = \\delta(\\mu - 1)$. This is needed per Section~26.1, paragraph 3 of the ENDF manual \\cite{ENDF6Doc}.", + "name": "forward", + "required": false, + "rootNode": false + }, + "isotropic2d":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": {}, + "description": "When the scattering is isotropic and independent of energy $E$ the \\element{isotropic} angular distribution can be used. Normalisation is always 1; hence, $f(E,\\mu) = P(\\mu,E) = 1/2$.", + "name": "isotropic2d", + "required": false, + "rootNode": false + }, + "weighted":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "The weighting function $p_k(E)$ given as an XYs1d.", + "name": "XYs1d", + "occurrence": "1", + "required": true + }, + "XYs2d": { + "__class__": "nodes.ChildNode", + "description": "The energy distribution $f_{k}(E\\rightarrow E')$ given as an \\element{XYs2d}.", + "name": "XYs2d", + "occurrence": "1", + "required": false + }, + "evaporation": { + "__class__": "nodes.ChildNode", + "description": "The energy distribution $f_{k}(E\\rightarrow E')$ given as an \\element{evaporation}.", + "name": "evaporation", + "occurrence": "1", + "required": false + }, + "generalEvaporation": { + "__class__": "nodes.ChildNode", + "description": "The energy distribution $f_{k}(E\\rightarrow E')$ given as an \\element{generalEvaporation}.", + "name": "generalEvaporation", + "occurrence": "1", + "required": false + }, + "simpleMaxwellianFission": { + "__class__": "nodes.ChildNode", + "description": "Maxwellian representation for $P(E'|E)$, primarily for fission neutrons.", + "name": "simpleMaxwellianFission", + "occurrence": "1", + "required": false + }, + "Watt": { + "__class__": "nodes.ChildNode", + "description": "Watt spectrum representation for $P(E'|E)$, primarily for fission neutrons.", + "name": "Watt", + "occurrence": "1", + "required": false + }, + "MadlandNix": { + "__class__": "nodes.ChildNode", + "description": "Madland-Nix parameterisation for $P(E'|E)$, primarily for fission neutrons.", + "name": "MadlandNix", + "occurrence": "1", + "required": false + } + }, + "description": [ + "The partial energy distributions $f_{k}(E\\rightarrow E')$ are represented by various analytical formulations.", + "Each formulation is itself an energy distribution." + ], + "name": "weighted", + "required": true, + "rootNode": false + }, + "reference":{ + "__class__": "nodes.Node", + "abstractNode": "labelNode", + "attributes": { + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Link (using xPath syntax) to another multiplicity in the file. Link may be absolute or relative.", + "name": "href", + "required": false, + "type": "bodyText" + }, + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": false, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "A multiplicity may consist of a link to another multiplicity in the same file. The primary purpose for this option is to associate fission neutron multiplicity with a fission \\element{reaction}.", + "name": "reference", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/summary_tsl.json b/standards/gnds-2.0/summary_tsl.json new file mode 100644 index 000000000..9d14599a3 --- /dev/null +++ b/standards/gnds-2.0/summary_tsl.json @@ -0,0 +1,943 @@ +{ + "__namespace__":"tsl", + "thermalNeutronScatteringLaw1d":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Style label for this element.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The URL this element links to", + "name": "href", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "Used to link the reaction \\element{crossSection} to the corresponding thermal neutron scattering law entry ", + "in the \\element{doubleDifferentialCrossSection}. " + ], + "name": "thermalNeutronScatteringLaw1d", + "required": true, + "rootNode": false + }, + + "thermalNeutronScatteringLaw":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Style label for this element.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "href": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The URL this element links to", + "name": "href", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": {}, + "description": [ + "Used to link the outgoing neutron \\element{distribution} to the corresponding thermal neutron scattering law entry ", + "in the \\element{doubleDifferentialCrossSection}. " + ], + "name": "thermalNeutronScatteringLaw", + "required": true, + "rootNode": false + }, + + "thermalNeutronScatteringLaw_coherentElastic":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Style label for this element.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": "n", + "description": "The id of the scattered particle (should always be `n').", + "name": "pid", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": "lab", + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": false, + "type": "frame" + } + }, + "bodyText": null, + "childNodes": { + "S_table": { + "__class__": "nodes.ChildNode", + "description": "Cumulative structure factor as a function of incident energy and temperature.", + "name": "S_table", + "occurrence": "choice", + "required": false + }, + "BraggEdges": { + "__class__": "nodes.ChildNode", + "description": "Stores a list of Bragg edges along with energies and structure factors.", + "name": "BraggEdges", + "occurrence": "choice", + "required": false + } + }, + "description": [ + "Neutrons can elastically scatter coherently off of regular substances such as crystals, including powdered crystalline material. ", + "The differential cross section for such scattering off a single scatterer can be written \\cite{ENDF6Doc}", + "\\begin{equation}", + " \\frac{d^2 \\sigma}{dE' \\; d\\Omega}(E \\to E', \\mu, T) = \\frac{1}{2\\pi E} \\sum_{j = 1}^{E_{j}(T) < E}", + " s_j(T)\\; \\delta (\\mu - \\mu_j(T) ) \\; \\delta (E - E' ) \\label{eq:BraggEdge}", + "\\end{equation}", + "where:", + "\\begin{equation}", + " \\mu_j(T) = 1 - \\frac{2E_j(T)}{E} \\label{eq:BraggEdgeMu}", + "\\end{equation}", + "The sum in (\\ref{eq:BraggEdge}) extends over all Bragg edges with energy less than $E$. ", + "\n\n", + "In other sources (e.g. \\cite{cacuci2010}), the structure factors $s_j(T)$ for the $i^{th}$ scatterer are written as ", + "\\begin{equation}", + "\\ s_j(T) = 2\\pi\\sigma_{\\textrm{\\scriptsize coh},i} f_j(T) \\exp({-4WE_j(T)}).", + "\\end{equation}", + "Here $f_j(T)$ is material dependent and plays the role of the crystallographic structure factors ", + "and $W$ is the Debye Waller factor.", + "\n\n", + "Two types of data containers can be used to store the energy- and temperature-dependent coherent elastic scattering factor: ", + "\\begin{itemize} ", + "\\item Using an `S\\_table' that stores the cumulative sum of the structure factor $$S(E,T) = \\sum\\limits_{i=1}^{E_i < E} s_i (T)$$", + "$S(E,T)$ uses histogram interpolation along incident energy $E$, i.e. the cumulative structure factor is flat until the next Bragg edge is encountered. ", + "This is the same method used to store the coherent elastic scattering factor in ENDF-6. ", + "\\item Storing a list of Bragg edges which include the temperature-dependent structure factor $s_j(T)$ and Bragg energy $E_j(T)$ for ", + "each Bragg edge. ", + "\\end{itemize}", + "Parameterised coherent and incoherent elastic scattering were added to the ENDF format in the early 1990's. " + ], + "name": "thermalNeutronScatteringLaw_coherentElastic", + "required": false, + "rootNode": false + }, + "S_table":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "gridded2d": { + "__class__": "nodes.ChildNode", + "description": [ + "Cumulative structure factors, $$S(E,T) = \\sum\\limits_{i=1}^{E_i < E} s_i (T)$$", + "The cumulative structure factor uses histogram interpolation along energy, with steps at each Bragg edge." + ], + "name": "gridded2d", + "occurrence": "1", + "required": true + } + }, + "description": "Stores the cumulative structure factor as a function of incident energy and temperature.", + "name": "S_table", + "required": true, + "rootNode": false + }, + + "BraggEdges":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "BraggEdge": { + "__class__": "nodes.ChildNode", + "description": "One Bragg edge's container. See section \\ref{format:tsl:BraggEdge}.", + "name": "BraggEdge", + "occurrence": "1+", + "required": true + } + }, + "description": "This is the container for descriptions of the Bragg edges.", + "name": "BraggEdges", + "required": true, + "rootNode": false + }, + "BraggEdge":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": null, + "name": "label", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "BraggEnergy": { + "__class__": "nodes.ChildNode", + "description": "An \\element{XYs1d} specifying the temperature dependence of the Bragg edge energy $E_j(T)$ in Eqs. (\\ref{eq:BraggEdge}) and (\\ref{eq:BraggEdgeMu}).", + "name": "BraggEnergy", + "occurrence": "1", + "required": true + }, + "structureFactor": { + "__class__": "nodes.ChildNode", + "description": "An \\element{XYs1d} specifying the structure factor for this Bragg edge, $s_j(T)$, for use in Eq. (\\ref{eq:BraggEdge}). ", + "name": "structureFactor", + "occurrence": "1", + "required": true + } + }, + "description": [ + "Each Bragg edge has a (temperature-dependent) energy and intensity. ", + "The evaluator must define a scheme for interpolating both the energy and structure factor in temperature. ", + "Note that ENDF-6 does not provide a simple way to denote the temperature dependence of Bragg energies, leaving them to processing codes to determine.\n" + ], + "name": "BraggEdge", + "required": false, + "rootNode": false + }, + "BraggEnergy":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "The temperature dependence of this Bragg edge's energy $E_j(T)$. ", + "name": "XYs1d", + "occurrence": "1", + "required": true + } + }, + "description": "An \\element{XYs1d} specifying the temperature dependence of the Bragg edge energy $E_j(T)$ for use in Eqs. \\eqref{eq:BraggEdge} and \\eqref{eq:BraggEdgeMu} ", + "name": "BraggEnergy", + "required": false, + "rootNode": false + }, + "structureFactor":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "The structure factors for this Bragg edge, $s_j(T)=S(E_j,T)$. ", + "name": "XYs1d", + "occurrence": "1", + "required": true + } + }, + "description": "An \\element{XYs1d} specifying the structure factor for this Bragg edge, $s_j(T)$, for use in Eq. \\eqref{eq:BraggEdge}.", + "name": "structureFactor", + "required": true, + "rootNode": false + }, + + "thermalNeutronScatteringLaw_incoherentElastic":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Style label for this element.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The id of the scattered particle (should always be `n').", + "name": "pid", + "required": true, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": true, + "type": "frame" + } + }, + "bodyText": null, + "childNodes": { + "boundAtomCrossSection": { + "__class__": "nodes.ChildNode", + "description": "The $\\sigma_{\\textrm{\\scriptsize bound},i}$ cross section for a single bound atom (of the principal scattering type).", + "name": "boundAtomCrossSection", + "occurrence": "1", + "required": true + }, + "DebyeWallerIntegral": { + "__class__": "nodes.ChildNode", + "description": "The Debye-Waller integral, divided by the atomic mass.", + "name": "DebyeWallerIntegral", + "occurrence": "1", + "required": true + } + }, + "description": [ + "Elastic scattering can be treated in the incoherent approximation for ", + "partially ordered systems such as ZrH$_x$ and polyethylene. The ", + "differential cross section is given by: ", + "\\begin{equation}", + "\\frac{{d^2 \\sigma }}{{dE' \\: d\\Omega }}", + "(E \\to E' ,\\mu ,T) = \\frac{{\\sigma_\\textrm{\\scriptsize bound} }}{{4\\pi }}", + "\\mathop e\\nolimits^{ - 2EW'(T)(1 - \\mu )} \\; \\delta (E - E')", + "\\end{equation}", + "where: ", + "\\begin{varlist}", + "\\item[$\\sigma_\\textrm{\\scriptsize bound}$] is the characteristic bound cross section (barns)", + "\\item[$W'$] is the DebyeWaller integral divided by the atomic mass (eV$^{-1}$)", + "\\end{varlist}", + "and all the other symbols have their previous meanings. The ", + "integrated cross section is easily obtained:", + "\\begin{equation}", + "\\sigma (E) = \\frac{{\\sigma_\\textrm{\\scriptsize bound} }}{2}\\left( {\\frac{{1 - e^{ - 4EW'} }}{{2EW' }}} \\right)", + "\\end{equation}", + "\n\n", + "Note that the limit of $\\sigma$ for small $E$ is $\\sigma_{\\textrm{\\scriptsize bound}}$.", + "\n\n", + "This formalism can be used for energies up to 5 eV.", + "\n\n", + "For some moderator materials containing more than one kind of atom, ", + "the incoherent elastic cross section is computed as the sum of ", + "contributions from two different materials. As an example in the ENDF-6 format, H in ", + "ZrH$_{x}$ is given in MAT 0007, and Zr in ZrH$_{x}$ is given in MAT ", + "0058." + ], + "name": "thermalNeutronScatteringLaw_incoherentElastic", + "required": false, + "rootNode": false + }, + "DebyeWallerIntegral":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "Data container storing the temperature dependence of the Debye-Waller integral. Axes have units of temperature (e.g. `K') and inverse energy (e.g. `1/eV').", + "name": "XYs1d", + "occurrence": "1", + "required": true + } + }, + "description": "The Debye-Waller integral, divided by the atomic mass, in units of inverse energy, $W'(T)$", + "name": "DebyeWallerIntegral", + "required": true, + "rootNode": false + }, + + "thermalNeutronScatteringLaw_incoherentInelastic":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "label": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Style label for this element.", + "name": "label", + "required": true, + "type": "XMLName" + }, + "pid": { + "__class__": "nodes.Attribute", + "default": "n", + "description": "The id of the scattered particle (should always be `n').", + "name": "pid", + "required": false, + "type": "XMLName" + }, + "productFrame": { + "__class__": "nodes.Attribute", + "default": "lab", + "description": "The frame that the product data are defined in.", + "name": "productFrame", + "required": false, + "type": "frame" + }, + "calculatedAtThermal": { + "__class__": "nodes.Attribute", + "default": false, + "description": ["Indicates that $\\alpha$ and $\\beta$ were calculated using kT=0.0253 eV", + "for ALL temperatures. If true, $\\alpha$ and $\\beta$ must be multiplied", + "by a temperature conversion factor before looking up values in the $S(\\alpha,\\beta)$ array.", + "This option is equivalent to the `LAT=1' option in ENDF-6."], + "name": "calculatedAtThermal", + "required": false, + "type": "Boolean" + }, + "incoherentApproximation": { + "__class__": "nodes.Attribute", + "default": true, + "description": "The incoherent approximation, where the ``distinct'' part of the scattering law is neglected (i.e. setting ${\\cal S}_{\\textrm{\\scriptsize dis},i}(\\alpha,\\beta,T) = 0$ and $\\sigma_{\\textrm{\\scriptsize inc},i}=0$).", + "name": "incoherentApproximation", + "required": false, + "type": "Boolean" + }, + "primaryScatterer": { + "__class__": "nodes.Attribute", + "default": null, + "description": [ + "the particle id of the primary scatterer. This value must match the \\attr{pid} of one of the ", + "\\element{scatteringAtom} elements contained in this element. ", + " The primary scatterer's mass is used to define $\\alpha$ as in ENDF-6." + ], + "name": "primaryScatterer", + "required": true, + "type": "XMLName" + } + }, + "bodyText": null, + "childNodes": { + "scatteringAtoms": { + "__class__": "nodes.ChildNode", + "description": "The container element for all thermal scattering law scatterers", + "name": "scatteringAtoms", + "occurrence": "1", + "required": true + } + }, + "description": [ + "For inelastic scattering, the cross section can be computed by summing together contributions from each type of atom in the molecule. ", + "For the i$^{th}$ scattering atom, the contribution to the total cross section is given by ", + "\\begin{equation}", + " \\frac{d^2\\sigma_i(E \\to E',\\mu ,T)}{dE'd\\Omega}=\\frac{M_i}{4\\pi k_BT} \\sqrt{\\frac{E'}{E}}\\left[", + " \\sigma_{\\textrm{\\scriptsize bound},i}{\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)+", + " \\sigma_{\\textrm{\\scriptsize coh},i}{\\cal S}_{\\textrm{\\scriptsize dis},i}(\\alpha,\\beta,T)\\right]", + " \\label{eq:inelasticTSL}", + "\\end{equation}", + "Here one has", + "\\begin{varlist}", + " \\item[${\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)$] Is the self term of the scattering kernel of the $i^{th}$ type scatterer,", + " \\item[${\\cal S}_{\\textrm{\\scriptsize dis},i}(\\alpha,\\beta,T)$] Is the distinct term of the scattering kernel of the $i^{th}$ type scatterer", + " \\item[$M_{i}$] Number of atoms of the $i^{th}$ type in the molecule or unit cell", + " \\item[$\\beta$] Energy transfer, $\\beta = (E' - E)/k_BT$", + " \\item[$\\alpha$] Momentum transfer, $\\alpha = \\left[ E' +E - 2\\mu \\sqrt{E E'}\\right] \\; /(m_{0}k_BT/m_n)$", + " \\item[$m_{0}$] the mass of the principal scattering atom in the molecule", + " \\item[$m_{n}$] the mass of the projectile, presumed to be a neutron (as this is thermal {\\em neutron} scattering data)", + " \\item[$\\sigma_{\\textrm{\\scriptsize coh},i}$] Coherent atom scattering cross section of the $i^{th}$ type scatterer", + " \\item[$\\sigma_{\\textrm{\\scriptsize inc},i}$] Incoherent atom scattering cross section of the $i^{th}$ type scatterer", + " \\item[$\\sigma_{\\textrm{\\scriptsize bound},i}$] Bound atom scattering cross section of the $i^{th}$ type scatterer in the molecule in question, note", + " \\begin{equation}", + " \\sigma_{\\textrm{\\scriptsize bound},i}=\\sigma_{\\textrm{\\scriptsize coh},i}+\\sigma_{\\textrm{\\scriptsize inc},i}", + " \\end{equation}", + " \\item[$\\sigma_{\\textrm{\\scriptsize free},i}$] Free scattering cross section of the $i^{th}$ type scatterer. In principal this should match the zero energy intercept of the equivalent fast region cross section. In practice it won't match because the fast region evaluation neglects the equation of state of the atom in the molecule in question so is usually treated as a free-gas equation of state. Note, the bound and free cross sections are related through", + " \\begin{equation}", + " \\sigma_{\\textrm{\\scriptsize bound},i} = \\sigma_{\\textrm{\\scriptsize free},i} \\left( \\frac{m_i + m_n}{m_i} \\right)^2", + " \\end{equation}", + "\\end{varlist}", + "\n\n", + "Note that GNDS extends the approximations allowed as in the legacy ENDF-6 format, only the incoherent approximation is used." + ], + "name": "thermalNeutronScatteringLaw_incoherentInelastic", + "required": false, + "rootNode": false + }, + "mass":{ + "attributes": { + "unit": { + "required": true, + "type": "XMLName" + }, + "value": { + "required": true, + "type": "Float64" + } + }, + "childNodes": {} + }, + "scatteringAtom":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "pid": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Particle id for this scatterer. Note that the pid will often be an element (i.e. `Zr') rather than a nuclide.", + "name": "pid", + "required": true, + "type": "XMLName" + }, + "primaryScatterer": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Denotes that the current scattering atom is the primary one.", + "name": "primaryScatterer", + "required": true, + "type": "Boolean" + }, + "numberPerMolecule": { + "__class__": "nodes.Attribute", + "default": null, + "description": "The number of this scattering atom per `molecule' of scatterers.", + "name": "numberPerMolecule", + "required": true, + "type": "Integer32" + } + }, + "bodyText": null, + "childNodes": { + "mass": { + "__class__": "nodes.ChildNode", + "description": "Mass of this scattering atom. Note that unlike ENDF-6, the mass is for a single atom (not multiplied by the number of atoms/molecule).", + "namespace": "tsl", + "name": "mass", + "occurrence": "1", + "required": true + }, + "e_critical": { + "__class__": "nodes.ChildNode", + "description": [ + "Energy ($E/k_BT$) above which the static model of elastic scattering is adequate. ", + "(total scattering properties may be obtained from fast region elastic and summed ", + "inelastic for the appropriate materials). This is equivalent to ENDF-6's B(2) value." + ], + "name": "e_critical", + "occurrence": "1", + "required": false + }, + "e_max": { + "__class__": "nodes.ChildNode", + "description": "The upper energy limit for which $S_{\\alpha, \\beta}$ may be used.", + "name": "e_max", + "occurrence": "1", + "required": true + }, + "boundAtomCrossSection": { + "__class__": "nodes.ChildNode", + "description": "The bound atom cross section for the principal scatterer. ", + "name": "boundAtomCrossSection", + "occurrence": "1", + "required": true + }, + "coherentAtomCrossSection": { + "__class__": "nodes.ChildNode", + "description": "The coherent cross section, $\\sigma_{\\textrm{\\scriptsize coh},i}$. In the incoherent approximation, this cross section is equivalent to the bound cross section, so is redundant.", + "name": "coherentAtomCrossSection", + "occurrence": "1", + "required": false + }, + "distinctScatteringKernel": { + "__class__": "nodes.ChildNode", + "description": "The distinct part of the scattering kernel, ${\\cal S}_{\\textrm{\\scriptsize dis},i}(\\alpha,\\beta,T)$", + "name": "distinctScatteringKernel", + "occurrence": "1", + "required": false + }, + "selfScatteringKernel": { + "__class__": "nodes.ChildNode", + "description": "The self part of the scattering kernel, ${\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)$", + "name": "selfScatteringKernel", + "occurrence": "1", + "required": true + }, + "T_effective": { + "__class__": "nodes.ChildNode", + "description": "Effective temperature to use for this scattering atom in the short-collision-time approximation.", + "name": "T_effective", + "occurrence": "1", + "required": false + } + }, + "description": [ + "Each scatterer has its own contribution to the total thermal scattering law cross section. ", + "In the legacy ENDF-6 format, each scatterer is stored in its own file, leading to possible ", + "bookkeeping errors. For example, the thermal scatter law data for H$_2$O is broken into two ", + "files, {\\ttfamily tsl-HinH2O.endf} and {\\ttfamily tsl-OinH2O.endf}. ", + "In the {\\ttfamily tsl-HinH2O.endf} file, both the Hydrogen and Oxygen scatterers are ", + "listed, but only the data for Hydrogen is provided.", + "\n\n", + "In this format specification two possibilities are allowed:", + "\\begin{itemize}", + " \\item The legacy, multiple file, arrangement where the thermal scattering law data is split across several files", + " \\item A unified file where all the scatterers for a molecule are collected in one file,", + "\\end{itemize}", + "Either way one must provide enough data to support legacy data processing where each scattering ", + "center's data is separated so that it may be ``pasted'' on to the equivalent high energy evaluation. ", + "The free atom cross section is also provided in order to facilitate this ``pasting''." + ], + "name": "scatteringAtom", + "required": true, + "rootNode": false + }, + "scatteringAtoms":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "scatteringAtom": { + "__class__": "nodes.ChildNode", + "description": [ + "Each scatterer has its own contribution to the total thermal scattering law cross section, so all the information needed ", + "to compute this contribution is contained in this child element." + ], + "name": "scatteringAtom", + "occurrence": "1+", + "required": true + } + }, + "description": "To collect the data for all the scatterers together, one defines the following container element for all thermal scattering law scatterers.", + "name": "scatteringAtoms", + "required": true, + "rootNode": false + }, + "e_critical":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unit of energy. ``eV'' is a good choice.", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Value of the energy.", + "name": "value", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "Energy above which the static model of elastic scattering is adequate. Above this energy, total scattering properties may be obtained from MT=2 as givin in File 2 or 3 and File 4 of the appropriate materials. This is equivalent to ENDF-6's \\texttt{B(2)} field.", + "name": "e_critical", + "required": false, + "rootNode": false + }, + "e_max":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unit of energy. ``eV'' is a good choice.", + "name": "unit", + "required": false, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Value of the energy.", + "name": "value", + "required": false, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "The upper energy limit for which $S_{\\alpha, \\beta}$ may be used. This is equivalent to ENDF-6's \\texttt{B(4)} field.", + "name": "e_max", + "required": true, + "rootNode": false + }, + "boundAtomCrossSection":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Any valid unit of area is acceptable however ``b'' is most appropriate.", + "name": "unit", + "required": true, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Value of the cross section.", + "name": "value", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "The $\\sigma_{\\textrm{\\scriptsize bound},i}$ cross section.", + "name": "boundAtomCrossSection", + "required": true, + "rootNode": false + }, + "coherentAtomCrossSection":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "unit": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Unit of area, such as ``b''.", + "name": "unit", + "required": true, + "type": "XMLName" + }, + "value": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Value of the cross section.", + "name": "value", + "required": true, + "type": "Float64" + } + }, + "bodyText": null, + "childNodes": {}, + "description": "The coherent cross section, $\\sigma_{\\textrm{\\scriptsize coh},i}$. In the incoherent approximation, this cross section is equivalent to the bound cross section, so is redundant.", + "name": "coherentAtomCrossSection", + "required": false, + "rootNode": false + }, + "selfScatteringKernel":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": { + "symmetric": { + "__class__": "nodes.Attribute", + "default": null, + "description": "Indicates whether the asymmetric version of the scattering kernel is used. Equivalent to the ENDF-6 \\texttt{LASYM} flag.", + "name": "symmetric", + "required": false, + "type": "Boolean" + } + }, + "bodyText": null, + "childNodes": { + "gridded3d": { + "__class__": "nodes.ChildNode", + "description": "The self part of the scattering kernel using a \\element{gridded3d} container with axes $\\alpha$, $\\beta$ and $T$", + "name": "gridded3d", + "occurrence": "choice", + "required": false + }, + "GaussianApproximation": { + "__class__": "nodes.ChildNode", + "description": "The self part of the scattering kernel using the Gaussian approximation.", + "name": "GaussianApproximation", + "occurrence": "choice", + "required": false + }, + "SCTApproximation": { + "__class__": "nodes.ChildNode", + "description": "The self part of the scattering kernel using the short collision time approximation.", + "name": "SCTApproximation", + "occurrence": "choice", + "required": false + }, + "freeGasApproximation": { + "__class__": "nodes.ChildNode", + "description": "The self part of the scattering kernel using the free gas approximation.", + "name": "freeGasApproximation", + "occurrence": "choice", + "required": false + } + }, + "description": [ + "The self-part of the scattering kernel, denoted as ${\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)$. ", + "If the kernel is symmetric in $\\beta$, then it is useful to define and provide ", + "$S_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)=e^{\\beta/2}{\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)$. ", + "With this, ", + "${\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)=e^{-\\beta}{\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,-\\beta,T)$ ", + "becomes $S_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)=S_{\\textrm{\\scriptsize self},i}(\\alpha,-\\beta,T)$.", + "\n\n", + "Note that the rectangular $\\alpha-\\beta$ grid covered by the the interpolation tables here, when mapped ", + "back to $E-\\mu$ space, does not cover the full range of $E$ and $\\mu$. In the legacy ENDF format the ", + "$\\alpha-\\beta$ grid is padded with zeros. When one encounters the zeros, one is supposed to switch from ", + "the full ${\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)$ to the short collision time approximation. ", + "How this transition is effected in practice is defined by the processing codes.", + "\n\n", + "In ENDF, there is an option for storing $\\log({\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T))$, ", + "rather than ${\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)$. This allows for a larger dynamic ", + "range of values of ${\\cal S}_{\\textrm{\\scriptsize self},i}(\\alpha,\\beta,T)$, given ENDF's limited precision. ", + "GNDS does not suffer from the same space limitations of ENDF so has no need for this flag." + ], + "name": "selfScatteringKernel", + "required": true, + "rootNode": false + }, + "distinctScatteringKernel":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "gridded3d": { + "__class__": "nodes.ChildNode", + "description": "The distinct part of the scattering kernel using a \\element{gridded3d} container with axes $\\alpha$, $\\beta$ and $T$", + "name": "gridded3d", + "occurrence": "1", + "required": false + } + }, + "description": "The distinct part of the scattering kernel, ${\\cal S}_{\\textrm{\\scriptsize dis},i}(\\alpha,\\beta,T)$", + "name": "distinctScatteringKernel", + "required": false, + "rootNode": false + }, + "T_effective":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "Function giving the correspondence between actual and effective temperature. Both axes are in units of temperature, e.g. `K'.", + "name": "XYs1d", + "occurrence": "1", + "required": true + } + }, + "description": ["Effective temperatures for use in the short collision time approximation.", + "Note that the short-collision-time approximation may be required for more than one type of scattering kernel:", + "if the scattering kernel is `SCTapproximation' then the SCT is used everywhere,", + "but it is also used with scattering kernel `gridded3d' for values of $\\alpha$ and $\\beta$", + "outside the tabulated array."], + "name": "T_effective", + "required": false, + "rootNode": false + }, + + "GaussianApproximation":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "phononSpectrum": { + "__class__": "nodes.ChildNode", + "description": "The phonon spectrum $\\rho(\\omega)$.", + "name": "phononSpectrum", + "occurrence": "1", + "required": false + } + }, + "description": [ + "By making the so-called Gaussian approximation to the intermediate scattering function ", + "\\cite{VanHove1954,HehrThesis}, the self part of the scattering kernel can be written in terms of ", + "the material phonon spectrum $\\rho(\\omega)$: ", + "\\begin{equation}", + " {\\cal S}_{\\textrm{\\scriptsize self}}(\\alpha, \\beta)=\\frac{1}{2\\pi}\\int_{-\\infty}^{\\infty}dt\\,e^{i\\beta t}e^{-\\gamma(t)}", + "\\end{equation}", + "where ", + "\\begin{equation}", + " \\gamma(t) = \\alpha\\int_{-\\infty}^{\\infty} d\\omega \\rho(\\omega)\\left(1-e^{-i\\omega t}\\right)\\frac{e^{-\\omega/2k_BT}}{(2\\omega/k_BT) \\sinh(\\omega/2k_BT)}", + "\\end{equation}", + "This Fourier transform is coded in R.E. MacFarlane's LEAPR module of NJOY \\cite{NJOYManual} and can be ", + "used to generate the inelastic scattering kernel. ", + "\n\n", + "Note that if the full scattering kernel is well approximated by only the self term and in this ", + "Gaussian approximation, the entire scattering kernel can be specified with the phonon spectrum. ", + "This spectrum may have a discrete portion and/or a continuous portion. Nevertheless, this offers one a ", + "compact way to encapsulate the scattering kernel and it provides one with a two-dimensional object that ", + "one can use to specify covariance." + ], + "name": "GaussianApproximation", + "required": false, + "rootNode": false + }, + "phononSpectrum":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": { + "XYs1d": { + "__class__": "nodes.ChildNode", + "description": "The actual interpolation table for the phonon spectrum $\\rho(\\omega)$ ", + "name": "XYs1d", + "occurrence": "1", + "required": true + } + }, + "description": "The phonon spectrum $\\rho(\\omega)$", + "name": "phononSpectrum", + "required": false, + "rootNode": false + }, + + "SCTApproximation":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": {}, + "description": [ + "Indicates that the short-collision-time (SCT) approximation should be ", + "used for this scattering atom for all values of $\\alpha$ and $\\beta$, not just for values", + "outside the tabulated grid.\\footnote{The SCT equation is given correctly in the General Atomics", + "report GA-9950, UC-80, Reactor Technology (1970), but is misprinted in ", + "LA-9303-M VOL II (ENDF-324) 1982, and in BNL-NCS-44945-05-Revised June 2005 (ENDF-102).} ", + "\\begin{equation}", + " S_{\\textrm{\\scriptsize self},i} (\\alpha, \\beta, T) \\approx", + " \\frac{ \\exp \\left[ -\\frac{\\left( \\alpha - \\left| \\beta \\right| \\right)^2 T}{4\\alpha T_{\\textrm{\\scriptsize eff},i} (T )}", + " - \\frac{ |\\beta |}{2} \\right] }{\\sqrt {4\\pi \\alpha \\frac{T_{\\textrm{\\scriptsize eff},i} (T)}{T} }}", + "\\end{equation}", + "The legacy ENDF-6 format signals this with the B(7)=0.0 flag" + ], + "name": "SCTApproximation", + "required": false, + "rootNode": false + }, + + "freeGasApproximation":{ + "__class__": "nodes.Node", + "abstractNode": null, + "attributes": {}, + "bodyText": null, + "childNodes": {}, + "description": [ + "Indicates that a free-gas approximation should be ", + "used for this scattering atom. In practice the free-gas approximation is typically used for", + "secondary scattering atoms that have little impact on the scattering cross section,", + "and processing codes may simply ignore the contribution of these scattering atoms.", + "The legacy ENDF-6 format signals this with the B(7)=1.0 flag" + ], + "name": "freeGasApproximation", + "required": false, + "rootNode": false + } +} diff --git a/standards/gnds-2.0/test/c/src/v2.0.h b/standards/gnds-2.0/test/c/src/v2.0.h new file mode 100644 index 000000000..70aa09ccc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0.h @@ -0,0 +1,631 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// ----------------------------------------------------------------------------- +// This header file is designed to work with both C and C++ +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0 +#define C_INTERFACE_TEST_V2_0 + +#include "GNDStk.h" + +#ifdef __cplusplus + // For C++ + #include "test/v2.0.hpp" +#endif + +#include "v2.0/fissionTransport/A.h" + +#include "v2.0/transport/A.h" + +#include "v2.0/documentation/Abstract.h" +#include "v2.0/documentation/Acknowledgement.h" +#include "v2.0/documentation/Acknowledgements.h" + +#include "v2.0/transport/Add.h" + +#include "v2.0/documentation/Affiliation.h" +#include "v2.0/documentation/Affiliations.h" + +#include "v2.0/pops/Alias.h" +#include "v2.0/pops/Aliases.h" + +#include "v2.0/styles/AngularDistributionReconstructed.h" + +#include "v2.0/transport/AngularEnergy.h" + +#include "v2.0/processed/AngularEnergyMC.h" + +#include "v2.0/transport/AngularTwoBody.h" +#include "v2.0/transport/Angular_uncorrelated.h" + +#include "v2.0/appData/ApplicationData.h" + +#include "v2.0/containers/Array.h" + +#include "v2.0/pops/Atomic.h" + +#include "v2.0/documentation/Author.h" +#include "v2.0/documentation/Authors.h" + +#include "v2.0/processed/AvailableEnergy.h" +#include "v2.0/processed/AvailableMomentum.h" + +#include "v2.0/pops/AverageEnergies.h" +#include "v2.0/pops/AverageEnergy.h" + +#include "v2.0/covariance/AverageParameterCovariance.h" + +#include "v2.0/styles/AverageProductData.h" + +#include "v2.0/processed/AverageProductEnergy.h" +#include "v2.0/processed/AverageProductMomentum.h" + +#include "v2.0/containers/Axes.h" +#include "v2.0/containers/Axis.h" + +#include "v2.0/fissionTransport/B.h" + +#include "v2.0/transport/Background.h" + +#include "v2.0/pops/Baryon.h" +#include "v2.0/pops/Baryons.h" + +#include "v2.0/documentation/Bibitem.h" +#include "v2.0/documentation/Bibliography.h" + +#include "v2.0/pops/BindingEnergy.h" + +#include "v2.0/documentation/Body.h" + +#include "v2.0/styles/Bondarenko.h" + +#include "v2.0/tsl/BoundAtomCrossSection.h" +#include "v2.0/tsl/BraggEdge.h" +#include "v2.0/tsl/BraggEdges.h" +#include "v2.0/tsl/BraggEnergy.h" + +#include "v2.0/transport/Branching1d.h" +#include "v2.0/transport/Branching3d.h" + +#include "v2.0/resonances/BreitWigner.h" + +#include "v2.0/containers/Cdf_in_xs_pdf_cdf1d.h" + +#include "v2.0/resonances/Channel.h" +#include "v2.0/resonances/Channels.h" + +#include "v2.0/pops/Charge.h" +#include "v2.0/pops/ChemicalElement.h" +#include "v2.0/pops/ChemicalElements.h" + +#include "v2.0/documentation/CodeRepo.h" + +#include "v2.0/tsl/CoherentAtomCrossSection.h" + +#include "v2.0/transport/CoherentPhoton.h" + +#include "v2.0/atomic/CoherentPhotonScattering.h" + +#include "v2.0/documentation/Collaboration.h" +#include "v2.0/documentation/Collaborations.h" + +#include "v2.0/containers/Column.h" + +#include "v2.0/covariance/ColumnData.h" + +#include "v2.0/containers/ColumnHeaders.h" + +#include "v2.0/covariance/ColumnSensitivity.h" + +#include "v2.0/documentation/ComputerCode.h" +#include "v2.0/documentation/ComputerCodes.h" + +#include "v2.0/containers/ConfidenceIntervals.h" + +#include "v2.0/pops/ConfidenceIntervals.h" +#include "v2.0/pops/Configuration.h" +#include "v2.0/pops/Configurations.h" + +#include "v2.0/containers/Constant1d.h" + +#include "v2.0/pops/Continuum.h" + +#include "v2.0/documentation/Contributor.h" +#include "v2.0/documentation/Contributors.h" + +#include "v2.0/appData/Conversion.h" + +#include "v2.0/documentation/Copyright.h" +#include "v2.0/documentation/CorrectionScript.h" + +#include "v2.0/cpTransport/CoulombPlusNuclearElastic.h" + +#include "v2.0/styles/CoulombPlusNuclearElasticMuCutoff.h" + +#include "v2.0/containers/Covariance.h" + +#include "v2.0/covariance/Covariance.h" +#include "v2.0/covariance/CovarianceMatrix.h" + +#include "v2.0/documentation/CovarianceScript.h" + +#include "v2.0/covariance/CovarianceSection.h" +#include "v2.0/covariance/CovarianceSections.h" +#include "v2.0/covariance/CovarianceSuite.h" + +#include "v2.0/transport/CrossSection.h" + +#include "v2.0/styles/CrossSectionReconstructed.h" + +#include "v2.0/transport/CrossSectionSum.h" +#include "v2.0/transport/CrossSectionSums.h" + +#include "v2.0/containers/Data.h" + +#include "v2.0/documentation/Date.h" +#include "v2.0/documentation/Dates.h" + +#include "v2.0/tsl/DebyeWallerIntegral.h" + +#include "v2.0/pops/Decay.h" +#include "v2.0/pops/DecayData.h" +#include "v2.0/pops/DecayMode.h" +#include "v2.0/pops/DecayModes.h" +#include "v2.0/pops/DecayPath.h" + +#include "v2.0/fissionTransport/DelayedBetaEnergy.h" +#include "v2.0/fissionTransport/DelayedGammaEnergy.h" + +#include "v2.0/fissionFragmentData/DelayedNeutron.h" + +#include "v2.0/fissionTransport/DelayedNeutronKE.h" + +#include "v2.0/fissionFragmentData/DelayedNeutrons.h" + +#include "v2.0/pops/Discrete.h" +#include "v2.0/pops/DiscreteEnergy.h" + +#include "v2.0/transport/DiscreteGamma.h" + +#include "v2.0/tsl/DistinctScatteringKernel.h" + +#include "v2.0/transport/Distribution.h" + +#include "v2.0/documentation/Documentation.h" + +#include "v2.0/containers/Double.h" + +#include "v2.0/extra/Double.h" + +#include "v2.0/transport/DoubleDifferentialCrossSection.h" + +#include "v2.0/fissionTransport/EFH.h" +#include "v2.0/fissionTransport/EFL.h" + +#include "v2.0/appData/ENDFconversionFlags.h" + +#include "v2.0/tsl/E_critical.h" +#include "v2.0/tsl/E_max.h" + +#include "v2.0/fpy/ElapsedTime.h" +#include "v2.0/fpy/ElapsedTimes.h" + +#include "v2.0/documentation/EndfCompatible.h" + +#include "v2.0/common/Energy.h" + +#include "v2.0/fpy/Energy.h" + +#include "v2.0/pops/Energy.h" + +#include "v2.0/transport/EnergyAngular.h" + +#include "v2.0/processed/EnergyAngularMC.h" + +#include "v2.0/resonances/EnergyInterval.h" +#include "v2.0/resonances/EnergyIntervals.h" + +#include "v2.0/transport/Energy_uncorrelated.h" + +#include "v2.0/styles/EqualProbableBins.h" +#include "v2.0/styles/Evaluated.h" + +#include "v2.0/transport/Evaporation.h" + +#include "v2.0/documentation/ExecutionArguments.h" +#include "v2.0/documentation/ExforDataSet.h" +#include "v2.0/documentation/ExforDataSets.h" +#include "v2.0/documentation/ExperimentalDataSets.h" + +#include "v2.0/common/ExternalFile.h" +#include "v2.0/common/ExternalFiles.h" + +#include "v2.0/resonances/ExternalRMatrix.h" + +#include "v2.0/transport/F.h" +#include "v2.0/transport/FastRegion.h" + +#include "v2.0/fissionTransport/FissionComponent.h" +#include "v2.0/fissionTransport/FissionComponents.h" +#include "v2.0/fissionTransport/FissionEnergyReleased.h" + +#include "v2.0/fissionFragmentData/FissionFragmentData.h" + +#include "v2.0/styles/Flux.h" + +#include "v2.0/atomic/FormFactor.h" + +#include "v2.0/transport/Forward.h" + +#include "v2.0/containers/Fraction.h" + +#include "v2.0/tsl/FreeGasApproximation.h" + +#include "v2.0/containers/Function1ds.h" +#include "v2.0/containers/Function2ds.h" +#include "v2.0/containers/Function3ds.h" + +#include "v2.0/transport/G.h" + +#include "v2.0/pops/GaugeBoson.h" +#include "v2.0/pops/GaugeBosons.h" + +#include "v2.0/tsl/GaussianApproximation.h" + +#include "v2.0/transport/GeneralEvaporation.h" + +#include "v2.0/containers/Grid.h" +#include "v2.0/containers/Gridded1d.h" +#include "v2.0/containers/Gridded2d.h" +#include "v2.0/containers/Gridded3d.h" + +#include "v2.0/styles/GriddedCrossSection.h" + +#include "v2.0/pops/Halflife.h" + +#include "v2.0/resonances/HardSphereRadius.h" + +#include "v2.0/styles/Heated.h" +#include "v2.0/styles/HeatedMultiGroup.h" + +#include "v2.0/atomic/ImaginaryAnomalousFactor.h" + +#include "v2.0/cpTransport/ImaginaryInterferenceTerm.h" + +#include "v2.0/map/Import.h" + +#include "v2.0/fpy/IncidentEnergies.h" +#include "v2.0/fpy/IncidentEnergy.h" + +#include "v2.0/transport/IncoherentPhoton.h" + +#include "v2.0/atomic/IncoherentPhotonScattering.h" + +#include "v2.0/transport/IncompleteReactions.h" + +#include "v2.0/documentation/InputDeck.h" +#include "v2.0/documentation/InputDecks.h" + +#include "v2.0/appData/Institution.h" + +#include "v2.0/containers/Integer.h" + +#include "v2.0/pops/Intensity.h" +#include "v2.0/pops/InternalConversionCoefficients.h" +#include "v2.0/pops/InternalPairFormationCoefficient.h" + +#include "v2.0/containers/Interval.h" + +#include "v2.0/pops/Interval.h" + +#include "v2.0/styles/InverseSpeed.h" + +#include "v2.0/pops/Isotope.h" +#include "v2.0/pops/Isotopes.h" + +#include "v2.0/transport/Isotropic2d.h" + +#include "v2.0/resonances/J.h" +#include "v2.0/resonances/Js.h" + +#include "v2.0/transport/KalbachMann.h" + +#include "v2.0/documentation/Keyword.h" +#include "v2.0/documentation/Keywords.h" + +#include "v2.0/resonances/L.h" + +#include "v2.0/containers/Legendre.h" + +#include "v2.0/pops/Lepton.h" +#include "v2.0/pops/Leptons.h" + +#include "v2.0/resonances/LevelSpacing.h" + +#include "v2.0/containers/Link.h" +#include "v2.0/containers/ListOfCovariances.h" +#include "v2.0/containers/LogNormal.h" + +#include "v2.0/pops/LogNormal.h" + +#include "v2.0/resonances/Ls.h" + +#include "v2.0/fissionTransport/MadlandNix.h" + +#include "v2.0/map/Map.h" + +#include "v2.0/common/Mass.h" + +#include "v2.0/pops/Mass.h" + +#include "v2.0/tsl/Mass.h" + +#include "v2.0/pops/MetaStable.h" + +#include "v2.0/covariance/Mixed.h" + +#include "v2.0/styles/MonteCarlo_cdf.h" +#include "v2.0/styles/MultiBand.h" +#include "v2.0/styles/MultiGroup.h" + +#include "v2.0/processed/MultiGroup3d.h" + +#include "v2.0/transport/MultiGroup3d.h" +#include "v2.0/transport/Multiplicity.h" +#include "v2.0/transport/MultiplicitySum.h" +#include "v2.0/transport/MultiplicitySums.h" +#include "v2.0/transport/NBodyPhaseSpace.h" + +#include "v2.0/fissionTransport/NeutrinoEnergy.h" +#include "v2.0/fissionTransport/NonNeutrinoEnergy.h" + +#include "v2.0/documentation/Note.h" + +#include "v2.0/cpTransport/NuclearAmplitudeExpansion.h" +#include "v2.0/cpTransport/NuclearPlusInterference.h" +#include "v2.0/cpTransport/NuclearTerm.h" + +#include "v2.0/pops/Nucleus.h" +#include "v2.0/pops/Nuclide.h" + +#include "v2.0/fpy/Nuclides.h" + +#include "v2.0/pops/Nuclides.h" + +#include "v2.0/transport/OrphanProduct.h" +#include "v2.0/transport/OrphanProducts.h" +#include "v2.0/transport/OutputChannel.h" + +#include "v2.0/documentation/OutputDeck.h" +#include "v2.0/documentation/OutputDecks.h" + +#include "v2.0/covariance/ParameterCovariance.h" +#include "v2.0/covariance/ParameterCovarianceMatrix.h" +#include "v2.0/covariance/ParameterCovariances.h" +#include "v2.0/covariance/ParameterLink.h" +#include "v2.0/covariance/Parameters.h" + +#include "v2.0/pops/Parity.h" + +#include "v2.0/containers/Pdf.h" + +#include "v2.0/pops/Pdf.h" + +#include "v2.0/containers/Pdf_in_xs_pdf_cdf1d.h" + +#include "v2.0/tsl/PhononSpectrum.h" + +#include "v2.0/pops/PhotonEmissionProbabilities.h" + +#include "v2.0/transport/PhotonEmissionProbabilities.h" + +#include "v2.0/pops/PoPs_database.h" + +#include "v2.0/containers/Polynomial1d.h" + +#include "v2.0/pops/PositronEmissionIntensity.h" + +#include "v2.0/transport/PrimaryGamma.h" + +#include "v2.0/common/Probability.h" + +#include "v2.0/pops/Probability.h" + +#include "v2.0/common/Product.h" + +#include "v2.0/pops/Product.h" + +#include "v2.0/fpy/ProductYield.h" +#include "v2.0/fpy/ProductYields.h" + +#include "v2.0/transport/Production.h" +#include "v2.0/transport/Productions.h" + +#include "v2.0/common/Products.h" + +#include "v2.0/pops/Products.h" + +#include "v2.0/styles/ProjectileEnergyDomain.h" + +#include "v2.0/fissionTransport/PromptGammaEnergy.h" +#include "v2.0/fissionTransport/PromptNeutronKE.h" +#include "v2.0/fissionTransport/PromptProductKE.h" + +#include "v2.0/map/Protare.h" + +#include "v2.0/common/Q.h" + +#include "v2.0/pops/Q.h" + +#include "v2.0/transport/R.h" + +#include "v2.0/resonances/RMatrix.h" + +#include "v2.0/fissionFragmentData/Rate.h" + +#include "v2.0/transport/Reaction.h" +#include "v2.0/transport/ReactionSuite.h" +#include "v2.0/transport/Reactions.h" + +#include "v2.0/atomic/RealAnomalousFactor.h" + +#include "v2.0/cpTransport/RealInterferenceTerm.h" + +#include "v2.0/styles/Realization.h" + +#include "v2.0/transport/Recoil.h" +#include "v2.0/transport/Reference.h" + +#include "v2.0/containers/Regions1d.h" +#include "v2.0/containers/Regions2d.h" +#include "v2.0/containers/Regions3d.h" + +#include "v2.0/documentation/RelatedItem.h" +#include "v2.0/documentation/RelatedItems.h" + +#include "v2.0/resonances/Resolved.h" + +#include "v2.0/transport/ResolvedRegion.h" + +#include "v2.0/resonances/ResonanceParameters.h" +#include "v2.0/resonances/ResonanceReaction.h" +#include "v2.0/resonances/ResonanceReactions.h" +#include "v2.0/resonances/Resonances.h" + +#include "v2.0/transport/ResonancesLink.h" +#include "v2.0/transport/ResonancesWithBackground.h" + +#include "v2.0/covariance/RowData.h" +#include "v2.0/covariance/RowSensitivity.h" + +#include "v2.0/cpTransport/RutherfordScattering.h" + +#include "v2.0/tsl/SCTApproximation.h" +#include "v2.0/tsl/S_table.h" + +#include "v2.0/covariance/SandwichProduct.h" + +#include "v2.0/tsl/ScatteringAtom.h" +#include "v2.0/tsl/ScatteringAtoms.h" + +#include "v2.0/atomic/ScatteringFactor.h" + +#include "v2.0/resonances/ScatteringRadius.h" + +#include "v2.0/tsl/SelfScatteringKernel.h" + +#include "v2.0/pops/Shell.h" + +#include "v2.0/covariance/ShortRangeSelfScalingVariance.h" + +#include "v2.0/styles/SigmaZeros.h" + +#include "v2.0/fissionTransport/SimpleMaxwellianFission.h" + +#include "v2.0/covariance/Slice.h" +#include "v2.0/covariance/Slices.h" + +#include "v2.0/styles/SnElasticUpScatter.h" + +#include "v2.0/pops/Spectra.h" +#include "v2.0/pops/Spectrum.h" +#include "v2.0/pops/Spin.h" + +#include "v2.0/resonances/SpinGroup.h" +#include "v2.0/resonances/SpinGroups.h" + +#include "v2.0/containers/Standard.h" + +#include "v2.0/pops/Standard.h" + +#include "v2.0/containers/String.h" + +#include "v2.0/tsl/StructureFactor.h" + +#include "v2.0/styles/Styles.h" + +#include "v2.0/covariance/Sum.h" +#include "v2.0/covariance/Summand.h" + +#include "v2.0/transport/Summands.h" +#include "v2.0/transport/Sums.h" + +#include "v2.0/map/TNSL.h" + +#include "v2.0/fissionTransport/T_M.h" + +#include "v2.0/tsl/T_effective.h" + +#include "v2.0/containers/Table.h" + +#include "v2.0/resonances/TabulatedWidths.h" + +#include "v2.0/common/Temperature.h" + +#include "v2.0/styles/Temperature.h" + +#include "v2.0/tsl/ThermalNeutronScatteringLaw.h" +#include "v2.0/tsl/ThermalNeutronScatteringLaw1d.h" +#include "v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.h" +#include "v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.h" +#include "v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.h" + +#include "v2.0/transport/Theta.h" + +#include "v2.0/fpy/Time.h" + +#include "v2.0/documentation/Title.h" + +#include "v2.0/fissionTransport/TotalEnergy.h" + +#include "v2.0/styles/Transportable.h" +#include "v2.0/styles/Transportables.h" + +#include "v2.0/transport/U.h" + +#include "v2.0/styles/URR_probabilityTables.h" + +#include "v2.0/transport/URR_probabilityTables1d.h" + +#include "v2.0/containers/Uncertainty.h" + +#include "v2.0/extra/Uncertainty.h" + +#include "v2.0/pops/Uncertainty.h" + +#include "v2.0/transport/Uncorrelated.h" + +#include "v2.0/pops/Unorthodox.h" +#include "v2.0/pops/Unorthodoxes.h" + +#include "v2.0/resonances/Unresolved.h" + +#include "v2.0/transport/UnresolvedRegion.h" +#include "v2.0/transport/Unspecified.h" + +#include "v2.0/containers/Values.h" + +#include "v2.0/documentation/Version.h" + +#include "v2.0/fissionTransport/Watt.h" + +#include "v2.0/transport/Weighted.h" +#include "v2.0/transport/WeightedFunctionals.h" + +#include "v2.0/resonances/Width.h" +#include "v2.0/resonances/Widths.h" + +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/XYs3d.h" +#include "v2.0/containers/Xs_in_xs_pdf_cdf1d.h" +#include "v2.0/containers/Xs_pdf_cdf1d.h" + +#include "v2.0/fpy/Yields.h" + +#include "v2.0/containers/Ys1d.h" + +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/ApplicationData.cpp b/standards/gnds-2.0/test/c/src/v2.0/appData/ApplicationData.cpp new file mode 100644 index 000000000..edad6ef90 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/appData/ApplicationData.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/appData/ApplicationData.hpp" +#include "ApplicationData.h" + +using namespace njoy::GNDStk; +using namespace test::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 = appData::Institution; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstApplicationData +ApplicationDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/appData/ApplicationData/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/ApplicationData.h b/standards/gnds-2.0/test/c/src/v2.0/appData/ApplicationData.h new file mode 100644 index 000000000..beb848749 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/appData/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_TEST_V2_0_APPDATA_APPLICATIONDATA +#define C_INTERFACE_TEST_V2_0_APPDATA_APPLICATIONDATA + +#include "GNDStk.h" +#include "v2.0/appData/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 +extern_c Handle2ApplicationData +ApplicationDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstApplicationData +ApplicationDataCreateConst( + ConstHandle2ConstInstitution institution +); + +// +++ Create, general +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/appData/ApplicationData/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/ApplicationData/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/appData/ApplicationData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/ApplicationData/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/appData/ApplicationData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/Conversion.cpp b/standards/gnds-2.0/test/c/src/v2.0/appData/Conversion.cpp new file mode 100644 index 000000000..8abdcad7d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/appData/Conversion.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/appData/Conversion.hpp" +#include "Conversion.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2Conversion +ConversionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConversion +ConversionCreateConst( + const XMLName flags, + const char *const href +) { + ConstHandle2Conversion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + flags, + href + ); + return handle; +} + +// Create, general +Handle2Conversion +ConversionCreate( + const XMLName 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 +XMLName +ConversionFlagsGet(ConstHandle2ConstConversion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FlagsGet", self, extract::flags); +} + +// Set +void +ConversionFlagsSet(ConstHandle2Conversion self, const XMLName 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/appData/Conversion/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/Conversion.h b/standards/gnds-2.0/test/c/src/v2.0/appData/Conversion.h new file mode 100644 index 000000000..c9926a98a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/appData/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_TEST_V2_0_APPDATA_CONVERSION +#define C_INTERFACE_TEST_V2_0_APPDATA_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 +extern_c Handle2Conversion +ConversionDefault(); + +// --- Create, general, const +extern_c Handle2ConstConversion +ConversionCreateConst( + const XMLName flags, + const char *const href +); + +// +++ Create, general +extern_c Handle2Conversion +ConversionCreate( + const XMLName 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 XMLName +ConversionFlagsGet(ConstHandle2ConstConversion self); + +// +++ Set +extern_c void +ConversionFlagsSet(ConstHandle2Conversion self, const XMLName 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/appData/Conversion/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/Conversion/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/appData/Conversion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/Conversion/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/appData/Conversion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags.cpp b/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags.cpp new file mode 100644 index 000000000..87d1b42a2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/appData/ENDFconversionFlags.hpp" +#include "ENDFconversionFlags.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ENDFconversionFlagsClass; +using CPP = multigroup::ENDFconversionFlags; + +static const std::string CLASSNAME = "ENDFconversionFlags"; + +namespace extract { + static auto conversion = [](auto &obj) { return &obj.conversion; }; +} + +using CPPConversion = appData::Conversion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstENDFconversionFlags +ENDFconversionFlagsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ENDFconversionFlags +ENDFconversionFlagsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstENDFconversionFlags +ENDFconversionFlagsCreateConst( + ConstHandle2ConstConversion conversion +) { + ConstHandle2ENDFconversionFlags handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(conversion) + ); + return handle; +} + +// Create, general +Handle2ENDFconversionFlags +ENDFconversionFlagsCreate( + ConstHandle2ConstConversion conversion +) { + ConstHandle2ENDFconversionFlags handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(conversion) + ); + return handle; +} + +// Assign +// Use this to assign 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"); +} + + +// ----------------------------------------------------------------------------- +// Child: conversion +// ----------------------------------------------------------------------------- + +// Has +int +ENDFconversionFlagsConversionHas(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConversionHas", self, extract::conversion); +} + +// Get, const +Handle2ConstConversion +ENDFconversionFlagsConversionGetConst(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConversionGetConst", self, extract::conversion); +} + +// Get, non-const +Handle2Conversion +ENDFconversionFlagsConversionGet(ConstHandle2ENDFconversionFlags self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConversionGet", self, extract::conversion); +} + +// Set +void +ENDFconversionFlagsConversionSet(ConstHandle2ENDFconversionFlags self, ConstHandle2ConstConversion conversion) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ConversionSet", self, extract::conversion, conversion); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/appData/ENDFconversionFlags/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags.h b/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags.h new file mode 100644 index 000000000..c3dd91e4b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags.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. +// +// 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_TEST_V2_0_APPDATA_ENDFCONVERSIONFLAGS +#define C_INTERFACE_TEST_V2_0_APPDATA_ENDFCONVERSIONFLAGS + +#include "GNDStk.h" +#include "v2.0/appData/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 +extern_c Handle2ENDFconversionFlags +ENDFconversionFlagsDefault(); + +// --- Create, general, const +extern_c Handle2ConstENDFconversionFlags +ENDFconversionFlagsCreateConst( + ConstHandle2ConstConversion conversion +); + +// +++ Create, general +extern_c Handle2ENDFconversionFlags +ENDFconversionFlagsCreate( + ConstHandle2ConstConversion conversion +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Child: conversion +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ENDFconversionFlagsConversionHas(ConstHandle2ConstENDFconversionFlags self); + +// --- Get, const +extern_c Handle2ConstConversion +ENDFconversionFlagsConversionGetConst(ConstHandle2ConstENDFconversionFlags self); + +// +++ Get, non-const +extern_c Handle2Conversion +ENDFconversionFlagsConversionGet(ConstHandle2ENDFconversionFlags self); + +// +++ Set +extern_c void +ENDFconversionFlagsConversionSet(ConstHandle2ENDFconversionFlags self, ConstHandle2ConstConversion conversion); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/appData/ENDFconversionFlags/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/appData/ENDFconversionFlags/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/Institution.cpp b/standards/gnds-2.0/test/c/src/v2.0/appData/Institution.cpp new file mode 100644 index 000000000..2d815e21e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/appData/Institution.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/appData/Institution.hpp" +#include "Institution.h" + +using namespace njoy::GNDStk; +using namespace test::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 = appData::ENDFconversionFlags; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInstitution +InstitutionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Institution +InstitutionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInstitution +InstitutionCreateConst( + const XMLName label, + ConstHandle2ConstENDFconversionFlags ENDFconversionFlags +) { + ConstHandle2Institution handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(ENDFconversionFlags) + ); + return handle; +} + +// Create, general +Handle2Institution +InstitutionCreate( + const XMLName 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 +XMLName +InstitutionLabelGet(ConstHandle2ConstInstitution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +InstitutionLabelSet(ConstHandle2Institution self, const XMLName 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/appData/Institution/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/Institution.h b/standards/gnds-2.0/test/c/src/v2.0/appData/Institution.h new file mode 100644 index 000000000..80eb16ac2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/appData/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_TEST_V2_0_APPDATA_INSTITUTION +#define C_INTERFACE_TEST_V2_0_APPDATA_INSTITUTION + +#include "GNDStk.h" +#include "v2.0/appData/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 +extern_c Handle2Institution +InstitutionDefault(); + +// --- Create, general, const +extern_c Handle2ConstInstitution +InstitutionCreateConst( + const XMLName label, + ConstHandle2ConstENDFconversionFlags ENDFconversionFlags +); + +// +++ Create, general +extern_c Handle2Institution +InstitutionCreate( + const XMLName 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 XMLName +InstitutionLabelGet(ConstHandle2ConstInstitution self); + +// +++ Set +extern_c void +InstitutionLabelSet(ConstHandle2Institution self, const XMLName 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/appData/Institution/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/Institution/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/appData/Institution/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/appData/Institution/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/appData/Institution/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/CoherentPhotonScattering.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/CoherentPhotonScattering.cpp new file mode 100644 index 000000000..7ea246804 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/CoherentPhotonScattering.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/atomic/CoherentPhotonScattering.hpp" +#include "CoherentPhotonScattering.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CoherentPhotonScatteringClass; +using CPP = multigroup::CoherentPhotonScattering; + +static const std::string CLASSNAME = "CoherentPhotonScattering"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; + 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 formFactor = [](auto &obj) { return &obj.formFactor; }; + static auto realAnomalousFactor = [](auto &obj) { return &obj.realAnomalousFactor; }; + static auto imaginaryAnomalousFactor = [](auto &obj) { return &obj.imaginaryAnomalousFactor; }; +} + +using CPPFormFactor = atomic::FormFactor; +using CPPRealAnomalousFactor = atomic::RealAnomalousFactor; +using CPPImaginaryAnomalousFactor = atomic::ImaginaryAnomalousFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCoherentPhotonScattering +CoherentPhotonScatteringDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CoherentPhotonScattering +CoherentPhotonScatteringDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCoherentPhotonScattering +CoherentPhotonScatteringCreateConst( + const char *const href, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstFormFactor formFactor, + ConstHandle2ConstRealAnomalousFactor realAnomalousFactor, + ConstHandle2ConstImaginaryAnomalousFactor imaginaryAnomalousFactor +) { + ConstHandle2CoherentPhotonScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href, + label, + pid, + productFrame, + detail::tocpp(formFactor), + detail::tocpp(realAnomalousFactor), + detail::tocpp(imaginaryAnomalousFactor) + ); + return handle; +} + +// Create, general +Handle2CoherentPhotonScattering +CoherentPhotonScatteringCreate( + const char *const href, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstFormFactor formFactor, + ConstHandle2ConstRealAnomalousFactor realAnomalousFactor, + ConstHandle2ConstImaginaryAnomalousFactor imaginaryAnomalousFactor +) { + ConstHandle2CoherentPhotonScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href, + label, + 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: 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: label +// ----------------------------------------------------------------------------- + +// Has +int +CoherentPhotonScatteringLabelHas(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CoherentPhotonScatteringLabelGet(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CoherentPhotonScatteringLabelSet(ConstHandle2CoherentPhotonScattering self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +CoherentPhotonScatteringPidHas(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +XMLName +CoherentPhotonScatteringPidGet(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +CoherentPhotonScatteringPidSet(ConstHandle2CoherentPhotonScattering self, const XMLName 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 +enums::Frame +CoherentPhotonScatteringProductFrameGet(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +CoherentPhotonScatteringProductFrameSet(ConstHandle2CoherentPhotonScattering self, const enums::Frame 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/atomic/CoherentPhotonScattering/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/CoherentPhotonScattering.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/CoherentPhotonScattering.h new file mode 100644 index 000000000..3b16d0cf6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/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_TEST_V2_0_ATOMIC_COHERENTPHOTONSCATTERING +#define C_INTERFACE_TEST_V2_0_ATOMIC_COHERENTPHOTONSCATTERING + +#include "GNDStk.h" +#include "v2.0/atomic/FormFactor.h" +#include "v2.0/atomic/RealAnomalousFactor.h" +#include "v2.0/atomic/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 +extern_c Handle2CoherentPhotonScattering +CoherentPhotonScatteringDefault(); + +// --- Create, general, const +extern_c Handle2ConstCoherentPhotonScattering +CoherentPhotonScatteringCreateConst( + const char *const href, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstFormFactor formFactor, + ConstHandle2ConstRealAnomalousFactor realAnomalousFactor, + ConstHandle2ConstImaginaryAnomalousFactor imaginaryAnomalousFactor +); + +// +++ Create, general +extern_c Handle2CoherentPhotonScattering +CoherentPhotonScatteringCreate( + const char *const href, + const XMLName label, + const XMLName pid, + const enums::Frame 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: 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringLabelHas(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CoherentPhotonScatteringLabelGet(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringLabelSet(ConstHandle2CoherentPhotonScattering self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringPidHas(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CoherentPhotonScatteringPidGet(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringPidSet(ConstHandle2CoherentPhotonScattering self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringProductFrameHas(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c enums::Frame +CoherentPhotonScatteringProductFrameGet(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringProductFrameSet(ConstHandle2CoherentPhotonScattering self, const enums::Frame 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/atomic/CoherentPhotonScattering/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/CoherentPhotonScattering/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/CoherentPhotonScattering/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/CoherentPhotonScattering/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/CoherentPhotonScattering/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor.cpp new file mode 100644 index 000000000..9714ff1cb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/atomic/FormFactor.hpp" +#include "FormFactor.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFormFactor +FormFactorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2FormFactor +FormFactorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFormFactor +FormFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2FormFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2FormFactor +FormFactorCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2FormFactor 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 +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); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +FormFactorRegions1dHas(ConstHandle2ConstFormFactor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +FormFactorRegions1dGetConst(ConstHandle2ConstFormFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +FormFactorRegions1dGet(ConstHandle2FormFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +FormFactorRegions1dSet(ConstHandle2FormFactor self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/atomic/FormFactor/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor.h new file mode 100644 index 000000000..da85dc892 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor.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. +// +// 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_TEST_V2_0_ATOMIC_FORMFACTOR +#define C_INTERFACE_TEST_V2_0_ATOMIC_FORMFACTOR + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.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 +extern_c Handle2FormFactor +FormFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstFormFactor +FormFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2FormFactor +FormFactorCreate( + 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 +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); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FormFactorRegions1dHas(ConstHandle2ConstFormFactor self); + +// --- Get, const +extern_c Handle2ConstRegions1d +FormFactorRegions1dGetConst(ConstHandle2ConstFormFactor self); + +// +++ Get, non-const +extern_c Handle2Regions1d +FormFactorRegions1dGet(ConstHandle2FormFactor self); + +// +++ Set +extern_c void +FormFactorRegions1dSet(ConstHandle2FormFactor self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/atomic/FormFactor/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/FormFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor.cpp new file mode 100644 index 000000000..f1274b814 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/atomic/ImaginaryAnomalousFactor.hpp" +#include "ImaginaryAnomalousFactor.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstImaginaryAnomalousFactor +ImaginaryAnomalousFactorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ImaginaryAnomalousFactor +ImaginaryAnomalousFactorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstImaginaryAnomalousFactor +ImaginaryAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2ImaginaryAnomalousFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2ImaginaryAnomalousFactor +ImaginaryAnomalousFactorCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2ImaginaryAnomalousFactor 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 +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); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +ImaginaryAnomalousFactorRegions1dHas(ConstHandle2ConstImaginaryAnomalousFactor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +ImaginaryAnomalousFactorRegions1dGetConst(ConstHandle2ConstImaginaryAnomalousFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +ImaginaryAnomalousFactorRegions1dGet(ConstHandle2ImaginaryAnomalousFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +ImaginaryAnomalousFactorRegions1dSet(ConstHandle2ImaginaryAnomalousFactor self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/atomic/ImaginaryAnomalousFactor/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor.h new file mode 100644 index 000000000..53663435c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor.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. +// +// 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_TEST_V2_0_ATOMIC_IMAGINARYANOMALOUSFACTOR +#define C_INTERFACE_TEST_V2_0_ATOMIC_IMAGINARYANOMALOUSFACTOR + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.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 +extern_c Handle2ImaginaryAnomalousFactor +ImaginaryAnomalousFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstImaginaryAnomalousFactor +ImaginaryAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2ImaginaryAnomalousFactor +ImaginaryAnomalousFactorCreate( + 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 +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); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ImaginaryAnomalousFactorRegions1dHas(ConstHandle2ConstImaginaryAnomalousFactor self); + +// --- Get, const +extern_c Handle2ConstRegions1d +ImaginaryAnomalousFactorRegions1dGetConst(ConstHandle2ConstImaginaryAnomalousFactor self); + +// +++ Get, non-const +extern_c Handle2Regions1d +ImaginaryAnomalousFactorRegions1dGet(ConstHandle2ImaginaryAnomalousFactor self); + +// +++ Set +extern_c void +ImaginaryAnomalousFactorRegions1dSet(ConstHandle2ImaginaryAnomalousFactor self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/atomic/ImaginaryAnomalousFactor/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/ImaginaryAnomalousFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/IncoherentPhotonScattering.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/IncoherentPhotonScattering.cpp new file mode 100644 index 000000000..4f8272b93 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/IncoherentPhotonScattering.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/atomic/IncoherentPhotonScattering.hpp" +#include "IncoherentPhotonScattering.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = IncoherentPhotonScatteringClass; +using CPP = multigroup::IncoherentPhotonScattering; + +static const std::string CLASSNAME = "IncoherentPhotonScattering"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; + 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 scatteringFactor = [](auto &obj) { return &obj.scatteringFactor; }; +} + +using CPPScatteringFactor = atomic::ScatteringFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIncoherentPhotonScattering +IncoherentPhotonScatteringDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2IncoherentPhotonScattering +IncoherentPhotonScatteringDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIncoherentPhotonScattering +IncoherentPhotonScatteringCreateConst( + const char *const href, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstScatteringFactor scatteringFactor +) { + ConstHandle2IncoherentPhotonScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href, + label, + pid, + productFrame, + detail::tocpp(scatteringFactor) + ); + return handle; +} + +// Create, general +Handle2IncoherentPhotonScattering +IncoherentPhotonScatteringCreate( + const char *const href, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstScatteringFactor scatteringFactor +) { + ConstHandle2IncoherentPhotonScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href, + label, + 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: 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: label +// ----------------------------------------------------------------------------- + +// Has +int +IncoherentPhotonScatteringLabelHas(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +IncoherentPhotonScatteringLabelGet(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +IncoherentPhotonScatteringLabelSet(ConstHandle2IncoherentPhotonScattering self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +IncoherentPhotonScatteringPidHas(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +XMLName +IncoherentPhotonScatteringPidGet(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +IncoherentPhotonScatteringPidSet(ConstHandle2IncoherentPhotonScattering self, const XMLName 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 +enums::Frame +IncoherentPhotonScatteringProductFrameGet(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +IncoherentPhotonScatteringProductFrameSet(ConstHandle2IncoherentPhotonScattering self, const enums::Frame 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/atomic/IncoherentPhotonScattering/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/IncoherentPhotonScattering.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/IncoherentPhotonScattering.h new file mode 100644 index 000000000..dae251caf --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/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_TEST_V2_0_ATOMIC_INCOHERENTPHOTONSCATTERING +#define C_INTERFACE_TEST_V2_0_ATOMIC_INCOHERENTPHOTONSCATTERING + +#include "GNDStk.h" +#include "v2.0/atomic/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 +extern_c Handle2IncoherentPhotonScattering +IncoherentPhotonScatteringDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncoherentPhotonScattering +IncoherentPhotonScatteringCreateConst( + const char *const href, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstScatteringFactor scatteringFactor +); + +// +++ Create, general +extern_c Handle2IncoherentPhotonScattering +IncoherentPhotonScatteringCreate( + const char *const href, + const XMLName label, + const XMLName pid, + const enums::Frame 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: 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncoherentPhotonScatteringLabelHas(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +IncoherentPhotonScatteringLabelGet(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Set +extern_c void +IncoherentPhotonScatteringLabelSet(ConstHandle2IncoherentPhotonScattering self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncoherentPhotonScatteringPidHas(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +IncoherentPhotonScatteringPidGet(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Set +extern_c void +IncoherentPhotonScatteringPidSet(ConstHandle2IncoherentPhotonScattering self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncoherentPhotonScatteringProductFrameHas(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c enums::Frame +IncoherentPhotonScatteringProductFrameGet(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Set +extern_c void +IncoherentPhotonScatteringProductFrameSet(ConstHandle2IncoherentPhotonScattering self, const enums::Frame 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/atomic/IncoherentPhotonScattering/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/IncoherentPhotonScattering/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/IncoherentPhotonScattering/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/IncoherentPhotonScattering/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/IncoherentPhotonScattering/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor.cpp new file mode 100644 index 000000000..1b3c39151 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/atomic/RealAnomalousFactor.hpp" +#include "RealAnomalousFactor.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRealAnomalousFactor +RealAnomalousFactorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2RealAnomalousFactor +RealAnomalousFactorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRealAnomalousFactor +RealAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2RealAnomalousFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2RealAnomalousFactor +RealAnomalousFactorCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2RealAnomalousFactor 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 +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); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +RealAnomalousFactorRegions1dHas(ConstHandle2ConstRealAnomalousFactor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +RealAnomalousFactorRegions1dGetConst(ConstHandle2ConstRealAnomalousFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +RealAnomalousFactorRegions1dGet(ConstHandle2RealAnomalousFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +RealAnomalousFactorRegions1dSet(ConstHandle2RealAnomalousFactor self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/atomic/RealAnomalousFactor/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor.h new file mode 100644 index 000000000..a85d6a412 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor.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. +// +// 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_TEST_V2_0_ATOMIC_REALANOMALOUSFACTOR +#define C_INTERFACE_TEST_V2_0_ATOMIC_REALANOMALOUSFACTOR + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.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 +extern_c Handle2RealAnomalousFactor +RealAnomalousFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstRealAnomalousFactor +RealAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2RealAnomalousFactor +RealAnomalousFactorCreate( + 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 +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); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RealAnomalousFactorRegions1dHas(ConstHandle2ConstRealAnomalousFactor self); + +// --- Get, const +extern_c Handle2ConstRegions1d +RealAnomalousFactorRegions1dGetConst(ConstHandle2ConstRealAnomalousFactor self); + +// +++ Get, non-const +extern_c Handle2Regions1d +RealAnomalousFactorRegions1dGet(ConstHandle2RealAnomalousFactor self); + +// +++ Set +extern_c void +RealAnomalousFactorRegions1dSet(ConstHandle2RealAnomalousFactor self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/atomic/RealAnomalousFactor/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/RealAnomalousFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor.cpp new file mode 100644 index 000000000..c716776d9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/atomic/ScatteringFactor.hpp" +#include "ScatteringFactor.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstScatteringFactor +ScatteringFactorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ScatteringFactor +ScatteringFactorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstScatteringFactor +ScatteringFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2ScatteringFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2ScatteringFactor +ScatteringFactorCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2ScatteringFactor 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 +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); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringFactorRegions1dHas(ConstHandle2ConstScatteringFactor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +ScatteringFactorRegions1dGetConst(ConstHandle2ConstScatteringFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +ScatteringFactorRegions1dGet(ConstHandle2ScatteringFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +ScatteringFactorRegions1dSet(ConstHandle2ScatteringFactor self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/atomic/ScatteringFactor/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor.h new file mode 100644 index 000000000..2913afb61 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor.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. +// +// 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_TEST_V2_0_ATOMIC_SCATTERINGFACTOR +#define C_INTERFACE_TEST_V2_0_ATOMIC_SCATTERINGFACTOR + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.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 +extern_c Handle2ScatteringFactor +ScatteringFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringFactor +ScatteringFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2ScatteringFactor +ScatteringFactorCreate( + 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 +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); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringFactorRegions1dHas(ConstHandle2ConstScatteringFactor self); + +// --- Get, const +extern_c Handle2ConstRegions1d +ScatteringFactorRegions1dGetConst(ConstHandle2ConstScatteringFactor self); + +// +++ Get, non-const +extern_c Handle2Regions1d +ScatteringFactorRegions1dGet(ConstHandle2ScatteringFactor self); + +// +++ Set +extern_c void +ScatteringFactorRegions1dSet(ConstHandle2ScatteringFactor self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/atomic/ScatteringFactor/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/atomic/ScatteringFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Energy.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Energy.cpp new file mode 100644 index 000000000..426af7512 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Energy.cpp @@ -0,0 +1,538 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/common/Energy.hpp" +#include "Energy.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EnergyClass; +using CPP = multigroup::Energy; + +static const std::string CLASSNAME = "Energy"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = containers::Uncertainty; +using CPPDouble = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergy +EnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Energy +EnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergy +EnergyCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Energy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + EnergyDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Create, general +Handle2Energy +EnergyCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Energy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + EnergyDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Assign +// Use this to assign 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: label +// ----------------------------------------------------------------------------- + +// Has +int +EnergyLabelHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +EnergyLabelGet(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EnergyLabelSet(ConstHandle2Energy self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +EnergyUnitHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +EnergyUnitGet(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +EnergyUnitSet(ConstHandle2Energy self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +EnergyValueHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +EnergyValueGet(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +EnergyValueSet(ConstHandle2Energy self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +EnergyDocumentationHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +EnergyDocumentationGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +EnergyDocumentationGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +EnergyDocumentationSet(ConstHandle2Energy self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// 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: Double +// ----------------------------------------------------------------------------- + +// Has +int +EnergyDoubleHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Clear +void +EnergyDoubleClear(ConstHandle2Energy self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DoubleClear", self, extract::Double); +} + +// Size +size_t +EnergyDoubleSize(ConstHandle2ConstEnergy self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DoubleSize", self, extract::Double); +} + +// Add +void +EnergyDoubleAdd(ConstHandle2Energy self, ConstHandle2ConstDouble Double) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DoubleAdd", self, extract::Double, Double); +} + +// Get, by index \in [0,size), const +Handle2ConstDouble +EnergyDoubleGetConst(ConstHandle2ConstEnergy self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Double +EnergyDoubleGet(ConstHandle2Energy self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double, index_); +} + +// Set, by index \in [0,size) +void +EnergyDoubleSet( + ConstHandle2Energy self, + const size_t index_, + ConstHandle2ConstDouble Double +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, index_, Double); +} + +// Has, by label +int +EnergyDoubleHasByLabel( + ConstHandle2ConstEnergy self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByLabel", + self, extract::Double, meta::label, label); +} + +// Get, by label, const +Handle2ConstDouble +EnergyDoubleGetByLabelConst( + ConstHandle2ConstEnergy self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabelConst", + self, extract::Double, meta::label, label); +} + +// Get, by label, non-const +Handle2Double +EnergyDoubleGetByLabel( + ConstHandle2Energy self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabel", + self, extract::Double, meta::label, label); +} + +// Set, by label +void +EnergyDoubleSetByLabel( + ConstHandle2Energy self, + const XMLName label, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByLabel", + self, extract::Double, meta::label, label, Double); +} + +// Has, by unit +int +EnergyDoubleHasByUnit( + ConstHandle2ConstEnergy self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByUnit", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstDouble +EnergyDoubleGetByUnitConst( + ConstHandle2ConstEnergy self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnitConst", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Double +EnergyDoubleGetByUnit( + ConstHandle2Energy self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnit", + self, extract::Double, meta::unit, unit); +} + +// Set, by unit +void +EnergyDoubleSetByUnit( + ConstHandle2Energy self, + const XMLName unit, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByUnit", + self, extract::Double, meta::unit, unit, Double); +} + +// Has, by value +int +EnergyDoubleHasByValue( + ConstHandle2ConstEnergy self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByValue", + self, extract::Double, meta::value, value); +} + +// Get, by value, const +Handle2ConstDouble +EnergyDoubleGetByValueConst( + ConstHandle2ConstEnergy self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValueConst", + self, extract::Double, meta::value, value); +} + +// Get, by value, non-const +Handle2Double +EnergyDoubleGetByValue( + ConstHandle2Energy self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValue", + self, extract::Double, meta::value, value); +} + +// Set, by value +void +EnergyDoubleSetByValue( + ConstHandle2Energy self, + const Float64 value, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByValue", + self, extract::Double, meta::value, value, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Energy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Energy.h b/standards/gnds-2.0/test/c/src/v2.0/common/Energy.h new file mode 100644 index 000000000..fe5110b89 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Energy.h @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COMMON_ENERGY +#define C_INTERFACE_TEST_V2_0_COMMON_ENERGY + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/containers/Uncertainty.h" +#include "v2.0/containers/Double.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 +extern_c Handle2Energy +EnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergy +EnergyCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Create, general +extern_c Handle2Energy +EnergyCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Assign +// +++ Use this to assign one handled 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyLabelHas(ConstHandle2ConstEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyLabelGet(ConstHandle2ConstEnergy self); + +// +++ Set +extern_c void +EnergyLabelSet(ConstHandle2Energy self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyUnitHas(ConstHandle2ConstEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyUnitGet(ConstHandle2ConstEnergy self); + +// +++ Set +extern_c void +EnergyUnitSet(ConstHandle2Energy self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyValueHas(ConstHandle2ConstEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyValueGet(ConstHandle2ConstEnergy self); + +// +++ Set +extern_c void +EnergyValueSet(ConstHandle2Energy self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyDocumentationHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstDocumentation +EnergyDocumentationGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2Documentation +EnergyDocumentationGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyDocumentationSet(ConstHandle2Energy self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// 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: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyDoubleHas(ConstHandle2ConstEnergy self); + +// +++ Clear +extern_c void +EnergyDoubleClear(ConstHandle2Energy self); + +// +++ Size +extern_c size_t +EnergyDoubleSize(ConstHandle2ConstEnergy self); + +// +++ Add +extern_c void +EnergyDoubleAdd(ConstHandle2Energy self, ConstHandle2ConstDouble Double); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDouble +EnergyDoubleGetConst(ConstHandle2ConstEnergy self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Double +EnergyDoubleGet(ConstHandle2Energy self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +EnergyDoubleSet( + ConstHandle2Energy self, + const size_t index_, + ConstHandle2ConstDouble Double +); + +// +++ Has, by label +extern_c int +EnergyDoubleHasByLabel( + ConstHandle2ConstEnergy self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstDouble +EnergyDoubleGetByLabelConst( + ConstHandle2ConstEnergy self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Double +EnergyDoubleGetByLabel( + ConstHandle2Energy self, + const XMLName label +); + +// +++ Set, by label +extern_c void +EnergyDoubleSetByLabel( + ConstHandle2Energy self, + const XMLName label, + ConstHandle2ConstDouble Double +); + +// +++ Has, by unit +extern_c int +EnergyDoubleHasByUnit( + ConstHandle2ConstEnergy self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstDouble +EnergyDoubleGetByUnitConst( + ConstHandle2ConstEnergy self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Double +EnergyDoubleGetByUnit( + ConstHandle2Energy self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +EnergyDoubleSetByUnit( + ConstHandle2Energy self, + const XMLName unit, + ConstHandle2ConstDouble Double +); + +// +++ Has, by value +extern_c int +EnergyDoubleHasByValue( + ConstHandle2ConstEnergy self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstDouble +EnergyDoubleGetByValueConst( + ConstHandle2ConstEnergy self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2Double +EnergyDoubleGetByValue( + ConstHandle2Energy self, + const Float64 value +); + +// +++ Set, by value +extern_c void +EnergyDoubleSetByValue( + ConstHandle2Energy self, + const Float64 value, + ConstHandle2ConstDouble Double +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Energy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Energy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Energy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Energy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/common/Energy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFile.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFile.cpp new file mode 100644 index 000000000..aa0480afd --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFile.cpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/common/ExternalFile.hpp" +#include "ExternalFile.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2ExternalFile +ExternalFileDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstExternalFile +ExternalFileCreateConst( + const XMLName label, + const XMLName path, + const char *const checksum, + const enums::HashAlgorithm algorithm +) { + ConstHandle2ExternalFile handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + path, + checksum, + algorithm + ); + return handle; +} + +// Create, general +Handle2ExternalFile +ExternalFileCreate( + const XMLName label, + const XMLName path, + const char *const checksum, + const enums::HashAlgorithm 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 +XMLName +ExternalFileLabelGet(ConstHandle2ConstExternalFile self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ExternalFileLabelSet(ConstHandle2ExternalFile self, const XMLName 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 +XMLName +ExternalFilePathGet(ConstHandle2ConstExternalFile self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PathGet", self, extract::path); +} + +// Set +void +ExternalFilePathSet(ConstHandle2ExternalFile self, const XMLName 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 +enums::HashAlgorithm +ExternalFileAlgorithmGet(ConstHandle2ConstExternalFile self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AlgorithmGet", self, extract::algorithm); +} + +// Set +void +ExternalFileAlgorithmSet(ConstHandle2ExternalFile self, const enums::HashAlgorithm algorithm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AlgorithmSet", self, extract::algorithm, algorithm); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/ExternalFile/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFile.h b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFile.h new file mode 100644 index 000000000..dbf19163a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/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_TEST_V2_0_COMMON_EXTERNALFILE +#define C_INTERFACE_TEST_V2_0_COMMON_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 +extern_c Handle2ExternalFile +ExternalFileDefault(); + +// --- Create, general, const +extern_c Handle2ConstExternalFile +ExternalFileCreateConst( + const XMLName label, + const XMLName path, + const char *const checksum, + const enums::HashAlgorithm algorithm +); + +// +++ Create, general +extern_c Handle2ExternalFile +ExternalFileCreate( + const XMLName label, + const XMLName path, + const char *const checksum, + const enums::HashAlgorithm 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 XMLName +ExternalFileLabelGet(ConstHandle2ConstExternalFile self); + +// +++ Set +extern_c void +ExternalFileLabelSet(ConstHandle2ExternalFile self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: path +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExternalFilePathHas(ConstHandle2ConstExternalFile self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ExternalFilePathGet(ConstHandle2ConstExternalFile self); + +// +++ Set +extern_c void +ExternalFilePathSet(ConstHandle2ExternalFile self, const XMLName 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 enums::HashAlgorithm +ExternalFileAlgorithmGet(ConstHandle2ConstExternalFile self); + +// +++ Set +extern_c void +ExternalFileAlgorithmSet(ConstHandle2ExternalFile self, const enums::HashAlgorithm algorithm); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/ExternalFile/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFile/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFile/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFile/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFile/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles.cpp new file mode 100644 index 000000000..d38dab103 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/common/ExternalFiles.hpp" +#include "ExternalFiles.h" + +using namespace njoy::GNDStk; +using namespace test::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 = common::ExternalFile; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstExternalFiles +ExternalFilesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +ExternalFilesExternalFileHasByLabel( + ConstHandle2ConstExternalFiles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileHasByLabel", + self, extract::externalFile, meta::label, label); +} + +// Get, by label, const +Handle2ConstExternalFile +ExternalFilesExternalFileGetByLabelConst( + ConstHandle2ConstExternalFiles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByLabelConst", + self, extract::externalFile, meta::label, label); +} + +// Get, by label, non-const +Handle2ExternalFile +ExternalFilesExternalFileGetByLabel( + ConstHandle2ExternalFiles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByLabel", + self, extract::externalFile, meta::label, label); +} + +// Set, by label +void +ExternalFilesExternalFileSetByLabel( + ConstHandle2ExternalFiles self, + const XMLName label, + ConstHandle2ConstExternalFile externalFile +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileSetByLabel", + self, extract::externalFile, meta::label, label, externalFile); +} + +// Has, by path +int +ExternalFilesExternalFileHasByPath( + ConstHandle2ConstExternalFiles self, + const XMLName path +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileHasByPath", + self, extract::externalFile, meta::path, path); +} + +// Get, by path, const +Handle2ConstExternalFile +ExternalFilesExternalFileGetByPathConst( + ConstHandle2ConstExternalFiles self, + const XMLName path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByPathConst", + self, extract::externalFile, meta::path, path); +} + +// Get, by path, non-const +Handle2ExternalFile +ExternalFilesExternalFileGetByPath( + ConstHandle2ExternalFiles self, + const XMLName path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByPath", + self, extract::externalFile, meta::path, path); +} + +// Set, by path +void +ExternalFilesExternalFileSetByPath( + ConstHandle2ExternalFiles self, + const XMLName path, + ConstHandle2ConstExternalFile externalFile +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileSetByPath", + self, extract::externalFile, meta::path, path, externalFile); +} + +// 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); +} + +// Has, by algorithm +int +ExternalFilesExternalFileHasByAlgorithm( + ConstHandle2ConstExternalFiles self, + const enums::HashAlgorithm algorithm +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileHasByAlgorithm", + self, extract::externalFile, meta::algorithm, algorithm); +} + +// Get, by algorithm, const +Handle2ConstExternalFile +ExternalFilesExternalFileGetByAlgorithmConst( + ConstHandle2ConstExternalFiles self, + const enums::HashAlgorithm algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByAlgorithmConst", + self, extract::externalFile, meta::algorithm, algorithm); +} + +// Get, by algorithm, non-const +Handle2ExternalFile +ExternalFilesExternalFileGetByAlgorithm( + ConstHandle2ExternalFiles self, + const enums::HashAlgorithm algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByAlgorithm", + self, extract::externalFile, meta::algorithm, algorithm); +} + +// Set, by algorithm +void +ExternalFilesExternalFileSetByAlgorithm( + ConstHandle2ExternalFiles self, + const enums::HashAlgorithm algorithm, + ConstHandle2ConstExternalFile externalFile +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileSetByAlgorithm", + self, extract::externalFile, meta::algorithm, algorithm, externalFile); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/ExternalFiles/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles.h b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles.h new file mode 100644 index 000000000..28c14cf7c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles.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. +// +// 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_TEST_V2_0_COMMON_EXTERNALFILES +#define C_INTERFACE_TEST_V2_0_COMMON_EXTERNALFILES + +#include "GNDStk.h" +#include "v2.0/common/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 +extern_c Handle2ExternalFiles +ExternalFilesDefault(); + +// --- Create, general, const +extern_c Handle2ConstExternalFiles +ExternalFilesCreateConst( + ConstHandle2ExternalFile *const externalFile, const size_t externalFileSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +ExternalFilesExternalFileHasByLabel( + ConstHandle2ConstExternalFiles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstExternalFile +ExternalFilesExternalFileGetByLabelConst( + ConstHandle2ConstExternalFiles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2ExternalFile +ExternalFilesExternalFileGetByLabel( + ConstHandle2ExternalFiles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ExternalFilesExternalFileSetByLabel( + ConstHandle2ExternalFiles self, + const XMLName label, + ConstHandle2ConstExternalFile externalFile +); + +// +++ Has, by path +extern_c int +ExternalFilesExternalFileHasByPath( + ConstHandle2ConstExternalFiles self, + const XMLName path +); + +// --- Get, by path, const +extern_c Handle2ConstExternalFile +ExternalFilesExternalFileGetByPathConst( + ConstHandle2ConstExternalFiles self, + const XMLName path +); + +// +++ Get, by path, non-const +extern_c Handle2ExternalFile +ExternalFilesExternalFileGetByPath( + ConstHandle2ExternalFiles self, + const XMLName path +); + +// +++ Set, by path +extern_c void +ExternalFilesExternalFileSetByPath( + ConstHandle2ExternalFiles self, + const XMLName path, + ConstHandle2ConstExternalFile externalFile +); + +// +++ 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 +); + +// +++ Has, by algorithm +extern_c int +ExternalFilesExternalFileHasByAlgorithm( + ConstHandle2ConstExternalFiles self, + const enums::HashAlgorithm algorithm +); + +// --- Get, by algorithm, const +extern_c Handle2ConstExternalFile +ExternalFilesExternalFileGetByAlgorithmConst( + ConstHandle2ConstExternalFiles self, + const enums::HashAlgorithm algorithm +); + +// +++ Get, by algorithm, non-const +extern_c Handle2ExternalFile +ExternalFilesExternalFileGetByAlgorithm( + ConstHandle2ExternalFiles self, + const enums::HashAlgorithm algorithm +); + +// +++ Set, by algorithm +extern_c void +ExternalFilesExternalFileSetByAlgorithm( + ConstHandle2ExternalFiles self, + const enums::HashAlgorithm algorithm, + ConstHandle2ConstExternalFile externalFile +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/ExternalFiles/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/common/ExternalFiles/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Mass.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Mass.cpp new file mode 100644 index 000000000..3e6d98850 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Mass.cpp @@ -0,0 +1,538 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/common/Mass.hpp" +#include "Mass.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MassClass; +using CPP = multigroup::Mass; + +static const std::string CLASSNAME = "Mass"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = containers::Uncertainty; +using CPPDouble = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMass +MassDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Mass +MassDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMass +MassCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Mass handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + MassDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Create, general +Handle2Mass +MassCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Mass handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + MassDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Assign +// Use this to assign 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: label +// ----------------------------------------------------------------------------- + +// Has +int +MassLabelHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +MassLabelGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MassLabelSet(ConstHandle2Mass self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +MassUnitHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +MassUnitGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +MassUnitSet(ConstHandle2Mass self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +MassValueHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +MassValueGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +MassValueSet(ConstHandle2Mass self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +MassDocumentationHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +MassDocumentationGetConst(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +MassDocumentationGet(ConstHandle2Mass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +MassDocumentationSet(ConstHandle2Mass self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +MassUncertaintyHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +MassUncertaintyGetConst(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +MassUncertaintyGet(ConstHandle2Mass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +MassUncertaintySet(ConstHandle2Mass self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +MassDoubleHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Clear +void +MassDoubleClear(ConstHandle2Mass self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DoubleClear", self, extract::Double); +} + +// Size +size_t +MassDoubleSize(ConstHandle2ConstMass self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DoubleSize", self, extract::Double); +} + +// Add +void +MassDoubleAdd(ConstHandle2Mass self, ConstHandle2ConstDouble Double) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DoubleAdd", self, extract::Double, Double); +} + +// Get, by index \in [0,size), const +Handle2ConstDouble +MassDoubleGetConst(ConstHandle2ConstMass self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Double +MassDoubleGet(ConstHandle2Mass self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double, index_); +} + +// Set, by index \in [0,size) +void +MassDoubleSet( + ConstHandle2Mass self, + const size_t index_, + ConstHandle2ConstDouble Double +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, index_, Double); +} + +// Has, by label +int +MassDoubleHasByLabel( + ConstHandle2ConstMass self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByLabel", + self, extract::Double, meta::label, label); +} + +// Get, by label, const +Handle2ConstDouble +MassDoubleGetByLabelConst( + ConstHandle2ConstMass self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabelConst", + self, extract::Double, meta::label, label); +} + +// Get, by label, non-const +Handle2Double +MassDoubleGetByLabel( + ConstHandle2Mass self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabel", + self, extract::Double, meta::label, label); +} + +// Set, by label +void +MassDoubleSetByLabel( + ConstHandle2Mass self, + const XMLName label, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByLabel", + self, extract::Double, meta::label, label, Double); +} + +// Has, by unit +int +MassDoubleHasByUnit( + ConstHandle2ConstMass self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByUnit", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstDouble +MassDoubleGetByUnitConst( + ConstHandle2ConstMass self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnitConst", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Double +MassDoubleGetByUnit( + ConstHandle2Mass self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnit", + self, extract::Double, meta::unit, unit); +} + +// Set, by unit +void +MassDoubleSetByUnit( + ConstHandle2Mass self, + const XMLName unit, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByUnit", + self, extract::Double, meta::unit, unit, Double); +} + +// Has, by value +int +MassDoubleHasByValue( + ConstHandle2ConstMass self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByValue", + self, extract::Double, meta::value, value); +} + +// Get, by value, const +Handle2ConstDouble +MassDoubleGetByValueConst( + ConstHandle2ConstMass self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValueConst", + self, extract::Double, meta::value, value); +} + +// Get, by value, non-const +Handle2Double +MassDoubleGetByValue( + ConstHandle2Mass self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValue", + self, extract::Double, meta::value, value); +} + +// Set, by value +void +MassDoubleSetByValue( + ConstHandle2Mass self, + const Float64 value, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByValue", + self, extract::Double, meta::value, value, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Mass/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Mass.h b/standards/gnds-2.0/test/c/src/v2.0/common/Mass.h new file mode 100644 index 000000000..03633b142 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Mass.h @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COMMON_MASS +#define C_INTERFACE_TEST_V2_0_COMMON_MASS + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/containers/Uncertainty.h" +#include "v2.0/containers/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 +extern_c Handle2Mass +MassDefault(); + +// --- Create, general, const +extern_c Handle2ConstMass +MassCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Create, general +extern_c Handle2Mass +MassCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Assign +// +++ Use this to assign one handled 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassLabelHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MassLabelGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassLabelSet(ConstHandle2Mass self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassUnitHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MassUnitGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassUnitSet(ConstHandle2Mass self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassValueHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MassValueGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassValueSet(ConstHandle2Mass self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassDocumentationHas(ConstHandle2ConstMass self); + +// --- Get, const +extern_c Handle2ConstDocumentation +MassDocumentationGetConst(ConstHandle2ConstMass self); + +// +++ Get, non-const +extern_c Handle2Documentation +MassDocumentationGet(ConstHandle2Mass self); + +// +++ Set +extern_c void +MassDocumentationSet(ConstHandle2Mass self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassUncertaintyHas(ConstHandle2ConstMass self); + +// --- Get, const +extern_c Handle2ConstUncertainty +MassUncertaintyGetConst(ConstHandle2ConstMass self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +MassUncertaintyGet(ConstHandle2Mass self); + +// +++ Set +extern_c void +MassUncertaintySet(ConstHandle2Mass self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassDoubleHas(ConstHandle2ConstMass self); + +// +++ Clear +extern_c void +MassDoubleClear(ConstHandle2Mass self); + +// +++ Size +extern_c size_t +MassDoubleSize(ConstHandle2ConstMass self); + +// +++ Add +extern_c void +MassDoubleAdd(ConstHandle2Mass self, ConstHandle2ConstDouble Double); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDouble +MassDoubleGetConst(ConstHandle2ConstMass self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Double +MassDoubleGet(ConstHandle2Mass self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +MassDoubleSet( + ConstHandle2Mass self, + const size_t index_, + ConstHandle2ConstDouble Double +); + +// +++ Has, by label +extern_c int +MassDoubleHasByLabel( + ConstHandle2ConstMass self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstDouble +MassDoubleGetByLabelConst( + ConstHandle2ConstMass self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Double +MassDoubleGetByLabel( + ConstHandle2Mass self, + const XMLName label +); + +// +++ Set, by label +extern_c void +MassDoubleSetByLabel( + ConstHandle2Mass self, + const XMLName label, + ConstHandle2ConstDouble Double +); + +// +++ Has, by unit +extern_c int +MassDoubleHasByUnit( + ConstHandle2ConstMass self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstDouble +MassDoubleGetByUnitConst( + ConstHandle2ConstMass self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Double +MassDoubleGetByUnit( + ConstHandle2Mass self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +MassDoubleSetByUnit( + ConstHandle2Mass self, + const XMLName unit, + ConstHandle2ConstDouble Double +); + +// +++ Has, by value +extern_c int +MassDoubleHasByValue( + ConstHandle2ConstMass self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstDouble +MassDoubleGetByValueConst( + ConstHandle2ConstMass self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2Double +MassDoubleGetByValue( + ConstHandle2Mass self, + const Float64 value +); + +// +++ Set, by value +extern_c void +MassDoubleSetByValue( + ConstHandle2Mass self, + const Float64 value, + ConstHandle2ConstDouble Double +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Mass/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Mass/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Mass/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Mass/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/common/Mass/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Probability.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Probability.cpp new file mode 100644 index 000000000..a183edfd5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Probability.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/common/Probability.hpp" +#include "Probability.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProbability +ProbabilityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/common/Probability/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Probability.h b/standards/gnds-2.0/test/c/src/v2.0/common/Probability.h new file mode 100644 index 000000000..f329dde45 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/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_TEST_V2_0_COMMON_PROBABILITY +#define C_INTERFACE_TEST_V2_0_COMMON_PROBABILITY + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2Probability +ProbabilityDefault(); + +// --- Create, general, const +extern_c Handle2ConstProbability +ProbabilityCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/common/Probability/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Probability/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Probability/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Probability/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/common/Probability/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Product.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Product.cpp new file mode 100644 index 000000000..e887df50e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Product.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/common/Product.hpp" +#include "Product.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::Multiplicity; +using CPPDistribution = transport::Distribution; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProduct +ProductDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Product +ProductDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProduct +ProductCreateConst( + const XMLName label, + const XMLName pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution +) { + ConstHandle2Product handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + detail::tocpp(multiplicity), + detail::tocpp(distribution) + ); + return handle; +} + +// Create, general +Handle2Product +ProductCreate( + const XMLName label, + const XMLName 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 +XMLName +ProductLabelGet(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ProductLabelSet(ConstHandle2Product self, const XMLName 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 +XMLName +ProductPidGet(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ProductPidSet(ConstHandle2Product self, const XMLName 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/common/Product/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Product.h b/standards/gnds-2.0/test/c/src/v2.0/common/Product.h new file mode 100644 index 000000000..ac8599b8b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/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_TEST_V2_0_COMMON_PRODUCT +#define C_INTERFACE_TEST_V2_0_COMMON_PRODUCT + +#include "GNDStk.h" +#include "v2.0/transport/Multiplicity.h" +#include "v2.0/transport/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 +extern_c Handle2Product +ProductDefault(); + +// --- Create, general, const +extern_c Handle2ConstProduct +ProductCreateConst( + const XMLName label, + const XMLName pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution +); + +// +++ Create, general +extern_c Handle2Product +ProductCreate( + const XMLName label, + const XMLName 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 XMLName +ProductLabelGet(ConstHandle2ConstProduct self); + +// +++ Set +extern_c void +ProductLabelSet(ConstHandle2Product self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductPidHas(ConstHandle2ConstProduct self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProductPidGet(ConstHandle2ConstProduct self); + +// +++ Set +extern_c void +ProductPidSet(ConstHandle2Product self, const XMLName 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/common/Product/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Product/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Product/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Product/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/common/Product/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Products.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Products.cpp new file mode 100644 index 000000000..162a2c3e4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Products.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/common/Products.hpp" +#include "Products.h" + +using namespace njoy::GNDStk; +using namespace test::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 = common::Product; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProducts +ProductsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +ProductsProductHasByLabel( + ConstHandle2ConstProducts self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductHasByLabel", + self, extract::product, meta::label, label); +} + +// Get, by label, const +Handle2ConstProduct +ProductsProductGetByLabelConst( + ConstHandle2ConstProducts self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByLabelConst", + self, extract::product, meta::label, label); +} + +// Get, by label, non-const +Handle2Product +ProductsProductGetByLabel( + ConstHandle2Products self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByLabel", + self, extract::product, meta::label, label); +} + +// Set, by label +void +ProductsProductSetByLabel( + ConstHandle2Products self, + const XMLName label, + ConstHandle2ConstProduct product +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductSetByLabel", + self, extract::product, meta::label, label, product); +} + +// Has, by pid +int +ProductsProductHasByPid( + ConstHandle2ConstProducts self, + const XMLName pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductHasByPid", + self, extract::product, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstProduct +ProductsProductGetByPidConst( + ConstHandle2ConstProducts self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByPidConst", + self, extract::product, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2Product +ProductsProductGetByPid( + ConstHandle2Products self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByPid", + self, extract::product, meta::pid, pid); +} + +// Set, by pid +void +ProductsProductSetByPid( + ConstHandle2Products self, + const XMLName pid, + ConstHandle2ConstProduct product +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductSetByPid", + self, extract::product, meta::pid, pid, product); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Products/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Products.h b/standards/gnds-2.0/test/c/src/v2.0/common/Products.h new file mode 100644 index 000000000..679b521e6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Products.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COMMON_PRODUCTS +#define C_INTERFACE_TEST_V2_0_COMMON_PRODUCTS + +#include "GNDStk.h" +#include "v2.0/common/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 +extern_c Handle2Products +ProductsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProducts +ProductsCreateConst( + ConstHandle2Product *const product, const size_t productSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +ProductsProductHasByLabel( + ConstHandle2ConstProducts self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstProduct +ProductsProductGetByLabelConst( + ConstHandle2ConstProducts self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Product +ProductsProductGetByLabel( + ConstHandle2Products self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ProductsProductSetByLabel( + ConstHandle2Products self, + const XMLName label, + ConstHandle2ConstProduct product +); + +// +++ Has, by pid +extern_c int +ProductsProductHasByPid( + ConstHandle2ConstProducts self, + const XMLName pid +); + +// --- Get, by pid, const +extern_c Handle2ConstProduct +ProductsProductGetByPidConst( + ConstHandle2ConstProducts self, + const XMLName pid +); + +// +++ Get, by pid, non-const +extern_c Handle2Product +ProductsProductGetByPid( + ConstHandle2Products self, + const XMLName pid +); + +// +++ Set, by pid +extern_c void +ProductsProductSetByPid( + ConstHandle2Products self, + const XMLName pid, + ConstHandle2ConstProduct product +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Products/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Products/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Products/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Products/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/common/Products/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Q.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Q.cpp new file mode 100644 index 000000000..2dc9225e7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Q.cpp @@ -0,0 +1,334 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/common/Q.hpp" +#include "Q.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = QClass; +using CPP = multigroup::Q; + +static const std::string CLASSNAME = "Q"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = containers::Uncertainty; +using CPPConstant1d = containers::Constant1d; +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; +using CPPPolynomial1d = containers::Polynomial1d; +using CPPGridded1d = containers::Gridded1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstQ +QDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Q +QDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstQ +QCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, +) { + ConstHandle2Q handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Q +QCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, +) { + ConstHandle2Q handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +QLabelHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +QLabelGet(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +QLabelSet(ConstHandle2Q self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +QUnitHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +QUnitGet(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +QUnitSet(ConstHandle2Q self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +QValueHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +QValueGet(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +QValueSet(ConstHandle2Q self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +QDocumentationHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +QDocumentationGetConst(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +QDocumentationGet(ConstHandle2Q self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +QDocumentationSet(ConstHandle2Q self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +QUncertaintyHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +QUncertaintyGetConst(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +QUncertaintyGet(ConstHandle2Q self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +QUncertaintySet(ConstHandle2Q self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Q/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Q.h b/standards/gnds-2.0/test/c/src/v2.0/common/Q.h new file mode 100644 index 000000000..e09e07b6e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Q.h @@ -0,0 +1,250 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COMMON_Q +#define C_INTERFACE_TEST_V2_0_COMMON_Q + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/containers/Uncertainty.h" +#include "v2.0/containers/Constant1d.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.h" +#include "v2.0/containers/Polynomial1d.h" +#include "v2.0/containers/Gridded1d.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 +extern_c Handle2Q +QDefault(); + +// --- Create, general, const +extern_c Handle2ConstQ +QCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, +); + +// +++ Create, general +extern_c Handle2Q +QCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + 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 +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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QLabelHas(ConstHandle2ConstQ self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +QLabelGet(ConstHandle2ConstQ self); + +// +++ Set +extern_c void +QLabelSet(ConstHandle2Q self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QUnitHas(ConstHandle2ConstQ self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +QUnitGet(ConstHandle2ConstQ self); + +// +++ Set +extern_c void +QUnitSet(ConstHandle2Q self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QValueHas(ConstHandle2ConstQ self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +QValueGet(ConstHandle2ConstQ self); + +// +++ Set +extern_c void +QValueSet(ConstHandle2Q self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QDocumentationHas(ConstHandle2ConstQ self); + +// --- Get, const +extern_c Handle2ConstDocumentation +QDocumentationGetConst(ConstHandle2ConstQ self); + +// +++ Get, non-const +extern_c Handle2Documentation +QDocumentationGet(ConstHandle2Q self); + +// +++ Set +extern_c void +QDocumentationSet(ConstHandle2Q self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QUncertaintyHas(ConstHandle2ConstQ self); + +// --- Get, const +extern_c Handle2ConstUncertainty +QUncertaintyGetConst(ConstHandle2ConstQ self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +QUncertaintyGet(ConstHandle2Q self); + +// +++ Set +extern_c void +QUncertaintySet(ConstHandle2Q self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Q/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Q/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Q/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Q/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/common/Q/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Temperature.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Temperature.cpp new file mode 100644 index 000000000..761f88347 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Temperature.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/common/Temperature.hpp" +#include "Temperature.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = TemperatureClass; +using CPP = multigroup::Temperature; + +static const std::string CLASSNAME = "Temperature"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = containers::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTemperature +TemperatureDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Temperature +TemperatureDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTemperature +TemperatureCreateConst( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Temperature handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Temperature +TemperatureCreate( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Temperature handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + 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 +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: label +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureLabelHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +TemperatureLabelGet(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +TemperatureLabelSet(ConstHandle2Temperature self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureUnitHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +TemperatureUnitGet(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +TemperatureUnitSet(ConstHandle2Temperature self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureValueHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +TemperatureValueGet(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +TemperatureValueSet(ConstHandle2Temperature self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureDocumentationHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +TemperatureDocumentationGetConst(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +TemperatureDocumentationGet(ConstHandle2Temperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +TemperatureDocumentationSet(ConstHandle2Temperature self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureUncertaintyHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +TemperatureUncertaintyGetConst(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +TemperatureUncertaintyGet(ConstHandle2Temperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +TemperatureUncertaintySet(ConstHandle2Temperature self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Temperature/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Temperature.h b/standards/gnds-2.0/test/c/src/v2.0/common/Temperature.h new file mode 100644 index 000000000..71320f53a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/common/Temperature.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. +// +// 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_TEST_V2_0_COMMON_TEMPERATURE +#define C_INTERFACE_TEST_V2_0_COMMON_TEMPERATURE + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/containers/Uncertainty.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 +extern_c Handle2Temperature +TemperatureDefault(); + +// --- Create, general, const +extern_c Handle2ConstTemperature +TemperatureCreateConst( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2Temperature +TemperatureCreate( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstDocumentation documentation, + 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 +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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureLabelHas(ConstHandle2ConstTemperature self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TemperatureLabelGet(ConstHandle2ConstTemperature self); + +// +++ Set +extern_c void +TemperatureLabelSet(ConstHandle2Temperature self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureUnitHas(ConstHandle2ConstTemperature self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TemperatureUnitGet(ConstHandle2ConstTemperature self); + +// +++ Set +extern_c void +TemperatureUnitSet(ConstHandle2Temperature self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureValueHas(ConstHandle2ConstTemperature self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +TemperatureValueGet(ConstHandle2ConstTemperature self); + +// +++ Set +extern_c void +TemperatureValueSet(ConstHandle2Temperature self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureDocumentationHas(ConstHandle2ConstTemperature self); + +// --- Get, const +extern_c Handle2ConstDocumentation +TemperatureDocumentationGetConst(ConstHandle2ConstTemperature self); + +// +++ Get, non-const +extern_c Handle2Documentation +TemperatureDocumentationGet(ConstHandle2Temperature self); + +// +++ Set +extern_c void +TemperatureDocumentationSet(ConstHandle2Temperature self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureUncertaintyHas(ConstHandle2ConstTemperature self); + +// --- Get, const +extern_c Handle2ConstUncertainty +TemperatureUncertaintyGetConst(ConstHandle2ConstTemperature self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +TemperatureUncertaintyGet(ConstHandle2Temperature self); + +// +++ Set +extern_c void +TemperatureUncertaintySet(ConstHandle2Temperature self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/common/Temperature/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Temperature/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/common/Temperature/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/common/Temperature/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/common/Temperature/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Array.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Array.cpp new file mode 100644 index 000000000..926bc6048 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Array.cpp @@ -0,0 +1,1035 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Array.hpp" +#include "Array.h" + +using namespace njoy::GNDStk; +using namespace test::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 permutation = [](auto &obj) { return &obj.permutation; }; + static auto storageOrder = [](auto &obj) { return &obj.storageOrder; }; + static auto offset = [](auto &obj) { return &obj.offset; }; + static auto values = [](auto &obj) { return &obj.values; }; + static auto array = [](auto &obj) { return &obj.array; }; +} + +using CPPValues = containers::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstArray +ArrayDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Array +ArrayDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstArray +ArrayCreateConst( + const IntegerTuple shape, + const UTF8Text compression, + const UTF8Text symmetry, + const UTF8Text permutation, + const UTF8Text storageOrder, + const IntegerTuple offset, + ConstHandle2Values *const values, const size_t valuesSize, + ConstHandle2Array *const array, const size_t arraySize +) { + ConstHandle2Array handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + shape, + compression, + symmetry, + permutation, + storageOrder, + offset, + std::vector{}, + std::vector{} + ); + for (size_t ValuesN = 0; ValuesN < valuesSize; ++ValuesN) + ArrayValuesAdd(handle, values[ValuesN]); + for (size_t ArrayN = 0; ArrayN < arraySize; ++ArrayN) + ArrayArrayAdd(handle, array[ArrayN]); + return handle; +} + +// Create, general +Handle2Array +ArrayCreate( + const IntegerTuple shape, + const UTF8Text compression, + const UTF8Text symmetry, + const UTF8Text permutation, + const UTF8Text storageOrder, + const IntegerTuple offset, + ConstHandle2Values *const values, const size_t valuesSize, + ConstHandle2Array *const array, const size_t arraySize +) { + ConstHandle2Array handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + shape, + compression, + symmetry, + permutation, + storageOrder, + offset, + std::vector{}, + std::vector{} + ); + for (size_t ValuesN = 0; ValuesN < valuesSize; ++ValuesN) + ArrayValuesAdd(handle, values[ValuesN]); + for (size_t ArrayN = 0; ArrayN < arraySize; ++ArrayN) + ArrayArrayAdd(handle, array[ArrayN]); + return handle; +} + +// Assign +// Use this to assign 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 +IntegerTuple +ArrayShapeGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ShapeGet", self, extract::shape); +} + +// Set +void +ArrayShapeSet(ConstHandle2Array self, const IntegerTuple 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 +UTF8Text +ArrayCompressionGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CompressionGet", self, extract::compression); +} + +// Set +void +ArrayCompressionSet(ConstHandle2Array self, const UTF8Text 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 +UTF8Text +ArraySymmetryGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SymmetryGet", self, extract::symmetry); +} + +// Set +void +ArraySymmetrySet(ConstHandle2Array self, const UTF8Text symmetry) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SymmetrySet", self, extract::symmetry, symmetry); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: permutation +// ----------------------------------------------------------------------------- + +// Has +int +ArrayPermutationHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PermutationHas", self, extract::permutation); +} + +// Get +// Returns by value +UTF8Text +ArrayPermutationGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PermutationGet", self, extract::permutation); +} + +// Set +void +ArrayPermutationSet(ConstHandle2Array self, const UTF8Text permutation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PermutationSet", self, extract::permutation, permutation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: storageOrder +// ----------------------------------------------------------------------------- + +// Has +int +ArrayStorageOrderHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StorageOrderHas", self, extract::storageOrder); +} + +// Get +// Returns by value +UTF8Text +ArrayStorageOrderGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StorageOrderGet", self, extract::storageOrder); +} + +// Set +void +ArrayStorageOrderSet(ConstHandle2Array self, const UTF8Text storageOrder) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StorageOrderSet", self, extract::storageOrder, storageOrder); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: offset +// ----------------------------------------------------------------------------- + +// Has +int +ArrayOffsetHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OffsetHas", self, extract::offset); +} + +// Get +// Returns by value +IntegerTuple +ArrayOffsetGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OffsetGet", self, extract::offset); +} + +// Set +void +ArrayOffsetSet(ConstHandle2Array self, const IntegerTuple offset) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OffsetSet", self, extract::offset, offset); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +ArrayValuesHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Clear +void +ArrayValuesClear(ConstHandle2Array self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ValuesClear", self, extract::values); +} + +// Size +size_t +ArrayValuesSize(ConstHandle2ConstArray self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ValuesSize", self, extract::values); +} + +// Add +void +ArrayValuesAdd(ConstHandle2Array self, ConstHandle2ConstValues values) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ValuesAdd", self, extract::values, values); +} + +// Get, by index \in [0,size), const +Handle2ConstValues +ArrayValuesGetConst(ConstHandle2ConstArray self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Values +ArrayValuesGet(ConstHandle2Array self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values, index_); +} + +// Set, by index \in [0,size) +void +ArrayValuesSet( + ConstHandle2Array self, + const size_t index_, + ConstHandle2ConstValues values +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, index_, values); +} + +// Has, by valueType +int +ArrayValuesHasByValueType( + ConstHandle2ConstArray self, + const UTF8Text valueType +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ValuesHasByValueType", + self, extract::values, meta::valueType, valueType); +} + +// Get, by valueType, const +Handle2ConstValues +ArrayValuesGetByValueTypeConst( + ConstHandle2ConstArray self, + const UTF8Text valueType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByValueTypeConst", + self, extract::values, meta::valueType, valueType); +} + +// Get, by valueType, non-const +Handle2Values +ArrayValuesGetByValueType( + ConstHandle2Array self, + const UTF8Text valueType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByValueType", + self, extract::values, meta::valueType, valueType); +} + +// Set, by valueType +void +ArrayValuesSetByValueType( + ConstHandle2Array self, + const UTF8Text valueType, + ConstHandle2ConstValues values +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ValuesSetByValueType", + self, extract::values, meta::valueType, valueType, values); +} + +// Has, by start +int +ArrayValuesHasByStart( + ConstHandle2ConstArray self, + const Integer32 start +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ValuesHasByStart", + self, extract::values, meta::start, start); +} + +// Get, by start, const +Handle2ConstValues +ArrayValuesGetByStartConst( + ConstHandle2ConstArray self, + const Integer32 start +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByStartConst", + self, extract::values, meta::start, start); +} + +// Get, by start, non-const +Handle2Values +ArrayValuesGetByStart( + ConstHandle2Array self, + const Integer32 start +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByStart", + self, extract::values, meta::start, start); +} + +// Set, by start +void +ArrayValuesSetByStart( + ConstHandle2Array self, + const Integer32 start, + ConstHandle2ConstValues values +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ValuesSetByStart", + self, extract::values, meta::start, start, values); +} + +// Has, by length +int +ArrayValuesHasByLength( + ConstHandle2ConstArray self, + const Integer32 length +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ValuesHasByLength", + self, extract::values, meta::length, length); +} + +// Get, by length, const +Handle2ConstValues +ArrayValuesGetByLengthConst( + ConstHandle2ConstArray self, + const Integer32 length +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByLengthConst", + self, extract::values, meta::length, length); +} + +// Get, by length, non-const +Handle2Values +ArrayValuesGetByLength( + ConstHandle2Array self, + const Integer32 length +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByLength", + self, extract::values, meta::length, length); +} + +// Set, by length +void +ArrayValuesSetByLength( + ConstHandle2Array self, + const Integer32 length, + ConstHandle2ConstValues values +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ValuesSetByLength", + self, extract::values, meta::length, length, values); +} + +// Has, by href +int +ArrayValuesHasByHref( + ConstHandle2ConstArray self, + const UTF8Text href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ValuesHasByHref", + self, extract::values, meta::href, href); +} + +// Get, by href, const +Handle2ConstValues +ArrayValuesGetByHrefConst( + ConstHandle2ConstArray self, + const UTF8Text href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByHrefConst", + self, extract::values, meta::href, href); +} + +// Get, by href, non-const +Handle2Values +ArrayValuesGetByHref( + ConstHandle2Array self, + const UTF8Text href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByHref", + self, extract::values, meta::href, href); +} + +// Set, by href +void +ArrayValuesSetByHref( + ConstHandle2Array self, + const UTF8Text href, + ConstHandle2ConstValues values +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ValuesSetByHref", + self, extract::values, meta::href, href, values); +} + +// Has, by startIndex +int +ArrayValuesHasByStartIndex( + ConstHandle2ConstArray self, + const Integer32 startIndex +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ValuesHasByStartIndex", + self, extract::values, meta::startIndex, startIndex); +} + +// Get, by startIndex, const +Handle2ConstValues +ArrayValuesGetByStartIndexConst( + ConstHandle2ConstArray self, + const Integer32 startIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByStartIndexConst", + self, extract::values, meta::startIndex, startIndex); +} + +// Get, by startIndex, non-const +Handle2Values +ArrayValuesGetByStartIndex( + ConstHandle2Array self, + const Integer32 startIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByStartIndex", + self, extract::values, meta::startIndex, startIndex); +} + +// Set, by startIndex +void +ArrayValuesSetByStartIndex( + ConstHandle2Array self, + const Integer32 startIndex, + ConstHandle2ConstValues values +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ValuesSetByStartIndex", + self, extract::values, meta::startIndex, startIndex, values); +} + +// Has, by count +int +ArrayValuesHasByCount( + ConstHandle2ConstArray self, + const Integer32 count +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ValuesHasByCount", + self, extract::values, meta::count, count); +} + +// Get, by count, const +Handle2ConstValues +ArrayValuesGetByCountConst( + ConstHandle2ConstArray self, + const Integer32 count +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByCountConst", + self, extract::values, meta::count, count); +} + +// Get, by count, non-const +Handle2Values +ArrayValuesGetByCount( + ConstHandle2Array self, + const Integer32 count +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ValuesGetByCount", + self, extract::values, meta::count, count); +} + +// Set, by count +void +ArrayValuesSetByCount( + ConstHandle2Array self, + const Integer32 count, + ConstHandle2ConstValues values +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ValuesSetByCount", + self, extract::values, meta::count, count, values); +} + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// Has +int +ArrayArrayHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ArrayHas", self, extract::array); +} + +// Clear +void +ArrayArrayClear(ConstHandle2Array self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ArrayClear", self, extract::array); +} + +// Size +size_t +ArrayArraySize(ConstHandle2ConstArray self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ArraySize", self, extract::array); +} + +// Add +void +ArrayArrayAdd(ConstHandle2Array self, ConstHandle2ConstArray array) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ArrayAdd", self, extract::array, array); +} + +// Get, by index \in [0,size), const +Handle2ConstArray +ArrayArrayGetConst(ConstHandle2ConstArray self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ArrayGetConst", self, extract::array, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Array +ArrayArrayGet(ConstHandle2Array self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ArrayGet", self, extract::array, index_); +} + +// Set, by index \in [0,size) +void +ArrayArraySet( + ConstHandle2Array self, + const size_t index_, + ConstHandle2ConstArray array +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ArraySet", self, extract::array, index_, array); +} + +// Has, by shape +int +ArrayArrayHasByShape( + ConstHandle2ConstArray self, + const IntegerTuple shape +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ArrayHasByShape", + self, extract::array, meta::shape, shape); +} + +// Get, by shape, const +Handle2ConstArray +ArrayArrayGetByShapeConst( + ConstHandle2ConstArray self, + const IntegerTuple shape +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByShapeConst", + self, extract::array, meta::shape, shape); +} + +// Get, by shape, non-const +Handle2Array +ArrayArrayGetByShape( + ConstHandle2Array self, + const IntegerTuple shape +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByShape", + self, extract::array, meta::shape, shape); +} + +// Set, by shape +void +ArrayArraySetByShape( + ConstHandle2Array self, + const IntegerTuple shape, + ConstHandle2ConstArray array +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ArraySetByShape", + self, extract::array, meta::shape, shape, array); +} + +// Has, by compression +int +ArrayArrayHasByCompression( + ConstHandle2ConstArray self, + const UTF8Text compression +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ArrayHasByCompression", + self, extract::array, meta::compression, compression); +} + +// Get, by compression, const +Handle2ConstArray +ArrayArrayGetByCompressionConst( + ConstHandle2ConstArray self, + const UTF8Text compression +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByCompressionConst", + self, extract::array, meta::compression, compression); +} + +// Get, by compression, non-const +Handle2Array +ArrayArrayGetByCompression( + ConstHandle2Array self, + const UTF8Text compression +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByCompression", + self, extract::array, meta::compression, compression); +} + +// Set, by compression +void +ArrayArraySetByCompression( + ConstHandle2Array self, + const UTF8Text compression, + ConstHandle2ConstArray array +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ArraySetByCompression", + self, extract::array, meta::compression, compression, array); +} + +// Has, by symmetry +int +ArrayArrayHasBySymmetry( + ConstHandle2ConstArray self, + const UTF8Text symmetry +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ArrayHasBySymmetry", + self, extract::array, meta::symmetry, symmetry); +} + +// Get, by symmetry, const +Handle2ConstArray +ArrayArrayGetBySymmetryConst( + ConstHandle2ConstArray self, + const UTF8Text symmetry +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetBySymmetryConst", + self, extract::array, meta::symmetry, symmetry); +} + +// Get, by symmetry, non-const +Handle2Array +ArrayArrayGetBySymmetry( + ConstHandle2Array self, + const UTF8Text symmetry +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetBySymmetry", + self, extract::array, meta::symmetry, symmetry); +} + +// Set, by symmetry +void +ArrayArraySetBySymmetry( + ConstHandle2Array self, + const UTF8Text symmetry, + ConstHandle2ConstArray array +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ArraySetBySymmetry", + self, extract::array, meta::symmetry, symmetry, array); +} + +// Has, by permutation +int +ArrayArrayHasByPermutation( + ConstHandle2ConstArray self, + const UTF8Text permutation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ArrayHasByPermutation", + self, extract::array, meta::permutation, permutation); +} + +// Get, by permutation, const +Handle2ConstArray +ArrayArrayGetByPermutationConst( + ConstHandle2ConstArray self, + const UTF8Text permutation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByPermutationConst", + self, extract::array, meta::permutation, permutation); +} + +// Get, by permutation, non-const +Handle2Array +ArrayArrayGetByPermutation( + ConstHandle2Array self, + const UTF8Text permutation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByPermutation", + self, extract::array, meta::permutation, permutation); +} + +// Set, by permutation +void +ArrayArraySetByPermutation( + ConstHandle2Array self, + const UTF8Text permutation, + ConstHandle2ConstArray array +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ArraySetByPermutation", + self, extract::array, meta::permutation, permutation, array); +} + +// Has, by storageOrder +int +ArrayArrayHasByStorageOrder( + ConstHandle2ConstArray self, + const UTF8Text storageOrder +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ArrayHasByStorageOrder", + self, extract::array, meta::storageOrder, storageOrder); +} + +// Get, by storageOrder, const +Handle2ConstArray +ArrayArrayGetByStorageOrderConst( + ConstHandle2ConstArray self, + const UTF8Text storageOrder +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByStorageOrderConst", + self, extract::array, meta::storageOrder, storageOrder); +} + +// Get, by storageOrder, non-const +Handle2Array +ArrayArrayGetByStorageOrder( + ConstHandle2Array self, + const UTF8Text storageOrder +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByStorageOrder", + self, extract::array, meta::storageOrder, storageOrder); +} + +// Set, by storageOrder +void +ArrayArraySetByStorageOrder( + ConstHandle2Array self, + const UTF8Text storageOrder, + ConstHandle2ConstArray array +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ArraySetByStorageOrder", + self, extract::array, meta::storageOrder, storageOrder, array); +} + +// Has, by offset +int +ArrayArrayHasByOffset( + ConstHandle2ConstArray self, + const IntegerTuple offset +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ArrayHasByOffset", + self, extract::array, meta::offset, offset); +} + +// Get, by offset, const +Handle2ConstArray +ArrayArrayGetByOffsetConst( + ConstHandle2ConstArray self, + const IntegerTuple offset +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByOffsetConst", + self, extract::array, meta::offset, offset); +} + +// Get, by offset, non-const +Handle2Array +ArrayArrayGetByOffset( + ConstHandle2Array self, + const IntegerTuple offset +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ArrayGetByOffset", + self, extract::array, meta::offset, offset); +} + +// Set, by offset +void +ArrayArraySetByOffset( + ConstHandle2Array self, + const IntegerTuple offset, + ConstHandle2ConstArray array +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ArraySetByOffset", + self, extract::array, meta::offset, offset, array); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Array/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Array.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Array.h new file mode 100644 index 000000000..95d121b79 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Array.h @@ -0,0 +1,684 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_CONTAINERS_ARRAY +#define C_INTERFACE_TEST_V2_0_CONTAINERS_ARRAY + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2Array +ArrayDefault(); + +// --- Create, general, const +extern_c Handle2ConstArray +ArrayCreateConst( + const IntegerTuple shape, + const UTF8Text compression, + const UTF8Text symmetry, + const UTF8Text permutation, + const UTF8Text storageOrder, + const IntegerTuple offset, + ConstHandle2Values *const values, const size_t valuesSize, + ConstHandle2Array *const array, const size_t arraySize +); + +// +++ Create, general +extern_c Handle2Array +ArrayCreate( + const IntegerTuple shape, + const UTF8Text compression, + const UTF8Text symmetry, + const UTF8Text permutation, + const UTF8Text storageOrder, + const IntegerTuple offset, + ConstHandle2Values *const values, const size_t valuesSize, + ConstHandle2Array *const array, const size_t arraySize +); + +// +++ Assign +// +++ Use this to assign one handled 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 IntegerTuple +ArrayShapeGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayShapeSet(ConstHandle2Array self, const IntegerTuple shape); + + +// ----------------------------------------------------------------------------- +// Metadatum: compression +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayCompressionHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +ArrayCompressionGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayCompressionSet(ConstHandle2Array self, const UTF8Text compression); + + +// ----------------------------------------------------------------------------- +// Metadatum: symmetry +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArraySymmetryHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +ArraySymmetryGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArraySymmetrySet(ConstHandle2Array self, const UTF8Text symmetry); + + +// ----------------------------------------------------------------------------- +// Metadatum: permutation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayPermutationHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +ArrayPermutationGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayPermutationSet(ConstHandle2Array self, const UTF8Text permutation); + + +// ----------------------------------------------------------------------------- +// Metadatum: storageOrder +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayStorageOrderHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +ArrayStorageOrderGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayStorageOrderSet(ConstHandle2Array self, const UTF8Text storageOrder); + + +// ----------------------------------------------------------------------------- +// Metadatum: offset +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayOffsetHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c IntegerTuple +ArrayOffsetGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayOffsetSet(ConstHandle2Array self, const IntegerTuple offset); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayValuesHas(ConstHandle2ConstArray self); + +// +++ Clear +extern_c void +ArrayValuesClear(ConstHandle2Array self); + +// +++ Size +extern_c size_t +ArrayValuesSize(ConstHandle2ConstArray self); + +// +++ Add +extern_c void +ArrayValuesAdd(ConstHandle2Array self, ConstHandle2ConstValues values); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstValues +ArrayValuesGetConst(ConstHandle2ConstArray self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Values +ArrayValuesGet(ConstHandle2Array self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ArrayValuesSet( + ConstHandle2Array self, + const size_t index_, + ConstHandle2ConstValues values +); + +// +++ Has, by valueType +extern_c int +ArrayValuesHasByValueType( + ConstHandle2ConstArray self, + const UTF8Text valueType +); + +// --- Get, by valueType, const +extern_c Handle2ConstValues +ArrayValuesGetByValueTypeConst( + ConstHandle2ConstArray self, + const UTF8Text valueType +); + +// +++ Get, by valueType, non-const +extern_c Handle2Values +ArrayValuesGetByValueType( + ConstHandle2Array self, + const UTF8Text valueType +); + +// +++ Set, by valueType +extern_c void +ArrayValuesSetByValueType( + ConstHandle2Array self, + const UTF8Text valueType, + ConstHandle2ConstValues values +); + +// +++ Has, by start +extern_c int +ArrayValuesHasByStart( + ConstHandle2ConstArray self, + const Integer32 start +); + +// --- Get, by start, const +extern_c Handle2ConstValues +ArrayValuesGetByStartConst( + ConstHandle2ConstArray self, + const Integer32 start +); + +// +++ Get, by start, non-const +extern_c Handle2Values +ArrayValuesGetByStart( + ConstHandle2Array self, + const Integer32 start +); + +// +++ Set, by start +extern_c void +ArrayValuesSetByStart( + ConstHandle2Array self, + const Integer32 start, + ConstHandle2ConstValues values +); + +// +++ Has, by length +extern_c int +ArrayValuesHasByLength( + ConstHandle2ConstArray self, + const Integer32 length +); + +// --- Get, by length, const +extern_c Handle2ConstValues +ArrayValuesGetByLengthConst( + ConstHandle2ConstArray self, + const Integer32 length +); + +// +++ Get, by length, non-const +extern_c Handle2Values +ArrayValuesGetByLength( + ConstHandle2Array self, + const Integer32 length +); + +// +++ Set, by length +extern_c void +ArrayValuesSetByLength( + ConstHandle2Array self, + const Integer32 length, + ConstHandle2ConstValues values +); + +// +++ Has, by href +extern_c int +ArrayValuesHasByHref( + ConstHandle2ConstArray self, + const UTF8Text href +); + +// --- Get, by href, const +extern_c Handle2ConstValues +ArrayValuesGetByHrefConst( + ConstHandle2ConstArray self, + const UTF8Text href +); + +// +++ Get, by href, non-const +extern_c Handle2Values +ArrayValuesGetByHref( + ConstHandle2Array self, + const UTF8Text href +); + +// +++ Set, by href +extern_c void +ArrayValuesSetByHref( + ConstHandle2Array self, + const UTF8Text href, + ConstHandle2ConstValues values +); + +// +++ Has, by startIndex +extern_c int +ArrayValuesHasByStartIndex( + ConstHandle2ConstArray self, + const Integer32 startIndex +); + +// --- Get, by startIndex, const +extern_c Handle2ConstValues +ArrayValuesGetByStartIndexConst( + ConstHandle2ConstArray self, + const Integer32 startIndex +); + +// +++ Get, by startIndex, non-const +extern_c Handle2Values +ArrayValuesGetByStartIndex( + ConstHandle2Array self, + const Integer32 startIndex +); + +// +++ Set, by startIndex +extern_c void +ArrayValuesSetByStartIndex( + ConstHandle2Array self, + const Integer32 startIndex, + ConstHandle2ConstValues values +); + +// +++ Has, by count +extern_c int +ArrayValuesHasByCount( + ConstHandle2ConstArray self, + const Integer32 count +); + +// --- Get, by count, const +extern_c Handle2ConstValues +ArrayValuesGetByCountConst( + ConstHandle2ConstArray self, + const Integer32 count +); + +// +++ Get, by count, non-const +extern_c Handle2Values +ArrayValuesGetByCount( + ConstHandle2Array self, + const Integer32 count +); + +// +++ Set, by count +extern_c void +ArrayValuesSetByCount( + ConstHandle2Array self, + const Integer32 count, + ConstHandle2ConstValues values +); + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayArrayHas(ConstHandle2ConstArray self); + +// +++ Clear +extern_c void +ArrayArrayClear(ConstHandle2Array self); + +// +++ Size +extern_c size_t +ArrayArraySize(ConstHandle2ConstArray self); + +// +++ Add +extern_c void +ArrayArrayAdd(ConstHandle2Array self, ConstHandle2ConstArray array); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstArray +ArrayArrayGetConst(ConstHandle2ConstArray self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Array +ArrayArrayGet(ConstHandle2Array self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ArrayArraySet( + ConstHandle2Array self, + const size_t index_, + ConstHandle2ConstArray array +); + +// +++ Has, by shape +extern_c int +ArrayArrayHasByShape( + ConstHandle2ConstArray self, + const IntegerTuple shape +); + +// --- Get, by shape, const +extern_c Handle2ConstArray +ArrayArrayGetByShapeConst( + ConstHandle2ConstArray self, + const IntegerTuple shape +); + +// +++ Get, by shape, non-const +extern_c Handle2Array +ArrayArrayGetByShape( + ConstHandle2Array self, + const IntegerTuple shape +); + +// +++ Set, by shape +extern_c void +ArrayArraySetByShape( + ConstHandle2Array self, + const IntegerTuple shape, + ConstHandle2ConstArray array +); + +// +++ Has, by compression +extern_c int +ArrayArrayHasByCompression( + ConstHandle2ConstArray self, + const UTF8Text compression +); + +// --- Get, by compression, const +extern_c Handle2ConstArray +ArrayArrayGetByCompressionConst( + ConstHandle2ConstArray self, + const UTF8Text compression +); + +// +++ Get, by compression, non-const +extern_c Handle2Array +ArrayArrayGetByCompression( + ConstHandle2Array self, + const UTF8Text compression +); + +// +++ Set, by compression +extern_c void +ArrayArraySetByCompression( + ConstHandle2Array self, + const UTF8Text compression, + ConstHandle2ConstArray array +); + +// +++ Has, by symmetry +extern_c int +ArrayArrayHasBySymmetry( + ConstHandle2ConstArray self, + const UTF8Text symmetry +); + +// --- Get, by symmetry, const +extern_c Handle2ConstArray +ArrayArrayGetBySymmetryConst( + ConstHandle2ConstArray self, + const UTF8Text symmetry +); + +// +++ Get, by symmetry, non-const +extern_c Handle2Array +ArrayArrayGetBySymmetry( + ConstHandle2Array self, + const UTF8Text symmetry +); + +// +++ Set, by symmetry +extern_c void +ArrayArraySetBySymmetry( + ConstHandle2Array self, + const UTF8Text symmetry, + ConstHandle2ConstArray array +); + +// +++ Has, by permutation +extern_c int +ArrayArrayHasByPermutation( + ConstHandle2ConstArray self, + const UTF8Text permutation +); + +// --- Get, by permutation, const +extern_c Handle2ConstArray +ArrayArrayGetByPermutationConst( + ConstHandle2ConstArray self, + const UTF8Text permutation +); + +// +++ Get, by permutation, non-const +extern_c Handle2Array +ArrayArrayGetByPermutation( + ConstHandle2Array self, + const UTF8Text permutation +); + +// +++ Set, by permutation +extern_c void +ArrayArraySetByPermutation( + ConstHandle2Array self, + const UTF8Text permutation, + ConstHandle2ConstArray array +); + +// +++ Has, by storageOrder +extern_c int +ArrayArrayHasByStorageOrder( + ConstHandle2ConstArray self, + const UTF8Text storageOrder +); + +// --- Get, by storageOrder, const +extern_c Handle2ConstArray +ArrayArrayGetByStorageOrderConst( + ConstHandle2ConstArray self, + const UTF8Text storageOrder +); + +// +++ Get, by storageOrder, non-const +extern_c Handle2Array +ArrayArrayGetByStorageOrder( + ConstHandle2Array self, + const UTF8Text storageOrder +); + +// +++ Set, by storageOrder +extern_c void +ArrayArraySetByStorageOrder( + ConstHandle2Array self, + const UTF8Text storageOrder, + ConstHandle2ConstArray array +); + +// +++ Has, by offset +extern_c int +ArrayArrayHasByOffset( + ConstHandle2ConstArray self, + const IntegerTuple offset +); + +// --- Get, by offset, const +extern_c Handle2ConstArray +ArrayArrayGetByOffsetConst( + ConstHandle2ConstArray self, + const IntegerTuple offset +); + +// +++ Get, by offset, non-const +extern_c Handle2Array +ArrayArrayGetByOffset( + ConstHandle2Array self, + const IntegerTuple offset +); + +// +++ Set, by offset +extern_c void +ArrayArraySetByOffset( + ConstHandle2Array self, + const IntegerTuple offset, + ConstHandle2ConstArray array +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Array/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Array/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Array/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Array/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Array/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Axes.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Axes.cpp new file mode 100644 index 000000000..29fbc3b4f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Axes.cpp @@ -0,0 +1,681 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Axes.hpp" +#include "Axes.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AxesClass; +using CPP = multigroup::Axes; + +static const std::string CLASSNAME = "Axes"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; + static auto axis = [](auto &obj) { return &obj.axis; }; + static auto grid = [](auto &obj) { return &obj.grid; }; +} + +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 UTF8Text href, + ConstHandle2Axis *const axis, const size_t axisSize, + ConstHandle2Grid *const grid, const size_t gridSize +) { + ConstHandle2Axes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href, + 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 +Handle2Axes +AxesCreate( + const UTF8Text href, + ConstHandle2Axis *const axis, const size_t axisSize, + ConstHandle2Grid *const grid, const size_t gridSize +) { + ConstHandle2Axes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href, + 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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +AxesHrefHas(ConstHandle2ConstAxes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +UTF8Text +AxesHrefGet(ConstHandle2ConstAxes self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +AxesHrefSet(ConstHandle2Axes self, const UTF8Text href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + +// Has, by index +int +AxesAxisHasByIndex( + ConstHandle2ConstAxes self, + const Integer32 index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AxisHasByIndex", + self, extract::axis, meta::index, index); +} + +// Get, by index, const +Handle2ConstAxis +AxesAxisGetByIndexConst( + ConstHandle2ConstAxes self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByIndexConst", + self, extract::axis, meta::index, index); +} + +// Get, by index, non-const +Handle2Axis +AxesAxisGetByIndex( + ConstHandle2Axes self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByIndex", + self, extract::axis, meta::index, index); +} + +// Set, by index +void +AxesAxisSetByIndex( + ConstHandle2Axes self, + const Integer32 index, + ConstHandle2ConstAxis axis +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AxisSetByIndex", + self, extract::axis, meta::index, index, axis); +} + +// Has, by label +int +AxesAxisHasByLabel( + ConstHandle2ConstAxes self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AxisHasByLabel", + self, extract::axis, meta::label, label); +} + +// Get, by label, const +Handle2ConstAxis +AxesAxisGetByLabelConst( + ConstHandle2ConstAxes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByLabelConst", + self, extract::axis, meta::label, label); +} + +// Get, by label, non-const +Handle2Axis +AxesAxisGetByLabel( + ConstHandle2Axes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByLabel", + self, extract::axis, meta::label, label); +} + +// Set, by label +void +AxesAxisSetByLabel( + ConstHandle2Axes self, + const XMLName label, + ConstHandle2ConstAxis axis +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AxisSetByLabel", + self, extract::axis, meta::label, label, axis); +} + +// Has, by unit +int +AxesAxisHasByUnit( + ConstHandle2ConstAxes self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AxisHasByUnit", + self, extract::axis, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstAxis +AxesAxisGetByUnitConst( + ConstHandle2ConstAxes self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByUnitConst", + self, extract::axis, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Axis +AxesAxisGetByUnit( + ConstHandle2Axes self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByUnit", + self, extract::axis, meta::unit, unit); +} + +// Set, by unit +void +AxesAxisSetByUnit( + ConstHandle2Axes self, + const XMLName 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); +} + +// Has, by index +int +AxesGridHasByIndex( + ConstHandle2ConstAxes self, + const Integer32 index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByIndex", + self, extract::grid, meta::index, index); +} + +// Get, by index, const +Handle2ConstGrid +AxesGridGetByIndexConst( + ConstHandle2ConstAxes self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByIndexConst", + self, extract::grid, meta::index, index); +} + +// Get, by index, non-const +Handle2Grid +AxesGridGetByIndex( + ConstHandle2Axes self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByIndex", + self, extract::grid, meta::index, index); +} + +// Set, by index +void +AxesGridSetByIndex( + ConstHandle2Axes self, + const Integer32 index, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByIndex", + self, extract::grid, meta::index, index, grid); +} + +// Has, by interpolation +int +AxesGridHasByInterpolation( + ConstHandle2ConstAxes self, + const enums::Interpolation interpolation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByInterpolation", + self, extract::grid, meta::interpolation, interpolation); +} + +// Get, by interpolation, const +Handle2ConstGrid +AxesGridGetByInterpolationConst( + ConstHandle2ConstAxes self, + const enums::Interpolation interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByInterpolationConst", + self, extract::grid, meta::interpolation, interpolation); +} + +// Get, by interpolation, non-const +Handle2Grid +AxesGridGetByInterpolation( + ConstHandle2Axes self, + const enums::Interpolation interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByInterpolation", + self, extract::grid, meta::interpolation, interpolation); +} + +// Set, by interpolation +void +AxesGridSetByInterpolation( + ConstHandle2Axes self, + const enums::Interpolation interpolation, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByInterpolation", + self, extract::grid, meta::interpolation, interpolation, grid); +} + +// Has, by label +int +AxesGridHasByLabel( + ConstHandle2ConstAxes self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByLabel", + self, extract::grid, meta::label, label); +} + +// Get, by label, const +Handle2ConstGrid +AxesGridGetByLabelConst( + ConstHandle2ConstAxes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByLabelConst", + self, extract::grid, meta::label, label); +} + +// Get, by label, non-const +Handle2Grid +AxesGridGetByLabel( + ConstHandle2Axes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByLabel", + self, extract::grid, meta::label, label); +} + +// Set, by label +void +AxesGridSetByLabel( + ConstHandle2Axes self, + const XMLName label, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByLabel", + self, extract::grid, meta::label, label, grid); +} + +// Has, by style +int +AxesGridHasByStyle( + ConstHandle2ConstAxes self, + const UTF8Text style +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByStyle", + self, extract::grid, meta::style, style); +} + +// Get, by style, const +Handle2ConstGrid +AxesGridGetByStyleConst( + ConstHandle2ConstAxes self, + const UTF8Text style +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByStyleConst", + self, extract::grid, meta::style, style); +} + +// Get, by style, non-const +Handle2Grid +AxesGridGetByStyle( + ConstHandle2Axes self, + const UTF8Text style +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByStyle", + self, extract::grid, meta::style, style); +} + +// Set, by style +void +AxesGridSetByStyle( + ConstHandle2Axes self, + const UTF8Text style, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByStyle", + self, extract::grid, meta::style, style, grid); +} + +// Has, by unit +int +AxesGridHasByUnit( + ConstHandle2ConstAxes self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByUnit", + self, extract::grid, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstGrid +AxesGridGetByUnitConst( + ConstHandle2ConstAxes self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByUnitConst", + self, extract::grid, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Grid +AxesGridGetByUnit( + ConstHandle2Axes self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByUnit", + self, extract::grid, meta::unit, unit); +} + +// Set, by unit +void +AxesGridSetByUnit( + ConstHandle2Axes self, + const XMLName unit, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByUnit", + self, extract::grid, meta::unit, unit, grid); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Axes/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Axes.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Axes.h new file mode 100644 index 000000000..f69a6d843 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Axes.h @@ -0,0 +1,469 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_CONTAINERS_AXES +#define C_INTERFACE_TEST_V2_0_CONTAINERS_AXES + +#include "GNDStk.h" +#include "v2.0/containers/Axis.h" +#include "v2.0/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 UTF8Text href, + ConstHandle2Axis *const axis, const size_t axisSize, + ConstHandle2Grid *const grid, const size_t gridSize +); + +// +++ Create, general +extern_c Handle2Axes +AxesCreate( + const UTF8Text href, + 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxesHrefHas(ConstHandle2ConstAxes self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +AxesHrefGet(ConstHandle2ConstAxes self); + +// +++ Set +extern_c void +AxesHrefSet(ConstHandle2Axes self, const UTF8Text href); + + +// ----------------------------------------------------------------------------- +// 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 +); + +// +++ Has, by index +extern_c int +AxesAxisHasByIndex( + ConstHandle2ConstAxes self, + const Integer32 index +); + +// --- Get, by index, const +extern_c Handle2ConstAxis +AxesAxisGetByIndexConst( + ConstHandle2ConstAxes self, + const Integer32 index +); + +// +++ Get, by index, non-const +extern_c Handle2Axis +AxesAxisGetByIndex( + ConstHandle2Axes self, + const Integer32 index +); + +// +++ Set, by index +extern_c void +AxesAxisSetByIndex( + ConstHandle2Axes self, + const Integer32 index, + ConstHandle2ConstAxis axis +); + +// +++ Has, by label +extern_c int +AxesAxisHasByLabel( + ConstHandle2ConstAxes self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstAxis +AxesAxisGetByLabelConst( + ConstHandle2ConstAxes self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Axis +AxesAxisGetByLabel( + ConstHandle2Axes self, + const XMLName label +); + +// +++ Set, by label +extern_c void +AxesAxisSetByLabel( + ConstHandle2Axes self, + const XMLName label, + ConstHandle2ConstAxis axis +); + +// +++ Has, by unit +extern_c int +AxesAxisHasByUnit( + ConstHandle2ConstAxes self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstAxis +AxesAxisGetByUnitConst( + ConstHandle2ConstAxes self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Axis +AxesAxisGetByUnit( + ConstHandle2Axes self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +AxesAxisSetByUnit( + ConstHandle2Axes self, + const XMLName 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 +); + +// +++ Has, by index +extern_c int +AxesGridHasByIndex( + ConstHandle2ConstAxes self, + const Integer32 index +); + +// --- Get, by index, const +extern_c Handle2ConstGrid +AxesGridGetByIndexConst( + ConstHandle2ConstAxes self, + const Integer32 index +); + +// +++ Get, by index, non-const +extern_c Handle2Grid +AxesGridGetByIndex( + ConstHandle2Axes self, + const Integer32 index +); + +// +++ Set, by index +extern_c void +AxesGridSetByIndex( + ConstHandle2Axes self, + const Integer32 index, + ConstHandle2ConstGrid grid +); + +// +++ Has, by interpolation +extern_c int +AxesGridHasByInterpolation( + ConstHandle2ConstAxes self, + const enums::Interpolation interpolation +); + +// --- Get, by interpolation, const +extern_c Handle2ConstGrid +AxesGridGetByInterpolationConst( + ConstHandle2ConstAxes self, + const enums::Interpolation interpolation +); + +// +++ Get, by interpolation, non-const +extern_c Handle2Grid +AxesGridGetByInterpolation( + ConstHandle2Axes self, + const enums::Interpolation interpolation +); + +// +++ Set, by interpolation +extern_c void +AxesGridSetByInterpolation( + ConstHandle2Axes self, + const enums::Interpolation interpolation, + ConstHandle2ConstGrid grid +); + +// +++ Has, by label +extern_c int +AxesGridHasByLabel( + ConstHandle2ConstAxes self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstGrid +AxesGridGetByLabelConst( + ConstHandle2ConstAxes self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Grid +AxesGridGetByLabel( + ConstHandle2Axes self, + const XMLName label +); + +// +++ Set, by label +extern_c void +AxesGridSetByLabel( + ConstHandle2Axes self, + const XMLName label, + ConstHandle2ConstGrid grid +); + +// +++ Has, by style +extern_c int +AxesGridHasByStyle( + ConstHandle2ConstAxes self, + const UTF8Text style +); + +// --- Get, by style, const +extern_c Handle2ConstGrid +AxesGridGetByStyleConst( + ConstHandle2ConstAxes self, + const UTF8Text style +); + +// +++ Get, by style, non-const +extern_c Handle2Grid +AxesGridGetByStyle( + ConstHandle2Axes self, + const UTF8Text style +); + +// +++ Set, by style +extern_c void +AxesGridSetByStyle( + ConstHandle2Axes self, + const UTF8Text style, + ConstHandle2ConstGrid grid +); + +// +++ Has, by unit +extern_c int +AxesGridHasByUnit( + ConstHandle2ConstAxes self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstGrid +AxesGridGetByUnitConst( + ConstHandle2ConstAxes self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Grid +AxesGridGetByUnit( + ConstHandle2Axes self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +AxesGridSetByUnit( + ConstHandle2Axes self, + const XMLName unit, + ConstHandle2ConstGrid grid +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Axes/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Axes/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Axes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Axes/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Axes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Axis.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Axis.cpp new file mode 100644 index 000000000..6727a63c5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Axis.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Axis.hpp" +#include "Axis.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2Axis +AxisDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAxis +AxisCreateConst( + const Integer32 index, + const XMLName label, + const XMLName unit +) { + ConstHandle2Axis handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + label, + unit + ); + return handle; +} + +// Create, general +Handle2Axis +AxisCreate( + const Integer32 index, + const XMLName label, + const XMLName 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 +Integer32 +AxisIndexGet(ConstHandle2ConstAxis self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +AxisIndexSet(ConstHandle2Axis self, const Integer32 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 +XMLName +AxisLabelGet(ConstHandle2ConstAxis self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AxisLabelSet(ConstHandle2Axis self, const XMLName 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 +XMLName +AxisUnitGet(ConstHandle2ConstAxis self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +AxisUnitSet(ConstHandle2Axis self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Axis/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Axis.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Axis.h new file mode 100644 index 000000000..dd8b8dee4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/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_TEST_V2_0_CONTAINERS_AXIS +#define C_INTERFACE_TEST_V2_0_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 Integer32 index, + const XMLName label, + const XMLName unit +); + +// +++ Create, general +extern_c Handle2Axis +AxisCreate( + const Integer32 index, + const XMLName label, + const XMLName 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 Integer32 +AxisIndexGet(ConstHandle2ConstAxis self); + +// +++ Set +extern_c void +AxisIndexSet(ConstHandle2Axis self, const Integer32 index); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxisLabelHas(ConstHandle2ConstAxis self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AxisLabelGet(ConstHandle2ConstAxis self); + +// +++ Set +extern_c void +AxisLabelSet(ConstHandle2Axis self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxisUnitHas(ConstHandle2ConstAxis self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AxisUnitGet(ConstHandle2ConstAxis self); + +// +++ Set +extern_c void +AxisUnitSet(ConstHandle2Axis self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Axis/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Axis/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Axis/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Axis/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Axis/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d.cpp new file mode 100644 index 000000000..126dae18b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Cdf_in_xs_pdf_cdf1d.hpp" +#include "Cdf_in_xs_pdf_cdf1d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Cdf_in_xs_pdf_cdf1dClass; +using CPP = multigroup::Cdf_in_xs_pdf_cdf1d; + +static const std::string CLASSNAME = "Cdf_in_xs_pdf_cdf1d"; + +namespace extract { + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPValues = containers::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCdf_in_xs_pdf_cdf1d +Cdf_in_xs_pdf_cdf1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Cdf_in_xs_pdf_cdf1d +Cdf_in_xs_pdf_cdf1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCdf_in_xs_pdf_cdf1d +Cdf_in_xs_pdf_cdf1dCreateConst( + ConstHandle2ConstValues values +) { + ConstHandle2Cdf_in_xs_pdf_cdf1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(values) + ); + return handle; +} + +// Create, general +Handle2Cdf_in_xs_pdf_cdf1d +Cdf_in_xs_pdf_cdf1dCreate( + ConstHandle2ConstValues values +) { + ConstHandle2Cdf_in_xs_pdf_cdf1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + 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 +Cdf_in_xs_pdf_cdf1dAssign(ConstHandle2Cdf_in_xs_pdf_cdf1d self, ConstHandle2ConstCdf_in_xs_pdf_cdf1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Cdf_in_xs_pdf_cdf1dDelete(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Cdf_in_xs_pdf_cdf1dRead(ConstHandle2Cdf_in_xs_pdf_cdf1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Cdf_in_xs_pdf_cdf1dWrite(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Cdf_in_xs_pdf_cdf1dPrint(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Cdf_in_xs_pdf_cdf1dPrintXML(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Cdf_in_xs_pdf_cdf1dPrintJSON(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +Cdf_in_xs_pdf_cdf1dValuesHas(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +Cdf_in_xs_pdf_cdf1dValuesGetConst(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +Cdf_in_xs_pdf_cdf1dValuesGet(ConstHandle2Cdf_in_xs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +Cdf_in_xs_pdf_cdf1dValuesSet(ConstHandle2Cdf_in_xs_pdf_cdf1d self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d.h new file mode 100644 index 000000000..a20d771c0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d.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. +// +// Cdf_in_xs_pdf_cdf1d is the basic handle type in this file. Example: +// // Create a default Cdf_in_xs_pdf_cdf1d object: +// Cdf_in_xs_pdf_cdf1d handle = Cdf_in_xs_pdf_cdf1dDefault(); +// Functions involving Cdf_in_xs_pdf_cdf1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_CDF_IN_XS_PDF_CDF1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_CDF_IN_XS_PDF_CDF1D + +#include "GNDStk.h" +#include "v2.0/containers/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Cdf_in_xs_pdf_cdf1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Cdf_in_xs_pdf_cdf1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Cdf_in_xs_pdf_cdf1dClass *Cdf_in_xs_pdf_cdf1d; + +// --- Const-aware handles. +typedef const struct Cdf_in_xs_pdf_cdf1dClass *const ConstHandle2ConstCdf_in_xs_pdf_cdf1d; +typedef struct Cdf_in_xs_pdf_cdf1dClass *const ConstHandle2Cdf_in_xs_pdf_cdf1d; +typedef const struct Cdf_in_xs_pdf_cdf1dClass * Handle2ConstCdf_in_xs_pdf_cdf1d; +typedef struct Cdf_in_xs_pdf_cdf1dClass * Handle2Cdf_in_xs_pdf_cdf1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCdf_in_xs_pdf_cdf1d +Cdf_in_xs_pdf_cdf1dDefaultConst(); + +// +++ Create, default +extern_c Handle2Cdf_in_xs_pdf_cdf1d +Cdf_in_xs_pdf_cdf1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstCdf_in_xs_pdf_cdf1d +Cdf_in_xs_pdf_cdf1dCreateConst( + ConstHandle2ConstValues values +); + +// +++ Create, general +extern_c Handle2Cdf_in_xs_pdf_cdf1d +Cdf_in_xs_pdf_cdf1dCreate( + 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 +Cdf_in_xs_pdf_cdf1dAssign(ConstHandle2Cdf_in_xs_pdf_cdf1d self, ConstHandle2ConstCdf_in_xs_pdf_cdf1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Cdf_in_xs_pdf_cdf1dDelete(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Cdf_in_xs_pdf_cdf1dRead(ConstHandle2Cdf_in_xs_pdf_cdf1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Cdf_in_xs_pdf_cdf1dWrite(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Cdf_in_xs_pdf_cdf1dPrint(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self); + +// +++ Print to standard output, as XML +extern_c int +Cdf_in_xs_pdf_cdf1dPrintXML(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self); + +// +++ Print to standard output, as JSON +extern_c int +Cdf_in_xs_pdf_cdf1dPrintJSON(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Cdf_in_xs_pdf_cdf1dValuesHas(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self); + +// --- Get, const +extern_c Handle2ConstValues +Cdf_in_xs_pdf_cdf1dValuesGetConst(ConstHandle2ConstCdf_in_xs_pdf_cdf1d self); + +// +++ Get, non-const +extern_c Handle2Values +Cdf_in_xs_pdf_cdf1dValuesGet(ConstHandle2Cdf_in_xs_pdf_cdf1d self); + +// +++ Set +extern_c void +Cdf_in_xs_pdf_cdf1dValuesSet(ConstHandle2Cdf_in_xs_pdf_cdf1d self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Column.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Column.cpp new file mode 100644 index 000000000..300d3cab4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Column.cpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Column.hpp" +#include "Column.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto types = [](auto &obj) { return &obj.types; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstColumn +ColumnDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Column +ColumnDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstColumn +ColumnCreateConst( + const Integer32 index, + const XMLName name, + const XMLName unit, + const XMLName types +) { + ConstHandle2Column handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + name, + unit, + types + ); + return handle; +} + +// Create, general +Handle2Column +ColumnCreate( + const Integer32 index, + const XMLName name, + const XMLName unit, + const XMLName types +) { + ConstHandle2Column handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + name, + unit, + types + ); + return handle; +} + +// Assign +// Use this to assign 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 +Integer32 +ColumnIndexGet(ConstHandle2ConstColumn self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +ColumnIndexSet(ConstHandle2Column self, const Integer32 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 +XMLName +ColumnNameGet(ConstHandle2ConstColumn self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +ColumnNameSet(ConstHandle2Column self, const XMLName 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 +XMLName +ColumnUnitGet(ConstHandle2ConstColumn self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +ColumnUnitSet(ConstHandle2Column self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: types +// ----------------------------------------------------------------------------- + +// Has +int +ColumnTypesHas(ConstHandle2ConstColumn self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TypesHas", self, extract::types); +} + +// Get +// Returns by value +XMLName +ColumnTypesGet(ConstHandle2ConstColumn self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypesGet", self, extract::types); +} + +// Set +void +ColumnTypesSet(ConstHandle2Column self, const XMLName types) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypesSet", self, extract::types, types); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Column/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Column.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Column.h new file mode 100644 index 000000000..d8fb23509 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Column.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. +// +// 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_TEST_V2_0_CONTAINERS_COLUMN +#define C_INTERFACE_TEST_V2_0_CONTAINERS_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 +extern_c Handle2Column +ColumnDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumn +ColumnCreateConst( + const Integer32 index, + const XMLName name, + const XMLName unit, + const XMLName types +); + +// +++ Create, general +extern_c Handle2Column +ColumnCreate( + const Integer32 index, + const XMLName name, + const XMLName unit, + const XMLName types +); + +// +++ Assign +// +++ Use this to assign one handled 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 Integer32 +ColumnIndexGet(ConstHandle2ConstColumn self); + +// +++ Set +extern_c void +ColumnIndexSet(ConstHandle2Column self, const Integer32 index); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnNameHas(ConstHandle2ConstColumn self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ColumnNameGet(ConstHandle2ConstColumn self); + +// +++ Set +extern_c void +ColumnNameSet(ConstHandle2Column self, const XMLName name); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnUnitHas(ConstHandle2ConstColumn self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ColumnUnitGet(ConstHandle2ConstColumn self); + +// +++ Set +extern_c void +ColumnUnitSet(ConstHandle2Column self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: types +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnTypesHas(ConstHandle2ConstColumn self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ColumnTypesGet(ConstHandle2ConstColumn self); + +// +++ Set +extern_c void +ColumnTypesSet(ConstHandle2Column self, const XMLName types); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Column/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Column/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Column/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Column/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Column/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders.cpp new file mode 100644 index 000000000..3bc7fd793 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/ColumnHeaders.hpp" +#include "ColumnHeaders.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Column; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstColumnHeaders +ColumnHeadersDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by index +int +ColumnHeadersColumnHasByIndex( + ConstHandle2ConstColumnHeaders self, + const Integer32 index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ColumnHasByIndex", + self, extract::column, meta::index, index); +} + +// Get, by index, const +Handle2ConstColumn +ColumnHeadersColumnGetByIndexConst( + ConstHandle2ConstColumnHeaders self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByIndexConst", + self, extract::column, meta::index, index); +} + +// Get, by index, non-const +Handle2Column +ColumnHeadersColumnGetByIndex( + ConstHandle2ColumnHeaders self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByIndex", + self, extract::column, meta::index, index); +} + +// Set, by index +void +ColumnHeadersColumnSetByIndex( + ConstHandle2ColumnHeaders self, + const Integer32 index, + ConstHandle2ConstColumn column +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ColumnSetByIndex", + self, extract::column, meta::index, index, column); +} + +// Has, by name +int +ColumnHeadersColumnHasByName( + ConstHandle2ConstColumnHeaders self, + const XMLName name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ColumnHasByName", + self, extract::column, meta::name, name); +} + +// Get, by name, const +Handle2ConstColumn +ColumnHeadersColumnGetByNameConst( + ConstHandle2ConstColumnHeaders self, + const XMLName name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByNameConst", + self, extract::column, meta::name, name); +} + +// Get, by name, non-const +Handle2Column +ColumnHeadersColumnGetByName( + ConstHandle2ColumnHeaders self, + const XMLName name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByName", + self, extract::column, meta::name, name); +} + +// Set, by name +void +ColumnHeadersColumnSetByName( + ConstHandle2ColumnHeaders self, + const XMLName name, + ConstHandle2ConstColumn column +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ColumnSetByName", + self, extract::column, meta::name, name, column); +} + +// Has, by unit +int +ColumnHeadersColumnHasByUnit( + ConstHandle2ConstColumnHeaders self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ColumnHasByUnit", + self, extract::column, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstColumn +ColumnHeadersColumnGetByUnitConst( + ConstHandle2ConstColumnHeaders self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByUnitConst", + self, extract::column, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Column +ColumnHeadersColumnGetByUnit( + ConstHandle2ColumnHeaders self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByUnit", + self, extract::column, meta::unit, unit); +} + +// Set, by unit +void +ColumnHeadersColumnSetByUnit( + ConstHandle2ColumnHeaders self, + const XMLName unit, + ConstHandle2ConstColumn column +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ColumnSetByUnit", + self, extract::column, meta::unit, unit, column); +} + +// Has, by types +int +ColumnHeadersColumnHasByTypes( + ConstHandle2ConstColumnHeaders self, + const XMLName types +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ColumnHasByTypes", + self, extract::column, meta::types, types); +} + +// Get, by types, const +Handle2ConstColumn +ColumnHeadersColumnGetByTypesConst( + ConstHandle2ConstColumnHeaders self, + const XMLName types +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByTypesConst", + self, extract::column, meta::types, types); +} + +// Get, by types, non-const +Handle2Column +ColumnHeadersColumnGetByTypes( + ConstHandle2ColumnHeaders self, + const XMLName types +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByTypes", + self, extract::column, meta::types, types); +} + +// Set, by types +void +ColumnHeadersColumnSetByTypes( + ConstHandle2ColumnHeaders self, + const XMLName types, + ConstHandle2ConstColumn column +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ColumnSetByTypes", + self, extract::column, meta::types, types, column); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/ColumnHeaders/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders.h b/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders.h new file mode 100644 index 000000000..d197d116f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders.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. +// +// 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_TEST_V2_0_CONTAINERS_COLUMNHEADERS +#define C_INTERFACE_TEST_V2_0_CONTAINERS_COLUMNHEADERS + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2ColumnHeaders +ColumnHeadersDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumnHeaders +ColumnHeadersCreateConst( + ConstHandle2Column *const column, const size_t columnSize +); + +// +++ Create, general +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 +); + +// +++ Has, by index +extern_c int +ColumnHeadersColumnHasByIndex( + ConstHandle2ConstColumnHeaders self, + const Integer32 index +); + +// --- Get, by index, const +extern_c Handle2ConstColumn +ColumnHeadersColumnGetByIndexConst( + ConstHandle2ConstColumnHeaders self, + const Integer32 index +); + +// +++ Get, by index, non-const +extern_c Handle2Column +ColumnHeadersColumnGetByIndex( + ConstHandle2ColumnHeaders self, + const Integer32 index +); + +// +++ Set, by index +extern_c void +ColumnHeadersColumnSetByIndex( + ConstHandle2ColumnHeaders self, + const Integer32 index, + ConstHandle2ConstColumn column +); + +// +++ Has, by name +extern_c int +ColumnHeadersColumnHasByName( + ConstHandle2ConstColumnHeaders self, + const XMLName name +); + +// --- Get, by name, const +extern_c Handle2ConstColumn +ColumnHeadersColumnGetByNameConst( + ConstHandle2ConstColumnHeaders self, + const XMLName name +); + +// +++ Get, by name, non-const +extern_c Handle2Column +ColumnHeadersColumnGetByName( + ConstHandle2ColumnHeaders self, + const XMLName name +); + +// +++ Set, by name +extern_c void +ColumnHeadersColumnSetByName( + ConstHandle2ColumnHeaders self, + const XMLName name, + ConstHandle2ConstColumn column +); + +// +++ Has, by unit +extern_c int +ColumnHeadersColumnHasByUnit( + ConstHandle2ConstColumnHeaders self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstColumn +ColumnHeadersColumnGetByUnitConst( + ConstHandle2ConstColumnHeaders self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Column +ColumnHeadersColumnGetByUnit( + ConstHandle2ColumnHeaders self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +ColumnHeadersColumnSetByUnit( + ConstHandle2ColumnHeaders self, + const XMLName unit, + ConstHandle2ConstColumn column +); + +// +++ Has, by types +extern_c int +ColumnHeadersColumnHasByTypes( + ConstHandle2ConstColumnHeaders self, + const XMLName types +); + +// --- Get, by types, const +extern_c Handle2ConstColumn +ColumnHeadersColumnGetByTypesConst( + ConstHandle2ConstColumnHeaders self, + const XMLName types +); + +// +++ Get, by types, non-const +extern_c Handle2Column +ColumnHeadersColumnGetByTypes( + ConstHandle2ColumnHeaders self, + const XMLName types +); + +// +++ Set, by types +extern_c void +ColumnHeadersColumnSetByTypes( + ConstHandle2ColumnHeaders self, + const XMLName types, + ConstHandle2ConstColumn column +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/ColumnHeaders/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/ColumnHeaders/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals.cpp new file mode 100644 index 000000000..32ca95c21 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/ConfidenceIntervals.hpp" +#include "ConfidenceIntervals.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ConfidenceIntervalsClass; +using CPP = multigroup::ConfidenceIntervals; + +static const std::string CLASSNAME = "ConfidenceIntervals"; + +namespace extract { + static auto interval = [](auto &obj) { return &obj.interval; }; +} + +using CPPInterval = containers::Interval; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConfidenceIntervals +ConfidenceIntervalsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ConfidenceIntervals +ConfidenceIntervalsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConfidenceIntervals +ConfidenceIntervalsCreateConst( + ConstHandle2Interval *const interval, const size_t intervalSize +) { + ConstHandle2ConfidenceIntervals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t IntervalN = 0; IntervalN < intervalSize; ++IntervalN) + ConfidenceIntervalsIntervalAdd(handle, interval[IntervalN]); + return handle; +} + +// Create, general +Handle2ConfidenceIntervals +ConfidenceIntervalsCreate( + ConstHandle2Interval *const interval, const size_t intervalSize +) { + ConstHandle2ConfidenceIntervals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t IntervalN = 0; IntervalN < intervalSize; ++IntervalN) + ConfidenceIntervalsIntervalAdd(handle, interval[IntervalN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ConfidenceIntervalsAssign(ConstHandle2ConfidenceIntervals self, ConstHandle2ConstConfidenceIntervals from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ConfidenceIntervalsDelete(ConstHandle2ConstConfidenceIntervals self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ConfidenceIntervalsRead(ConstHandle2ConfidenceIntervals self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ConfidenceIntervalsWrite(ConstHandle2ConstConfidenceIntervals self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ConfidenceIntervalsPrint(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ConfidenceIntervalsPrintXML(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ConfidenceIntervalsPrintJSON(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: interval +// ----------------------------------------------------------------------------- + +// Has +int +ConfidenceIntervalsIntervalHas(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IntervalHas", self, extract::interval); +} + +// Clear +void +ConfidenceIntervalsIntervalClear(ConstHandle2ConfidenceIntervals self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"IntervalClear", self, extract::interval); +} + +// Size +size_t +ConfidenceIntervalsIntervalSize(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"IntervalSize", self, extract::interval); +} + +// Add +void +ConfidenceIntervalsIntervalAdd(ConstHandle2ConfidenceIntervals self, ConstHandle2ConstInterval interval) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"IntervalAdd", self, extract::interval, interval); +} + +// Get, by index \in [0,size), const +Handle2ConstInterval +ConfidenceIntervalsIntervalGetConst(ConstHandle2ConstConfidenceIntervals self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IntervalGetConst", self, extract::interval, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Interval +ConfidenceIntervalsIntervalGet(ConstHandle2ConfidenceIntervals self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IntervalGet", self, extract::interval, index_); +} + +// Set, by index \in [0,size) +void +ConfidenceIntervalsIntervalSet( + ConstHandle2ConfidenceIntervals self, + const size_t index_, + ConstHandle2ConstInterval interval +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"IntervalSet", self, extract::interval, index_, interval); +} + +// Has, by confidence +int +ConfidenceIntervalsIntervalHasByConfidence( + ConstHandle2ConstConfidenceIntervals self, + const Float64 confidence +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IntervalHasByConfidence", + self, extract::interval, meta::confidence, confidence); +} + +// Get, by confidence, const +Handle2ConstInterval +ConfidenceIntervalsIntervalGetByConfidenceConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 confidence +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByConfidenceConst", + self, extract::interval, meta::confidence, confidence); +} + +// Get, by confidence, non-const +Handle2Interval +ConfidenceIntervalsIntervalGetByConfidence( + ConstHandle2ConfidenceIntervals self, + const Float64 confidence +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByConfidence", + self, extract::interval, meta::confidence, confidence); +} + +// Set, by confidence +void +ConfidenceIntervalsIntervalSetByConfidence( + ConstHandle2ConfidenceIntervals self, + const Float64 confidence, + ConstHandle2ConstInterval interval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IntervalSetByConfidence", + self, extract::interval, meta::confidence, confidence, interval); +} + +// Has, by lower +int +ConfidenceIntervalsIntervalHasByLower( + ConstHandle2ConstConfidenceIntervals self, + const Float64 lower +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IntervalHasByLower", + self, extract::interval, meta::lower, lower); +} + +// Get, by lower, const +Handle2ConstInterval +ConfidenceIntervalsIntervalGetByLowerConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 lower +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByLowerConst", + self, extract::interval, meta::lower, lower); +} + +// Get, by lower, non-const +Handle2Interval +ConfidenceIntervalsIntervalGetByLower( + ConstHandle2ConfidenceIntervals self, + const Float64 lower +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByLower", + self, extract::interval, meta::lower, lower); +} + +// Set, by lower +void +ConfidenceIntervalsIntervalSetByLower( + ConstHandle2ConfidenceIntervals self, + const Float64 lower, + ConstHandle2ConstInterval interval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IntervalSetByLower", + self, extract::interval, meta::lower, lower, interval); +} + +// Has, by upper +int +ConfidenceIntervalsIntervalHasByUpper( + ConstHandle2ConstConfidenceIntervals self, + const Float64 upper +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IntervalHasByUpper", + self, extract::interval, meta::upper, upper); +} + +// Get, by upper, const +Handle2ConstInterval +ConfidenceIntervalsIntervalGetByUpperConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 upper +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByUpperConst", + self, extract::interval, meta::upper, upper); +} + +// Get, by upper, non-const +Handle2Interval +ConfidenceIntervalsIntervalGetByUpper( + ConstHandle2ConfidenceIntervals self, + const Float64 upper +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByUpper", + self, extract::interval, meta::upper, upper); +} + +// Set, by upper +void +ConfidenceIntervalsIntervalSetByUpper( + ConstHandle2ConfidenceIntervals self, + const Float64 upper, + ConstHandle2ConstInterval interval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IntervalSetByUpper", + self, extract::interval, meta::upper, upper, interval); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/ConfidenceIntervals/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals.h b/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals.h new file mode 100644 index 000000000..cc175d58e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals.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. +// +// ConfidenceIntervals is the basic handle type in this file. Example: +// // Create a default ConfidenceIntervals object: +// ConfidenceIntervals handle = ConfidenceIntervalsDefault(); +// Functions involving ConfidenceIntervals are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_CONFIDENCEINTERVALS +#define C_INTERFACE_TEST_V2_0_CONTAINERS_CONFIDENCEINTERVALS + +#include "GNDStk.h" +#include "v2.0/containers/Interval.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ConfidenceIntervalsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ConfidenceIntervals +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ConfidenceIntervalsClass *ConfidenceIntervals; + +// --- Const-aware handles. +typedef const struct ConfidenceIntervalsClass *const ConstHandle2ConstConfidenceIntervals; +typedef struct ConfidenceIntervalsClass *const ConstHandle2ConfidenceIntervals; +typedef const struct ConfidenceIntervalsClass * Handle2ConstConfidenceIntervals; +typedef struct ConfidenceIntervalsClass * Handle2ConfidenceIntervals; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstConfidenceIntervals +ConfidenceIntervalsDefaultConst(); + +// +++ Create, default +extern_c Handle2ConfidenceIntervals +ConfidenceIntervalsDefault(); + +// --- Create, general, const +extern_c Handle2ConstConfidenceIntervals +ConfidenceIntervalsCreateConst( + ConstHandle2Interval *const interval, const size_t intervalSize +); + +// +++ Create, general +extern_c Handle2ConfidenceIntervals +ConfidenceIntervalsCreate( + ConstHandle2Interval *const interval, const size_t intervalSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ConfidenceIntervalsAssign(ConstHandle2ConfidenceIntervals self, ConstHandle2ConstConfidenceIntervals from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ConfidenceIntervalsDelete(ConstHandle2ConstConfidenceIntervals self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ConfidenceIntervalsRead(ConstHandle2ConfidenceIntervals self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ConfidenceIntervalsWrite(ConstHandle2ConstConfidenceIntervals self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ConfidenceIntervalsPrint(ConstHandle2ConstConfidenceIntervals self); + +// +++ Print to standard output, as XML +extern_c int +ConfidenceIntervalsPrintXML(ConstHandle2ConstConfidenceIntervals self); + +// +++ Print to standard output, as JSON +extern_c int +ConfidenceIntervalsPrintJSON(ConstHandle2ConstConfidenceIntervals self); + + +// ----------------------------------------------------------------------------- +// Child: interval +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ConfidenceIntervalsIntervalHas(ConstHandle2ConstConfidenceIntervals self); + +// +++ Clear +extern_c void +ConfidenceIntervalsIntervalClear(ConstHandle2ConfidenceIntervals self); + +// +++ Size +extern_c size_t +ConfidenceIntervalsIntervalSize(ConstHandle2ConstConfidenceIntervals self); + +// +++ Add +extern_c void +ConfidenceIntervalsIntervalAdd(ConstHandle2ConfidenceIntervals self, ConstHandle2ConstInterval interval); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstInterval +ConfidenceIntervalsIntervalGetConst(ConstHandle2ConstConfidenceIntervals self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Interval +ConfidenceIntervalsIntervalGet(ConstHandle2ConfidenceIntervals self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ConfidenceIntervalsIntervalSet( + ConstHandle2ConfidenceIntervals self, + const size_t index_, + ConstHandle2ConstInterval interval +); + +// +++ Has, by confidence +extern_c int +ConfidenceIntervalsIntervalHasByConfidence( + ConstHandle2ConstConfidenceIntervals self, + const Float64 confidence +); + +// --- Get, by confidence, const +extern_c Handle2ConstInterval +ConfidenceIntervalsIntervalGetByConfidenceConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 confidence +); + +// +++ Get, by confidence, non-const +extern_c Handle2Interval +ConfidenceIntervalsIntervalGetByConfidence( + ConstHandle2ConfidenceIntervals self, + const Float64 confidence +); + +// +++ Set, by confidence +extern_c void +ConfidenceIntervalsIntervalSetByConfidence( + ConstHandle2ConfidenceIntervals self, + const Float64 confidence, + ConstHandle2ConstInterval interval +); + +// +++ Has, by lower +extern_c int +ConfidenceIntervalsIntervalHasByLower( + ConstHandle2ConstConfidenceIntervals self, + const Float64 lower +); + +// --- Get, by lower, const +extern_c Handle2ConstInterval +ConfidenceIntervalsIntervalGetByLowerConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 lower +); + +// +++ Get, by lower, non-const +extern_c Handle2Interval +ConfidenceIntervalsIntervalGetByLower( + ConstHandle2ConfidenceIntervals self, + const Float64 lower +); + +// +++ Set, by lower +extern_c void +ConfidenceIntervalsIntervalSetByLower( + ConstHandle2ConfidenceIntervals self, + const Float64 lower, + ConstHandle2ConstInterval interval +); + +// +++ Has, by upper +extern_c int +ConfidenceIntervalsIntervalHasByUpper( + ConstHandle2ConstConfidenceIntervals self, + const Float64 upper +); + +// --- Get, by upper, const +extern_c Handle2ConstInterval +ConfidenceIntervalsIntervalGetByUpperConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 upper +); + +// +++ Get, by upper, non-const +extern_c Handle2Interval +ConfidenceIntervalsIntervalGetByUpper( + ConstHandle2ConfidenceIntervals self, + const Float64 upper +); + +// +++ Set, by upper +extern_c void +ConfidenceIntervalsIntervalSetByUpper( + ConstHandle2ConfidenceIntervals self, + const Float64 upper, + ConstHandle2ConstInterval interval +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/ConfidenceIntervals/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/ConfidenceIntervals/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d.cpp new file mode 100644 index 000000000..06fdf8179 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d.cpp @@ -0,0 +1,356 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Constant1d.hpp" +#include "Constant1d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Constant1dClass; +using CPP = multigroup::Constant1d; + +static const std::string CLASSNAME = "Constant1d"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + 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 = containers::Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConstant1d +Constant1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Constant1d +Constant1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConstant1d +Constant1dCreateConst( + const Float64 value, + const XMLName label, + const Float64 outerDomainValue, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstAxes axes +) { + ConstHandle2Constant1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + label, + outerDomainValue, + domainMin, + domainMax, + detail::tocpp(axes) + ); + return handle; +} + +// Create, general +Handle2Constant1d +Constant1dCreate( + const Float64 value, + const XMLName label, + const Float64 outerDomainValue, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstAxes axes +) { + ConstHandle2Constant1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + label, + outerDomainValue, + 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: value +// ----------------------------------------------------------------------------- + +// Has +int +Constant1dValueHas(ConstHandle2ConstConstant1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +Constant1dValueGet(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +Constant1dValueSet(ConstHandle2Constant1d self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Constant1dLabelHas(ConstHandle2ConstConstant1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +Constant1dLabelGet(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Constant1dLabelSet(ConstHandle2Constant1d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +Constant1dOuterDomainValueHas(ConstHandle2ConstConstant1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +Float64 +Constant1dOuterDomainValueGet(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +Constant1dOuterDomainValueSet(ConstHandle2Constant1d self, const Float64 outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +Constant1dDomainMinHas(ConstHandle2ConstConstant1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +Float64 +Constant1dDomainMinGet(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +Constant1dDomainMinSet(ConstHandle2Constant1d self, const Float64 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 +Float64 +Constant1dDomainMaxGet(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +Constant1dDomainMaxSet(ConstHandle2Constant1d self, const Float64 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/containers/Constant1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d.h new file mode 100644 index 000000000..6f8cd8c50 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d.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. +// +// 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_TEST_V2_0_CONTAINERS_CONSTANT1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_CONSTANT1D + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2Constant1d +Constant1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstConstant1d +Constant1dCreateConst( + const Float64 value, + const XMLName label, + const Float64 outerDomainValue, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstAxes axes +); + +// +++ Create, general +extern_c Handle2Constant1d +Constant1dCreate( + const Float64 value, + const XMLName label, + const Float64 outerDomainValue, + const Float64 domainMin, + const Float64 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: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dValueHas(ConstHandle2ConstConstant1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Constant1dValueGet(ConstHandle2ConstConstant1d self); + +// +++ Set +extern_c void +Constant1dValueSet(ConstHandle2Constant1d self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dLabelHas(ConstHandle2ConstConstant1d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +Constant1dLabelGet(ConstHandle2ConstConstant1d self); + +// +++ Set +extern_c void +Constant1dLabelSet(ConstHandle2Constant1d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dOuterDomainValueHas(ConstHandle2ConstConstant1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Constant1dOuterDomainValueGet(ConstHandle2ConstConstant1d self); + +// +++ Set +extern_c void +Constant1dOuterDomainValueSet(ConstHandle2Constant1d self, const Float64 outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dDomainMinHas(ConstHandle2ConstConstant1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Constant1dDomainMinGet(ConstHandle2ConstConstant1d self); + +// +++ Set +extern_c void +Constant1dDomainMinSet(ConstHandle2Constant1d self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dDomainMaxHas(ConstHandle2ConstConstant1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Constant1dDomainMaxGet(ConstHandle2ConstConstant1d self); + +// +++ Set +extern_c void +Constant1dDomainMaxSet(ConstHandle2Constant1d self, const Float64 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/containers/Constant1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Constant1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance.cpp new file mode 100644 index 000000000..d153d8e2b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Covariance.hpp" +#include "Covariance.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovariance +CovarianceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Covariance +CovarianceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovariance +CovarianceCreateConst( + const XMLName label, + const char *const href +) { + ConstHandle2Covariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href + ); + return handle; +} + +// Create, general +Handle2Covariance +CovarianceCreate( + const XMLName label, + const char *const href +) { + ConstHandle2Covariance 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 +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 +XMLName +CovarianceLabelGet(ConstHandle2ConstCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CovarianceLabelSet(ConstHandle2Covariance self, const XMLName 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Covariance/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance.h new file mode 100644 index 000000000..5977a0230 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance.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. +// +// 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_TEST_V2_0_CONTAINERS_COVARIANCE +#define C_INTERFACE_TEST_V2_0_CONTAINERS_COVARIANCE + +#include "GNDStk.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 +extern_c Handle2Covariance +CovarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovariance +CovarianceCreateConst( + const XMLName label, + const char *const href +); + +// +++ Create, general +extern_c Handle2Covariance +CovarianceCreate( + const XMLName 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 +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 XMLName +CovarianceLabelGet(ConstHandle2ConstCovariance self); + +// +++ Set +extern_c void +CovarianceLabelSet(ConstHandle2Covariance self, const XMLName 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Covariance/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Covariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Data.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Data.cpp new file mode 100644 index 000000000..97bf1280e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Data.cpp @@ -0,0 +1,425 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Data.hpp" +#include "Data.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = DataClass; +using CPP = multigroup::Data; + +static const std::string CLASSNAME = "Data"; + +namespace extract { + static auto sep = [](auto &obj) { return &obj.sep; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstData +DataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Data +DataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstData +DataCreateConst( + const UTF8Text sep +) { + ConstHandle2Data handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + sep + ); + return handle; +} + +// Create, general +Handle2Data +DataCreate( + const UTF8Text sep +) { + ConstHandle2Data handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + sep + ); + return handle; +} + +// Assign +// Use this to assign 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 +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +DataIntsClear(ConstHandle2Data self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +DataIntsSize(ConstHandle2ConstData self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +DataIntsGet(ConstHandle2ConstData self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +DataIntsSet(ConstHandle2Data self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +DataIntsGetArrayConst(ConstHandle2ConstData self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +DataIntsGetArray(ConstHandle2Data self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +DataIntsSetArray(ConstHandle2Data self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +DataUnsignedsClear(ConstHandle2Data self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +DataUnsignedsSize(ConstHandle2ConstData self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +DataUnsignedsGet(ConstHandle2ConstData self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +DataUnsignedsSet(ConstHandle2Data self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +DataUnsignedsGetArrayConst(ConstHandle2ConstData self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +DataUnsignedsGetArray(ConstHandle2Data self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +DataUnsignedsSetArray(ConstHandle2Data self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +DataFloatsClear(ConstHandle2Data self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +DataFloatsSize(ConstHandle2ConstData self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +DataFloatsGet(ConstHandle2ConstData self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +DataFloatsSet(ConstHandle2Data self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +DataFloatsGetArrayConst(ConstHandle2ConstData self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +DataFloatsGetArray(ConstHandle2Data self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +DataFloatsSetArray(ConstHandle2Data self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// 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); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: sep +// ----------------------------------------------------------------------------- + +// Has +int +DataSepHas(ConstHandle2ConstData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SepHas", self, extract::sep); +} + +// Get +// Returns by value +UTF8Text +DataSepGet(ConstHandle2ConstData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SepGet", self, extract::sep); +} + +// Set +void +DataSepSet(ConstHandle2Data self, const UTF8Text sep) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SepSet", self, extract::sep, sep); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Data/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Data.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Data.h new file mode 100644 index 000000000..244692b3a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Data.h @@ -0,0 +1,298 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_CONTAINERS_DATA +#define C_INTERFACE_TEST_V2_0_CONTAINERS_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 +extern_c Handle2Data +DataDefault(); + +// --- Create, general, const +extern_c Handle2ConstData +DataCreateConst( + const UTF8Text sep +); + +// +++ Create, general +extern_c Handle2Data +DataCreate( + const UTF8Text sep +); + +// +++ Assign +// +++ Use this to assign one handled 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 +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +DataIntsClear(ConstHandle2Data self); + +// +++ Get size +extern_c size_t +DataIntsSize(ConstHandle2ConstData self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +DataIntsGet(ConstHandle2ConstData self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +DataIntsSet(ConstHandle2Data self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +DataIntsGetArrayConst(ConstHandle2ConstData self); + +// +++ Get pointer to existing values, non-const +extern_c int * +DataIntsGetArray(ConstHandle2Data self); + +// +++ Set completely new values and size +extern_c void +DataIntsSetArray(ConstHandle2Data self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +DataUnsignedsClear(ConstHandle2Data self); + +// +++ Get size +extern_c size_t +DataUnsignedsSize(ConstHandle2ConstData self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +DataUnsignedsGet(ConstHandle2ConstData self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +DataUnsignedsSet(ConstHandle2Data self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +DataUnsignedsGetArrayConst(ConstHandle2ConstData self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +DataUnsignedsGetArray(ConstHandle2Data self); + +// +++ Set completely new values and size +extern_c void +DataUnsignedsSetArray(ConstHandle2Data self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +DataFloatsClear(ConstHandle2Data self); + +// +++ Get size +extern_c size_t +DataFloatsSize(ConstHandle2ConstData self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +DataFloatsGet(ConstHandle2ConstData self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +DataFloatsSet(ConstHandle2Data self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +DataFloatsGetArrayConst(ConstHandle2ConstData self); + +// +++ Get pointer to existing values, non-const +extern_c float * +DataFloatsGetArray(ConstHandle2Data self); + +// +++ Set completely new values and size +extern_c void +DataFloatsSetArray(ConstHandle2Data self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: sep +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DataSepHas(ConstHandle2ConstData self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +DataSepGet(ConstHandle2ConstData self); + +// +++ Set +extern_c void +DataSepSet(ConstHandle2Data self, const UTF8Text sep); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Data/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Data/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Data/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Data/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Data/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Double.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Double.cpp new file mode 100644 index 000000000..991355b86 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Double.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Double.hpp" +#include "Double.h" + +using namespace njoy::GNDStk; +using namespace test::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 unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPUncertainty = containers::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDouble +DoubleDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Double +DoubleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDouble +DoubleCreateConst( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Double handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Double +DoubleCreate( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Double handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + 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 +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 +XMLName +DoubleLabelGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +DoubleLabelSet(ConstHandle2Double self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +DoubleUnitHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +DoubleUnitGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +DoubleUnitSet(ConstHandle2Double self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +DoubleValueHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +DoubleValueGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +DoubleValueSet(ConstHandle2Double self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// 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/containers/Double/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Double.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Double.h new file mode 100644 index 000000000..ec1019bf2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/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_TEST_V2_0_CONTAINERS_DOUBLE +#define C_INTERFACE_TEST_V2_0_CONTAINERS_DOUBLE + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2Double +DoubleDefault(); + +// --- Create, general, const +extern_c Handle2ConstDouble +DoubleCreateConst( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2Double +DoubleCreate( + const XMLName label, + const XMLName unit, + const Float64 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 +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 XMLName +DoubleLabelGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleLabelSet(ConstHandle2Double self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleUnitHas(ConstHandle2ConstDouble self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +DoubleUnitGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleUnitSet(ConstHandle2Double self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleValueHas(ConstHandle2ConstDouble self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +DoubleValueGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleValueSet(ConstHandle2Double self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// 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/containers/Double/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Double/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Double/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Double/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Double/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Fraction.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Fraction.cpp new file mode 100644 index 000000000..95ba5fb1e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Fraction.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Fraction.hpp" +#include "Fraction.h" + +using namespace njoy::GNDStk; +using namespace test::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 unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFraction +FractionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Fraction +FractionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFraction +FractionCreateConst( + const XMLName label, + const XMLName unit, + const Fraction32 value +) { + ConstHandle2Fraction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value + ); + return handle; +} + +// Create, general +Handle2Fraction +FractionCreate( + const XMLName label, + const XMLName unit, + const Fraction32 value +) { + ConstHandle2Fraction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + 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 +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 +XMLName +FractionLabelGet(ConstHandle2ConstFraction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +FractionLabelSet(ConstHandle2Fraction self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +FractionUnitHas(ConstHandle2ConstFraction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +FractionUnitGet(ConstHandle2ConstFraction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +FractionUnitSet(ConstHandle2Fraction self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +FractionValueHas(ConstHandle2ConstFraction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Fraction32 +FractionValueGet(ConstHandle2ConstFraction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +FractionValueSet(ConstHandle2Fraction self, const Fraction32 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Fraction/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Fraction.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Fraction.h new file mode 100644 index 000000000..d3623f006 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/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_TEST_V2_0_CONTAINERS_FRACTION +#define C_INTERFACE_TEST_V2_0_CONTAINERS_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 +extern_c Handle2Fraction +FractionDefault(); + +// --- Create, general, const +extern_c Handle2ConstFraction +FractionCreateConst( + const XMLName label, + const XMLName unit, + const Fraction32 value +); + +// +++ Create, general +extern_c Handle2Fraction +FractionCreate( + const XMLName label, + const XMLName unit, + const Fraction32 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 +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 XMLName +FractionLabelGet(ConstHandle2ConstFraction self); + +// +++ Set +extern_c void +FractionLabelSet(ConstHandle2Fraction self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FractionUnitHas(ConstHandle2ConstFraction self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +FractionUnitGet(ConstHandle2ConstFraction self); + +// +++ Set +extern_c void +FractionUnitSet(ConstHandle2Fraction self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FractionValueHas(ConstHandle2ConstFraction self); + +// +++ Get +// +++ Returns by value +extern_c Fraction32 +FractionValueGet(ConstHandle2ConstFraction self); + +// +++ Set +extern_c void +FractionValueSet(ConstHandle2Fraction self, const Fraction32 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Fraction/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Fraction/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Fraction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Fraction/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Fraction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds.cpp new file mode 100644 index 000000000..2014f945e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds.cpp @@ -0,0 +1,143 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Function1ds.hpp" +#include "Function1ds.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Function1dsClass; +using CPP = multigroup::Function1ds; + +static const std::string CLASSNAME = "Function1ds"; + +namespace extract { +} + +using CPPXYs1d = containers::XYs1d; +using CPPConstant1d = containers::Constant1d; +using CPPPolynomial1d = containers::Polynomial1d; +using CPPLegendre = containers::Legendre; +using CPPGridded1d = containers::Gridded1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFunction1ds +Function1dsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Function1ds +Function1dsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFunction1ds +Function1dsCreateConst( +) { + ConstHandle2Function1ds handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2Function1ds +Function1dsCreate( +) { + ConstHandle2Function1ds 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Function1ds/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds.h new file mode 100644 index 000000000..1ea490ce3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds.h @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_CONTAINERS_FUNCTION1DS +#define C_INTERFACE_TEST_V2_0_CONTAINERS_FUNCTION1DS + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Constant1d.h" +#include "v2.0/containers/Polynomial1d.h" +#include "v2.0/containers/Legendre.h" +#include "v2.0/containers/Gridded1d.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 +extern_c Handle2Function1ds +Function1dsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFunction1ds +Function1dsCreateConst( +); + +// +++ Create, general +extern_c Handle2Function1ds +Function1dsCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Function1ds/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Function1ds/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds.cpp new file mode 100644 index 000000000..b9368c075 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Function2ds.hpp" +#include "Function2ds.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Function2dsClass; +using CPP = multigroup::Function2ds; + +static const std::string CLASSNAME = "Function2ds"; + +namespace extract { +} + +using CPPXYs2d = containers::XYs2d; +using CPPGridded2d = containers::Gridded2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFunction2ds +Function2dsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Function2ds +Function2dsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFunction2ds +Function2dsCreateConst( +) { + ConstHandle2Function2ds handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2Function2ds +Function2dsCreate( +) { + ConstHandle2Function2ds 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Function2ds/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds.h new file mode 100644 index 000000000..13124c70b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds.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. +// +// 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_TEST_V2_0_CONTAINERS_FUNCTION2DS +#define C_INTERFACE_TEST_V2_0_CONTAINERS_FUNCTION2DS + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Gridded2d.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 +extern_c Handle2Function2ds +Function2dsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFunction2ds +Function2dsCreateConst( +); + +// +++ Create, general +extern_c Handle2Function2ds +Function2dsCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Function2ds/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Function2ds/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds.cpp new file mode 100644 index 000000000..df06d6b4e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Function3ds.hpp" +#include "Function3ds.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Function3dsClass; +using CPP = multigroup::Function3ds; + +static const std::string CLASSNAME = "Function3ds"; + +namespace extract { +} + +using CPPXYs3d = containers::XYs3d; +using CPPGridded3d = containers::Gridded3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFunction3ds +Function3dsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Function3ds +Function3dsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFunction3ds +Function3dsCreateConst( +) { + ConstHandle2Function3ds handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2Function3ds +Function3dsCreate( +) { + ConstHandle2Function3ds 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 +Function3dsAssign(ConstHandle2Function3ds self, ConstHandle2ConstFunction3ds from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Function3dsDelete(ConstHandle2ConstFunction3ds self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Function3dsRead(ConstHandle2Function3ds self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Function3dsWrite(ConstHandle2ConstFunction3ds self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Function3dsPrint(ConstHandle2ConstFunction3ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Function3dsPrintXML(ConstHandle2ConstFunction3ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Function3dsPrintJSON(ConstHandle2ConstFunction3ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Function3ds/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds.h new file mode 100644 index 000000000..0c7453867 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds.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. +// +// Function3ds is the basic handle type in this file. Example: +// // Create a default Function3ds object: +// Function3ds handle = Function3dsDefault(); +// Functions involving Function3ds are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_FUNCTION3DS +#define C_INTERFACE_TEST_V2_0_CONTAINERS_FUNCTION3DS + +#include "GNDStk.h" +#include "v2.0/containers/XYs3d.h" +#include "v2.0/containers/Gridded3d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Function3dsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Function3ds +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Function3dsClass *Function3ds; + +// --- Const-aware handles. +typedef const struct Function3dsClass *const ConstHandle2ConstFunction3ds; +typedef struct Function3dsClass *const ConstHandle2Function3ds; +typedef const struct Function3dsClass * Handle2ConstFunction3ds; +typedef struct Function3dsClass * Handle2Function3ds; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFunction3ds +Function3dsDefaultConst(); + +// +++ Create, default +extern_c Handle2Function3ds +Function3dsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFunction3ds +Function3dsCreateConst( +); + +// +++ Create, general +extern_c Handle2Function3ds +Function3dsCreate( +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Function3dsAssign(ConstHandle2Function3ds self, ConstHandle2ConstFunction3ds from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Function3dsDelete(ConstHandle2ConstFunction3ds self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Function3dsRead(ConstHandle2Function3ds self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Function3dsWrite(ConstHandle2ConstFunction3ds self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Function3dsPrint(ConstHandle2ConstFunction3ds self); + +// +++ Print to standard output, as XML +extern_c int +Function3dsPrintXML(ConstHandle2ConstFunction3ds self); + +// +++ Print to standard output, as JSON +extern_c int +Function3dsPrintJSON(ConstHandle2ConstFunction3ds self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Function3ds/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Function3ds/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Grid.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Grid.cpp new file mode 100644 index 000000000..04d00eb83 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Grid.cpp @@ -0,0 +1,315 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Grid.hpp" +#include "Grid.h" + +using namespace njoy::GNDStk; +using namespace test::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 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 Integer32 index, + const enums::Interpolation interpolation, + const XMLName label, + const UTF8Text style, + const XMLName unit, +) { + ConstHandle2Grid handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + interpolation, + label, + style, + unit + ); + return handle; +} + +// Create, general +Handle2Grid +GridCreate( + const Integer32 index, + const enums::Interpolation interpolation, + const XMLName label, + const UTF8Text style, + const XMLName 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 +Integer32 +GridIndexGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +GridIndexSet(ConstHandle2Grid self, const Integer32 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 +XMLName +GridLabelGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +GridLabelSet(ConstHandle2Grid self, const XMLName 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 +UTF8Text +GridStyleGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StyleGet", self, extract::style); +} + +// Set +void +GridStyleSet(ConstHandle2Grid self, const UTF8Text 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 +XMLName +GridUnitGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +GridUnitSet(ConstHandle2Grid self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Grid/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Grid.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Grid.h new file mode 100644 index 000000000..1929e744f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/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_TEST_V2_0_CONTAINERS_GRID +#define C_INTERFACE_TEST_V2_0_CONTAINERS_GRID + +#include "GNDStk.h" +#include "v2.0/containers/Values.h" +#include "v2.0/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 Integer32 index, + const enums::Interpolation interpolation, + const XMLName label, + const UTF8Text style, + const XMLName unit, +); + +// +++ Create, general +extern_c Handle2Grid +GridCreate( + const Integer32 index, + const enums::Interpolation interpolation, + const XMLName label, + const UTF8Text style, + const XMLName 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 Integer32 +GridIndexGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridIndexSet(ConstHandle2Grid self, const Integer32 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 XMLName +GridLabelGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridLabelSet(ConstHandle2Grid self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: style +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridStyleHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +GridStyleGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridStyleSet(ConstHandle2Grid self, const UTF8Text style); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridUnitHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +GridUnitGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridUnitSet(ConstHandle2Grid self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Grid/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Grid/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Grid/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Grid/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Grid/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d.cpp new file mode 100644 index 000000000..622c17d27 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Gridded1d.hpp" +#include "Gridded1d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Gridded1dClass; +using CPP = multigroup::Gridded1d; + +static const std::string CLASSNAME = "Gridded1d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto array = [](auto &obj) { return &obj.array; }; + static auto axes = [](auto &obj) { return &obj.axes; }; +} + +using CPPArray = containers::Array; +using CPPAxes = containers::Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGridded1d +Gridded1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Gridded1d +Gridded1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGridded1d +Gridded1dCreateConst( + const XMLName label, + ConstHandle2ConstArray array, + ConstHandle2ConstAxes axes +) { + ConstHandle2Gridded1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(array), + detail::tocpp(axes) + ); + return handle; +} + +// Create, general +Handle2Gridded1d +Gridded1dCreate( + const XMLName label, + ConstHandle2ConstArray array, + ConstHandle2ConstAxes axes +) { + ConstHandle2Gridded1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(array), + 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 +Gridded1dAssign(ConstHandle2Gridded1d self, ConstHandle2ConstGridded1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Gridded1dDelete(ConstHandle2ConstGridded1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Gridded1dRead(ConstHandle2Gridded1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Gridded1dWrite(ConstHandle2ConstGridded1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Gridded1dPrint(ConstHandle2ConstGridded1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Gridded1dPrintXML(ConstHandle2ConstGridded1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Gridded1dPrintJSON(ConstHandle2ConstGridded1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Gridded1dLabelHas(ConstHandle2ConstGridded1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +Gridded1dLabelGet(ConstHandle2ConstGridded1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Gridded1dLabelSet(ConstHandle2Gridded1d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// Has +int +Gridded1dArrayHas(ConstHandle2ConstGridded1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ArrayHas", self, extract::array); +} + +// Get, const +Handle2ConstArray +Gridded1dArrayGetConst(ConstHandle2ConstGridded1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGetConst", self, extract::array); +} + +// Get, non-const +Handle2Array +Gridded1dArrayGet(ConstHandle2Gridded1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGet", self, extract::array); +} + +// Set +void +Gridded1dArraySet(ConstHandle2Gridded1d self, ConstHandle2ConstArray array) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ArraySet", self, extract::array, array); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Gridded1dAxesHas(ConstHandle2ConstGridded1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Gridded1dAxesGetConst(ConstHandle2ConstGridded1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Gridded1dAxesGet(ConstHandle2Gridded1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Gridded1dAxesSet(ConstHandle2Gridded1d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Gridded1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d.h new file mode 100644 index 000000000..0a82f8630 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d.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. +// +// Gridded1d is the basic handle type in this file. Example: +// // Create a default Gridded1d object: +// Gridded1d handle = Gridded1dDefault(); +// Functions involving Gridded1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_GRIDDED1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_GRIDDED1D + +#include "GNDStk.h" +#include "v2.0/containers/Array.h" +#include "v2.0/containers/Axes.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Gridded1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Gridded1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Gridded1dClass *Gridded1d; + +// --- Const-aware handles. +typedef const struct Gridded1dClass *const ConstHandle2ConstGridded1d; +typedef struct Gridded1dClass *const ConstHandle2Gridded1d; +typedef const struct Gridded1dClass * Handle2ConstGridded1d; +typedef struct Gridded1dClass * Handle2Gridded1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGridded1d +Gridded1dDefaultConst(); + +// +++ Create, default +extern_c Handle2Gridded1d +Gridded1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstGridded1d +Gridded1dCreateConst( + const XMLName label, + ConstHandle2ConstArray array, + ConstHandle2ConstAxes axes +); + +// +++ Create, general +extern_c Handle2Gridded1d +Gridded1dCreate( + const XMLName label, + ConstHandle2ConstArray array, + 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 +Gridded1dAssign(ConstHandle2Gridded1d self, ConstHandle2ConstGridded1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Gridded1dDelete(ConstHandle2ConstGridded1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Gridded1dRead(ConstHandle2Gridded1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Gridded1dWrite(ConstHandle2ConstGridded1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Gridded1dPrint(ConstHandle2ConstGridded1d self); + +// +++ Print to standard output, as XML +extern_c int +Gridded1dPrintXML(ConstHandle2ConstGridded1d self); + +// +++ Print to standard output, as JSON +extern_c int +Gridded1dPrintJSON(ConstHandle2ConstGridded1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Gridded1dLabelHas(ConstHandle2ConstGridded1d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +Gridded1dLabelGet(ConstHandle2ConstGridded1d self); + +// +++ Set +extern_c void +Gridded1dLabelSet(ConstHandle2Gridded1d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Gridded1dArrayHas(ConstHandle2ConstGridded1d self); + +// --- Get, const +extern_c Handle2ConstArray +Gridded1dArrayGetConst(ConstHandle2ConstGridded1d self); + +// +++ Get, non-const +extern_c Handle2Array +Gridded1dArrayGet(ConstHandle2Gridded1d self); + +// +++ Set +extern_c void +Gridded1dArraySet(ConstHandle2Gridded1d self, ConstHandle2ConstArray array); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Gridded1dAxesHas(ConstHandle2ConstGridded1d self); + +// --- Get, const +extern_c Handle2ConstAxes +Gridded1dAxesGetConst(ConstHandle2ConstGridded1d self); + +// +++ Get, non-const +extern_c Handle2Axes +Gridded1dAxesGet(ConstHandle2Gridded1d self); + +// +++ Set +extern_c void +Gridded1dAxesSet(ConstHandle2Gridded1d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Gridded1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d.cpp new file mode 100644 index 000000000..8f4b3a69b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Gridded2d.hpp" +#include "Gridded2d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Gridded2dClass; +using CPP = multigroup::Gridded2d; + +static const std::string CLASSNAME = "Gridded2d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto array = [](auto &obj) { return &obj.array; }; + static auto axes = [](auto &obj) { return &obj.axes; }; +} + +using CPPArray = containers::Array; +using CPPAxes = containers::Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGridded2d +Gridded2dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Gridded2d +Gridded2dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGridded2d +Gridded2dCreateConst( + const XMLName label, + ConstHandle2ConstArray array, + ConstHandle2ConstAxes axes +) { + ConstHandle2Gridded2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(array), + detail::tocpp(axes) + ); + return handle; +} + +// Create, general +Handle2Gridded2d +Gridded2dCreate( + const XMLName label, + ConstHandle2ConstArray array, + ConstHandle2ConstAxes axes +) { + ConstHandle2Gridded2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(array), + 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Gridded2dLabelHas(ConstHandle2ConstGridded2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +Gridded2dLabelGet(ConstHandle2ConstGridded2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Gridded2dLabelSet(ConstHandle2Gridded2d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Gridded2d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d.h new file mode 100644 index 000000000..19de05293 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d.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. +// +// 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_TEST_V2_0_CONTAINERS_GRIDDED2D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_GRIDDED2D + +#include "GNDStk.h" +#include "v2.0/containers/Array.h" +#include "v2.0/containers/Axes.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 +extern_c Handle2Gridded2d +Gridded2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstGridded2d +Gridded2dCreateConst( + const XMLName label, + ConstHandle2ConstArray array, + ConstHandle2ConstAxes axes +); + +// +++ Create, general +extern_c Handle2Gridded2d +Gridded2dCreate( + const XMLName label, + ConstHandle2ConstArray array, + 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 +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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Gridded2dLabelHas(ConstHandle2ConstGridded2d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +Gridded2dLabelGet(ConstHandle2ConstGridded2d self); + +// +++ Set +extern_c void +Gridded2dLabelSet(ConstHandle2Gridded2d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Gridded2d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d.cpp new file mode 100644 index 000000000..8c13cd740 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Gridded3d.hpp" +#include "Gridded3d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Gridded3dClass; +using CPP = multigroup::Gridded3d; + +static const std::string CLASSNAME = "Gridded3d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto array = [](auto &obj) { return &obj.array; }; + static auto axes = [](auto &obj) { return &obj.axes; }; +} + +using CPPArray = containers::Array; +using CPPAxes = containers::Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGridded3d +Gridded3dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Gridded3d +Gridded3dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGridded3d +Gridded3dCreateConst( + const XMLName label, + ConstHandle2ConstArray array, + ConstHandle2ConstAxes axes +) { + ConstHandle2Gridded3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(array), + detail::tocpp(axes) + ); + return handle; +} + +// Create, general +Handle2Gridded3d +Gridded3dCreate( + const XMLName label, + ConstHandle2ConstArray array, + ConstHandle2ConstAxes axes +) { + ConstHandle2Gridded3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(array), + 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Gridded3dLabelHas(ConstHandle2ConstGridded3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +Gridded3dLabelGet(ConstHandle2ConstGridded3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Gridded3dLabelSet(ConstHandle2Gridded3d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Gridded3d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d.h new file mode 100644 index 000000000..ce63b486d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d.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. +// +// 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_TEST_V2_0_CONTAINERS_GRIDDED3D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_GRIDDED3D + +#include "GNDStk.h" +#include "v2.0/containers/Array.h" +#include "v2.0/containers/Axes.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 +extern_c Handle2Gridded3d +Gridded3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstGridded3d +Gridded3dCreateConst( + const XMLName label, + ConstHandle2ConstArray array, + ConstHandle2ConstAxes axes +); + +// +++ Create, general +extern_c Handle2Gridded3d +Gridded3dCreate( + const XMLName label, + ConstHandle2ConstArray array, + 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 +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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Gridded3dLabelHas(ConstHandle2ConstGridded3d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +Gridded3dLabelGet(ConstHandle2ConstGridded3d self); + +// +++ Set +extern_c void +Gridded3dLabelSet(ConstHandle2Gridded3d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Gridded3d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Gridded3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Integer.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Integer.cpp new file mode 100644 index 000000000..b0eb244e3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Integer.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Integer.hpp" +#include "Integer.h" + +using namespace njoy::GNDStk; +using namespace test::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 unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInteger +IntegerDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Integer +IntegerDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInteger +IntegerCreateConst( + const XMLName label, + const XMLName unit, + const Integer32 value +) { + ConstHandle2Integer handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value + ); + return handle; +} + +// Create, general +Handle2Integer +IntegerCreate( + const XMLName label, + const XMLName unit, + const Integer32 value +) { + ConstHandle2Integer handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + 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 +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 +XMLName +IntegerLabelGet(ConstHandle2ConstInteger self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +IntegerLabelSet(ConstHandle2Integer self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +IntegerUnitHas(ConstHandle2ConstInteger self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +IntegerUnitGet(ConstHandle2ConstInteger self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +IntegerUnitSet(ConstHandle2Integer self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +IntegerValueHas(ConstHandle2ConstInteger self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Integer32 +IntegerValueGet(ConstHandle2ConstInteger self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +IntegerValueSet(ConstHandle2Integer self, const Integer32 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Integer/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Integer.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Integer.h new file mode 100644 index 000000000..9889a89a7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/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_TEST_V2_0_CONTAINERS_INTEGER +#define C_INTERFACE_TEST_V2_0_CONTAINERS_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 +extern_c Handle2Integer +IntegerDefault(); + +// --- Create, general, const +extern_c Handle2ConstInteger +IntegerCreateConst( + const XMLName label, + const XMLName unit, + const Integer32 value +); + +// +++ Create, general +extern_c Handle2Integer +IntegerCreate( + const XMLName label, + const XMLName unit, + const Integer32 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 +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 XMLName +IntegerLabelGet(ConstHandle2ConstInteger self); + +// +++ Set +extern_c void +IntegerLabelSet(ConstHandle2Integer self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntegerUnitHas(ConstHandle2ConstInteger self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +IntegerUnitGet(ConstHandle2ConstInteger self); + +// +++ Set +extern_c void +IntegerUnitSet(ConstHandle2Integer self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntegerValueHas(ConstHandle2ConstInteger self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +IntegerValueGet(ConstHandle2ConstInteger self); + +// +++ Set +extern_c void +IntegerValueSet(ConstHandle2Integer self, const Integer32 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Integer/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Integer/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Integer/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Integer/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Integer/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Interval.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Interval.cpp new file mode 100644 index 000000000..429bb392c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Interval.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Interval.hpp" +#include "Interval.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = IntervalClass; +using CPP = multigroup::Interval; + +static const std::string CLASSNAME = "Interval"; + +namespace extract { + static auto confidence = [](auto &obj) { return &obj.confidence; }; + static auto lower = [](auto &obj) { return &obj.lower; }; + static auto upper = [](auto &obj) { return &obj.upper; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInterval +IntervalDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Interval +IntervalDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInterval +IntervalCreateConst( + const Float64 confidence, + const Float64 lower, + const Float64 upper +) { + ConstHandle2Interval handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + confidence, + lower, + upper + ); + return handle; +} + +// Create, general +Handle2Interval +IntervalCreate( + const Float64 confidence, + const Float64 lower, + const Float64 upper +) { + ConstHandle2Interval handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + confidence, + lower, + upper + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IntervalAssign(ConstHandle2Interval self, ConstHandle2ConstInterval from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IntervalDelete(ConstHandle2ConstInterval self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IntervalRead(ConstHandle2Interval self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IntervalWrite(ConstHandle2ConstInterval self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IntervalPrint(ConstHandle2ConstInterval self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IntervalPrintXML(ConstHandle2ConstInterval self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IntervalPrintJSON(ConstHandle2ConstInterval self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: confidence +// ----------------------------------------------------------------------------- + +// Has +int +IntervalConfidenceHas(ConstHandle2ConstInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConfidenceHas", self, extract::confidence); +} + +// Get +// Returns by value +Float64 +IntervalConfidenceGet(ConstHandle2ConstInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfidenceGet", self, extract::confidence); +} + +// Set +void +IntervalConfidenceSet(ConstHandle2Interval self, const Float64 confidence) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ConfidenceSet", self, extract::confidence, confidence); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: lower +// ----------------------------------------------------------------------------- + +// Has +int +IntervalLowerHas(ConstHandle2ConstInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LowerHas", self, extract::lower); +} + +// Get +// Returns by value +Float64 +IntervalLowerGet(ConstHandle2ConstInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LowerGet", self, extract::lower); +} + +// Set +void +IntervalLowerSet(ConstHandle2Interval self, const Float64 lower) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LowerSet", self, extract::lower, lower); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: upper +// ----------------------------------------------------------------------------- + +// Has +int +IntervalUpperHas(ConstHandle2ConstInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UpperHas", self, extract::upper); +} + +// Get +// Returns by value +Float64 +IntervalUpperGet(ConstHandle2ConstInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UpperGet", self, extract::upper); +} + +// Set +void +IntervalUpperSet(ConstHandle2Interval self, const Float64 upper) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UpperSet", self, extract::upper, upper); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Interval/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Interval.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Interval.h new file mode 100644 index 000000000..fa407f4e6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Interval.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. +// +// Interval is the basic handle type in this file. Example: +// // Create a default Interval object: +// Interval handle = IntervalDefault(); +// Functions involving Interval are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_INTERVAL +#define C_INTERFACE_TEST_V2_0_CONTAINERS_INTERVAL + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IntervalClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Interval +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IntervalClass *Interval; + +// --- Const-aware handles. +typedef const struct IntervalClass *const ConstHandle2ConstInterval; +typedef struct IntervalClass *const ConstHandle2Interval; +typedef const struct IntervalClass * Handle2ConstInterval; +typedef struct IntervalClass * Handle2Interval; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstInterval +IntervalDefaultConst(); + +// +++ Create, default +extern_c Handle2Interval +IntervalDefault(); + +// --- Create, general, const +extern_c Handle2ConstInterval +IntervalCreateConst( + const Float64 confidence, + const Float64 lower, + const Float64 upper +); + +// +++ Create, general +extern_c Handle2Interval +IntervalCreate( + const Float64 confidence, + const Float64 lower, + const Float64 upper +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IntervalAssign(ConstHandle2Interval self, ConstHandle2ConstInterval from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IntervalDelete(ConstHandle2ConstInterval self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IntervalRead(ConstHandle2Interval self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IntervalWrite(ConstHandle2ConstInterval self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IntervalPrint(ConstHandle2ConstInterval self); + +// +++ Print to standard output, as XML +extern_c int +IntervalPrintXML(ConstHandle2ConstInterval self); + +// +++ Print to standard output, as JSON +extern_c int +IntervalPrintJSON(ConstHandle2ConstInterval self); + + +// ----------------------------------------------------------------------------- +// Metadatum: confidence +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntervalConfidenceHas(ConstHandle2ConstInterval self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +IntervalConfidenceGet(ConstHandle2ConstInterval self); + +// +++ Set +extern_c void +IntervalConfidenceSet(ConstHandle2Interval self, const Float64 confidence); + + +// ----------------------------------------------------------------------------- +// Metadatum: lower +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntervalLowerHas(ConstHandle2ConstInterval self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +IntervalLowerGet(ConstHandle2ConstInterval self); + +// +++ Set +extern_c void +IntervalLowerSet(ConstHandle2Interval self, const Float64 lower); + + +// ----------------------------------------------------------------------------- +// Metadatum: upper +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntervalUpperHas(ConstHandle2ConstInterval self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +IntervalUpperGet(ConstHandle2ConstInterval self); + +// +++ Set +extern_c void +IntervalUpperSet(ConstHandle2Interval self, const Float64 upper); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Interval/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Interval/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Interval/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Interval/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Interval/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre.cpp new file mode 100644 index 000000000..0e119d0c2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre.cpp @@ -0,0 +1,356 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Legendre.hpp" +#include "Legendre.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = LegendreClass; +using CPP = multigroup::Legendre; + +static const std::string CLASSNAME = "Legendre"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + static auto lowerIndex = [](auto &obj) { return &obj.lowerIndex; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPValues = containers::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLegendre +LegendreDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Legendre +LegendreDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLegendre +LegendreCreateConst( + const XMLName label, + const Float64 outerDomainValue, + const Integer32 lowerIndex, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstValues values +) { + ConstHandle2Legendre handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + outerDomainValue, + lowerIndex, + domainMin, + domainMax, + detail::tocpp(values) + ); + return handle; +} + +// Create, general +Handle2Legendre +LegendreCreate( + const XMLName label, + const Float64 outerDomainValue, + const Integer32 lowerIndex, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstValues values +) { + ConstHandle2Legendre handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + outerDomainValue, + lowerIndex, + domainMin, + domainMax, + 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: label +// ----------------------------------------------------------------------------- + +// Has +int +LegendreLabelHas(ConstHandle2ConstLegendre self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +LegendreLabelGet(ConstHandle2ConstLegendre self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +LegendreLabelSet(ConstHandle2Legendre self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +LegendreOuterDomainValueHas(ConstHandle2ConstLegendre self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +Float64 +LegendreOuterDomainValueGet(ConstHandle2ConstLegendre self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +LegendreOuterDomainValueSet(ConstHandle2Legendre self, const Float64 outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: lowerIndex +// ----------------------------------------------------------------------------- + +// Has +int +LegendreLowerIndexHas(ConstHandle2ConstLegendre self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LowerIndexHas", self, extract::lowerIndex); +} + +// Get +// Returns by value +Integer32 +LegendreLowerIndexGet(ConstHandle2ConstLegendre self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LowerIndexGet", self, extract::lowerIndex); +} + +// Set +void +LegendreLowerIndexSet(ConstHandle2Legendre self, const Integer32 lowerIndex) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LowerIndexSet", self, extract::lowerIndex, lowerIndex); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +LegendreDomainMinHas(ConstHandle2ConstLegendre self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +Float64 +LegendreDomainMinGet(ConstHandle2ConstLegendre self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +LegendreDomainMinSet(ConstHandle2Legendre self, const Float64 domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +LegendreDomainMaxHas(ConstHandle2ConstLegendre self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +Float64 +LegendreDomainMaxGet(ConstHandle2ConstLegendre self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +LegendreDomainMaxSet(ConstHandle2Legendre self, const Float64 domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// 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/containers/Legendre/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre.h new file mode 100644 index 000000000..bf3f01957 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre.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. +// +// 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_TEST_V2_0_CONTAINERS_LEGENDRE +#define C_INTERFACE_TEST_V2_0_CONTAINERS_LEGENDRE + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2Legendre +LegendreDefault(); + +// --- Create, general, const +extern_c Handle2ConstLegendre +LegendreCreateConst( + const XMLName label, + const Float64 outerDomainValue, + const Integer32 lowerIndex, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstValues values +); + +// +++ Create, general +extern_c Handle2Legendre +LegendreCreate( + const XMLName label, + const Float64 outerDomainValue, + const Integer32 lowerIndex, + const Float64 domainMin, + const Float64 domainMax, + 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LegendreLabelHas(ConstHandle2ConstLegendre self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +LegendreLabelGet(ConstHandle2ConstLegendre self); + +// +++ Set +extern_c void +LegendreLabelSet(ConstHandle2Legendre self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LegendreOuterDomainValueHas(ConstHandle2ConstLegendre self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +LegendreOuterDomainValueGet(ConstHandle2ConstLegendre self); + +// +++ Set +extern_c void +LegendreOuterDomainValueSet(ConstHandle2Legendre self, const Float64 outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Metadatum: lowerIndex +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LegendreLowerIndexHas(ConstHandle2ConstLegendre self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +LegendreLowerIndexGet(ConstHandle2ConstLegendre self); + +// +++ Set +extern_c void +LegendreLowerIndexSet(ConstHandle2Legendre self, const Integer32 lowerIndex); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LegendreDomainMinHas(ConstHandle2ConstLegendre self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +LegendreDomainMinGet(ConstHandle2ConstLegendre self); + +// +++ Set +extern_c void +LegendreDomainMinSet(ConstHandle2Legendre self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LegendreDomainMaxHas(ConstHandle2ConstLegendre self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +LegendreDomainMaxGet(ConstHandle2ConstLegendre self); + +// +++ Set +extern_c void +LegendreDomainMaxSet(ConstHandle2Legendre self, const Float64 domainMax); + + +// ----------------------------------------------------------------------------- +// 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/containers/Legendre/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Legendre/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Link.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Link.cpp new file mode 100644 index 000000000..66e963d39 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Link.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Link.hpp" +#include "Link.h" + +using namespace njoy::GNDStk; +using namespace test::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 +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 "v2.0/containers/Link/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Link.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Link.h new file mode 100644 index 000000000..16a62eec1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/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_TEST_V2_0_CONTAINERS_LINK +#define C_INTERFACE_TEST_V2_0_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 "v2.0/containers/Link/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Link/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Link/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Link/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Link/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances.cpp new file mode 100644 index 000000000..a397a1ad5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/ListOfCovariances.hpp" +#include "ListOfCovariances.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Covariance; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstListOfCovariances +ListOfCovariancesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +ListOfCovariancesCovarianceHasByLabel( + ConstHandle2ConstListOfCovariances self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceHasByLabel", + self, extract::covariance, meta::label, label); +} + +// Get, by label, const +Handle2ConstCovariance +ListOfCovariancesCovarianceGetByLabelConst( + ConstHandle2ConstListOfCovariances self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceGetByLabelConst", + self, extract::covariance, meta::label, label); +} + +// Get, by label, non-const +Handle2Covariance +ListOfCovariancesCovarianceGetByLabel( + ConstHandle2ListOfCovariances self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceGetByLabel", + self, extract::covariance, meta::label, label); +} + +// Set, by label +void +ListOfCovariancesCovarianceSetByLabel( + ConstHandle2ListOfCovariances self, + const XMLName label, + ConstHandle2ConstCovariance covariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSetByLabel", + self, extract::covariance, meta::label, label, covariance); +} + +// 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/containers/ListOfCovariances/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances.h b/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances.h new file mode 100644 index 000000000..a15075b11 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_CONTAINERS_LISTOFCOVARIANCES +#define C_INTERFACE_TEST_V2_0_CONTAINERS_LISTOFCOVARIANCES + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2ListOfCovariances +ListOfCovariancesDefault(); + +// --- Create, general, const +extern_c Handle2ConstListOfCovariances +ListOfCovariancesCreateConst( + ConstHandle2Covariance *const covariance, const size_t covarianceSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +ListOfCovariancesCovarianceHasByLabel( + ConstHandle2ConstListOfCovariances self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstCovariance +ListOfCovariancesCovarianceGetByLabelConst( + ConstHandle2ConstListOfCovariances self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Covariance +ListOfCovariancesCovarianceGetByLabel( + ConstHandle2ListOfCovariances self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ListOfCovariancesCovarianceSetByLabel( + ConstHandle2ListOfCovariances self, + const XMLName label, + ConstHandle2ConstCovariance covariance +); + +// +++ 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/containers/ListOfCovariances/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/ListOfCovariances/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal.cpp new file mode 100644 index 000000000..9db48166c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/LogNormal.hpp" +#include "LogNormal.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = LogNormalClass; +using CPP = multigroup::LogNormal; + +static const std::string CLASSNAME = "LogNormal"; + +namespace extract { + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDouble = extra::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLogNormal +LogNormalDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2LogNormal +LogNormalDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLogNormal +LogNormalCreateConst( + ConstHandle2ConstDouble Double +) { + ConstHandle2LogNormal handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(Double) + ); + return handle; +} + +// Create, general +Handle2LogNormal +LogNormalCreate( + ConstHandle2ConstDouble Double +) { + ConstHandle2LogNormal 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 +LogNormalAssign(ConstHandle2LogNormal self, ConstHandle2ConstLogNormal from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LogNormalDelete(ConstHandle2ConstLogNormal self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LogNormalRead(ConstHandle2LogNormal self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LogNormalWrite(ConstHandle2ConstLogNormal self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LogNormalPrint(ConstHandle2ConstLogNormal self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LogNormalPrintXML(ConstHandle2ConstLogNormal self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LogNormalPrintJSON(ConstHandle2ConstLogNormal self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +LogNormalDoubleHas(ConstHandle2ConstLogNormal self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +LogNormalDoubleGetConst(ConstHandle2ConstLogNormal self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +LogNormalDoubleGet(ConstHandle2LogNormal self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +LogNormalDoubleSet(ConstHandle2LogNormal self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/LogNormal/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal.h b/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal.h new file mode 100644 index 000000000..27e372b69 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal.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. +// +// LogNormal is the basic handle type in this file. Example: +// // Create a default LogNormal object: +// LogNormal handle = LogNormalDefault(); +// Functions involving LogNormal are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_LOGNORMAL +#define C_INTERFACE_TEST_V2_0_CONTAINERS_LOGNORMAL + +#include "GNDStk.h" +#include "v2.0/extra/Double.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LogNormalClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ LogNormal +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LogNormalClass *LogNormal; + +// --- Const-aware handles. +typedef const struct LogNormalClass *const ConstHandle2ConstLogNormal; +typedef struct LogNormalClass *const ConstHandle2LogNormal; +typedef const struct LogNormalClass * Handle2ConstLogNormal; +typedef struct LogNormalClass * Handle2LogNormal; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLogNormal +LogNormalDefaultConst(); + +// +++ Create, default +extern_c Handle2LogNormal +LogNormalDefault(); + +// --- Create, general, const +extern_c Handle2ConstLogNormal +LogNormalCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +extern_c Handle2LogNormal +LogNormalCreate( + 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 +LogNormalAssign(ConstHandle2LogNormal self, ConstHandle2ConstLogNormal from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LogNormalDelete(ConstHandle2ConstLogNormal self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LogNormalRead(ConstHandle2LogNormal self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LogNormalWrite(ConstHandle2ConstLogNormal self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LogNormalPrint(ConstHandle2ConstLogNormal self); + +// +++ Print to standard output, as XML +extern_c int +LogNormalPrintXML(ConstHandle2ConstLogNormal self); + +// +++ Print to standard output, as JSON +extern_c int +LogNormalPrintJSON(ConstHandle2ConstLogNormal self); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LogNormalDoubleHas(ConstHandle2ConstLogNormal self); + +// --- Get, const +extern_c Handle2ConstDouble +LogNormalDoubleGetConst(ConstHandle2ConstLogNormal self); + +// +++ Get, non-const +extern_c Handle2Double +LogNormalDoubleGet(ConstHandle2LogNormal self); + +// +++ Set +extern_c void +LogNormalDoubleSet(ConstHandle2LogNormal self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/LogNormal/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/LogNormal/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf.cpp new file mode 100644 index 000000000..4595f5b0a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Pdf.hpp" +#include "Pdf.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = PdfClass; +using CPP = multigroup::Pdf; + +static const std::string CLASSNAME = "Pdf"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPdf +PdfDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Pdf +PdfDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPdf +PdfCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Pdf handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2Pdf +PdfCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Pdf 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 +PdfAssign(ConstHandle2Pdf self, ConstHandle2ConstPdf from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PdfDelete(ConstHandle2ConstPdf self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PdfRead(ConstHandle2Pdf self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PdfWrite(ConstHandle2ConstPdf self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PdfPrint(ConstHandle2ConstPdf self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PdfPrintXML(ConstHandle2ConstPdf self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PdfPrintJSON(ConstHandle2ConstPdf self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +PdfXYs1dHas(ConstHandle2ConstPdf self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +PdfXYs1dGetConst(ConstHandle2ConstPdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +PdfXYs1dGet(ConstHandle2Pdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +PdfXYs1dSet(ConstHandle2Pdf self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +PdfRegions1dHas(ConstHandle2ConstPdf self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +PdfRegions1dGetConst(ConstHandle2ConstPdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +PdfRegions1dGet(ConstHandle2Pdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +PdfRegions1dSet(ConstHandle2Pdf self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Pdf/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf.h new file mode 100644 index 000000000..5a717e693 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf.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. +// +// Pdf is the basic handle type in this file. Example: +// // Create a default Pdf object: +// Pdf handle = PdfDefault(); +// Functions involving Pdf are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_PDF +#define C_INTERFACE_TEST_V2_0_CONTAINERS_PDF + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PdfClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Pdf +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PdfClass *Pdf; + +// --- Const-aware handles. +typedef const struct PdfClass *const ConstHandle2ConstPdf; +typedef struct PdfClass *const ConstHandle2Pdf; +typedef const struct PdfClass * Handle2ConstPdf; +typedef struct PdfClass * Handle2Pdf; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPdf +PdfDefaultConst(); + +// +++ Create, default +extern_c Handle2Pdf +PdfDefault(); + +// --- Create, general, const +extern_c Handle2ConstPdf +PdfCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2Pdf +PdfCreate( + 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 +PdfAssign(ConstHandle2Pdf self, ConstHandle2ConstPdf from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PdfDelete(ConstHandle2ConstPdf self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PdfRead(ConstHandle2Pdf self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PdfWrite(ConstHandle2ConstPdf self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PdfPrint(ConstHandle2ConstPdf self); + +// +++ Print to standard output, as XML +extern_c int +PdfPrintXML(ConstHandle2ConstPdf self); + +// +++ Print to standard output, as JSON +extern_c int +PdfPrintJSON(ConstHandle2ConstPdf self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PdfXYs1dHas(ConstHandle2ConstPdf self); + +// --- Get, const +extern_c Handle2ConstXYs1d +PdfXYs1dGetConst(ConstHandle2ConstPdf self); + +// +++ Get, non-const +extern_c Handle2XYs1d +PdfXYs1dGet(ConstHandle2Pdf self); + +// +++ Set +extern_c void +PdfXYs1dSet(ConstHandle2Pdf self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PdfRegions1dHas(ConstHandle2ConstPdf self); + +// --- Get, const +extern_c Handle2ConstRegions1d +PdfRegions1dGetConst(ConstHandle2ConstPdf self); + +// +++ Get, non-const +extern_c Handle2Regions1d +PdfRegions1dGet(ConstHandle2Pdf self); + +// +++ Set +extern_c void +PdfRegions1dSet(ConstHandle2Pdf self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Pdf/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d.cpp new file mode 100644 index 000000000..a3e46cb63 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Pdf_in_xs_pdf_cdf1d.hpp" +#include "Pdf_in_xs_pdf_cdf1d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Pdf_in_xs_pdf_cdf1dClass; +using CPP = multigroup::Pdf_in_xs_pdf_cdf1d; + +static const std::string CLASSNAME = "Pdf_in_xs_pdf_cdf1d"; + +namespace extract { + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPValues = containers::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPdf_in_xs_pdf_cdf1d +Pdf_in_xs_pdf_cdf1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Pdf_in_xs_pdf_cdf1d +Pdf_in_xs_pdf_cdf1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPdf_in_xs_pdf_cdf1d +Pdf_in_xs_pdf_cdf1dCreateConst( + ConstHandle2ConstValues values +) { + ConstHandle2Pdf_in_xs_pdf_cdf1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(values) + ); + return handle; +} + +// Create, general +Handle2Pdf_in_xs_pdf_cdf1d +Pdf_in_xs_pdf_cdf1dCreate( + ConstHandle2ConstValues values +) { + ConstHandle2Pdf_in_xs_pdf_cdf1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + 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 +Pdf_in_xs_pdf_cdf1dAssign(ConstHandle2Pdf_in_xs_pdf_cdf1d self, ConstHandle2ConstPdf_in_xs_pdf_cdf1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Pdf_in_xs_pdf_cdf1dDelete(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Pdf_in_xs_pdf_cdf1dRead(ConstHandle2Pdf_in_xs_pdf_cdf1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Pdf_in_xs_pdf_cdf1dWrite(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Pdf_in_xs_pdf_cdf1dPrint(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Pdf_in_xs_pdf_cdf1dPrintXML(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Pdf_in_xs_pdf_cdf1dPrintJSON(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +Pdf_in_xs_pdf_cdf1dValuesHas(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +Pdf_in_xs_pdf_cdf1dValuesGetConst(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +Pdf_in_xs_pdf_cdf1dValuesGet(ConstHandle2Pdf_in_xs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +Pdf_in_xs_pdf_cdf1dValuesSet(ConstHandle2Pdf_in_xs_pdf_cdf1d self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d.h new file mode 100644 index 000000000..524374862 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d.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. +// +// Pdf_in_xs_pdf_cdf1d is the basic handle type in this file. Example: +// // Create a default Pdf_in_xs_pdf_cdf1d object: +// Pdf_in_xs_pdf_cdf1d handle = Pdf_in_xs_pdf_cdf1dDefault(); +// Functions involving Pdf_in_xs_pdf_cdf1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_PDF_IN_XS_PDF_CDF1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_PDF_IN_XS_PDF_CDF1D + +#include "GNDStk.h" +#include "v2.0/containers/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Pdf_in_xs_pdf_cdf1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Pdf_in_xs_pdf_cdf1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Pdf_in_xs_pdf_cdf1dClass *Pdf_in_xs_pdf_cdf1d; + +// --- Const-aware handles. +typedef const struct Pdf_in_xs_pdf_cdf1dClass *const ConstHandle2ConstPdf_in_xs_pdf_cdf1d; +typedef struct Pdf_in_xs_pdf_cdf1dClass *const ConstHandle2Pdf_in_xs_pdf_cdf1d; +typedef const struct Pdf_in_xs_pdf_cdf1dClass * Handle2ConstPdf_in_xs_pdf_cdf1d; +typedef struct Pdf_in_xs_pdf_cdf1dClass * Handle2Pdf_in_xs_pdf_cdf1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPdf_in_xs_pdf_cdf1d +Pdf_in_xs_pdf_cdf1dDefaultConst(); + +// +++ Create, default +extern_c Handle2Pdf_in_xs_pdf_cdf1d +Pdf_in_xs_pdf_cdf1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstPdf_in_xs_pdf_cdf1d +Pdf_in_xs_pdf_cdf1dCreateConst( + ConstHandle2ConstValues values +); + +// +++ Create, general +extern_c Handle2Pdf_in_xs_pdf_cdf1d +Pdf_in_xs_pdf_cdf1dCreate( + 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 +Pdf_in_xs_pdf_cdf1dAssign(ConstHandle2Pdf_in_xs_pdf_cdf1d self, ConstHandle2ConstPdf_in_xs_pdf_cdf1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Pdf_in_xs_pdf_cdf1dDelete(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Pdf_in_xs_pdf_cdf1dRead(ConstHandle2Pdf_in_xs_pdf_cdf1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Pdf_in_xs_pdf_cdf1dWrite(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Pdf_in_xs_pdf_cdf1dPrint(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self); + +// +++ Print to standard output, as XML +extern_c int +Pdf_in_xs_pdf_cdf1dPrintXML(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self); + +// +++ Print to standard output, as JSON +extern_c int +Pdf_in_xs_pdf_cdf1dPrintJSON(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Pdf_in_xs_pdf_cdf1dValuesHas(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self); + +// --- Get, const +extern_c Handle2ConstValues +Pdf_in_xs_pdf_cdf1dValuesGetConst(ConstHandle2ConstPdf_in_xs_pdf_cdf1d self); + +// +++ Get, non-const +extern_c Handle2Values +Pdf_in_xs_pdf_cdf1dValuesGet(ConstHandle2Pdf_in_xs_pdf_cdf1d self); + +// +++ Set +extern_c void +Pdf_in_xs_pdf_cdf1dValuesSet(ConstHandle2Pdf_in_xs_pdf_cdf1d self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d.cpp new file mode 100644 index 000000000..622fe620d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d.cpp @@ -0,0 +1,442 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Polynomial1d.hpp" +#include "Polynomial1d.h" + +using namespace njoy::GNDStk; +using namespace test::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 outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + static auto lowerIndex = [](auto &obj) { return &obj.lowerIndex; }; + 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 uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPAxes = containers::Axes; +using CPPUncertainty = extra::Uncertainty; +using CPPValues = containers::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPolynomial1d +Polynomial1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Polynomial1d +Polynomial1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPolynomial1d +Polynomial1dCreateConst( + const XMLName label, + const Float64 outerDomainValue, + const Integer32 lowerIndex, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstValues values +) { + ConstHandle2Polynomial1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + outerDomainValue, + lowerIndex, + domainMin, + domainMax, + detail::tocpp(axes), + detail::tocpp(uncertainty), + detail::tocpp(values) + ); + return handle; +} + +// Create, general +Handle2Polynomial1d +Polynomial1dCreate( + const XMLName label, + const Float64 outerDomainValue, + const Integer32 lowerIndex, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstValues values +) { + ConstHandle2Polynomial1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + outerDomainValue, + lowerIndex, + domainMin, + domainMax, + detail::tocpp(axes), + detail::tocpp(uncertainty), + 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: label +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dLabelHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +Polynomial1dLabelGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Polynomial1dLabelSet(ConstHandle2Polynomial1d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dOuterDomainValueHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +Float64 +Polynomial1dOuterDomainValueGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +Polynomial1dOuterDomainValueSet(ConstHandle2Polynomial1d self, const Float64 outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: lowerIndex +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dLowerIndexHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LowerIndexHas", self, extract::lowerIndex); +} + +// Get +// Returns by value +Integer32 +Polynomial1dLowerIndexGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LowerIndexGet", self, extract::lowerIndex); +} + +// Set +void +Polynomial1dLowerIndexSet(ConstHandle2Polynomial1d self, const Integer32 lowerIndex) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LowerIndexSet", self, extract::lowerIndex, lowerIndex); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dDomainMinHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +Float64 +Polynomial1dDomainMinGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +Polynomial1dDomainMinSet(ConstHandle2Polynomial1d self, const Float64 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 +Float64 +Polynomial1dDomainMaxGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +Polynomial1dDomainMaxSet(ConstHandle2Polynomial1d self, const Float64 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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/containers/Polynomial1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d.h new file mode 100644 index 000000000..380923345 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d.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. +// +// 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_TEST_V2_0_CONTAINERS_POLYNOMIAL1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_POLYNOMIAL1D + +#include "GNDStk.h" +#include "v2.0/containers/Axes.h" +#include "v2.0/extra/Uncertainty.h" +#include "v2.0/containers/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 +extern_c Handle2Polynomial1d +Polynomial1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstPolynomial1d +Polynomial1dCreateConst( + const XMLName label, + const Float64 outerDomainValue, + const Integer32 lowerIndex, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstValues values +); + +// +++ Create, general +extern_c Handle2Polynomial1d +Polynomial1dCreate( + const XMLName label, + const Float64 outerDomainValue, + const Integer32 lowerIndex, + const Float64 domainMin, + const Float64 domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dLabelHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +Polynomial1dLabelGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dLabelSet(ConstHandle2Polynomial1d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dOuterDomainValueHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Polynomial1dOuterDomainValueGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dOuterDomainValueSet(ConstHandle2Polynomial1d self, const Float64 outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Metadatum: lowerIndex +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dLowerIndexHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +Polynomial1dLowerIndexGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dLowerIndexSet(ConstHandle2Polynomial1d self, const Integer32 lowerIndex); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dDomainMinHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Polynomial1dDomainMinGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dDomainMinSet(ConstHandle2Polynomial1d self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dDomainMaxHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Polynomial1dDomainMaxGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dDomainMaxSet(ConstHandle2Polynomial1d self, const Float64 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: 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); + + +// ----------------------------------------------------------------------------- +// 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/containers/Polynomial1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Polynomial1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions1d.cpp new file mode 100644 index 000000000..da85e6df7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions1d.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Regions1d.hpp" +#include "Regions1d.h" + +using namespace njoy::GNDStk; +using namespace test::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 function1ds = [](auto &obj) { return &obj.function1ds; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPAxes = containers::Axes; +using CPPFunction1ds = containers::Function1ds; +using CPPUncertainty = extra::Uncertainty; + + +// ----------------------------------------------------------------------------- +// 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 XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction1ds function1ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Regions1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(function1ds), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Regions1d +Regions1dCreate( + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction1ds function1ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Regions1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + 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 +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 +XMLName +Regions1dLabelGet(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Regions1dLabelSet(ConstHandle2Regions1d self, const XMLName 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 +Float64 +Regions1dOuterDomainValueGet(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +Regions1dOuterDomainValueSet(ConstHandle2Regions1d self, const Float64 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Regions1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions1d.h new file mode 100644 index 000000000..ddb88e78d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/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_TEST_V2_0_CONTAINERS_REGIONS1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_REGIONS1D + +#include "GNDStk.h" +#include "v2.0/containers/Axes.h" +#include "v2.0/containers/Function1ds.h" +#include "v2.0/extra/Uncertainty.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 XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction1ds function1ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2Regions1d +Regions1dCreate( + const XMLName label, + const Float64 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 +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 XMLName +Regions1dLabelGet(ConstHandle2ConstRegions1d self); + +// +++ Set +extern_c void +Regions1dLabelSet(ConstHandle2Regions1d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dOuterDomainValueHas(ConstHandle2ConstRegions1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Regions1dOuterDomainValueGet(ConstHandle2ConstRegions1d self); + +// +++ Set +extern_c void +Regions1dOuterDomainValueSet(ConstHandle2Regions1d self, const Float64 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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Regions1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d.cpp new file mode 100644 index 000000000..e0e671956 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Regions2d.hpp" +#include "Regions2d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Regions2dClass; +using CPP = multigroup::Regions2d; + +static const std::string CLASSNAME = "Regions2d"; + +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 function2ds = [](auto &obj) { return &obj.function2ds; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPAxes = containers::Axes; +using CPPFunction2ds = containers::Function2ds; +using CPPUncertainty = containers::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRegions2d +Regions2dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Regions2d +Regions2dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRegions2d +Regions2dCreateConst( + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Regions2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(function2ds), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Regions2d +Regions2dCreate( + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Regions2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + outerDomainValue, + 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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Regions2dLabelHas(ConstHandle2ConstRegions2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +Regions2dLabelGet(ConstHandle2ConstRegions2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Regions2dLabelSet(ConstHandle2Regions2d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +Regions2dOuterDomainValueHas(ConstHandle2ConstRegions2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +Float64 +Regions2dOuterDomainValueGet(ConstHandle2ConstRegions2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +Regions2dOuterDomainValueSet(ConstHandle2Regions2d self, const Float64 outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// 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/containers/Regions2d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d.h new file mode 100644 index 000000000..4a00bf0e1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d.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. +// +// 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_TEST_V2_0_CONTAINERS_REGIONS2D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_REGIONS2D + +#include "GNDStk.h" +#include "v2.0/containers/Axes.h" +#include "v2.0/containers/Function2ds.h" +#include "v2.0/containers/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 +extern_c Handle2Regions2d +Regions2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstRegions2d +Regions2dCreateConst( + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2Regions2d +Regions2dCreate( + const XMLName label, + const Float64 outerDomainValue, + 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions2dLabelHas(ConstHandle2ConstRegions2d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +Regions2dLabelGet(ConstHandle2ConstRegions2d self); + +// +++ Set +extern_c void +Regions2dLabelSet(ConstHandle2Regions2d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions2dOuterDomainValueHas(ConstHandle2ConstRegions2d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Regions2dOuterDomainValueGet(ConstHandle2ConstRegions2d self); + +// +++ Set +extern_c void +Regions2dOuterDomainValueSet(ConstHandle2Regions2d self, const Float64 outerDomainValue); + + +// ----------------------------------------------------------------------------- +// 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/containers/Regions2d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d.cpp new file mode 100644 index 000000000..df15d08db --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Regions3d.hpp" +#include "Regions3d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Regions3dClass; +using CPP = multigroup::Regions3d; + +static const std::string CLASSNAME = "Regions3d"; + +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 function3ds = [](auto &obj) { return &obj.function3ds; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPAxes = containers::Axes; +using CPPFunction3ds = containers::Function3ds; +using CPPUncertainty = containers::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRegions3d +Regions3dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Regions3d +Regions3dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRegions3d +Regions3dCreateConst( + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction3ds function3ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Regions3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(function3ds), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Regions3d +Regions3dCreate( + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction3ds function3ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Regions3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(function3ds), + 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 +Regions3dAssign(ConstHandle2Regions3d self, ConstHandle2ConstRegions3d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Regions3dDelete(ConstHandle2ConstRegions3d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Regions3dRead(ConstHandle2Regions3d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Regions3dWrite(ConstHandle2ConstRegions3d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Regions3dPrint(ConstHandle2ConstRegions3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Regions3dPrintXML(ConstHandle2ConstRegions3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Regions3dPrintJSON(ConstHandle2ConstRegions3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Regions3dLabelHas(ConstHandle2ConstRegions3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +Regions3dLabelGet(ConstHandle2ConstRegions3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Regions3dLabelSet(ConstHandle2Regions3d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +Regions3dOuterDomainValueHas(ConstHandle2ConstRegions3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +Float64 +Regions3dOuterDomainValueGet(ConstHandle2ConstRegions3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +Regions3dOuterDomainValueSet(ConstHandle2Regions3d self, const Float64 outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Regions3dAxesHas(ConstHandle2ConstRegions3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Regions3dAxesGetConst(ConstHandle2ConstRegions3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Regions3dAxesGet(ConstHandle2Regions3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Regions3dAxesSet(ConstHandle2Regions3d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: function3ds +// ----------------------------------------------------------------------------- + +// Has +int +Regions3dFunction3dsHas(ConstHandle2ConstRegions3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Function3dsHas", self, extract::function3ds); +} + +// Get, const +Handle2ConstFunction3ds +Regions3dFunction3dsGetConst(ConstHandle2ConstRegions3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function3dsGetConst", self, extract::function3ds); +} + +// Get, non-const +Handle2Function3ds +Regions3dFunction3dsGet(ConstHandle2Regions3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function3dsGet", self, extract::function3ds); +} + +// Set +void +Regions3dFunction3dsSet(ConstHandle2Regions3d self, ConstHandle2ConstFunction3ds function3ds) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Function3dsSet", self, extract::function3ds, function3ds); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +Regions3dUncertaintyHas(ConstHandle2ConstRegions3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +Regions3dUncertaintyGetConst(ConstHandle2ConstRegions3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +Regions3dUncertaintyGet(ConstHandle2Regions3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +Regions3dUncertaintySet(ConstHandle2Regions3d self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Regions3d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d.h new file mode 100644 index 000000000..a7793b3a4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d.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. +// +// Regions3d is the basic handle type in this file. Example: +// // Create a default Regions3d object: +// Regions3d handle = Regions3dDefault(); +// Functions involving Regions3d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_REGIONS3D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_REGIONS3D + +#include "GNDStk.h" +#include "v2.0/containers/Axes.h" +#include "v2.0/containers/Function3ds.h" +#include "v2.0/containers/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Regions3dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Regions3d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Regions3dClass *Regions3d; + +// --- Const-aware handles. +typedef const struct Regions3dClass *const ConstHandle2ConstRegions3d; +typedef struct Regions3dClass *const ConstHandle2Regions3d; +typedef const struct Regions3dClass * Handle2ConstRegions3d; +typedef struct Regions3dClass * Handle2Regions3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRegions3d +Regions3dDefaultConst(); + +// +++ Create, default +extern_c Handle2Regions3d +Regions3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstRegions3d +Regions3dCreateConst( + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction3ds function3ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2Regions3d +Regions3dCreate( + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction3ds function3ds, + 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 +Regions3dAssign(ConstHandle2Regions3d self, ConstHandle2ConstRegions3d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Regions3dDelete(ConstHandle2ConstRegions3d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Regions3dRead(ConstHandle2Regions3d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Regions3dWrite(ConstHandle2ConstRegions3d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Regions3dPrint(ConstHandle2ConstRegions3d self); + +// +++ Print to standard output, as XML +extern_c int +Regions3dPrintXML(ConstHandle2ConstRegions3d self); + +// +++ Print to standard output, as JSON +extern_c int +Regions3dPrintJSON(ConstHandle2ConstRegions3d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions3dLabelHas(ConstHandle2ConstRegions3d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +Regions3dLabelGet(ConstHandle2ConstRegions3d self); + +// +++ Set +extern_c void +Regions3dLabelSet(ConstHandle2Regions3d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions3dOuterDomainValueHas(ConstHandle2ConstRegions3d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Regions3dOuterDomainValueGet(ConstHandle2ConstRegions3d self); + +// +++ Set +extern_c void +Regions3dOuterDomainValueSet(ConstHandle2Regions3d self, const Float64 outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions3dAxesHas(ConstHandle2ConstRegions3d self); + +// --- Get, const +extern_c Handle2ConstAxes +Regions3dAxesGetConst(ConstHandle2ConstRegions3d self); + +// +++ Get, non-const +extern_c Handle2Axes +Regions3dAxesGet(ConstHandle2Regions3d self); + +// +++ Set +extern_c void +Regions3dAxesSet(ConstHandle2Regions3d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: function3ds +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions3dFunction3dsHas(ConstHandle2ConstRegions3d self); + +// --- Get, const +extern_c Handle2ConstFunction3ds +Regions3dFunction3dsGetConst(ConstHandle2ConstRegions3d self); + +// +++ Get, non-const +extern_c Handle2Function3ds +Regions3dFunction3dsGet(ConstHandle2Regions3d self); + +// +++ Set +extern_c void +Regions3dFunction3dsSet(ConstHandle2Regions3d self, ConstHandle2ConstFunction3ds function3ds); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions3dUncertaintyHas(ConstHandle2ConstRegions3d self); + +// --- Get, const +extern_c Handle2ConstUncertainty +Regions3dUncertaintyGetConst(ConstHandle2ConstRegions3d self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +Regions3dUncertaintyGet(ConstHandle2Regions3d self); + +// +++ Set +extern_c void +Regions3dUncertaintySet(ConstHandle2Regions3d self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Regions3d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Regions3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Standard.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Standard.cpp new file mode 100644 index 000000000..d0c29c102 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Standard.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Standard.hpp" +#include "Standard.h" + +using namespace njoy::GNDStk; +using namespace test::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 = extra::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstStandard +StandardDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/containers/Standard/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Standard.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Standard.h new file mode 100644 index 000000000..3bd3ebdfc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/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_TEST_V2_0_CONTAINERS_STANDARD +#define C_INTERFACE_TEST_V2_0_CONTAINERS_STANDARD + +#include "GNDStk.h" +#include "v2.0/extra/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 +extern_c Handle2Standard +StandardDefault(); + +// --- Create, general, const +extern_c Handle2ConstStandard +StandardCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/containers/Standard/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Standard/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Standard/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Standard/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Standard/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/String.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/String.cpp new file mode 100644 index 000000000..d5aab2a76 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/String.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/String.hpp" +#include "String.h" + +using namespace njoy::GNDStk; +using namespace test::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 unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstString +StringDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2String +StringDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstString +StringCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value +) { + ConstHandle2String handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value + ); + return handle; +} + +// Create, general +Handle2String +StringCreate( + const XMLName label, + const XMLName unit, + const XMLName value +) { + ConstHandle2String handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + 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 +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 +XMLName +StringLabelGet(ConstHandle2ConstString self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +StringLabelSet(ConstHandle2String self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +StringUnitHas(ConstHandle2ConstString self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +StringUnitGet(ConstHandle2ConstString self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +StringUnitSet(ConstHandle2String self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +StringValueHas(ConstHandle2ConstString self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +StringValueGet(ConstHandle2ConstString self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +StringValueSet(ConstHandle2String self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/String/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/String.h b/standards/gnds-2.0/test/c/src/v2.0/containers/String.h new file mode 100644 index 000000000..470a907f1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/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_TEST_V2_0_CONTAINERS_STRING +#define C_INTERFACE_TEST_V2_0_CONTAINERS_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 +extern_c Handle2String +StringDefault(); + +// --- Create, general, const +extern_c Handle2ConstString +StringCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value +); + +// +++ Create, general +extern_c Handle2String +StringCreate( + const XMLName label, + const XMLName unit, + const XMLName 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 +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 XMLName +StringLabelGet(ConstHandle2ConstString self); + +// +++ Set +extern_c void +StringLabelSet(ConstHandle2String self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StringUnitHas(ConstHandle2ConstString self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +StringUnitGet(ConstHandle2ConstString self); + +// +++ Set +extern_c void +StringUnitSet(ConstHandle2String self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StringValueHas(ConstHandle2ConstString self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +StringValueGet(ConstHandle2ConstString self); + +// +++ Set +extern_c void +StringValueSet(ConstHandle2String self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/String/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/String/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/String/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/String/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/String/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Table.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Table.cpp new file mode 100644 index 000000000..c8a614171 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Table.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Table.hpp" +#include "Table.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = TableClass; +using CPP = multigroup::Table; + +static const std::string CLASSNAME = "Table"; + +namespace extract { + static auto columns = [](auto &obj) { return &obj.columns; }; + static auto rows = [](auto &obj) { return &obj.rows; }; + static auto storageOrder = [](auto &obj) { return &obj.storageOrder; }; + static auto columnHeaders = [](auto &obj) { return &obj.columnHeaders; }; + static auto data = [](auto &obj) { return &obj.data; }; +} + +using CPPColumnHeaders = containers::ColumnHeaders; +using CPPData = containers::Data; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTable +TableDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Table +TableDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTable +TableCreateConst( + const Integer32 columns, + const Integer32 rows, + const XMLName storageOrder, + ConstHandle2ConstColumnHeaders columnHeaders, + ConstHandle2ConstData data +) { + ConstHandle2Table handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + columns, + rows, + storageOrder, + detail::tocpp(columnHeaders), + detail::tocpp(data) + ); + return handle; +} + +// Create, general +Handle2Table +TableCreate( + const Integer32 columns, + const Integer32 rows, + const XMLName storageOrder, + ConstHandle2ConstColumnHeaders columnHeaders, + ConstHandle2ConstData data +) { + ConstHandle2Table handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + columns, + rows, + storageOrder, + 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: columns +// ----------------------------------------------------------------------------- + +// Has +int +TableColumnsHas(ConstHandle2ConstTable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ColumnsHas", self, extract::columns); +} + +// Get +// Returns by value +Integer32 +TableColumnsGet(ConstHandle2ConstTable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnsGet", self, extract::columns); +} + +// Set +void +TableColumnsSet(ConstHandle2Table self, const Integer32 columns) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ColumnsSet", self, extract::columns, columns); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: rows +// ----------------------------------------------------------------------------- + +// Has +int +TableRowsHas(ConstHandle2ConstTable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RowsHas", self, extract::rows); +} + +// Get +// Returns by value +Integer32 +TableRowsGet(ConstHandle2ConstTable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowsGet", self, extract::rows); +} + +// Set +void +TableRowsSet(ConstHandle2Table self, const Integer32 rows) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RowsSet", self, extract::rows, rows); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: storageOrder +// ----------------------------------------------------------------------------- + +// Has +int +TableStorageOrderHas(ConstHandle2ConstTable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StorageOrderHas", self, extract::storageOrder); +} + +// Get +// Returns by value +XMLName +TableStorageOrderGet(ConstHandle2ConstTable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StorageOrderGet", self, extract::storageOrder); +} + +// Set +void +TableStorageOrderSet(ConstHandle2Table self, const XMLName storageOrder) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StorageOrderSet", self, extract::storageOrder, storageOrder); +} + + +// ----------------------------------------------------------------------------- +// 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/containers/Table/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Table.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Table.h new file mode 100644 index 000000000..4a7056514 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Table.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. +// +// 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_TEST_V2_0_CONTAINERS_TABLE +#define C_INTERFACE_TEST_V2_0_CONTAINERS_TABLE + +#include "GNDStk.h" +#include "v2.0/containers/ColumnHeaders.h" +#include "v2.0/containers/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 +extern_c Handle2Table +TableDefault(); + +// --- Create, general, const +extern_c Handle2ConstTable +TableCreateConst( + const Integer32 columns, + const Integer32 rows, + const XMLName storageOrder, + ConstHandle2ConstColumnHeaders columnHeaders, + ConstHandle2ConstData data +); + +// +++ Create, general +extern_c Handle2Table +TableCreate( + const Integer32 columns, + const Integer32 rows, + const XMLName storageOrder, + 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: columns +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TableColumnsHas(ConstHandle2ConstTable self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +TableColumnsGet(ConstHandle2ConstTable self); + +// +++ Set +extern_c void +TableColumnsSet(ConstHandle2Table self, const Integer32 columns); + + +// ----------------------------------------------------------------------------- +// Metadatum: rows +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TableRowsHas(ConstHandle2ConstTable self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +TableRowsGet(ConstHandle2ConstTable self); + +// +++ Set +extern_c void +TableRowsSet(ConstHandle2Table self, const Integer32 rows); + + +// ----------------------------------------------------------------------------- +// Metadatum: storageOrder +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TableStorageOrderHas(ConstHandle2ConstTable self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TableStorageOrderGet(ConstHandle2ConstTable self); + +// +++ Set +extern_c void +TableStorageOrderSet(ConstHandle2Table self, const XMLName storageOrder); + + +// ----------------------------------------------------------------------------- +// 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/containers/Table/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Table/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Table/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Table/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Table/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty.cpp new file mode 100644 index 000000000..e2a94a7a7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty.cpp @@ -0,0 +1,482 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Uncertainty.hpp" +#include "Uncertainty.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = UncertaintyClass; +using CPP = multigroup::Uncertainty; + +static const std::string CLASSNAME = "Uncertainty"; + +namespace extract { + static auto standard = [](auto &obj) { return &obj.standard; }; + static auto logNormal = [](auto &obj) { return &obj.logNormal; }; + static auto confidenceIntervals = [](auto &obj) { return &obj.confidenceIntervals; }; + static auto pdf = [](auto &obj) { return &obj.pdf; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; + static auto covariance = [](auto &obj) { return &obj.covariance; }; + static auto listOfCovariances = [](auto &obj) { return &obj.listOfCovariances; }; +} + +using CPPStandard = containers::Standard; +using CPPLogNormal = containers::LogNormal; +using CPPConfidenceIntervals = containers::ConfidenceIntervals; +using CPPPdf = containers::Pdf; +using CPPXYs1d = containers::XYs1d; +using CPPPolynomial1d = containers::Polynomial1d; +using CPPCovariance = containers::Covariance; +using CPPListOfCovariances = containers::ListOfCovariances; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUncertainty +UncertaintyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Uncertainty +UncertaintyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUncertainty +UncertaintyCreateConst( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstPdf pdf, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstListOfCovariances listOfCovariances +) { + ConstHandle2Uncertainty handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(standard), + detail::tocpp(logNormal), + detail::tocpp(confidenceIntervals), + detail::tocpp(pdf), + detail::tocpp(XYs1d), + detail::tocpp(polynomial1d), + detail::tocpp(covariance), + detail::tocpp(listOfCovariances) + ); + return handle; +} + +// Create, general +Handle2Uncertainty +UncertaintyCreate( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstPdf pdf, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstListOfCovariances listOfCovariances +) { + ConstHandle2Uncertainty handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(standard), + detail::tocpp(logNormal), + detail::tocpp(confidenceIntervals), + detail::tocpp(pdf), + detail::tocpp(XYs1d), + detail::tocpp(polynomial1d), + detail::tocpp(covariance), + detail::tocpp(listOfCovariances) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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: logNormal +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyLogNormalHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LogNormalHas", self, extract::logNormal); +} + +// Get, const +Handle2ConstLogNormal +UncertaintyLogNormalGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LogNormalGetConst", self, extract::logNormal); +} + +// Get, non-const +Handle2LogNormal +UncertaintyLogNormalGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LogNormalGet", self, extract::logNormal); +} + +// Set +void +UncertaintyLogNormalSet(ConstHandle2Uncertainty self, ConstHandle2ConstLogNormal logNormal) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LogNormalSet", self, extract::logNormal, logNormal); +} + + +// ----------------------------------------------------------------------------- +// Child: confidenceIntervals +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyConfidenceIntervalsHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsHas", self, extract::confidenceIntervals); +} + +// Get, const +Handle2ConstConfidenceIntervals +UncertaintyConfidenceIntervalsGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsGetConst", self, extract::confidenceIntervals); +} + +// Get, non-const +Handle2ConfidenceIntervals +UncertaintyConfidenceIntervalsGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsGet", self, extract::confidenceIntervals); +} + +// Set +void +UncertaintyConfidenceIntervalsSet(ConstHandle2Uncertainty self, ConstHandle2ConstConfidenceIntervals confidenceIntervals) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsSet", self, extract::confidenceIntervals, confidenceIntervals); +} + + +// ----------------------------------------------------------------------------- +// Child: pdf +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyPdfHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PdfHas", self, extract::pdf); +} + +// Get, const +Handle2ConstPdf +UncertaintyPdfGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PdfGetConst", self, extract::pdf); +} + +// Get, non-const +Handle2Pdf +UncertaintyPdfGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PdfGet", self, extract::pdf); +} + +// Set +void +UncertaintyPdfSet(ConstHandle2Uncertainty self, ConstHandle2ConstPdf pdf) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PdfSet", self, extract::pdf, pdf); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyXYs1dHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +UncertaintyXYs1dGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +UncertaintyXYs1dGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +UncertaintyXYs1dSet(ConstHandle2Uncertainty self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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: 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Uncertainty/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty.h new file mode 100644 index 000000000..6ca5b1c83 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty.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. +// +// 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_TEST_V2_0_CONTAINERS_UNCERTAINTY +#define C_INTERFACE_TEST_V2_0_CONTAINERS_UNCERTAINTY + +#include "GNDStk.h" +#include "v2.0/containers/Standard.h" +#include "v2.0/containers/LogNormal.h" +#include "v2.0/containers/ConfidenceIntervals.h" +#include "v2.0/containers/Pdf.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Polynomial1d.h" +#include "v2.0/containers/Covariance.h" +#include "v2.0/containers/ListOfCovariances.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 +extern_c Handle2Uncertainty +UncertaintyDefault(); + +// --- Create, general, const +extern_c Handle2ConstUncertainty +UncertaintyCreateConst( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstPdf pdf, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstListOfCovariances listOfCovariances +); + +// +++ Create, general +extern_c Handle2Uncertainty +UncertaintyCreate( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstPdf pdf, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstListOfCovariances listOfCovariances +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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: logNormal +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyLogNormalHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstLogNormal +UncertaintyLogNormalGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2LogNormal +UncertaintyLogNormalGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyLogNormalSet(ConstHandle2Uncertainty self, ConstHandle2ConstLogNormal logNormal); + + +// ----------------------------------------------------------------------------- +// Child: confidenceIntervals +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyConfidenceIntervalsHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstConfidenceIntervals +UncertaintyConfidenceIntervalsGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2ConfidenceIntervals +UncertaintyConfidenceIntervalsGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyConfidenceIntervalsSet(ConstHandle2Uncertainty self, ConstHandle2ConstConfidenceIntervals confidenceIntervals); + + +// ----------------------------------------------------------------------------- +// Child: pdf +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyPdfHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstPdf +UncertaintyPdfGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2Pdf +UncertaintyPdfGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyPdfSet(ConstHandle2Uncertainty self, ConstHandle2ConstPdf pdf); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyXYs1dHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstXYs1d +UncertaintyXYs1dGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2XYs1d +UncertaintyXYs1dGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyXYs1dSet(ConstHandle2Uncertainty self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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: 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Uncertainty/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Uncertainty/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Values.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Values.cpp new file mode 100644 index 000000000..93fe6377c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Values.cpp @@ -0,0 +1,600 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Values.hpp" +#include "Values.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +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; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto startIndex = [](auto &obj) { return &obj.startIndex; }; + static auto count = [](auto &obj) { return &obj.count; }; +} + + +// ----------------------------------------------------------------------------- +// 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 UTF8Text valueType, + const Integer32 start, + const Integer32 length, + const UTF8Text href, + const Integer32 startIndex, + const Integer32 count +) { + ConstHandle2Values handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + valueType, + start, + length, + href, + startIndex, + count + ); + return handle; +} + +// Create, general +Handle2Values +ValuesCreate( + const UTF8Text valueType, + const Integer32 start, + const Integer32 length, + const UTF8Text href, + const Integer32 startIndex, + const Integer32 count +) { + ConstHandle2Values handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + valueType, + start, + length, + href, + startIndex, + count + ); + return handle; +} + +// Assign +// Use this to assign 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 +UTF8Text +ValuesValueTypeGet(ConstHandle2ConstValues self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueTypeGet", self, extract::valueType); +} + +// Set +void +ValuesValueTypeSet(ConstHandle2Values self, const UTF8Text 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 +Integer32 +ValuesStartGet(ConstHandle2ConstValues self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StartGet", self, extract::start); +} + +// Set +void +ValuesStartSet(ConstHandle2Values self, const Integer32 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 +Integer32 +ValuesLengthGet(ConstHandle2ConstValues self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LengthGet", self, extract::length); +} + +// Set +void +ValuesLengthSet(ConstHandle2Values self, const Integer32 length) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LengthSet", self, extract::length, length); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ValuesHrefHas(ConstHandle2ConstValues self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +UTF8Text +ValuesHrefGet(ConstHandle2ConstValues self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ValuesHrefSet(ConstHandle2Values self, const UTF8Text href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: startIndex +// ----------------------------------------------------------------------------- + +// Has +int +ValuesStartIndexHas(ConstHandle2ConstValues self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StartIndexHas", self, extract::startIndex); +} + +// Get +// Returns by value +Integer32 +ValuesStartIndexGet(ConstHandle2ConstValues self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StartIndexGet", self, extract::startIndex); +} + +// Set +void +ValuesStartIndexSet(ConstHandle2Values self, const Integer32 startIndex) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StartIndexSet", self, extract::startIndex, startIndex); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: count +// ----------------------------------------------------------------------------- + +// Has +int +ValuesCountHas(ConstHandle2ConstValues self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CountHas", self, extract::count); +} + +// Get +// Returns by value +Integer32 +ValuesCountGet(ConstHandle2ConstValues self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CountGet", self, extract::count); +} + +// Set +void +ValuesCountSet(ConstHandle2Values self, const Integer32 count) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CountSet", self, extract::count, count); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Values/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Values.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Values.h new file mode 100644 index 000000000..bee7f5f86 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Values.h @@ -0,0 +1,398 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_CONTAINERS_VALUES +#define C_INTERFACE_TEST_V2_0_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 UTF8Text valueType, + const Integer32 start, + const Integer32 length, + const UTF8Text href, + const Integer32 startIndex, + const Integer32 count +); + +// +++ Create, general +extern_c Handle2Values +ValuesCreate( + const UTF8Text valueType, + const Integer32 start, + const Integer32 length, + const UTF8Text href, + const Integer32 startIndex, + const Integer32 count +); + +// +++ Assign +// +++ Use this to assign one handled 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 UTF8Text +ValuesValueTypeGet(ConstHandle2ConstValues self); + +// +++ Set +extern_c void +ValuesValueTypeSet(ConstHandle2Values self, const UTF8Text valueType); + + +// ----------------------------------------------------------------------------- +// Metadatum: start +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ValuesStartHas(ConstHandle2ConstValues self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ValuesStartGet(ConstHandle2ConstValues self); + +// +++ Set +extern_c void +ValuesStartSet(ConstHandle2Values self, const Integer32 start); + + +// ----------------------------------------------------------------------------- +// Metadatum: length +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ValuesLengthHas(ConstHandle2ConstValues self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ValuesLengthGet(ConstHandle2ConstValues self); + +// +++ Set +extern_c void +ValuesLengthSet(ConstHandle2Values self, const Integer32 length); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ValuesHrefHas(ConstHandle2ConstValues self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +ValuesHrefGet(ConstHandle2ConstValues self); + +// +++ Set +extern_c void +ValuesHrefSet(ConstHandle2Values self, const UTF8Text href); + + +// ----------------------------------------------------------------------------- +// Metadatum: startIndex +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ValuesStartIndexHas(ConstHandle2ConstValues self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ValuesStartIndexGet(ConstHandle2ConstValues self); + +// +++ Set +extern_c void +ValuesStartIndexSet(ConstHandle2Values self, const Integer32 startIndex); + + +// ----------------------------------------------------------------------------- +// Metadatum: count +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ValuesCountHas(ConstHandle2ConstValues self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ValuesCountGet(ConstHandle2ConstValues self); + +// +++ Set +extern_c void +ValuesCountSet(ConstHandle2Values self, const Integer32 count); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Values/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Values/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Values/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Values/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Values/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs1d.cpp new file mode 100644 index 000000000..8a04f2ffd --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs1d.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/XYs1d.hpp" +#include "XYs1d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +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 uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPAxes = containers::Axes; +using CPPUncertainty = extra::Uncertainty; +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 Integer32 index, + const enums::Interpolation interpolation, + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstValues values +) { + ConstHandle2XYs1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + interpolation, + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(uncertainty), + detail::tocpp(values) + ); + return handle; +} + +// Create, general +Handle2XYs1d +XYs1dCreate( + const Integer32 index, + const enums::Interpolation interpolation, + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstValues values +) { + ConstHandle2XYs1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + interpolation, + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(uncertainty), + 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 +Integer32 +XYs1dIndexGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +XYs1dIndexSet(ConstHandle2XYs1d self, const Integer32 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 +XMLName +XYs1dLabelGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +XYs1dLabelSet(ConstHandle2XYs1d self, const XMLName 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 +Float64 +XYs1dOuterDomainValueGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +XYs1dOuterDomainValueSet(ConstHandle2XYs1d self, const Float64 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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 "v2.0/containers/XYs1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs1d.h new file mode 100644 index 000000000..2ee04ca4f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/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_TEST_V2_0_CONTAINERS_XYS1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_XYS1D + +#include "GNDStk.h" +#include "v2.0/containers/Axes.h" +#include "v2.0/extra/Uncertainty.h" +#include "v2.0/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 Integer32 index, + const enums::Interpolation interpolation, + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstValues values +); + +// +++ Create, general +extern_c Handle2XYs1d +XYs1dCreate( + const Integer32 index, + const enums::Interpolation interpolation, + const XMLName label, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + 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 Integer32 +XYs1dIndexGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dIndexSet(ConstHandle2XYs1d self, const Integer32 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 XMLName +XYs1dLabelGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dLabelSet(ConstHandle2XYs1d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dOuterDomainValueHas(ConstHandle2ConstXYs1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +XYs1dOuterDomainValueGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dOuterDomainValueSet(ConstHandle2XYs1d self, const Float64 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: 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); + + +// ----------------------------------------------------------------------------- +// 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 "v2.0/containers/XYs1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs2d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs2d.cpp new file mode 100644 index 000000000..b12b8ffbc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs2d.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/XYs2d.hpp" +#include "XYs2d.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Axes; +using CPPFunction1ds = containers::Function1ds; +using CPPUncertainty = containers::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstXYs2d +XYs2dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2XYs2d +XYs2dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstXYs2d +XYs2dCreateConst( + const Integer32 index, + const enums::Interpolation interpolation, + const XMLName interpolationQualifier, + const Float64 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 +Handle2XYs2d +XYs2dCreate( + const Integer32 index, + const enums::Interpolation interpolation, + const XMLName interpolationQualifier, + const Float64 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 +Integer32 +XYs2dIndexGet(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +XYs2dIndexSet(ConstHandle2XYs2d self, const Integer32 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 +enums::Interpolation +XYs2dInterpolationGet(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationGet", self, extract::interpolation); +} + +// Set +void +XYs2dInterpolationSet(ConstHandle2XYs2d self, const enums::Interpolation 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 +XMLName +XYs2dInterpolationQualifierGet(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationQualifierGet", self, extract::interpolationQualifier); +} + +// Set +void +XYs2dInterpolationQualifierSet(ConstHandle2XYs2d self, const XMLName 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 +Float64 +XYs2dOuterDomainValueGet(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +XYs2dOuterDomainValueSet(ConstHandle2XYs2d self, const Float64 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/containers/XYs2d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs2d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs2d.h new file mode 100644 index 000000000..d2f1f09eb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/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_TEST_V2_0_CONTAINERS_XYS2D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_XYS2D + +#include "GNDStk.h" +#include "v2.0/containers/Axes.h" +#include "v2.0/containers/Function1ds.h" +#include "v2.0/containers/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 +extern_c Handle2XYs2d +XYs2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstXYs2d +XYs2dCreateConst( + const Integer32 index, + const enums::Interpolation interpolation, + const XMLName interpolationQualifier, + const Float64 outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction1ds function1ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2XYs2d +XYs2dCreate( + const Integer32 index, + const enums::Interpolation interpolation, + const XMLName interpolationQualifier, + const Float64 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 Integer32 +XYs2dIndexGet(ConstHandle2ConstXYs2d self); + +// +++ Set +extern_c void +XYs2dIndexSet(ConstHandle2XYs2d self, const Integer32 index); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dInterpolationHas(ConstHandle2ConstXYs2d self); + +// +++ Get +// +++ Returns by value +extern_c enums::Interpolation +XYs2dInterpolationGet(ConstHandle2ConstXYs2d self); + +// +++ Set +extern_c void +XYs2dInterpolationSet(ConstHandle2XYs2d self, const enums::Interpolation interpolation); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolationQualifier +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dInterpolationQualifierHas(ConstHandle2ConstXYs2d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +XYs2dInterpolationQualifierGet(ConstHandle2ConstXYs2d self); + +// +++ Set +extern_c void +XYs2dInterpolationQualifierSet(ConstHandle2XYs2d self, const XMLName interpolationQualifier); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dOuterDomainValueHas(ConstHandle2ConstXYs2d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +XYs2dOuterDomainValueGet(ConstHandle2ConstXYs2d self); + +// +++ Set +extern_c void +XYs2dOuterDomainValueSet(ConstHandle2XYs2d self, const Float64 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/containers/XYs2d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs2d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs2d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d.cpp new file mode 100644 index 000000000..08de73002 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/XYs3d.hpp" +#include "XYs3d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = XYs3dClass; +using CPP = multigroup::XYs3d; + +static const std::string CLASSNAME = "XYs3d"; + +namespace extract { + static auto interpolation = [](auto &obj) { return &obj.interpolation; }; + static auto interpolationQualifier = [](auto &obj) { return &obj.interpolationQualifier; }; + 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 = containers::Axes; +using CPPFunction2ds = containers::Function2ds; +using CPPUncertainty = containers::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstXYs3d +XYs3dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2XYs3d +XYs3dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstXYs3d +XYs3dCreateConst( + const enums::Interpolation interpolation, + const XMLName interpolationQualifier, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2XYs3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + interpolation, + interpolationQualifier, + detail::tocpp(axes), + detail::tocpp(function2ds), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2XYs3d +XYs3dCreate( + const enums::Interpolation interpolation, + const XMLName interpolationQualifier, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2XYs3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + interpolation, + interpolationQualifier, + 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 +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: interpolation +// ----------------------------------------------------------------------------- + +// Has +int +XYs3dInterpolationHas(ConstHandle2ConstXYs3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationHas", self, extract::interpolation); +} + +// Get +// Returns by value +enums::Interpolation +XYs3dInterpolationGet(ConstHandle2ConstXYs3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationGet", self, extract::interpolation); +} + +// Set +void +XYs3dInterpolationSet(ConstHandle2XYs3d self, const enums::Interpolation interpolation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InterpolationSet", self, extract::interpolation, interpolation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolationQualifier +// ----------------------------------------------------------------------------- + +// Has +int +XYs3dInterpolationQualifierHas(ConstHandle2ConstXYs3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationQualifierHas", self, extract::interpolationQualifier); +} + +// Get +// Returns by value +XMLName +XYs3dInterpolationQualifierGet(ConstHandle2ConstXYs3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationQualifierGet", self, extract::interpolationQualifier); +} + +// Set +void +XYs3dInterpolationQualifierSet(ConstHandle2XYs3d self, const XMLName 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); +} + +// Get, const +Handle2ConstFunction2ds +XYs3dFunction2dsGetConst(ConstHandle2ConstXYs3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function2dsGetConst", self, extract::function2ds); +} + +// Get, non-const +Handle2Function2ds +XYs3dFunction2dsGet(ConstHandle2XYs3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function2dsGet", self, extract::function2ds); +} + +// Set +void +XYs3dFunction2dsSet(ConstHandle2XYs3d self, ConstHandle2ConstFunction2ds function2ds) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Function2dsSet", self, extract::function2ds, function2ds); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +XYs3dUncertaintyHas(ConstHandle2ConstXYs3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +XYs3dUncertaintyGetConst(ConstHandle2ConstXYs3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +XYs3dUncertaintyGet(ConstHandle2XYs3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +XYs3dUncertaintySet(ConstHandle2XYs3d self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/XYs3d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d.h new file mode 100644 index 000000000..41e3e3fe5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d.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. +// +// 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_TEST_V2_0_CONTAINERS_XYS3D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_XYS3D + +#include "GNDStk.h" +#include "v2.0/containers/Axes.h" +#include "v2.0/containers/Function2ds.h" +#include "v2.0/containers/Uncertainty.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 +extern_c Handle2XYs3d +XYs3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstXYs3d +XYs3dCreateConst( + const enums::Interpolation interpolation, + const XMLName interpolationQualifier, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2XYs3d +XYs3dCreate( + const enums::Interpolation interpolation, + const XMLName interpolationQualifier, + 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 +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: interpolation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs3dInterpolationHas(ConstHandle2ConstXYs3d self); + +// +++ Get +// +++ Returns by value +extern_c enums::Interpolation +XYs3dInterpolationGet(ConstHandle2ConstXYs3d self); + +// +++ Set +extern_c void +XYs3dInterpolationSet(ConstHandle2XYs3d self, const enums::Interpolation interpolation); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolationQualifier +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs3dInterpolationQualifierHas(ConstHandle2ConstXYs3d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +XYs3dInterpolationQualifierGet(ConstHandle2ConstXYs3d self); + +// +++ Set +extern_c void +XYs3dInterpolationQualifierSet(ConstHandle2XYs3d self, const XMLName 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); + +// --- Get, const +extern_c Handle2ConstFunction2ds +XYs3dFunction2dsGetConst(ConstHandle2ConstXYs3d self); + +// +++ Get, non-const +extern_c Handle2Function2ds +XYs3dFunction2dsGet(ConstHandle2XYs3d self); + +// +++ Set +extern_c void +XYs3dFunction2dsSet(ConstHandle2XYs3d self, ConstHandle2ConstFunction2ds function2ds); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs3dUncertaintyHas(ConstHandle2ConstXYs3d self); + +// --- Get, const +extern_c Handle2ConstUncertainty +XYs3dUncertaintyGetConst(ConstHandle2ConstXYs3d self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +XYs3dUncertaintyGet(ConstHandle2XYs3d self); + +// +++ Set +extern_c void +XYs3dUncertaintySet(ConstHandle2XYs3d self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/XYs3d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/XYs3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d.cpp new file mode 100644 index 000000000..e9c171949 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Xs_in_xs_pdf_cdf1d.hpp" +#include "Xs_in_xs_pdf_cdf1d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Xs_in_xs_pdf_cdf1dClass; +using CPP = multigroup::Xs_in_xs_pdf_cdf1d; + +static const std::string CLASSNAME = "Xs_in_xs_pdf_cdf1d"; + +namespace extract { + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPValues = containers::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstXs_in_xs_pdf_cdf1d +Xs_in_xs_pdf_cdf1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Xs_in_xs_pdf_cdf1d +Xs_in_xs_pdf_cdf1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstXs_in_xs_pdf_cdf1d +Xs_in_xs_pdf_cdf1dCreateConst( + ConstHandle2ConstValues values +) { + ConstHandle2Xs_in_xs_pdf_cdf1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(values) + ); + return handle; +} + +// Create, general +Handle2Xs_in_xs_pdf_cdf1d +Xs_in_xs_pdf_cdf1dCreate( + ConstHandle2ConstValues values +) { + ConstHandle2Xs_in_xs_pdf_cdf1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + 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 +Xs_in_xs_pdf_cdf1dAssign(ConstHandle2Xs_in_xs_pdf_cdf1d self, ConstHandle2ConstXs_in_xs_pdf_cdf1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Xs_in_xs_pdf_cdf1dDelete(ConstHandle2ConstXs_in_xs_pdf_cdf1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Xs_in_xs_pdf_cdf1dRead(ConstHandle2Xs_in_xs_pdf_cdf1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Xs_in_xs_pdf_cdf1dWrite(ConstHandle2ConstXs_in_xs_pdf_cdf1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Xs_in_xs_pdf_cdf1dPrint(ConstHandle2ConstXs_in_xs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Xs_in_xs_pdf_cdf1dPrintXML(ConstHandle2ConstXs_in_xs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Xs_in_xs_pdf_cdf1dPrintJSON(ConstHandle2ConstXs_in_xs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +Xs_in_xs_pdf_cdf1dValuesHas(ConstHandle2ConstXs_in_xs_pdf_cdf1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +Xs_in_xs_pdf_cdf1dValuesGetConst(ConstHandle2ConstXs_in_xs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +Xs_in_xs_pdf_cdf1dValuesGet(ConstHandle2Xs_in_xs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +Xs_in_xs_pdf_cdf1dValuesSet(ConstHandle2Xs_in_xs_pdf_cdf1d self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d.h new file mode 100644 index 000000000..cf74fc50c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d.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. +// +// Xs_in_xs_pdf_cdf1d is the basic handle type in this file. Example: +// // Create a default Xs_in_xs_pdf_cdf1d object: +// Xs_in_xs_pdf_cdf1d handle = Xs_in_xs_pdf_cdf1dDefault(); +// Functions involving Xs_in_xs_pdf_cdf1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_XS_IN_XS_PDF_CDF1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_XS_IN_XS_PDF_CDF1D + +#include "GNDStk.h" +#include "v2.0/containers/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Xs_in_xs_pdf_cdf1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Xs_in_xs_pdf_cdf1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Xs_in_xs_pdf_cdf1dClass *Xs_in_xs_pdf_cdf1d; + +// --- Const-aware handles. +typedef const struct Xs_in_xs_pdf_cdf1dClass *const ConstHandle2ConstXs_in_xs_pdf_cdf1d; +typedef struct Xs_in_xs_pdf_cdf1dClass *const ConstHandle2Xs_in_xs_pdf_cdf1d; +typedef const struct Xs_in_xs_pdf_cdf1dClass * Handle2ConstXs_in_xs_pdf_cdf1d; +typedef struct Xs_in_xs_pdf_cdf1dClass * Handle2Xs_in_xs_pdf_cdf1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstXs_in_xs_pdf_cdf1d +Xs_in_xs_pdf_cdf1dDefaultConst(); + +// +++ Create, default +extern_c Handle2Xs_in_xs_pdf_cdf1d +Xs_in_xs_pdf_cdf1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstXs_in_xs_pdf_cdf1d +Xs_in_xs_pdf_cdf1dCreateConst( + ConstHandle2ConstValues values +); + +// +++ Create, general +extern_c Handle2Xs_in_xs_pdf_cdf1d +Xs_in_xs_pdf_cdf1dCreate( + 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 +Xs_in_xs_pdf_cdf1dAssign(ConstHandle2Xs_in_xs_pdf_cdf1d self, ConstHandle2ConstXs_in_xs_pdf_cdf1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Xs_in_xs_pdf_cdf1dDelete(ConstHandle2ConstXs_in_xs_pdf_cdf1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Xs_in_xs_pdf_cdf1dRead(ConstHandle2Xs_in_xs_pdf_cdf1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Xs_in_xs_pdf_cdf1dWrite(ConstHandle2ConstXs_in_xs_pdf_cdf1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Xs_in_xs_pdf_cdf1dPrint(ConstHandle2ConstXs_in_xs_pdf_cdf1d self); + +// +++ Print to standard output, as XML +extern_c int +Xs_in_xs_pdf_cdf1dPrintXML(ConstHandle2ConstXs_in_xs_pdf_cdf1d self); + +// +++ Print to standard output, as JSON +extern_c int +Xs_in_xs_pdf_cdf1dPrintJSON(ConstHandle2ConstXs_in_xs_pdf_cdf1d self); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Xs_in_xs_pdf_cdf1dValuesHas(ConstHandle2ConstXs_in_xs_pdf_cdf1d self); + +// --- Get, const +extern_c Handle2ConstValues +Xs_in_xs_pdf_cdf1dValuesGetConst(ConstHandle2ConstXs_in_xs_pdf_cdf1d self); + +// +++ Get, non-const +extern_c Handle2Values +Xs_in_xs_pdf_cdf1dValuesGet(ConstHandle2Xs_in_xs_pdf_cdf1d self); + +// +++ Set +extern_c void +Xs_in_xs_pdf_cdf1dValuesSet(ConstHandle2Xs_in_xs_pdf_cdf1d self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d.cpp new file mode 100644 index 000000000..233d226f3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Xs_pdf_cdf1d.hpp" +#include "Xs_pdf_cdf1d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Xs_pdf_cdf1dClass; +using CPP = multigroup::Xs_pdf_cdf1d; + +static const std::string CLASSNAME = "Xs_pdf_cdf1d"; + +namespace extract { + static auto outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + static auto xs_in_xs_pdf_cdf1d = [](auto &obj) { return &obj.xs_in_xs_pdf_cdf1d; }; + static auto pdf = [](auto &obj) { return &obj.pdf; }; + static auto cdf_in_xs_pdf_cdf1d = [](auto &obj) { return &obj.cdf_in_xs_pdf_cdf1d; }; +} + +using CPPXs_in_xs_pdf_cdf1d = containers::Xs_in_xs_pdf_cdf1d; +using CPPPdf = containers::Pdf; +using CPPCdf_in_xs_pdf_cdf1d = containers::Cdf_in_xs_pdf_cdf1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstXs_pdf_cdf1d +Xs_pdf_cdf1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Xs_pdf_cdf1d +Xs_pdf_cdf1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstXs_pdf_cdf1d +Xs_pdf_cdf1dCreateConst( + const Float64 outerDomainValue, + ConstHandle2ConstXs_in_xs_pdf_cdf1d xs_in_xs_pdf_cdf1d, + ConstHandle2ConstPdf pdf, + ConstHandle2ConstCdf_in_xs_pdf_cdf1d cdf_in_xs_pdf_cdf1d +) { + ConstHandle2Xs_pdf_cdf1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + outerDomainValue, + detail::tocpp(xs_in_xs_pdf_cdf1d), + detail::tocpp(pdf), + detail::tocpp(cdf_in_xs_pdf_cdf1d) + ); + return handle; +} + +// Create, general +Handle2Xs_pdf_cdf1d +Xs_pdf_cdf1dCreate( + const Float64 outerDomainValue, + ConstHandle2ConstXs_in_xs_pdf_cdf1d xs_in_xs_pdf_cdf1d, + ConstHandle2ConstPdf pdf, + ConstHandle2ConstCdf_in_xs_pdf_cdf1d cdf_in_xs_pdf_cdf1d +) { + ConstHandle2Xs_pdf_cdf1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + outerDomainValue, + detail::tocpp(xs_in_xs_pdf_cdf1d), + detail::tocpp(pdf), + detail::tocpp(cdf_in_xs_pdf_cdf1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Xs_pdf_cdf1dAssign(ConstHandle2Xs_pdf_cdf1d self, ConstHandle2ConstXs_pdf_cdf1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Xs_pdf_cdf1dDelete(ConstHandle2ConstXs_pdf_cdf1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Xs_pdf_cdf1dRead(ConstHandle2Xs_pdf_cdf1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Xs_pdf_cdf1dWrite(ConstHandle2ConstXs_pdf_cdf1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Xs_pdf_cdf1dPrint(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Xs_pdf_cdf1dPrintXML(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Xs_pdf_cdf1dPrintJSON(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +Xs_pdf_cdf1dOuterDomainValueHas(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +Float64 +Xs_pdf_cdf1dOuterDomainValueGet(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +Xs_pdf_cdf1dOuterDomainValueSet(ConstHandle2Xs_pdf_cdf1d self, const Float64 outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Child: xs_in_xs_pdf_cdf1d +// ----------------------------------------------------------------------------- + +// Has +int +Xs_pdf_cdf1dXs_in_xs_pdf_cdf1dHas(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Xs_in_xs_pdf_cdf1dHas", self, extract::xs_in_xs_pdf_cdf1d); +} + +// Get, const +Handle2ConstXs_in_xs_pdf_cdf1d +Xs_pdf_cdf1dXs_in_xs_pdf_cdf1dGetConst(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Xs_in_xs_pdf_cdf1dGetConst", self, extract::xs_in_xs_pdf_cdf1d); +} + +// Get, non-const +Handle2Xs_in_xs_pdf_cdf1d +Xs_pdf_cdf1dXs_in_xs_pdf_cdf1dGet(ConstHandle2Xs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Xs_in_xs_pdf_cdf1dGet", self, extract::xs_in_xs_pdf_cdf1d); +} + +// Set +void +Xs_pdf_cdf1dXs_in_xs_pdf_cdf1dSet(ConstHandle2Xs_pdf_cdf1d self, ConstHandle2ConstXs_in_xs_pdf_cdf1d xs_in_xs_pdf_cdf1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Xs_in_xs_pdf_cdf1dSet", self, extract::xs_in_xs_pdf_cdf1d, xs_in_xs_pdf_cdf1d); +} + + +// ----------------------------------------------------------------------------- +// Child: pdf +// ----------------------------------------------------------------------------- + +// Has +int +Xs_pdf_cdf1dPdfHas(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PdfHas", self, extract::pdf); +} + +// Get, const +Handle2ConstPdf +Xs_pdf_cdf1dPdfGetConst(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PdfGetConst", self, extract::pdf); +} + +// Get, non-const +Handle2Pdf +Xs_pdf_cdf1dPdfGet(ConstHandle2Xs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PdfGet", self, extract::pdf); +} + +// Set +void +Xs_pdf_cdf1dPdfSet(ConstHandle2Xs_pdf_cdf1d self, ConstHandle2ConstPdf pdf) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PdfSet", self, extract::pdf, pdf); +} + + +// ----------------------------------------------------------------------------- +// Child: cdf_in_xs_pdf_cdf1d +// ----------------------------------------------------------------------------- + +// Has +int +Xs_pdf_cdf1dCdf_in_xs_pdf_cdf1dHas(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Cdf_in_xs_pdf_cdf1dHas", self, extract::cdf_in_xs_pdf_cdf1d); +} + +// Get, const +Handle2ConstCdf_in_xs_pdf_cdf1d +Xs_pdf_cdf1dCdf_in_xs_pdf_cdf1dGetConst(ConstHandle2ConstXs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Cdf_in_xs_pdf_cdf1dGetConst", self, extract::cdf_in_xs_pdf_cdf1d); +} + +// Get, non-const +Handle2Cdf_in_xs_pdf_cdf1d +Xs_pdf_cdf1dCdf_in_xs_pdf_cdf1dGet(ConstHandle2Xs_pdf_cdf1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Cdf_in_xs_pdf_cdf1dGet", self, extract::cdf_in_xs_pdf_cdf1d); +} + +// Set +void +Xs_pdf_cdf1dCdf_in_xs_pdf_cdf1dSet(ConstHandle2Xs_pdf_cdf1d self, ConstHandle2ConstCdf_in_xs_pdf_cdf1d cdf_in_xs_pdf_cdf1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Cdf_in_xs_pdf_cdf1dSet", self, extract::cdf_in_xs_pdf_cdf1d, cdf_in_xs_pdf_cdf1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Xs_pdf_cdf1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d.h new file mode 100644 index 000000000..65364d94b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d.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. +// +// Xs_pdf_cdf1d is the basic handle type in this file. Example: +// // Create a default Xs_pdf_cdf1d object: +// Xs_pdf_cdf1d handle = Xs_pdf_cdf1dDefault(); +// Functions involving Xs_pdf_cdf1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_XS_PDF_CDF1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_XS_PDF_CDF1D + +#include "GNDStk.h" +#include "v2.0/containers/Xs_in_xs_pdf_cdf1d.h" +#include "v2.0/containers/Pdf.h" +#include "v2.0/containers/Cdf_in_xs_pdf_cdf1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Xs_pdf_cdf1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Xs_pdf_cdf1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Xs_pdf_cdf1dClass *Xs_pdf_cdf1d; + +// --- Const-aware handles. +typedef const struct Xs_pdf_cdf1dClass *const ConstHandle2ConstXs_pdf_cdf1d; +typedef struct Xs_pdf_cdf1dClass *const ConstHandle2Xs_pdf_cdf1d; +typedef const struct Xs_pdf_cdf1dClass * Handle2ConstXs_pdf_cdf1d; +typedef struct Xs_pdf_cdf1dClass * Handle2Xs_pdf_cdf1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstXs_pdf_cdf1d +Xs_pdf_cdf1dDefaultConst(); + +// +++ Create, default +extern_c Handle2Xs_pdf_cdf1d +Xs_pdf_cdf1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstXs_pdf_cdf1d +Xs_pdf_cdf1dCreateConst( + const Float64 outerDomainValue, + ConstHandle2ConstXs_in_xs_pdf_cdf1d xs_in_xs_pdf_cdf1d, + ConstHandle2ConstPdf pdf, + ConstHandle2ConstCdf_in_xs_pdf_cdf1d cdf_in_xs_pdf_cdf1d +); + +// +++ Create, general +extern_c Handle2Xs_pdf_cdf1d +Xs_pdf_cdf1dCreate( + const Float64 outerDomainValue, + ConstHandle2ConstXs_in_xs_pdf_cdf1d xs_in_xs_pdf_cdf1d, + ConstHandle2ConstPdf pdf, + ConstHandle2ConstCdf_in_xs_pdf_cdf1d cdf_in_xs_pdf_cdf1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Xs_pdf_cdf1dAssign(ConstHandle2Xs_pdf_cdf1d self, ConstHandle2ConstXs_pdf_cdf1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Xs_pdf_cdf1dDelete(ConstHandle2ConstXs_pdf_cdf1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Xs_pdf_cdf1dRead(ConstHandle2Xs_pdf_cdf1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Xs_pdf_cdf1dWrite(ConstHandle2ConstXs_pdf_cdf1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Xs_pdf_cdf1dPrint(ConstHandle2ConstXs_pdf_cdf1d self); + +// +++ Print to standard output, as XML +extern_c int +Xs_pdf_cdf1dPrintXML(ConstHandle2ConstXs_pdf_cdf1d self); + +// +++ Print to standard output, as JSON +extern_c int +Xs_pdf_cdf1dPrintJSON(ConstHandle2ConstXs_pdf_cdf1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Xs_pdf_cdf1dOuterDomainValueHas(ConstHandle2ConstXs_pdf_cdf1d self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +Xs_pdf_cdf1dOuterDomainValueGet(ConstHandle2ConstXs_pdf_cdf1d self); + +// +++ Set +extern_c void +Xs_pdf_cdf1dOuterDomainValueSet(ConstHandle2Xs_pdf_cdf1d self, const Float64 outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Child: xs_in_xs_pdf_cdf1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Xs_pdf_cdf1dXs_in_xs_pdf_cdf1dHas(ConstHandle2ConstXs_pdf_cdf1d self); + +// --- Get, const +extern_c Handle2ConstXs_in_xs_pdf_cdf1d +Xs_pdf_cdf1dXs_in_xs_pdf_cdf1dGetConst(ConstHandle2ConstXs_pdf_cdf1d self); + +// +++ Get, non-const +extern_c Handle2Xs_in_xs_pdf_cdf1d +Xs_pdf_cdf1dXs_in_xs_pdf_cdf1dGet(ConstHandle2Xs_pdf_cdf1d self); + +// +++ Set +extern_c void +Xs_pdf_cdf1dXs_in_xs_pdf_cdf1dSet(ConstHandle2Xs_pdf_cdf1d self, ConstHandle2ConstXs_in_xs_pdf_cdf1d xs_in_xs_pdf_cdf1d); + + +// ----------------------------------------------------------------------------- +// Child: pdf +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Xs_pdf_cdf1dPdfHas(ConstHandle2ConstXs_pdf_cdf1d self); + +// --- Get, const +extern_c Handle2ConstPdf +Xs_pdf_cdf1dPdfGetConst(ConstHandle2ConstXs_pdf_cdf1d self); + +// +++ Get, non-const +extern_c Handle2Pdf +Xs_pdf_cdf1dPdfGet(ConstHandle2Xs_pdf_cdf1d self); + +// +++ Set +extern_c void +Xs_pdf_cdf1dPdfSet(ConstHandle2Xs_pdf_cdf1d self, ConstHandle2ConstPdf pdf); + + +// ----------------------------------------------------------------------------- +// Child: cdf_in_xs_pdf_cdf1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Xs_pdf_cdf1dCdf_in_xs_pdf_cdf1dHas(ConstHandle2ConstXs_pdf_cdf1d self); + +// --- Get, const +extern_c Handle2ConstCdf_in_xs_pdf_cdf1d +Xs_pdf_cdf1dCdf_in_xs_pdf_cdf1dGetConst(ConstHandle2ConstXs_pdf_cdf1d self); + +// +++ Get, non-const +extern_c Handle2Cdf_in_xs_pdf_cdf1d +Xs_pdf_cdf1dCdf_in_xs_pdf_cdf1dGet(ConstHandle2Xs_pdf_cdf1d self); + +// +++ Set +extern_c void +Xs_pdf_cdf1dCdf_in_xs_pdf_cdf1dSet(ConstHandle2Xs_pdf_cdf1d self, ConstHandle2ConstCdf_in_xs_pdf_cdf1d cdf_in_xs_pdf_cdf1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Xs_pdf_cdf1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Xs_pdf_cdf1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d.cpp new file mode 100644 index 000000000..623f426c7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/containers/Ys1d.hpp" +#include "Ys1d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Ys1dClass; +using CPP = multigroup::Ys1d; + +static const std::string CLASSNAME = "Ys1d"; + +namespace extract { + static auto interpolation = [](auto &obj) { return &obj.interpolation; }; + static auto label = [](auto &obj) { return &obj.label; }; + 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 +Handle2ConstYs1d +Ys1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Ys1d +Ys1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstYs1d +Ys1dCreateConst( + const enums::Interpolation interpolation, + const XMLName label, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +) { + ConstHandle2Ys1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + interpolation, + label, + detail::tocpp(axes), + detail::tocpp(values) + ); + return handle; +} + +// Create, general +Handle2Ys1d +Ys1dCreate( + const enums::Interpolation interpolation, + const XMLName label, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +) { + ConstHandle2Ys1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + interpolation, + label, + 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 +Ys1dAssign(ConstHandle2Ys1d self, ConstHandle2ConstYs1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Ys1dDelete(ConstHandle2ConstYs1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Ys1dRead(ConstHandle2Ys1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Ys1dWrite(ConstHandle2ConstYs1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Ys1dPrint(ConstHandle2ConstYs1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Ys1dPrintXML(ConstHandle2ConstYs1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Ys1dPrintJSON(ConstHandle2ConstYs1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// Has +int +Ys1dInterpolationHas(ConstHandle2ConstYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationHas", self, extract::interpolation); +} + +// Get +// Returns by value +enums::Interpolation +Ys1dInterpolationGet(ConstHandle2ConstYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationGet", self, extract::interpolation); +} + +// Set +void +Ys1dInterpolationSet(ConstHandle2Ys1d self, const enums::Interpolation interpolation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InterpolationSet", self, extract::interpolation, interpolation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Ys1dLabelHas(ConstHandle2ConstYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +Ys1dLabelGet(ConstHandle2ConstYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Ys1dLabelSet(ConstHandle2Ys1d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Ys1dAxesHas(ConstHandle2ConstYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Ys1dAxesGetConst(ConstHandle2ConstYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Ys1dAxesGet(ConstHandle2Ys1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Ys1dAxesSet(ConstHandle2Ys1d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +Ys1dValuesHas(ConstHandle2ConstYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +Ys1dValuesGetConst(ConstHandle2ConstYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +Ys1dValuesGet(ConstHandle2Ys1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +Ys1dValuesSet(ConstHandle2Ys1d self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Ys1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d.h new file mode 100644 index 000000000..87a2d46d9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d.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. +// +// Ys1d is the basic handle type in this file. Example: +// // Create a default Ys1d object: +// Ys1d handle = Ys1dDefault(); +// Functions involving Ys1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_CONTAINERS_YS1D +#define C_INTERFACE_TEST_V2_0_CONTAINERS_YS1D + +#include "GNDStk.h" +#include "v2.0/containers/Axes.h" +#include "v2.0/containers/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Ys1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Ys1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Ys1dClass *Ys1d; + +// --- Const-aware handles. +typedef const struct Ys1dClass *const ConstHandle2ConstYs1d; +typedef struct Ys1dClass *const ConstHandle2Ys1d; +typedef const struct Ys1dClass * Handle2ConstYs1d; +typedef struct Ys1dClass * Handle2Ys1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstYs1d +Ys1dDefaultConst(); + +// +++ Create, default +extern_c Handle2Ys1d +Ys1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstYs1d +Ys1dCreateConst( + const enums::Interpolation interpolation, + const XMLName label, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +); + +// +++ Create, general +extern_c Handle2Ys1d +Ys1dCreate( + const enums::Interpolation interpolation, + const XMLName label, + 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 +Ys1dAssign(ConstHandle2Ys1d self, ConstHandle2ConstYs1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Ys1dDelete(ConstHandle2ConstYs1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Ys1dRead(ConstHandle2Ys1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Ys1dWrite(ConstHandle2ConstYs1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Ys1dPrint(ConstHandle2ConstYs1d self); + +// +++ Print to standard output, as XML +extern_c int +Ys1dPrintXML(ConstHandle2ConstYs1d self); + +// +++ Print to standard output, as JSON +extern_c int +Ys1dPrintJSON(ConstHandle2ConstYs1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Ys1dInterpolationHas(ConstHandle2ConstYs1d self); + +// +++ Get +// +++ Returns by value +extern_c enums::Interpolation +Ys1dInterpolationGet(ConstHandle2ConstYs1d self); + +// +++ Set +extern_c void +Ys1dInterpolationSet(ConstHandle2Ys1d self, const enums::Interpolation interpolation); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Ys1dLabelHas(ConstHandle2ConstYs1d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +Ys1dLabelGet(ConstHandle2ConstYs1d self); + +// +++ Set +extern_c void +Ys1dLabelSet(ConstHandle2Ys1d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Ys1dAxesHas(ConstHandle2ConstYs1d self); + +// --- Get, const +extern_c Handle2ConstAxes +Ys1dAxesGetConst(ConstHandle2ConstYs1d self); + +// +++ Get, non-const +extern_c Handle2Axes +Ys1dAxesGet(ConstHandle2Ys1d self); + +// +++ Set +extern_c void +Ys1dAxesSet(ConstHandle2Ys1d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Ys1dValuesHas(ConstHandle2ConstYs1d self); + +// --- Get, const +extern_c Handle2ConstValues +Ys1dValuesGetConst(ConstHandle2ConstYs1d self); + +// +++ Get, non-const +extern_c Handle2Values +Ys1dValuesGet(ConstHandle2Ys1d self); + +// +++ Set +extern_c void +Ys1dValuesSet(ConstHandle2Ys1d self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/containers/Ys1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/containers/Ys1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance.cpp new file mode 100644 index 000000000..a79daf349 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance.cpp @@ -0,0 +1,295 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/AverageParameterCovariance.hpp" +#include "AverageParameterCovariance.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AverageParameterCovarianceClass; +using CPP = multigroup::AverageParameterCovariance; + +static const std::string CLASSNAME = "AverageParameterCovariance"; + +namespace extract { + static auto crossTerm = [](auto &obj) { return &obj.crossTerm; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto columnData = [](auto &obj) { return &obj.columnData; }; + static auto rowData = [](auto &obj) { return &obj.rowData; }; +} + +using CPPColumnData = covariance::ColumnData; +using CPPRowData = covariance::RowData; +using CPPCovarianceMatrix = covariance::CovarianceMatrix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageParameterCovariance +AverageParameterCovarianceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AverageParameterCovariance +AverageParameterCovarianceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAverageParameterCovariance +AverageParameterCovarianceCreateConst( + const bool crossTerm, + const XMLName label, + ConstHandle2ConstColumnData columnData, + ConstHandle2ConstRowData rowData, +) { + ConstHandle2AverageParameterCovariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + crossTerm, + label, + detail::tocpp(columnData), + detail::tocpp(rowData) + ); + return handle; +} + +// Create, general +Handle2AverageParameterCovariance +AverageParameterCovarianceCreate( + const bool crossTerm, + const XMLName label, + ConstHandle2ConstColumnData columnData, + ConstHandle2ConstRowData rowData, +) { + ConstHandle2AverageParameterCovariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + crossTerm, + label, + detail::tocpp(columnData), + detail::tocpp(rowData) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AverageParameterCovarianceLabelHas(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +AverageParameterCovarianceLabelGet(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AverageParameterCovarianceLabelSet(ConstHandle2AverageParameterCovariance self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/AverageParameterCovariance/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance.h new file mode 100644 index 000000000..745907af9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance.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. +// +// 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_TEST_V2_0_COVARIANCE_AVERAGEPARAMETERCOVARIANCE +#define C_INTERFACE_TEST_V2_0_COVARIANCE_AVERAGEPARAMETERCOVARIANCE + +#include "GNDStk.h" +#include "v2.0/covariance/ColumnData.h" +#include "v2.0/covariance/RowData.h" +#include "v2.0/covariance/CovarianceMatrix.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 +extern_c Handle2AverageParameterCovariance +AverageParameterCovarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageParameterCovariance +AverageParameterCovarianceCreateConst( + const bool crossTerm, + const XMLName label, + ConstHandle2ConstColumnData columnData, + ConstHandle2ConstRowData rowData, +); + +// +++ Create, general +extern_c Handle2AverageParameterCovariance +AverageParameterCovarianceCreate( + const bool crossTerm, + const XMLName label, + ConstHandle2ConstColumnData columnData, + ConstHandle2ConstRowData rowData, +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageParameterCovarianceLabelHas(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AverageParameterCovarianceLabelGet(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Set +extern_c void +AverageParameterCovarianceLabelSet(ConstHandle2AverageParameterCovariance self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/AverageParameterCovariance/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/AverageParameterCovariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData.cpp new file mode 100644 index 000000000..e351b42b3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/ColumnData.hpp" +#include "ColumnData.h" + +using namespace njoy::GNDStk; +using namespace test::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 dimension = [](auto &obj) { return &obj.dimension; }; + static auto slices = [](auto &obj) { return &obj.slices; }; +} + +using CPPSlices = covariance::Slices; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstColumnData +ColumnDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ColumnData +ColumnDataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstColumnData +ColumnDataCreateConst( + const XMLName ENDF_MFMT, + const XMLName href, + const Integer32 dimension, + ConstHandle2ConstSlices slices +) { + ConstHandle2ColumnData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MFMT, + href, + dimension, + detail::tocpp(slices) + ); + return handle; +} + +// Create, general +Handle2ColumnData +ColumnDataCreate( + const XMLName ENDF_MFMT, + const XMLName href, + const Integer32 dimension, + ConstHandle2ConstSlices slices +) { + ConstHandle2ColumnData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MFMT, + href, + dimension, + 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 +XMLName +ColumnDataENDFMFMTGet(ConstHandle2ConstColumnData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMFMTGet", self, extract::ENDF_MFMT); +} + +// Set +void +ColumnDataENDFMFMTSet(ConstHandle2ColumnData self, const XMLName 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 +XMLName +ColumnDataHrefGet(ConstHandle2ConstColumnData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ColumnDataHrefSet(ConstHandle2ColumnData self, const XMLName href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// Has +int +ColumnDataDimensionHas(ConstHandle2ConstColumnData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DimensionHas", self, extract::dimension); +} + +// Get +// Returns by value +Integer32 +ColumnDataDimensionGet(ConstHandle2ConstColumnData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DimensionGet", self, extract::dimension); +} + +// Set +void +ColumnDataDimensionSet(ConstHandle2ColumnData self, const Integer32 dimension) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DimensionSet", self, extract::dimension, dimension); +} + + +// ----------------------------------------------------------------------------- +// 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/covariance/ColumnData/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData.h new file mode 100644 index 000000000..4e4652408 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData.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. +// +// 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_TEST_V2_0_COVARIANCE_COLUMNDATA +#define C_INTERFACE_TEST_V2_0_COVARIANCE_COLUMNDATA + +#include "GNDStk.h" +#include "v2.0/covariance/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 +extern_c Handle2ColumnData +ColumnDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumnData +ColumnDataCreateConst( + const XMLName ENDF_MFMT, + const XMLName href, + const Integer32 dimension, + ConstHandle2ConstSlices slices +); + +// +++ Create, general +extern_c Handle2ColumnData +ColumnDataCreate( + const XMLName ENDF_MFMT, + const XMLName href, + const Integer32 dimension, + 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 XMLName +ColumnDataENDFMFMTGet(ConstHandle2ConstColumnData self); + +// +++ Set +extern_c void +ColumnDataENDFMFMTSet(ConstHandle2ColumnData self, const XMLName ENDF_MFMT); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnDataHrefHas(ConstHandle2ConstColumnData self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ColumnDataHrefGet(ConstHandle2ConstColumnData self); + +// +++ Set +extern_c void +ColumnDataHrefSet(ConstHandle2ColumnData self, const XMLName href); + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnDataDimensionHas(ConstHandle2ConstColumnData self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ColumnDataDimensionGet(ConstHandle2ConstColumnData self); + +// +++ Set +extern_c void +ColumnDataDimensionSet(ConstHandle2ColumnData self, const Integer32 dimension); + + +// ----------------------------------------------------------------------------- +// 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/covariance/ColumnData/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity.cpp new file mode 100644 index 000000000..e5137b6bc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/ColumnSensitivity.hpp" +#include "ColumnSensitivity.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ColumnSensitivityClass; +using CPP = multigroup::ColumnSensitivity; + +static const std::string CLASSNAME = "ColumnSensitivity"; + +namespace extract { + static auto array = [](auto &obj) { return &obj.array; }; +} + +using CPPArray = containers::Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstColumnSensitivity +ColumnSensitivityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ColumnSensitivity +ColumnSensitivityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstColumnSensitivity +ColumnSensitivityCreateConst( + ConstHandle2ConstArray array +) { + ConstHandle2ColumnSensitivity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(array) + ); + return handle; +} + +// Create, general +Handle2ColumnSensitivity +ColumnSensitivityCreate( + ConstHandle2ConstArray array +) { + ConstHandle2ColumnSensitivity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + 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 +ColumnSensitivityAssign(ConstHandle2ColumnSensitivity self, ConstHandle2ConstColumnSensitivity from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ColumnSensitivityDelete(ConstHandle2ConstColumnSensitivity self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ColumnSensitivityRead(ConstHandle2ColumnSensitivity self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ColumnSensitivityWrite(ConstHandle2ConstColumnSensitivity self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ColumnSensitivityPrint(ConstHandle2ConstColumnSensitivity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ColumnSensitivityPrintXML(ConstHandle2ConstColumnSensitivity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ColumnSensitivityPrintJSON(ConstHandle2ConstColumnSensitivity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// Has +int +ColumnSensitivityArrayHas(ConstHandle2ConstColumnSensitivity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ArrayHas", self, extract::array); +} + +// Get, const +Handle2ConstArray +ColumnSensitivityArrayGetConst(ConstHandle2ConstColumnSensitivity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGetConst", self, extract::array); +} + +// Get, non-const +Handle2Array +ColumnSensitivityArrayGet(ConstHandle2ColumnSensitivity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGet", self, extract::array); +} + +// Set +void +ColumnSensitivityArraySet(ConstHandle2ColumnSensitivity self, ConstHandle2ConstArray array) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ArraySet", self, extract::array, array); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ColumnSensitivity/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity.h new file mode 100644 index 000000000..4bf40a98e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity.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. +// +// ColumnSensitivity is the basic handle type in this file. Example: +// // Create a default ColumnSensitivity object: +// ColumnSensitivity handle = ColumnSensitivityDefault(); +// Functions involving ColumnSensitivity are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_COVARIANCE_COLUMNSENSITIVITY +#define C_INTERFACE_TEST_V2_0_COVARIANCE_COLUMNSENSITIVITY + +#include "GNDStk.h" +#include "v2.0/containers/Array.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ColumnSensitivityClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ColumnSensitivity +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ColumnSensitivityClass *ColumnSensitivity; + +// --- Const-aware handles. +typedef const struct ColumnSensitivityClass *const ConstHandle2ConstColumnSensitivity; +typedef struct ColumnSensitivityClass *const ConstHandle2ColumnSensitivity; +typedef const struct ColumnSensitivityClass * Handle2ConstColumnSensitivity; +typedef struct ColumnSensitivityClass * Handle2ColumnSensitivity; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstColumnSensitivity +ColumnSensitivityDefaultConst(); + +// +++ Create, default +extern_c Handle2ColumnSensitivity +ColumnSensitivityDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumnSensitivity +ColumnSensitivityCreateConst( + ConstHandle2ConstArray array +); + +// +++ Create, general +extern_c Handle2ColumnSensitivity +ColumnSensitivityCreate( + 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 +ColumnSensitivityAssign(ConstHandle2ColumnSensitivity self, ConstHandle2ConstColumnSensitivity from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ColumnSensitivityDelete(ConstHandle2ConstColumnSensitivity self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ColumnSensitivityRead(ConstHandle2ColumnSensitivity self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ColumnSensitivityWrite(ConstHandle2ConstColumnSensitivity self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ColumnSensitivityPrint(ConstHandle2ConstColumnSensitivity self); + +// +++ Print to standard output, as XML +extern_c int +ColumnSensitivityPrintXML(ConstHandle2ConstColumnSensitivity self); + +// +++ Print to standard output, as JSON +extern_c int +ColumnSensitivityPrintJSON(ConstHandle2ConstColumnSensitivity self); + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnSensitivityArrayHas(ConstHandle2ConstColumnSensitivity self); + +// --- Get, const +extern_c Handle2ConstArray +ColumnSensitivityArrayGetConst(ConstHandle2ConstColumnSensitivity self); + +// +++ Get, non-const +extern_c Handle2Array +ColumnSensitivityArrayGet(ConstHandle2ColumnSensitivity self); + +// +++ Set +extern_c void +ColumnSensitivityArraySet(ConstHandle2ColumnSensitivity self, ConstHandle2ConstArray array); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ColumnSensitivity/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ColumnSensitivity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance.cpp new file mode 100644 index 000000000..6d4794bc5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/Covariance.hpp" +#include "Covariance.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CovarianceClass; +using CPP = multigroup::Covariance; + +static const std::string CLASSNAME = "Covariance"; + +namespace extract { + static auto array = [](auto &obj) { return &obj.array; }; +} + +using CPPArray = containers::Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovariance +CovarianceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Covariance +CovarianceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovariance +CovarianceCreateConst( + ConstHandle2ConstArray array +) { + ConstHandle2Covariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(array) + ); + return handle; +} + +// Create, general +Handle2Covariance +CovarianceCreate( + ConstHandle2ConstArray array +) { + ConstHandle2Covariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + 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"); +} + + +// ----------------------------------------------------------------------------- +// 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/covariance/Covariance/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance.h new file mode 100644 index 000000000..a5d42fddb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance.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. +// +// 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_TEST_V2_0_COVARIANCE_COVARIANCE +#define C_INTERFACE_TEST_V2_0_COVARIANCE_COVARIANCE + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2Covariance +CovarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovariance +CovarianceCreateConst( + ConstHandle2ConstArray array +); + +// +++ Create, general +extern_c Handle2Covariance +CovarianceCreate( + 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); + + +// ----------------------------------------------------------------------------- +// 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/covariance/Covariance/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Covariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix.cpp new file mode 100644 index 000000000..3569abd28 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix.cpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/CovarianceMatrix.hpp" +#include "CovarianceMatrix.h" + +using namespace njoy::GNDStk; +using namespace test::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 productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto type = [](auto &obj) { return &obj.type; }; +} + +using CPPGridded2d = containers::Gridded2d; +using CPPSandwichProduct = covariance::SandwichProduct; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovarianceMatrix +CovarianceMatrixDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CovarianceMatrix +CovarianceMatrixDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovarianceMatrix +CovarianceMatrixCreateConst( + const XMLName label, + const enums::Frame productFrame, + const XMLName type, +) { + ConstHandle2CovarianceMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + type + ); + return handle; +} + +// Create, general +Handle2CovarianceMatrix +CovarianceMatrixCreate( + const XMLName label, + const enums::Frame productFrame, + const XMLName type, +) { + ConstHandle2CovarianceMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + type + ); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +CovarianceMatrixLabelGet(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CovarianceMatrixLabelSet(ConstHandle2CovarianceMatrix self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceMatrixProductFrameHas(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +enums::Frame +CovarianceMatrixProductFrameGet(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +CovarianceMatrixProductFrameSet(ConstHandle2CovarianceMatrix self, const enums::Frame productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceMatrixTypeHas(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TypeHas", self, extract::type); +} + +// Get +// Returns by value +XMLName +CovarianceMatrixTypeGet(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +CovarianceMatrixTypeSet(ConstHandle2CovarianceMatrix self, const XMLName type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/CovarianceMatrix/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix.h new file mode 100644 index 000000000..f7cdb1037 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix.h @@ -0,0 +1,199 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COVARIANCE_COVARIANCEMATRIX +#define C_INTERFACE_TEST_V2_0_COVARIANCE_COVARIANCEMATRIX + +#include "GNDStk.h" +#include "v2.0/containers/Gridded2d.h" +#include "v2.0/covariance/SandwichProduct.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 +extern_c Handle2CovarianceMatrix +CovarianceMatrixDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceMatrix +CovarianceMatrixCreateConst( + const XMLName label, + const enums::Frame productFrame, + const XMLName type, +); + +// +++ Create, general +extern_c Handle2CovarianceMatrix +CovarianceMatrixCreate( + const XMLName label, + const enums::Frame productFrame, + const XMLName type, +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +CovarianceMatrixLabelGet(ConstHandle2ConstCovarianceMatrix self); + +// +++ Set +extern_c void +CovarianceMatrixLabelSet(ConstHandle2CovarianceMatrix self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceMatrixProductFrameHas(ConstHandle2ConstCovarianceMatrix self); + +// +++ Get +// +++ Returns by value +extern_c enums::Frame +CovarianceMatrixProductFrameGet(ConstHandle2ConstCovarianceMatrix self); + +// +++ Set +extern_c void +CovarianceMatrixProductFrameSet(ConstHandle2CovarianceMatrix self, const enums::Frame productFrame); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceMatrixTypeHas(ConstHandle2ConstCovarianceMatrix self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CovarianceMatrixTypeGet(ConstHandle2ConstCovarianceMatrix self); + +// +++ Set +extern_c void +CovarianceMatrixTypeSet(ConstHandle2CovarianceMatrix self, const XMLName type); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/CovarianceMatrix/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection.cpp new file mode 100644 index 000000000..3b164b6c8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection.cpp @@ -0,0 +1,297 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/CovarianceSection.hpp" +#include "CovarianceSection.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CovarianceSectionClass; +using CPP = multigroup::CovarianceSection; + +static const std::string CLASSNAME = "CovarianceSection"; + +namespace extract { + static auto crossTerm = [](auto &obj) { return &obj.crossTerm; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto rowData = [](auto &obj) { return &obj.rowData; }; + static auto columnData = [](auto &obj) { return &obj.columnData; }; +} + +using CPPRowData = covariance::RowData; +using CPPColumnData = covariance::ColumnData; +using CPPCovarianceMatrix = covariance::CovarianceMatrix; +using CPPSum = covariance::Sum; +using CPPMixed = covariance::Mixed; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovarianceSection +CovarianceSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CovarianceSection +CovarianceSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovarianceSection +CovarianceSectionCreateConst( + const bool crossTerm, + const XMLName label, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData, +) { + ConstHandle2CovarianceSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + crossTerm, + label, + detail::tocpp(rowData), + detail::tocpp(columnData) + ); + return handle; +} + +// Create, general +Handle2CovarianceSection +CovarianceSectionCreate( + const bool crossTerm, + const XMLName label, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData, +) { + ConstHandle2CovarianceSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + crossTerm, + label, + 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 +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: 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); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSectionLabelHas(ConstHandle2ConstCovarianceSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CovarianceSectionLabelGet(ConstHandle2ConstCovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CovarianceSectionLabelSet(ConstHandle2CovarianceSection self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/CovarianceSection/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection.h new file mode 100644 index 000000000..df54f32e6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection.h @@ -0,0 +1,228 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COVARIANCE_COVARIANCESECTION +#define C_INTERFACE_TEST_V2_0_COVARIANCE_COVARIANCESECTION + +#include "GNDStk.h" +#include "v2.0/covariance/RowData.h" +#include "v2.0/covariance/ColumnData.h" +#include "v2.0/covariance/CovarianceMatrix.h" +#include "v2.0/covariance/Sum.h" +#include "v2.0/covariance/Mixed.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 +extern_c Handle2CovarianceSection +CovarianceSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceSection +CovarianceSectionCreateConst( + const bool crossTerm, + const XMLName label, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData, +); + +// +++ Create, general +extern_c Handle2CovarianceSection +CovarianceSectionCreate( + const bool crossTerm, + const XMLName label, + 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 +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: 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSectionLabelHas(ConstHandle2ConstCovarianceSection self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CovarianceSectionLabelGet(ConstHandle2ConstCovarianceSection self); + +// +++ Set +extern_c void +CovarianceSectionLabelSet(ConstHandle2CovarianceSection self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/CovarianceSection/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections.cpp new file mode 100644 index 000000000..3a7cbdc27 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/CovarianceSections.hpp" +#include "CovarianceSections.h" + +using namespace njoy::GNDStk; +using namespace test::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 = covariance::CovarianceSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovarianceSections +CovarianceSectionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// 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); +} + +// Has, by label +int +CovarianceSectionsCovarianceSectionHasByLabel( + ConstHandle2ConstCovarianceSections self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionHasByLabel", + self, extract::covarianceSection, meta::label, label); +} + +// Get, by label, const +Handle2ConstCovarianceSection +CovarianceSectionsCovarianceSectionGetByLabelConst( + ConstHandle2ConstCovarianceSections self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionGetByLabelConst", + self, extract::covarianceSection, meta::label, label); +} + +// Get, by label, non-const +Handle2CovarianceSection +CovarianceSectionsCovarianceSectionGetByLabel( + ConstHandle2CovarianceSections self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionGetByLabel", + self, extract::covarianceSection, meta::label, label); +} + +// Set, by label +void +CovarianceSectionsCovarianceSectionSetByLabel( + ConstHandle2CovarianceSections self, + const XMLName label, + ConstHandle2ConstCovarianceSection covarianceSection +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionSetByLabel", + self, extract::covarianceSection, meta::label, label, covarianceSection); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/CovarianceSections/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections.h new file mode 100644 index 000000000..7950b654b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COVARIANCE_COVARIANCESECTIONS +#define C_INTERFACE_TEST_V2_0_COVARIANCE_COVARIANCESECTIONS + +#include "GNDStk.h" +#include "v2.0/covariance/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 +extern_c Handle2CovarianceSections +CovarianceSectionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceSections +CovarianceSectionsCreateConst( + ConstHandle2CovarianceSection *const covarianceSection, const size_t covarianceSectionSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ Has, by label +extern_c int +CovarianceSectionsCovarianceSectionHasByLabel( + ConstHandle2ConstCovarianceSections self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstCovarianceSection +CovarianceSectionsCovarianceSectionGetByLabelConst( + ConstHandle2ConstCovarianceSections self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2CovarianceSection +CovarianceSectionsCovarianceSectionGetByLabel( + ConstHandle2CovarianceSections self, + const XMLName label +); + +// +++ Set, by label +extern_c void +CovarianceSectionsCovarianceSectionSetByLabel( + ConstHandle2CovarianceSections self, + const XMLName label, + ConstHandle2ConstCovarianceSection covarianceSection +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/CovarianceSections/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSections/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSuite.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSuite.cpp new file mode 100644 index 000000000..304269d4b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSuite.cpp @@ -0,0 +1,485 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/CovarianceSuite.hpp" +#include "CovarianceSuite.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CovarianceSuiteClass; +using CPP = multigroup::CovarianceSuite; + +static const std::string CLASSNAME = "CovarianceSuite"; + +namespace extract { + static auto evaluation = [](auto &obj) { return &obj.evaluation; }; + static auto projectile = [](auto &obj) { return &obj.projectile; }; + static auto target = [](auto &obj) { return &obj.target; }; + 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 = common::ExternalFiles; +using CPPStyles = styles::Styles; +using CPPCovarianceSections = covariance::CovarianceSections; +using CPPParameterCovariances = covariance::ParameterCovariances; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovarianceSuite +CovarianceSuiteDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CovarianceSuite +CovarianceSuiteDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovarianceSuite +CovarianceSuiteCreateConst( + const XMLName evaluation, + const XMLName projectile, + const XMLName target, + const enums::Interaction interaction, + const Float64 format, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstCovarianceSections covarianceSections, + ConstHandle2ConstParameterCovariances parameterCovariances +) { + ConstHandle2CovarianceSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + evaluation, + projectile, + target, + interaction, + format, + detail::tocpp(externalFiles), + detail::tocpp(styles), + detail::tocpp(covarianceSections), + detail::tocpp(parameterCovariances) + ); + return handle; +} + +// Create, general +Handle2CovarianceSuite +CovarianceSuiteCreate( + const XMLName evaluation, + const XMLName projectile, + const XMLName target, + const enums::Interaction interaction, + const Float64 format, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstCovarianceSections covarianceSections, + ConstHandle2ConstParameterCovariances parameterCovariances +) { + ConstHandle2CovarianceSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + evaluation, + projectile, + target, + 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: evaluation +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteEvaluationHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaluationHas", self, extract::evaluation); +} + +// Get +// Returns by value +XMLName +CovarianceSuiteEvaluationGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaluationGet", self, extract::evaluation); +} + +// Set +void +CovarianceSuiteEvaluationSet(ConstHandle2CovarianceSuite self, const XMLName evaluation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaluationSet", self, extract::evaluation, evaluation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteProjectileHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileHas", self, extract::projectile); +} + +// Get +// Returns by value +XMLName +CovarianceSuiteProjectileGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileGet", self, extract::projectile); +} + +// Set +void +CovarianceSuiteProjectileSet(ConstHandle2CovarianceSuite self, const XMLName 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 +XMLName +CovarianceSuiteTargetGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TargetGet", self, extract::target); +} + +// Set +void +CovarianceSuiteTargetSet(ConstHandle2CovarianceSuite self, const XMLName target) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TargetSet", self, extract::target, target); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteInteractionHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InteractionHas", self, extract::interaction); +} + +// Get +// Returns by value +enums::Interaction +CovarianceSuiteInteractionGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InteractionGet", self, extract::interaction); +} + +// Set +void +CovarianceSuiteInteractionSet(ConstHandle2CovarianceSuite self, const enums::Interaction 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 +Float64 +CovarianceSuiteFormatGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormatGet", self, extract::format); +} + +// Set +void +CovarianceSuiteFormatSet(ConstHandle2CovarianceSuite self, const Float64 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/covariance/CovarianceSuite/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSuite.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSuite.h new file mode 100644 index 000000000..eada9c986 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/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_TEST_V2_0_COVARIANCE_COVARIANCESUITE +#define C_INTERFACE_TEST_V2_0_COVARIANCE_COVARIANCESUITE + +#include "GNDStk.h" +#include "v2.0/common/ExternalFiles.h" +#include "v2.0/styles/Styles.h" +#include "v2.0/covariance/CovarianceSections.h" +#include "v2.0/covariance/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 +extern_c Handle2CovarianceSuite +CovarianceSuiteDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceSuite +CovarianceSuiteCreateConst( + const XMLName evaluation, + const XMLName projectile, + const XMLName target, + const enums::Interaction interaction, + const Float64 format, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstCovarianceSections covarianceSections, + ConstHandle2ConstParameterCovariances parameterCovariances +); + +// +++ Create, general +extern_c Handle2CovarianceSuite +CovarianceSuiteCreate( + const XMLName evaluation, + const XMLName projectile, + const XMLName target, + const enums::Interaction interaction, + const Float64 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: evaluation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteEvaluationHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CovarianceSuiteEvaluationGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteEvaluationSet(ConstHandle2CovarianceSuite self, const XMLName evaluation); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteProjectileHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CovarianceSuiteProjectileGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteProjectileSet(ConstHandle2CovarianceSuite self, const XMLName projectile); + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteTargetHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CovarianceSuiteTargetGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteTargetSet(ConstHandle2CovarianceSuite self, const XMLName target); + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteInteractionHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c enums::Interaction +CovarianceSuiteInteractionGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteInteractionSet(ConstHandle2CovarianceSuite self, const enums::Interaction interaction); + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteFormatHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +CovarianceSuiteFormatGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteFormatSet(ConstHandle2CovarianceSuite self, const Float64 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/covariance/CovarianceSuite/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSuite/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSuite/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSuite/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/CovarianceSuite/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed.cpp new file mode 100644 index 000000000..6b6a63deb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed.cpp @@ -0,0 +1,845 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/Mixed.hpp" +#include "Mixed.h" + +using namespace njoy::GNDStk; +using namespace test::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 shortRangeSelfScalingVariance = [](auto &obj) { return &obj.shortRangeSelfScalingVariance; }; + static auto sum = [](auto &obj) { return &obj.sum; }; +} + +using CPPCovarianceMatrix = covariance::CovarianceMatrix; +using CPPShortRangeSelfScalingVariance = covariance::ShortRangeSelfScalingVariance; +using CPPSum = covariance::Sum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMixed +MixedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Mixed +MixedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMixed +MixedCreateConst( + const XMLName label, + ConstHandle2CovarianceMatrix *const covarianceMatrix, const size_t covarianceMatrixSize, + ConstHandle2ShortRangeSelfScalingVariance *const shortRangeSelfScalingVariance, const size_t shortRangeSelfScalingVarianceSize, + ConstHandle2Sum *const sum, const size_t sumSize +) { + ConstHandle2Mixed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + std::vector{}, + std::vector{}, + std::vector{} + ); + for (size_t CovarianceMatrixN = 0; CovarianceMatrixN < covarianceMatrixSize; ++CovarianceMatrixN) + MixedCovarianceMatrixAdd(handle, covarianceMatrix[CovarianceMatrixN]); + for (size_t ShortRangeSelfScalingVarianceN = 0; ShortRangeSelfScalingVarianceN < shortRangeSelfScalingVarianceSize; ++ShortRangeSelfScalingVarianceN) + MixedShortRangeSelfScalingVarianceAdd(handle, shortRangeSelfScalingVariance[ShortRangeSelfScalingVarianceN]); + for (size_t SumN = 0; SumN < sumSize; ++SumN) + MixedSumAdd(handle, sum[SumN]); + return handle; +} + +// Create, general +Handle2Mixed +MixedCreate( + const XMLName label, + ConstHandle2CovarianceMatrix *const covarianceMatrix, const size_t covarianceMatrixSize, + ConstHandle2ShortRangeSelfScalingVariance *const shortRangeSelfScalingVariance, const size_t shortRangeSelfScalingVarianceSize, + ConstHandle2Sum *const sum, const size_t sumSize +) { + ConstHandle2Mixed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + std::vector{}, + std::vector{}, + std::vector{} + ); + for (size_t CovarianceMatrixN = 0; CovarianceMatrixN < covarianceMatrixSize; ++CovarianceMatrixN) + MixedCovarianceMatrixAdd(handle, covarianceMatrix[CovarianceMatrixN]); + for (size_t ShortRangeSelfScalingVarianceN = 0; ShortRangeSelfScalingVarianceN < shortRangeSelfScalingVarianceSize; ++ShortRangeSelfScalingVarianceN) + MixedShortRangeSelfScalingVarianceAdd(handle, shortRangeSelfScalingVariance[ShortRangeSelfScalingVarianceN]); + 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 +XMLName +MixedLabelGet(ConstHandle2ConstMixed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MixedLabelSet(ConstHandle2Mixed self, const XMLName 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); +} + +// Has, by label +int +MixedCovarianceMatrixHasByLabel( + ConstHandle2ConstMixed self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixHasByLabel", + self, extract::covarianceMatrix, meta::label, label); +} + +// Get, by label, const +Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByLabelConst( + ConstHandle2ConstMixed self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByLabelConst", + self, extract::covarianceMatrix, meta::label, label); +} + +// Get, by label, non-const +Handle2CovarianceMatrix +MixedCovarianceMatrixGetByLabel( + ConstHandle2Mixed self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByLabel", + self, extract::covarianceMatrix, meta::label, label); +} + +// Set, by label +void +MixedCovarianceMatrixSetByLabel( + ConstHandle2Mixed self, + const XMLName label, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixSetByLabel", + self, extract::covarianceMatrix, meta::label, label, covarianceMatrix); +} + +// Has, by productFrame +int +MixedCovarianceMatrixHasByProductFrame( + ConstHandle2ConstMixed self, + const enums::Frame productFrame +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixHasByProductFrame", + self, extract::covarianceMatrix, meta::productFrame, productFrame); +} + +// Get, by productFrame, const +Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByProductFrameConst( + ConstHandle2ConstMixed self, + const enums::Frame productFrame +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByProductFrameConst", + self, extract::covarianceMatrix, meta::productFrame, productFrame); +} + +// Get, by productFrame, non-const +Handle2CovarianceMatrix +MixedCovarianceMatrixGetByProductFrame( + ConstHandle2Mixed self, + const enums::Frame productFrame +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByProductFrame", + self, extract::covarianceMatrix, meta::productFrame, productFrame); +} + +// Set, by productFrame +void +MixedCovarianceMatrixSetByProductFrame( + ConstHandle2Mixed self, + const enums::Frame productFrame, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixSetByProductFrame", + self, extract::covarianceMatrix, meta::productFrame, productFrame, covarianceMatrix); +} + +// Has, by type +int +MixedCovarianceMatrixHasByType( + ConstHandle2ConstMixed self, + const XMLName type +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixHasByType", + self, extract::covarianceMatrix, meta::type, type); +} + +// Get, by type, const +Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByTypeConst( + ConstHandle2ConstMixed self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByTypeConst", + self, extract::covarianceMatrix, meta::type, type); +} + +// Get, by type, non-const +Handle2CovarianceMatrix +MixedCovarianceMatrixGetByType( + ConstHandle2Mixed self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByType", + self, extract::covarianceMatrix, meta::type, type); +} + +// Set, by type +void +MixedCovarianceMatrixSetByType( + ConstHandle2Mixed self, + const XMLName type, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixSetByType", + self, extract::covarianceMatrix, meta::type, type, covarianceMatrix); +} + + +// ----------------------------------------------------------------------------- +// Child: shortRangeSelfScalingVariance +// ----------------------------------------------------------------------------- + +// Has +int +MixedShortRangeSelfScalingVarianceHas(ConstHandle2ConstMixed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceHas", self, extract::shortRangeSelfScalingVariance); +} + +// Clear +void +MixedShortRangeSelfScalingVarianceClear(ConstHandle2Mixed self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceClear", self, extract::shortRangeSelfScalingVariance); +} + +// Size +size_t +MixedShortRangeSelfScalingVarianceSize(ConstHandle2ConstMixed self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceSize", self, extract::shortRangeSelfScalingVariance); +} + +// Add +void +MixedShortRangeSelfScalingVarianceAdd(ConstHandle2Mixed self, ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceAdd", self, extract::shortRangeSelfScalingVariance, shortRangeSelfScalingVariance); +} + +// Get, by index \in [0,size), const +Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetConst(ConstHandle2ConstMixed self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGetConst", self, extract::shortRangeSelfScalingVariance, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGet(ConstHandle2Mixed self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGet", self, extract::shortRangeSelfScalingVariance, index_); +} + +// Set, by index \in [0,size) +void +MixedShortRangeSelfScalingVarianceSet( + ConstHandle2Mixed self, + const size_t index_, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceSet", self, extract::shortRangeSelfScalingVariance, index_, shortRangeSelfScalingVariance); +} + +// Has, by dependenceOnProcessedGroupWidth +int +MixedShortRangeSelfScalingVarianceHasByDependenceOnProcessedGroupWidth( + ConstHandle2ConstMixed self, + const XMLName dependenceOnProcessedGroupWidth +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceHasByDependenceOnProcessedGroupWidth", + self, extract::shortRangeSelfScalingVariance, meta::dependenceOnProcessedGroupWidth, dependenceOnProcessedGroupWidth); +} + +// Get, by dependenceOnProcessedGroupWidth, const +Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByDependenceOnProcessedGroupWidthConst( + ConstHandle2ConstMixed self, + const XMLName dependenceOnProcessedGroupWidth +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGetByDependenceOnProcessedGroupWidthConst", + self, extract::shortRangeSelfScalingVariance, meta::dependenceOnProcessedGroupWidth, dependenceOnProcessedGroupWidth); +} + +// Get, by dependenceOnProcessedGroupWidth, non-const +Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByDependenceOnProcessedGroupWidth( + ConstHandle2Mixed self, + const XMLName dependenceOnProcessedGroupWidth +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGetByDependenceOnProcessedGroupWidth", + self, extract::shortRangeSelfScalingVariance, meta::dependenceOnProcessedGroupWidth, dependenceOnProcessedGroupWidth); +} + +// Set, by dependenceOnProcessedGroupWidth +void +MixedShortRangeSelfScalingVarianceSetByDependenceOnProcessedGroupWidth( + ConstHandle2Mixed self, + const XMLName dependenceOnProcessedGroupWidth, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceSetByDependenceOnProcessedGroupWidth", + self, extract::shortRangeSelfScalingVariance, meta::dependenceOnProcessedGroupWidth, dependenceOnProcessedGroupWidth, shortRangeSelfScalingVariance); +} + +// Has, by label +int +MixedShortRangeSelfScalingVarianceHasByLabel( + ConstHandle2ConstMixed self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceHasByLabel", + self, extract::shortRangeSelfScalingVariance, meta::label, label); +} + +// Get, by label, const +Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByLabelConst( + ConstHandle2ConstMixed self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGetByLabelConst", + self, extract::shortRangeSelfScalingVariance, meta::label, label); +} + +// Get, by label, non-const +Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByLabel( + ConstHandle2Mixed self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGetByLabel", + self, extract::shortRangeSelfScalingVariance, meta::label, label); +} + +// Set, by label +void +MixedShortRangeSelfScalingVarianceSetByLabel( + ConstHandle2Mixed self, + const XMLName label, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceSetByLabel", + self, extract::shortRangeSelfScalingVariance, meta::label, label, shortRangeSelfScalingVariance); +} + +// Has, by type +int +MixedShortRangeSelfScalingVarianceHasByType( + ConstHandle2ConstMixed self, + const XMLName type +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceHasByType", + self, extract::shortRangeSelfScalingVariance, meta::type, type); +} + +// Get, by type, const +Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByTypeConst( + ConstHandle2ConstMixed self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGetByTypeConst", + self, extract::shortRangeSelfScalingVariance, meta::type, type); +} + +// Get, by type, non-const +Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByType( + ConstHandle2Mixed self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGetByType", + self, extract::shortRangeSelfScalingVariance, meta::type, type); +} + +// Set, by type +void +MixedShortRangeSelfScalingVarianceSetByType( + ConstHandle2Mixed self, + const XMLName type, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceSetByType", + self, extract::shortRangeSelfScalingVariance, meta::type, type, shortRangeSelfScalingVariance); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + +// Has, by domainMin +int +MixedSumHasByDomainMin( + ConstHandle2ConstMixed self, + const Float64 domainMin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SumHasByDomainMin", + self, extract::sum, meta::domainMin, domainMin); +} + +// Get, by domainMin, const +Handle2ConstSum +MixedSumGetByDomainMinConst( + ConstHandle2ConstMixed self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainMinConst", + self, extract::sum, meta::domainMin, domainMin); +} + +// Get, by domainMin, non-const +Handle2Sum +MixedSumGetByDomainMin( + ConstHandle2Mixed self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainMin", + self, extract::sum, meta::domainMin, domainMin); +} + +// Set, by domainMin +void +MixedSumSetByDomainMin( + ConstHandle2Mixed self, + const Float64 domainMin, + ConstHandle2ConstSum sum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SumSetByDomainMin", + self, extract::sum, meta::domainMin, domainMin, sum); +} + +// Has, by domainMax +int +MixedSumHasByDomainMax( + ConstHandle2ConstMixed self, + const Float64 domainMax +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SumHasByDomainMax", + self, extract::sum, meta::domainMax, domainMax); +} + +// Get, by domainMax, const +Handle2ConstSum +MixedSumGetByDomainMaxConst( + ConstHandle2ConstMixed self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainMaxConst", + self, extract::sum, meta::domainMax, domainMax); +} + +// Get, by domainMax, non-const +Handle2Sum +MixedSumGetByDomainMax( + ConstHandle2Mixed self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainMax", + self, extract::sum, meta::domainMax, domainMax); +} + +// Set, by domainMax +void +MixedSumSetByDomainMax( + ConstHandle2Mixed self, + const Float64 domainMax, + ConstHandle2ConstSum sum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SumSetByDomainMax", + self, extract::sum, meta::domainMax, domainMax, sum); +} + +// Has, by domainUnit +int +MixedSumHasByDomainUnit( + ConstHandle2ConstMixed self, + const XMLName domainUnit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SumHasByDomainUnit", + self, extract::sum, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, const +Handle2ConstSum +MixedSumGetByDomainUnitConst( + ConstHandle2ConstMixed self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainUnitConst", + self, extract::sum, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, non-const +Handle2Sum +MixedSumGetByDomainUnit( + ConstHandle2Mixed self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainUnit", + self, extract::sum, meta::domainUnit, domainUnit); +} + +// Set, by domainUnit +void +MixedSumSetByDomainUnit( + ConstHandle2Mixed self, + const XMLName domainUnit, + ConstHandle2ConstSum sum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SumSetByDomainUnit", + self, extract::sum, meta::domainUnit, domainUnit, sum); +} + +// Has, by label +int +MixedSumHasByLabel( + ConstHandle2ConstMixed self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SumHasByLabel", + self, extract::sum, meta::label, label); +} + +// Get, by label, const +Handle2ConstSum +MixedSumGetByLabelConst( + ConstHandle2ConstMixed self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByLabelConst", + self, extract::sum, meta::label, label); +} + +// Get, by label, non-const +Handle2Sum +MixedSumGetByLabel( + ConstHandle2Mixed self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByLabel", + self, extract::sum, meta::label, label); +} + +// Set, by label +void +MixedSumSetByLabel( + ConstHandle2Mixed self, + const XMLName label, + ConstHandle2ConstSum sum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SumSetByLabel", + self, extract::sum, meta::label, label, sum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/Mixed/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed.h new file mode 100644 index 000000000..2be67654c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed.h @@ -0,0 +1,567 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COVARIANCE_MIXED +#define C_INTERFACE_TEST_V2_0_COVARIANCE_MIXED + +#include "GNDStk.h" +#include "v2.0/covariance/CovarianceMatrix.h" +#include "v2.0/covariance/ShortRangeSelfScalingVariance.h" +#include "v2.0/covariance/Sum.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 +extern_c Handle2Mixed +MixedDefault(); + +// --- Create, general, const +extern_c Handle2ConstMixed +MixedCreateConst( + const XMLName label, + ConstHandle2CovarianceMatrix *const covarianceMatrix, const size_t covarianceMatrixSize, + ConstHandle2ShortRangeSelfScalingVariance *const shortRangeSelfScalingVariance, const size_t shortRangeSelfScalingVarianceSize, + ConstHandle2Sum *const sum, const size_t sumSize +); + +// +++ Create, general +extern_c Handle2Mixed +MixedCreate( + const XMLName label, + ConstHandle2CovarianceMatrix *const covarianceMatrix, const size_t covarianceMatrixSize, + ConstHandle2ShortRangeSelfScalingVariance *const shortRangeSelfScalingVariance, const size_t shortRangeSelfScalingVarianceSize, + ConstHandle2Sum *const sum, const size_t sumSize +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +MixedLabelGet(ConstHandle2ConstMixed self); + +// +++ Set +extern_c void +MixedLabelSet(ConstHandle2Mixed self, const XMLName 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 +); + +// +++ Has, by label +extern_c int +MixedCovarianceMatrixHasByLabel( + ConstHandle2ConstMixed self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByLabelConst( + ConstHandle2ConstMixed self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2CovarianceMatrix +MixedCovarianceMatrixGetByLabel( + ConstHandle2Mixed self, + const XMLName label +); + +// +++ Set, by label +extern_c void +MixedCovarianceMatrixSetByLabel( + ConstHandle2Mixed self, + const XMLName label, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +); + +// +++ Has, by productFrame +extern_c int +MixedCovarianceMatrixHasByProductFrame( + ConstHandle2ConstMixed self, + const enums::Frame productFrame +); + +// --- Get, by productFrame, const +extern_c Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByProductFrameConst( + ConstHandle2ConstMixed self, + const enums::Frame productFrame +); + +// +++ Get, by productFrame, non-const +extern_c Handle2CovarianceMatrix +MixedCovarianceMatrixGetByProductFrame( + ConstHandle2Mixed self, + const enums::Frame productFrame +); + +// +++ Set, by productFrame +extern_c void +MixedCovarianceMatrixSetByProductFrame( + ConstHandle2Mixed self, + const enums::Frame productFrame, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +); + +// +++ Has, by type +extern_c int +MixedCovarianceMatrixHasByType( + ConstHandle2ConstMixed self, + const XMLName type +); + +// --- Get, by type, const +extern_c Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByTypeConst( + ConstHandle2ConstMixed self, + const XMLName type +); + +// +++ Get, by type, non-const +extern_c Handle2CovarianceMatrix +MixedCovarianceMatrixGetByType( + ConstHandle2Mixed self, + const XMLName type +); + +// +++ Set, by type +extern_c void +MixedCovarianceMatrixSetByType( + ConstHandle2Mixed self, + const XMLName type, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +); + + +// ----------------------------------------------------------------------------- +// Child: shortRangeSelfScalingVariance +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MixedShortRangeSelfScalingVarianceHas(ConstHandle2ConstMixed self); + +// +++ Clear +extern_c void +MixedShortRangeSelfScalingVarianceClear(ConstHandle2Mixed self); + +// +++ Size +extern_c size_t +MixedShortRangeSelfScalingVarianceSize(ConstHandle2ConstMixed self); + +// +++ Add +extern_c void +MixedShortRangeSelfScalingVarianceAdd(ConstHandle2Mixed self, ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetConst(ConstHandle2ConstMixed self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGet(ConstHandle2Mixed self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +MixedShortRangeSelfScalingVarianceSet( + ConstHandle2Mixed self, + const size_t index_, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +); + +// +++ Has, by dependenceOnProcessedGroupWidth +extern_c int +MixedShortRangeSelfScalingVarianceHasByDependenceOnProcessedGroupWidth( + ConstHandle2ConstMixed self, + const XMLName dependenceOnProcessedGroupWidth +); + +// --- Get, by dependenceOnProcessedGroupWidth, const +extern_c Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByDependenceOnProcessedGroupWidthConst( + ConstHandle2ConstMixed self, + const XMLName dependenceOnProcessedGroupWidth +); + +// +++ Get, by dependenceOnProcessedGroupWidth, non-const +extern_c Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByDependenceOnProcessedGroupWidth( + ConstHandle2Mixed self, + const XMLName dependenceOnProcessedGroupWidth +); + +// +++ Set, by dependenceOnProcessedGroupWidth +extern_c void +MixedShortRangeSelfScalingVarianceSetByDependenceOnProcessedGroupWidth( + ConstHandle2Mixed self, + const XMLName dependenceOnProcessedGroupWidth, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +); + +// +++ Has, by label +extern_c int +MixedShortRangeSelfScalingVarianceHasByLabel( + ConstHandle2ConstMixed self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByLabelConst( + ConstHandle2ConstMixed self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByLabel( + ConstHandle2Mixed self, + const XMLName label +); + +// +++ Set, by label +extern_c void +MixedShortRangeSelfScalingVarianceSetByLabel( + ConstHandle2Mixed self, + const XMLName label, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +); + +// +++ Has, by type +extern_c int +MixedShortRangeSelfScalingVarianceHasByType( + ConstHandle2ConstMixed self, + const XMLName type +); + +// --- Get, by type, const +extern_c Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByTypeConst( + ConstHandle2ConstMixed self, + const XMLName type +); + +// +++ Get, by type, non-const +extern_c Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetByType( + ConstHandle2Mixed self, + const XMLName type +); + +// +++ Set, by type +extern_c void +MixedShortRangeSelfScalingVarianceSetByType( + ConstHandle2Mixed self, + const XMLName type, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +); + + +// ----------------------------------------------------------------------------- +// 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 +); + +// +++ Has, by domainMin +extern_c int +MixedSumHasByDomainMin( + ConstHandle2ConstMixed self, + const Float64 domainMin +); + +// --- Get, by domainMin, const +extern_c Handle2ConstSum +MixedSumGetByDomainMinConst( + ConstHandle2ConstMixed self, + const Float64 domainMin +); + +// +++ Get, by domainMin, non-const +extern_c Handle2Sum +MixedSumGetByDomainMin( + ConstHandle2Mixed self, + const Float64 domainMin +); + +// +++ Set, by domainMin +extern_c void +MixedSumSetByDomainMin( + ConstHandle2Mixed self, + const Float64 domainMin, + ConstHandle2ConstSum sum +); + +// +++ Has, by domainMax +extern_c int +MixedSumHasByDomainMax( + ConstHandle2ConstMixed self, + const Float64 domainMax +); + +// --- Get, by domainMax, const +extern_c Handle2ConstSum +MixedSumGetByDomainMaxConst( + ConstHandle2ConstMixed self, + const Float64 domainMax +); + +// +++ Get, by domainMax, non-const +extern_c Handle2Sum +MixedSumGetByDomainMax( + ConstHandle2Mixed self, + const Float64 domainMax +); + +// +++ Set, by domainMax +extern_c void +MixedSumSetByDomainMax( + ConstHandle2Mixed self, + const Float64 domainMax, + ConstHandle2ConstSum sum +); + +// +++ Has, by domainUnit +extern_c int +MixedSumHasByDomainUnit( + ConstHandle2ConstMixed self, + const XMLName domainUnit +); + +// --- Get, by domainUnit, const +extern_c Handle2ConstSum +MixedSumGetByDomainUnitConst( + ConstHandle2ConstMixed self, + const XMLName domainUnit +); + +// +++ Get, by domainUnit, non-const +extern_c Handle2Sum +MixedSumGetByDomainUnit( + ConstHandle2Mixed self, + const XMLName domainUnit +); + +// +++ Set, by domainUnit +extern_c void +MixedSumSetByDomainUnit( + ConstHandle2Mixed self, + const XMLName domainUnit, + ConstHandle2ConstSum sum +); + +// +++ Has, by label +extern_c int +MixedSumHasByLabel( + ConstHandle2ConstMixed self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstSum +MixedSumGetByLabelConst( + ConstHandle2ConstMixed self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Sum +MixedSumGetByLabel( + ConstHandle2Mixed self, + const XMLName label +); + +// +++ Set, by label +extern_c void +MixedSumSetByLabel( + ConstHandle2Mixed self, + const XMLName label, + ConstHandle2ConstSum sum +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/Mixed/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Mixed/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance.cpp new file mode 100644 index 000000000..5f0a5c655 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance.cpp @@ -0,0 +1,380 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/ParameterCovariance.hpp" +#include "ParameterCovariance.h" + +using namespace njoy::GNDStk; +using namespace test::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 = covariance::RowData; +using CPPParameterCovarianceMatrix = covariance::ParameterCovarianceMatrix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameterCovariance +ParameterCovarianceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ParameterCovariance +ParameterCovarianceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParameterCovariance +ParameterCovarianceCreateConst( + const XMLName label, + ConstHandle2ConstRowData rowData, + ConstHandle2ParameterCovarianceMatrix *const parameterCovarianceMatrix, const size_t parameterCovarianceMatrixSize +) { + ConstHandle2ParameterCovariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(rowData), + std::vector{} + ); + for (size_t ParameterCovarianceMatrixN = 0; ParameterCovarianceMatrixN < parameterCovarianceMatrixSize; ++ParameterCovarianceMatrixN) + ParameterCovarianceParameterCovarianceMatrixAdd(handle, parameterCovarianceMatrix[ParameterCovarianceMatrixN]); + return handle; +} + +// Create, general +Handle2ParameterCovariance +ParameterCovarianceCreate( + const XMLName label, + ConstHandle2ConstRowData rowData, + ConstHandle2ParameterCovarianceMatrix *const parameterCovarianceMatrix, const size_t parameterCovarianceMatrixSize +) { + ConstHandle2ParameterCovariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(rowData), + std::vector{} + ); + for (size_t ParameterCovarianceMatrixN = 0; ParameterCovarianceMatrixN < parameterCovarianceMatrixSize; ++ParameterCovarianceMatrixN) + ParameterCovarianceParameterCovarianceMatrixAdd(handle, parameterCovarianceMatrix[ParameterCovarianceMatrixN]); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +ParameterCovarianceLabelGet(ConstHandle2ConstParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ParameterCovarianceLabelSet(ConstHandle2ParameterCovariance self, const XMLName 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); +} + +// Clear +void +ParameterCovarianceParameterCovarianceMatrixClear(ConstHandle2ParameterCovariance self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixClear", self, extract::parameterCovarianceMatrix); +} + +// Size +size_t +ParameterCovarianceParameterCovarianceMatrixSize(ConstHandle2ConstParameterCovariance self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixSize", self, extract::parameterCovarianceMatrix); +} + +// Add +void +ParameterCovarianceParameterCovarianceMatrixAdd(ConstHandle2ParameterCovariance self, ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixAdd", self, extract::parameterCovarianceMatrix, parameterCovarianceMatrix); +} + +// Get, by index \in [0,size), const +Handle2ConstParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetConst(ConstHandle2ConstParameterCovariance self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixGetConst", self, extract::parameterCovarianceMatrix, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGet(ConstHandle2ParameterCovariance self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixGet", self, extract::parameterCovarianceMatrix, index_); +} + +// Set, by index \in [0,size) +void +ParameterCovarianceParameterCovarianceMatrixSet( + ConstHandle2ParameterCovariance self, + const size_t index_, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixSet", self, extract::parameterCovarianceMatrix, index_, parameterCovarianceMatrix); +} + +// Has, by label +int +ParameterCovarianceParameterCovarianceMatrixHasByLabel( + ConstHandle2ConstParameterCovariance self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixHasByLabel", + self, extract::parameterCovarianceMatrix, meta::label, label); +} + +// Get, by label, const +Handle2ConstParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetByLabelConst( + ConstHandle2ConstParameterCovariance self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixGetByLabelConst", + self, extract::parameterCovarianceMatrix, meta::label, label); +} + +// Get, by label, non-const +Handle2ParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetByLabel( + ConstHandle2ParameterCovariance self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixGetByLabel", + self, extract::parameterCovarianceMatrix, meta::label, label); +} + +// Set, by label +void +ParameterCovarianceParameterCovarianceMatrixSetByLabel( + ConstHandle2ParameterCovariance self, + const XMLName label, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixSetByLabel", + self, extract::parameterCovarianceMatrix, meta::label, label, parameterCovarianceMatrix); +} + +// Has, by type +int +ParameterCovarianceParameterCovarianceMatrixHasByType( + ConstHandle2ConstParameterCovariance self, + const XMLName type +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixHasByType", + self, extract::parameterCovarianceMatrix, meta::type, type); +} + +// Get, by type, const +Handle2ConstParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetByTypeConst( + ConstHandle2ConstParameterCovariance self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixGetByTypeConst", + self, extract::parameterCovarianceMatrix, meta::type, type); +} + +// Get, by type, non-const +Handle2ParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetByType( + ConstHandle2ParameterCovariance self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixGetByType", + self, extract::parameterCovarianceMatrix, meta::type, type); +} + +// Set, by type +void +ParameterCovarianceParameterCovarianceMatrixSetByType( + ConstHandle2ParameterCovariance self, + const XMLName type, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixSetByType", + self, extract::parameterCovarianceMatrix, meta::type, type, parameterCovarianceMatrix); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ParameterCovariance/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance.h new file mode 100644 index 000000000..0a2da4faa --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance.h @@ -0,0 +1,279 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCE +#define C_INTERFACE_TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCE + +#include "GNDStk.h" +#include "v2.0/covariance/RowData.h" +#include "v2.0/covariance/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 +extern_c Handle2ParameterCovariance +ParameterCovarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameterCovariance +ParameterCovarianceCreateConst( + const XMLName label, + ConstHandle2ConstRowData rowData, + ConstHandle2ParameterCovarianceMatrix *const parameterCovarianceMatrix, const size_t parameterCovarianceMatrixSize +); + +// +++ Create, general +extern_c Handle2ParameterCovariance +ParameterCovarianceCreate( + const XMLName label, + ConstHandle2ConstRowData rowData, + ConstHandle2ParameterCovarianceMatrix *const parameterCovarianceMatrix, const size_t parameterCovarianceMatrixSize +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +ParameterCovarianceLabelGet(ConstHandle2ConstParameterCovariance self); + +// +++ Set +extern_c void +ParameterCovarianceLabelSet(ConstHandle2ParameterCovariance self, const XMLName 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); + +// +++ Clear +extern_c void +ParameterCovarianceParameterCovarianceMatrixClear(ConstHandle2ParameterCovariance self); + +// +++ Size +extern_c size_t +ParameterCovarianceParameterCovarianceMatrixSize(ConstHandle2ConstParameterCovariance self); + +// +++ Add +extern_c void +ParameterCovarianceParameterCovarianceMatrixAdd(ConstHandle2ParameterCovariance self, ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetConst(ConstHandle2ConstParameterCovariance self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGet(ConstHandle2ParameterCovariance self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ParameterCovarianceParameterCovarianceMatrixSet( + ConstHandle2ParameterCovariance self, + const size_t index_, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +); + +// +++ Has, by label +extern_c int +ParameterCovarianceParameterCovarianceMatrixHasByLabel( + ConstHandle2ConstParameterCovariance self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetByLabelConst( + ConstHandle2ConstParameterCovariance self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2ParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetByLabel( + ConstHandle2ParameterCovariance self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ParameterCovarianceParameterCovarianceMatrixSetByLabel( + ConstHandle2ParameterCovariance self, + const XMLName label, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +); + +// +++ Has, by type +extern_c int +ParameterCovarianceParameterCovarianceMatrixHasByType( + ConstHandle2ConstParameterCovariance self, + const XMLName type +); + +// --- Get, by type, const +extern_c Handle2ConstParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetByTypeConst( + ConstHandle2ConstParameterCovariance self, + const XMLName type +); + +// +++ Get, by type, non-const +extern_c Handle2ParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetByType( + ConstHandle2ParameterCovariance self, + const XMLName type +); + +// +++ Set, by type +extern_c void +ParameterCovarianceParameterCovarianceMatrixSetByType( + ConstHandle2ParameterCovariance self, + const XMLName type, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ParameterCovariance/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovarianceMatrix.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovarianceMatrix.cpp new file mode 100644 index 000000000..dd1551ae2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovarianceMatrix.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/ParameterCovarianceMatrix.hpp" +#include "ParameterCovarianceMatrix.h" + +using namespace njoy::GNDStk; +using namespace test::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 parameters = [](auto &obj) { return &obj.parameters; }; + static auto array = [](auto &obj) { return &obj.array; }; +} + +using CPPParameters = covariance::Parameters; +using CPPArray = containers::Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameterCovarianceMatrix +ParameterCovarianceMatrixDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ParameterCovarianceMatrix +ParameterCovarianceMatrixDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParameterCovarianceMatrix +ParameterCovarianceMatrixCreateConst( + const XMLName label, + const XMLName type, + ConstHandle2ConstParameters parameters, + ConstHandle2ConstArray array +) { + ConstHandle2ParameterCovarianceMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + type, + detail::tocpp(parameters), + detail::tocpp(array) + ); + return handle; +} + +// Create, general +Handle2ParameterCovarianceMatrix +ParameterCovarianceMatrixCreate( + const XMLName label, + const XMLName type, + ConstHandle2ConstParameters parameters, + ConstHandle2ConstArray array +) { + ConstHandle2ParameterCovarianceMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + type, + detail::tocpp(parameters), + 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 +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 +XMLName +ParameterCovarianceMatrixLabelGet(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ParameterCovarianceMatrixLabelSet(ConstHandle2ParameterCovarianceMatrix self, const XMLName 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 +XMLName +ParameterCovarianceMatrixTypeGet(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +ParameterCovarianceMatrixTypeSet(ConstHandle2ParameterCovarianceMatrix self, const XMLName type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ParameterCovarianceMatrix/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovarianceMatrix.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovarianceMatrix.h new file mode 100644 index 000000000..240d59f1e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/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_TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCEMATRIX +#define C_INTERFACE_TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCEMATRIX + +#include "GNDStk.h" +#include "v2.0/covariance/Parameters.h" +#include "v2.0/containers/Array.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 +extern_c Handle2ParameterCovarianceMatrix +ParameterCovarianceMatrixDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameterCovarianceMatrix +ParameterCovarianceMatrixCreateConst( + const XMLName label, + const XMLName type, + ConstHandle2ConstParameters parameters, + ConstHandle2ConstArray array +); + +// +++ Create, general +extern_c Handle2ParameterCovarianceMatrix +ParameterCovarianceMatrixCreate( + const XMLName label, + const XMLName type, + ConstHandle2ConstParameters parameters, + 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 +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 XMLName +ParameterCovarianceMatrixLabelGet(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Set +extern_c void +ParameterCovarianceMatrixLabelSet(ConstHandle2ParameterCovarianceMatrix self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovarianceMatrixTypeHas(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ParameterCovarianceMatrixTypeGet(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Set +extern_c void +ParameterCovarianceMatrixTypeSet(ConstHandle2ParameterCovarianceMatrix self, const XMLName type); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ParameterCovarianceMatrix/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovarianceMatrix/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovarianceMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovarianceMatrix/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovarianceMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances.cpp new file mode 100644 index 000000000..f8bf388ac --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances.cpp @@ -0,0 +1,421 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/ParameterCovariances.hpp" +#include "ParameterCovariances.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ParameterCovariancesClass; +using CPP = multigroup::ParameterCovariances; + +static const std::string CLASSNAME = "ParameterCovariances"; + +namespace extract { + static auto averageParameterCovariance = [](auto &obj) { return &obj.averageParameterCovariance; }; + static auto parameterCovariance = [](auto &obj) { return &obj.parameterCovariance; }; +} + +using CPPAverageParameterCovariance = covariance::AverageParameterCovariance; +using CPPParameterCovariance = covariance::ParameterCovariance; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameterCovariances +ParameterCovariancesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ParameterCovariances +ParameterCovariancesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParameterCovariances +ParameterCovariancesCreateConst( + ConstHandle2AverageParameterCovariance *const averageParameterCovariance, const size_t averageParameterCovarianceSize, + ConstHandle2ParameterCovariance *const parameterCovariance, const size_t parameterCovarianceSize +) { + ConstHandle2ParameterCovariances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{}, + std::vector{} + ); + for (size_t AverageParameterCovarianceN = 0; AverageParameterCovarianceN < averageParameterCovarianceSize; ++AverageParameterCovarianceN) + ParameterCovariancesAverageParameterCovarianceAdd(handle, averageParameterCovariance[AverageParameterCovarianceN]); + for (size_t ParameterCovarianceN = 0; ParameterCovarianceN < parameterCovarianceSize; ++ParameterCovarianceN) + ParameterCovariancesParameterCovarianceAdd(handle, parameterCovariance[ParameterCovarianceN]); + return handle; +} + +// Create, general +Handle2ParameterCovariances +ParameterCovariancesCreate( + ConstHandle2AverageParameterCovariance *const averageParameterCovariance, const size_t averageParameterCovarianceSize, + ConstHandle2ParameterCovariance *const parameterCovariance, const size_t parameterCovarianceSize +) { + ConstHandle2ParameterCovariances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{}, + std::vector{} + ); + for (size_t AverageParameterCovarianceN = 0; AverageParameterCovarianceN < averageParameterCovarianceSize; ++AverageParameterCovarianceN) + ParameterCovariancesAverageParameterCovarianceAdd(handle, averageParameterCovariance[AverageParameterCovarianceN]); + for (size_t ParameterCovarianceN = 0; ParameterCovarianceN < parameterCovarianceSize; ++ParameterCovarianceN) + ParameterCovariancesParameterCovarianceAdd(handle, parameterCovariance[ParameterCovarianceN]); + return handle; +} + +// Assign +// Use this to assign 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: 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); +} + +// 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); +} + +// Has, by label +int +ParameterCovariancesAverageParameterCovarianceHasByLabel( + ConstHandle2ConstParameterCovariances self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceHasByLabel", + self, extract::averageParameterCovariance, meta::label, label); +} + +// Get, by label, const +Handle2ConstAverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByLabelConst( + ConstHandle2ConstParameterCovariances self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceGetByLabelConst", + self, extract::averageParameterCovariance, meta::label, label); +} + +// Get, by label, non-const +Handle2AverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByLabel( + ConstHandle2ParameterCovariances self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceGetByLabel", + self, extract::averageParameterCovariance, meta::label, label); +} + +// Set, by label +void +ParameterCovariancesAverageParameterCovarianceSetByLabel( + ConstHandle2ParameterCovariances self, + const XMLName label, + ConstHandle2ConstAverageParameterCovariance averageParameterCovariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceSetByLabel", + self, extract::averageParameterCovariance, meta::label, label, averageParameterCovariance); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + +// Has, by label +int +ParameterCovariancesParameterCovarianceHasByLabel( + ConstHandle2ConstParameterCovariances self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceHasByLabel", + self, extract::parameterCovariance, meta::label, label); +} + +// Get, by label, const +Handle2ConstParameterCovariance +ParameterCovariancesParameterCovarianceGetByLabelConst( + ConstHandle2ConstParameterCovariances self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceGetByLabelConst", + self, extract::parameterCovariance, meta::label, label); +} + +// Get, by label, non-const +Handle2ParameterCovariance +ParameterCovariancesParameterCovarianceGetByLabel( + ConstHandle2ParameterCovariances self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceGetByLabel", + self, extract::parameterCovariance, meta::label, label); +} + +// Set, by label +void +ParameterCovariancesParameterCovarianceSetByLabel( + ConstHandle2ParameterCovariances self, + const XMLName label, + ConstHandle2ConstParameterCovariance parameterCovariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceSetByLabel", + self, extract::parameterCovariance, meta::label, label, parameterCovariance); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ParameterCovariances/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances.h new file mode 100644 index 000000000..07db89224 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances.h @@ -0,0 +1,304 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCES +#define C_INTERFACE_TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCES + +#include "GNDStk.h" +#include "v2.0/covariance/AverageParameterCovariance.h" +#include "v2.0/covariance/ParameterCovariance.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 +extern_c Handle2ParameterCovariances +ParameterCovariancesDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameterCovariances +ParameterCovariancesCreateConst( + ConstHandle2AverageParameterCovariance *const averageParameterCovariance, const size_t averageParameterCovarianceSize, + ConstHandle2ParameterCovariance *const parameterCovariance, const size_t parameterCovarianceSize +); + +// +++ Create, general +extern_c Handle2ParameterCovariances +ParameterCovariancesCreate( + ConstHandle2AverageParameterCovariance *const averageParameterCovariance, const size_t averageParameterCovarianceSize, + ConstHandle2ParameterCovariance *const parameterCovariance, const size_t parameterCovarianceSize +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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 +); + +// +++ 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 +); + +// +++ Has, by label +extern_c int +ParameterCovariancesAverageParameterCovarianceHasByLabel( + ConstHandle2ConstParameterCovariances self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstAverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByLabelConst( + ConstHandle2ConstParameterCovariances self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2AverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByLabel( + ConstHandle2ParameterCovariances self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ParameterCovariancesAverageParameterCovarianceSetByLabel( + ConstHandle2ParameterCovariances self, + const XMLName label, + ConstHandle2ConstAverageParameterCovariance averageParameterCovariance +); + + +// ----------------------------------------------------------------------------- +// 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 +); + +// +++ Has, by label +extern_c int +ParameterCovariancesParameterCovarianceHasByLabel( + ConstHandle2ConstParameterCovariances self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstParameterCovariance +ParameterCovariancesParameterCovarianceGetByLabelConst( + ConstHandle2ConstParameterCovariances self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2ParameterCovariance +ParameterCovariancesParameterCovarianceGetByLabel( + ConstHandle2ParameterCovariances self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ParameterCovariancesParameterCovarianceSetByLabel( + ConstHandle2ParameterCovariances self, + const XMLName label, + ConstHandle2ConstParameterCovariance parameterCovariance +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ParameterCovariances/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterCovariances/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterLink.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterLink.cpp new file mode 100644 index 000000000..ccf15fc11 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterLink.cpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/ParameterLink.hpp" +#include "ParameterLink.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ParameterLinkClass; +using CPP = multigroup::ParameterLink; + +static const std::string CLASSNAME = "ParameterLink"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto matrixStartIndex = [](auto &obj) { return &obj.matrixStartIndex; }; + static auto nParameters = [](auto &obj) { return &obj.nParameters; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameterLink +ParameterLinkDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ParameterLink +ParameterLinkDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParameterLink +ParameterLinkCreateConst( + const XMLName href, + const XMLName label, + const Integer32 matrixStartIndex, + const Integer32 nParameters +) { + ConstHandle2ParameterLink handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href, + label, + matrixStartIndex, + nParameters + ); + return handle; +} + +// Create, general +Handle2ParameterLink +ParameterLinkCreate( + const XMLName href, + const XMLName label, + const Integer32 matrixStartIndex, + const Integer32 nParameters +) { + ConstHandle2ParameterLink handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href, + label, + matrixStartIndex, + nParameters + ); + return handle; +} + +// Assign +// Use this to assign 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: href +// ----------------------------------------------------------------------------- + +// Has +int +ParameterLinkHrefHas(ConstHandle2ConstParameterLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +XMLName +ParameterLinkHrefGet(ConstHandle2ConstParameterLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ParameterLinkHrefSet(ConstHandle2ParameterLink self, const XMLName href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ParameterLinkLabelHas(ConstHandle2ConstParameterLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ParameterLinkLabelGet(ConstHandle2ConstParameterLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ParameterLinkLabelSet(ConstHandle2ParameterLink self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: matrixStartIndex +// ----------------------------------------------------------------------------- + +// Has +int +ParameterLinkMatrixStartIndexHas(ConstHandle2ConstParameterLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MatrixStartIndexHas", self, extract::matrixStartIndex); +} + +// Get +// Returns by value +Integer32 +ParameterLinkMatrixStartIndexGet(ConstHandle2ConstParameterLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MatrixStartIndexGet", self, extract::matrixStartIndex); +} + +// Set +void +ParameterLinkMatrixStartIndexSet(ConstHandle2ParameterLink self, const Integer32 matrixStartIndex) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MatrixStartIndexSet", self, extract::matrixStartIndex, matrixStartIndex); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: nParameters +// ----------------------------------------------------------------------------- + +// Has +int +ParameterLinkNParametersHas(ConstHandle2ConstParameterLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NParametersHas", self, extract::nParameters); +} + +// Get +// Returns by value +Integer32 +ParameterLinkNParametersGet(ConstHandle2ConstParameterLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NParametersGet", self, extract::nParameters); +} + +// Set +void +ParameterLinkNParametersSet(ConstHandle2ParameterLink self, const Integer32 nParameters) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NParametersSet", self, extract::nParameters, nParameters); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ParameterLink/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterLink.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterLink.h new file mode 100644 index 000000000..5baeb8951 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/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_TEST_V2_0_COVARIANCE_PARAMETERLINK +#define C_INTERFACE_TEST_V2_0_COVARIANCE_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 +extern_c Handle2ParameterLink +ParameterLinkDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameterLink +ParameterLinkCreateConst( + const XMLName href, + const XMLName label, + const Integer32 matrixStartIndex, + const Integer32 nParameters +); + +// +++ Create, general +extern_c Handle2ParameterLink +ParameterLinkCreate( + const XMLName href, + const XMLName label, + const Integer32 matrixStartIndex, + const Integer32 nParameters +); + +// +++ Assign +// +++ Use this to assign one handled 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: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterLinkHrefHas(ConstHandle2ConstParameterLink self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ParameterLinkHrefGet(ConstHandle2ConstParameterLink self); + +// +++ Set +extern_c void +ParameterLinkHrefSet(ConstHandle2ParameterLink self, const XMLName href); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterLinkLabelHas(ConstHandle2ConstParameterLink self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ParameterLinkLabelGet(ConstHandle2ConstParameterLink self); + +// +++ Set +extern_c void +ParameterLinkLabelSet(ConstHandle2ParameterLink self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: matrixStartIndex +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterLinkMatrixStartIndexHas(ConstHandle2ConstParameterLink self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ParameterLinkMatrixStartIndexGet(ConstHandle2ConstParameterLink self); + +// +++ Set +extern_c void +ParameterLinkMatrixStartIndexSet(ConstHandle2ParameterLink self, const Integer32 matrixStartIndex); + + +// ----------------------------------------------------------------------------- +// Metadatum: nParameters +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterLinkNParametersHas(ConstHandle2ConstParameterLink self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ParameterLinkNParametersGet(ConstHandle2ConstParameterLink self); + +// +++ Set +extern_c void +ParameterLinkNParametersSet(ConstHandle2ParameterLink self, const Integer32 nParameters); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/ParameterLink/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterLink/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterLink/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterLink/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ParameterLink/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters.cpp new file mode 100644 index 000000000..31946b6b2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/Parameters.hpp" +#include "Parameters.h" + +using namespace njoy::GNDStk; +using namespace test::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 = covariance::ParameterLink; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameters +ParametersDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by href +int +ParametersParameterLinkHasByHref( + ConstHandle2ConstParameters self, + const XMLName href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkHasByHref", + self, extract::parameterLink, meta::href, href); +} + +// Get, by href, const +Handle2ConstParameterLink +ParametersParameterLinkGetByHrefConst( + ConstHandle2ConstParameters self, + const XMLName href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByHrefConst", + self, extract::parameterLink, meta::href, href); +} + +// Get, by href, non-const +Handle2ParameterLink +ParametersParameterLinkGetByHref( + ConstHandle2Parameters self, + const XMLName href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByHref", + self, extract::parameterLink, meta::href, href); +} + +// Set, by href +void +ParametersParameterLinkSetByHref( + ConstHandle2Parameters self, + const XMLName href, + ConstHandle2ConstParameterLink parameterLink +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkSetByHref", + self, extract::parameterLink, meta::href, href, parameterLink); +} + +// Has, by label +int +ParametersParameterLinkHasByLabel( + ConstHandle2ConstParameters self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkHasByLabel", + self, extract::parameterLink, meta::label, label); +} + +// Get, by label, const +Handle2ConstParameterLink +ParametersParameterLinkGetByLabelConst( + ConstHandle2ConstParameters self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByLabelConst", + self, extract::parameterLink, meta::label, label); +} + +// Get, by label, non-const +Handle2ParameterLink +ParametersParameterLinkGetByLabel( + ConstHandle2Parameters self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByLabel", + self, extract::parameterLink, meta::label, label); +} + +// Set, by label +void +ParametersParameterLinkSetByLabel( + ConstHandle2Parameters self, + const XMLName label, + ConstHandle2ConstParameterLink parameterLink +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkSetByLabel", + self, extract::parameterLink, meta::label, label, parameterLink); +} + +// Has, by matrixStartIndex +int +ParametersParameterLinkHasByMatrixStartIndex( + ConstHandle2ConstParameters self, + const Integer32 matrixStartIndex +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkHasByMatrixStartIndex", + self, extract::parameterLink, meta::matrixStartIndex, matrixStartIndex); +} + +// Get, by matrixStartIndex, const +Handle2ConstParameterLink +ParametersParameterLinkGetByMatrixStartIndexConst( + ConstHandle2ConstParameters self, + const Integer32 matrixStartIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByMatrixStartIndexConst", + self, extract::parameterLink, meta::matrixStartIndex, matrixStartIndex); +} + +// Get, by matrixStartIndex, non-const +Handle2ParameterLink +ParametersParameterLinkGetByMatrixStartIndex( + ConstHandle2Parameters self, + const Integer32 matrixStartIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByMatrixStartIndex", + self, extract::parameterLink, meta::matrixStartIndex, matrixStartIndex); +} + +// Set, by matrixStartIndex +void +ParametersParameterLinkSetByMatrixStartIndex( + ConstHandle2Parameters self, + const Integer32 matrixStartIndex, + ConstHandle2ConstParameterLink parameterLink +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkSetByMatrixStartIndex", + self, extract::parameterLink, meta::matrixStartIndex, matrixStartIndex, parameterLink); +} + +// Has, by nParameters +int +ParametersParameterLinkHasByNParameters( + ConstHandle2ConstParameters self, + const Integer32 nParameters +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkHasByNParameters", + self, extract::parameterLink, meta::nParameters, nParameters); +} + +// Get, by nParameters, const +Handle2ConstParameterLink +ParametersParameterLinkGetByNParametersConst( + ConstHandle2ConstParameters self, + const Integer32 nParameters +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByNParametersConst", + self, extract::parameterLink, meta::nParameters, nParameters); +} + +// Get, by nParameters, non-const +Handle2ParameterLink +ParametersParameterLinkGetByNParameters( + ConstHandle2Parameters self, + const Integer32 nParameters +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByNParameters", + self, extract::parameterLink, meta::nParameters, nParameters); +} + +// Set, by nParameters +void +ParametersParameterLinkSetByNParameters( + ConstHandle2Parameters self, + const Integer32 nParameters, + ConstHandle2ConstParameterLink parameterLink +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkSetByNParameters", + self, extract::parameterLink, meta::nParameters, nParameters, parameterLink); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/Parameters/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters.h new file mode 100644 index 000000000..97ac6a2c1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters.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. +// +// 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_TEST_V2_0_COVARIANCE_PARAMETERS +#define C_INTERFACE_TEST_V2_0_COVARIANCE_PARAMETERS + +#include "GNDStk.h" +#include "v2.0/covariance/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 +extern_c Handle2Parameters +ParametersDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameters +ParametersCreateConst( + ConstHandle2ParameterLink *const parameterLink, const size_t parameterLinkSize +); + +// +++ Create, general +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 +); + +// +++ Has, by href +extern_c int +ParametersParameterLinkHasByHref( + ConstHandle2ConstParameters self, + const XMLName href +); + +// --- Get, by href, const +extern_c Handle2ConstParameterLink +ParametersParameterLinkGetByHrefConst( + ConstHandle2ConstParameters self, + const XMLName href +); + +// +++ Get, by href, non-const +extern_c Handle2ParameterLink +ParametersParameterLinkGetByHref( + ConstHandle2Parameters self, + const XMLName href +); + +// +++ Set, by href +extern_c void +ParametersParameterLinkSetByHref( + ConstHandle2Parameters self, + const XMLName href, + ConstHandle2ConstParameterLink parameterLink +); + +// +++ Has, by label +extern_c int +ParametersParameterLinkHasByLabel( + ConstHandle2ConstParameters self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstParameterLink +ParametersParameterLinkGetByLabelConst( + ConstHandle2ConstParameters self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2ParameterLink +ParametersParameterLinkGetByLabel( + ConstHandle2Parameters self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ParametersParameterLinkSetByLabel( + ConstHandle2Parameters self, + const XMLName label, + ConstHandle2ConstParameterLink parameterLink +); + +// +++ Has, by matrixStartIndex +extern_c int +ParametersParameterLinkHasByMatrixStartIndex( + ConstHandle2ConstParameters self, + const Integer32 matrixStartIndex +); + +// --- Get, by matrixStartIndex, const +extern_c Handle2ConstParameterLink +ParametersParameterLinkGetByMatrixStartIndexConst( + ConstHandle2ConstParameters self, + const Integer32 matrixStartIndex +); + +// +++ Get, by matrixStartIndex, non-const +extern_c Handle2ParameterLink +ParametersParameterLinkGetByMatrixStartIndex( + ConstHandle2Parameters self, + const Integer32 matrixStartIndex +); + +// +++ Set, by matrixStartIndex +extern_c void +ParametersParameterLinkSetByMatrixStartIndex( + ConstHandle2Parameters self, + const Integer32 matrixStartIndex, + ConstHandle2ConstParameterLink parameterLink +); + +// +++ Has, by nParameters +extern_c int +ParametersParameterLinkHasByNParameters( + ConstHandle2ConstParameters self, + const Integer32 nParameters +); + +// --- Get, by nParameters, const +extern_c Handle2ConstParameterLink +ParametersParameterLinkGetByNParametersConst( + ConstHandle2ConstParameters self, + const Integer32 nParameters +); + +// +++ Get, by nParameters, non-const +extern_c Handle2ParameterLink +ParametersParameterLinkGetByNParameters( + ConstHandle2Parameters self, + const Integer32 nParameters +); + +// +++ Set, by nParameters +extern_c void +ParametersParameterLinkSetByNParameters( + ConstHandle2Parameters self, + const Integer32 nParameters, + ConstHandle2ConstParameterLink parameterLink +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/Parameters/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Parameters/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/RowData.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowData.cpp new file mode 100644 index 000000000..021ec6cd3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowData.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/RowData.hpp" +#include "RowData.h" + +using namespace njoy::GNDStk; +using namespace test::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 href = [](auto &obj) { return &obj.href; }; + static auto dimension = [](auto &obj) { return &obj.dimension; }; + static auto slices = [](auto &obj) { return &obj.slices; }; +} + +using CPPSlices = covariance::Slices; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRowData +RowDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2RowData +RowDataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRowData +RowDataCreateConst( + const XMLName ENDF_MFMT, + const XMLName href, + const Integer32 dimension, + ConstHandle2ConstSlices slices +) { + ConstHandle2RowData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MFMT, + href, + dimension, + detail::tocpp(slices) + ); + return handle; +} + +// Create, general +Handle2RowData +RowDataCreate( + const XMLName ENDF_MFMT, + const XMLName href, + const Integer32 dimension, + ConstHandle2ConstSlices slices +) { + ConstHandle2RowData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MFMT, + href, + dimension, + 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 +XMLName +RowDataENDFMFMTGet(ConstHandle2ConstRowData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMFMTGet", self, extract::ENDF_MFMT); +} + +// Set +void +RowDataENDFMFMTSet(ConstHandle2RowData self, const XMLName ENDF_MFMT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMFMTSet", self, extract::ENDF_MFMT, ENDF_MFMT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +RowDataHrefHas(ConstHandle2ConstRowData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +XMLName +RowDataHrefGet(ConstHandle2ConstRowData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +RowDataHrefSet(ConstHandle2RowData self, const XMLName href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// Has +int +RowDataDimensionHas(ConstHandle2ConstRowData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DimensionHas", self, extract::dimension); +} + +// Get +// Returns by value +Integer32 +RowDataDimensionGet(ConstHandle2ConstRowData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DimensionGet", self, extract::dimension); +} + +// Set +void +RowDataDimensionSet(ConstHandle2RowData self, const Integer32 dimension) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DimensionSet", self, extract::dimension, dimension); +} + + +// ----------------------------------------------------------------------------- +// 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/covariance/RowData/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/RowData.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowData.h new file mode 100644 index 000000000..f56f69bb4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/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_TEST_V2_0_COVARIANCE_ROWDATA +#define C_INTERFACE_TEST_V2_0_COVARIANCE_ROWDATA + +#include "GNDStk.h" +#include "v2.0/covariance/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 +extern_c Handle2RowData +RowDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstRowData +RowDataCreateConst( + const XMLName ENDF_MFMT, + const XMLName href, + const Integer32 dimension, + ConstHandle2ConstSlices slices +); + +// +++ Create, general +extern_c Handle2RowData +RowDataCreate( + const XMLName ENDF_MFMT, + const XMLName href, + const Integer32 dimension, + 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 XMLName +RowDataENDFMFMTGet(ConstHandle2ConstRowData self); + +// +++ Set +extern_c void +RowDataENDFMFMTSet(ConstHandle2RowData self, const XMLName ENDF_MFMT); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RowDataHrefHas(ConstHandle2ConstRowData self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +RowDataHrefGet(ConstHandle2ConstRowData self); + +// +++ Set +extern_c void +RowDataHrefSet(ConstHandle2RowData self, const XMLName href); + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RowDataDimensionHas(ConstHandle2ConstRowData self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +RowDataDimensionGet(ConstHandle2ConstRowData self); + +// +++ Set +extern_c void +RowDataDimensionSet(ConstHandle2RowData self, const Integer32 dimension); + + +// ----------------------------------------------------------------------------- +// 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/covariance/RowData/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/RowData/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/RowData/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity.cpp new file mode 100644 index 000000000..78de116ee --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/RowSensitivity.hpp" +#include "RowSensitivity.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = RowSensitivityClass; +using CPP = multigroup::RowSensitivity; + +static const std::string CLASSNAME = "RowSensitivity"; + +namespace extract { + static auto array = [](auto &obj) { return &obj.array; }; +} + +using CPPArray = containers::Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRowSensitivity +RowSensitivityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2RowSensitivity +RowSensitivityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRowSensitivity +RowSensitivityCreateConst( + ConstHandle2ConstArray array +) { + ConstHandle2RowSensitivity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(array) + ); + return handle; +} + +// Create, general +Handle2RowSensitivity +RowSensitivityCreate( + ConstHandle2ConstArray array +) { + ConstHandle2RowSensitivity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + 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 +RowSensitivityAssign(ConstHandle2RowSensitivity self, ConstHandle2ConstRowSensitivity from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RowSensitivityDelete(ConstHandle2ConstRowSensitivity self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RowSensitivityRead(ConstHandle2RowSensitivity self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RowSensitivityWrite(ConstHandle2ConstRowSensitivity self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RowSensitivityPrint(ConstHandle2ConstRowSensitivity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RowSensitivityPrintXML(ConstHandle2ConstRowSensitivity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RowSensitivityPrintJSON(ConstHandle2ConstRowSensitivity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// Has +int +RowSensitivityArrayHas(ConstHandle2ConstRowSensitivity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ArrayHas", self, extract::array); +} + +// Get, const +Handle2ConstArray +RowSensitivityArrayGetConst(ConstHandle2ConstRowSensitivity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGetConst", self, extract::array); +} + +// Get, non-const +Handle2Array +RowSensitivityArrayGet(ConstHandle2RowSensitivity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGet", self, extract::array); +} + +// Set +void +RowSensitivityArraySet(ConstHandle2RowSensitivity self, ConstHandle2ConstArray array) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ArraySet", self, extract::array, array); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/RowSensitivity/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity.h new file mode 100644 index 000000000..e85e7bb71 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity.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. +// +// RowSensitivity is the basic handle type in this file. Example: +// // Create a default RowSensitivity object: +// RowSensitivity handle = RowSensitivityDefault(); +// Functions involving RowSensitivity are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_COVARIANCE_ROWSENSITIVITY +#define C_INTERFACE_TEST_V2_0_COVARIANCE_ROWSENSITIVITY + +#include "GNDStk.h" +#include "v2.0/containers/Array.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RowSensitivityClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ RowSensitivity +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RowSensitivityClass *RowSensitivity; + +// --- Const-aware handles. +typedef const struct RowSensitivityClass *const ConstHandle2ConstRowSensitivity; +typedef struct RowSensitivityClass *const ConstHandle2RowSensitivity; +typedef const struct RowSensitivityClass * Handle2ConstRowSensitivity; +typedef struct RowSensitivityClass * Handle2RowSensitivity; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRowSensitivity +RowSensitivityDefaultConst(); + +// +++ Create, default +extern_c Handle2RowSensitivity +RowSensitivityDefault(); + +// --- Create, general, const +extern_c Handle2ConstRowSensitivity +RowSensitivityCreateConst( + ConstHandle2ConstArray array +); + +// +++ Create, general +extern_c Handle2RowSensitivity +RowSensitivityCreate( + 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 +RowSensitivityAssign(ConstHandle2RowSensitivity self, ConstHandle2ConstRowSensitivity from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RowSensitivityDelete(ConstHandle2ConstRowSensitivity self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RowSensitivityRead(ConstHandle2RowSensitivity self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RowSensitivityWrite(ConstHandle2ConstRowSensitivity self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RowSensitivityPrint(ConstHandle2ConstRowSensitivity self); + +// +++ Print to standard output, as XML +extern_c int +RowSensitivityPrintXML(ConstHandle2ConstRowSensitivity self); + +// +++ Print to standard output, as JSON +extern_c int +RowSensitivityPrintJSON(ConstHandle2ConstRowSensitivity self); + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RowSensitivityArrayHas(ConstHandle2ConstRowSensitivity self); + +// --- Get, const +extern_c Handle2ConstArray +RowSensitivityArrayGetConst(ConstHandle2ConstRowSensitivity self); + +// +++ Get, non-const +extern_c Handle2Array +RowSensitivityArrayGet(ConstHandle2RowSensitivity self); + +// +++ Set +extern_c void +RowSensitivityArraySet(ConstHandle2RowSensitivity self, ConstHandle2ConstArray array); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/RowSensitivity/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/RowSensitivity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct.cpp new file mode 100644 index 000000000..82e2ce4a8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/SandwichProduct.hpp" +#include "SandwichProduct.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = SandwichProductClass; +using CPP = multigroup::SandwichProduct; + +static const std::string CLASSNAME = "SandwichProduct"; + +namespace extract { + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto covariance = [](auto &obj) { return &obj.covariance; }; + static auto rowSensitivity = [](auto &obj) { return &obj.rowSensitivity; }; + static auto columnSensitivity = [](auto &obj) { return &obj.columnSensitivity; }; +} + +using CPPAxes = containers::Axes; +using CPPCovariance = covariance::Covariance; +using CPPRowSensitivity = covariance::RowSensitivity; +using CPPColumnSensitivity = covariance::ColumnSensitivity; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSandwichProduct +SandwichProductDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2SandwichProduct +SandwichProductDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSandwichProduct +SandwichProductCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstRowSensitivity rowSensitivity, + ConstHandle2ConstColumnSensitivity columnSensitivity +) { + ConstHandle2SandwichProduct handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(axes), + detail::tocpp(covariance), + detail::tocpp(rowSensitivity), + detail::tocpp(columnSensitivity) + ); + return handle; +} + +// Create, general +Handle2SandwichProduct +SandwichProductCreate( + ConstHandle2ConstAxes axes, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstRowSensitivity rowSensitivity, + ConstHandle2ConstColumnSensitivity columnSensitivity +) { + ConstHandle2SandwichProduct handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(axes), + detail::tocpp(covariance), + detail::tocpp(rowSensitivity), + detail::tocpp(columnSensitivity) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SandwichProductAssign(ConstHandle2SandwichProduct self, ConstHandle2ConstSandwichProduct from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SandwichProductDelete(ConstHandle2ConstSandwichProduct self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SandwichProductRead(ConstHandle2SandwichProduct self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SandwichProductWrite(ConstHandle2ConstSandwichProduct self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SandwichProductPrint(ConstHandle2ConstSandwichProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SandwichProductPrintXML(ConstHandle2ConstSandwichProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SandwichProductPrintJSON(ConstHandle2ConstSandwichProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +SandwichProductAxesHas(ConstHandle2ConstSandwichProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +SandwichProductAxesGetConst(ConstHandle2ConstSandwichProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +SandwichProductAxesGet(ConstHandle2SandwichProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +SandwichProductAxesSet(ConstHandle2SandwichProduct self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: covariance +// ----------------------------------------------------------------------------- + +// Has +int +SandwichProductCovarianceHas(ConstHandle2ConstSandwichProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CovarianceHas", self, extract::covariance); +} + +// Get, const +Handle2ConstCovariance +SandwichProductCovarianceGetConst(ConstHandle2ConstSandwichProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceGetConst", self, extract::covariance); +} + +// Get, non-const +Handle2Covariance +SandwichProductCovarianceGet(ConstHandle2SandwichProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceGet", self, extract::covariance); +} + +// Set +void +SandwichProductCovarianceSet(ConstHandle2SandwichProduct self, ConstHandle2ConstCovariance covariance) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CovarianceSet", self, extract::covariance, covariance); +} + + +// ----------------------------------------------------------------------------- +// Child: rowSensitivity +// ----------------------------------------------------------------------------- + +// Has +int +SandwichProductRowSensitivityHas(ConstHandle2ConstSandwichProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RowSensitivityHas", self, extract::rowSensitivity); +} + +// Get, const +Handle2ConstRowSensitivity +SandwichProductRowSensitivityGetConst(ConstHandle2ConstSandwichProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowSensitivityGetConst", self, extract::rowSensitivity); +} + +// Get, non-const +Handle2RowSensitivity +SandwichProductRowSensitivityGet(ConstHandle2SandwichProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowSensitivityGet", self, extract::rowSensitivity); +} + +// Set +void +SandwichProductRowSensitivitySet(ConstHandle2SandwichProduct self, ConstHandle2ConstRowSensitivity rowSensitivity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RowSensitivitySet", self, extract::rowSensitivity, rowSensitivity); +} + + +// ----------------------------------------------------------------------------- +// Child: columnSensitivity +// ----------------------------------------------------------------------------- + +// Has +int +SandwichProductColumnSensitivityHas(ConstHandle2ConstSandwichProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ColumnSensitivityHas", self, extract::columnSensitivity); +} + +// Get, const +Handle2ConstColumnSensitivity +SandwichProductColumnSensitivityGetConst(ConstHandle2ConstSandwichProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnSensitivityGetConst", self, extract::columnSensitivity); +} + +// Get, non-const +Handle2ColumnSensitivity +SandwichProductColumnSensitivityGet(ConstHandle2SandwichProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnSensitivityGet", self, extract::columnSensitivity); +} + +// Set +void +SandwichProductColumnSensitivitySet(ConstHandle2SandwichProduct self, ConstHandle2ConstColumnSensitivity columnSensitivity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ColumnSensitivitySet", self, extract::columnSensitivity, columnSensitivity); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/SandwichProduct/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct.h new file mode 100644 index 000000000..8a26ab881 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct.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. +// +// SandwichProduct is the basic handle type in this file. Example: +// // Create a default SandwichProduct object: +// SandwichProduct handle = SandwichProductDefault(); +// Functions involving SandwichProduct are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_COVARIANCE_SANDWICHPRODUCT +#define C_INTERFACE_TEST_V2_0_COVARIANCE_SANDWICHPRODUCT + +#include "GNDStk.h" +#include "v2.0/containers/Axes.h" +#include "v2.0/covariance/Covariance.h" +#include "v2.0/covariance/RowSensitivity.h" +#include "v2.0/covariance/ColumnSensitivity.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SandwichProductClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ SandwichProduct +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SandwichProductClass *SandwichProduct; + +// --- Const-aware handles. +typedef const struct SandwichProductClass *const ConstHandle2ConstSandwichProduct; +typedef struct SandwichProductClass *const ConstHandle2SandwichProduct; +typedef const struct SandwichProductClass * Handle2ConstSandwichProduct; +typedef struct SandwichProductClass * Handle2SandwichProduct; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSandwichProduct +SandwichProductDefaultConst(); + +// +++ Create, default +extern_c Handle2SandwichProduct +SandwichProductDefault(); + +// --- Create, general, const +extern_c Handle2ConstSandwichProduct +SandwichProductCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstRowSensitivity rowSensitivity, + ConstHandle2ConstColumnSensitivity columnSensitivity +); + +// +++ Create, general +extern_c Handle2SandwichProduct +SandwichProductCreate( + ConstHandle2ConstAxes axes, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstRowSensitivity rowSensitivity, + ConstHandle2ConstColumnSensitivity columnSensitivity +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SandwichProductAssign(ConstHandle2SandwichProduct self, ConstHandle2ConstSandwichProduct from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SandwichProductDelete(ConstHandle2ConstSandwichProduct self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SandwichProductRead(ConstHandle2SandwichProduct self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SandwichProductWrite(ConstHandle2ConstSandwichProduct self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SandwichProductPrint(ConstHandle2ConstSandwichProduct self); + +// +++ Print to standard output, as XML +extern_c int +SandwichProductPrintXML(ConstHandle2ConstSandwichProduct self); + +// +++ Print to standard output, as JSON +extern_c int +SandwichProductPrintJSON(ConstHandle2ConstSandwichProduct self); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SandwichProductAxesHas(ConstHandle2ConstSandwichProduct self); + +// --- Get, const +extern_c Handle2ConstAxes +SandwichProductAxesGetConst(ConstHandle2ConstSandwichProduct self); + +// +++ Get, non-const +extern_c Handle2Axes +SandwichProductAxesGet(ConstHandle2SandwichProduct self); + +// +++ Set +extern_c void +SandwichProductAxesSet(ConstHandle2SandwichProduct self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: covariance +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SandwichProductCovarianceHas(ConstHandle2ConstSandwichProduct self); + +// --- Get, const +extern_c Handle2ConstCovariance +SandwichProductCovarianceGetConst(ConstHandle2ConstSandwichProduct self); + +// +++ Get, non-const +extern_c Handle2Covariance +SandwichProductCovarianceGet(ConstHandle2SandwichProduct self); + +// +++ Set +extern_c void +SandwichProductCovarianceSet(ConstHandle2SandwichProduct self, ConstHandle2ConstCovariance covariance); + + +// ----------------------------------------------------------------------------- +// Child: rowSensitivity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SandwichProductRowSensitivityHas(ConstHandle2ConstSandwichProduct self); + +// --- Get, const +extern_c Handle2ConstRowSensitivity +SandwichProductRowSensitivityGetConst(ConstHandle2ConstSandwichProduct self); + +// +++ Get, non-const +extern_c Handle2RowSensitivity +SandwichProductRowSensitivityGet(ConstHandle2SandwichProduct self); + +// +++ Set +extern_c void +SandwichProductRowSensitivitySet(ConstHandle2SandwichProduct self, ConstHandle2ConstRowSensitivity rowSensitivity); + + +// ----------------------------------------------------------------------------- +// Child: columnSensitivity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SandwichProductColumnSensitivityHas(ConstHandle2ConstSandwichProduct self); + +// --- Get, const +extern_c Handle2ConstColumnSensitivity +SandwichProductColumnSensitivityGetConst(ConstHandle2ConstSandwichProduct self); + +// +++ Get, non-const +extern_c Handle2ColumnSensitivity +SandwichProductColumnSensitivityGet(ConstHandle2SandwichProduct self); + +// +++ Set +extern_c void +SandwichProductColumnSensitivitySet(ConstHandle2SandwichProduct self, ConstHandle2ConstColumnSensitivity columnSensitivity); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/SandwichProduct/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/SandwichProduct/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ShortRangeSelfScalingVariance.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ShortRangeSelfScalingVariance.cpp new file mode 100644 index 000000000..9c1e92bb0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/ShortRangeSelfScalingVariance.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/ShortRangeSelfScalingVariance.hpp" +#include "ShortRangeSelfScalingVariance.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ShortRangeSelfScalingVarianceClass; +using CPP = multigroup::ShortRangeSelfScalingVariance; + +static const std::string CLASSNAME = "ShortRangeSelfScalingVariance"; + +namespace extract { + static auto dependenceOnProcessedGroupWidth = [](auto &obj) { return &obj.dependenceOnProcessedGroupWidth; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto type = [](auto &obj) { return &obj.type; }; + static auto gridded2d = [](auto &obj) { return &obj.gridded2d; }; +} + +using CPPGridded2d = containers::Gridded2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceCreateConst( + const XMLName dependenceOnProcessedGroupWidth, + const XMLName label, + const XMLName type, + ConstHandle2ConstGridded2d gridded2d +) { + ConstHandle2ShortRangeSelfScalingVariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + dependenceOnProcessedGroupWidth, + label, + type, + detail::tocpp(gridded2d) + ); + return handle; +} + +// Create, general +Handle2ShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceCreate( + const XMLName dependenceOnProcessedGroupWidth, + const XMLName label, + const XMLName type, + ConstHandle2ConstGridded2d gridded2d +) { + ConstHandle2ShortRangeSelfScalingVariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + dependenceOnProcessedGroupWidth, + label, + type, + 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: dependenceOnProcessedGroupWidth +// ----------------------------------------------------------------------------- + +// Has +int +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthHas(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DependenceOnProcessedGroupWidthHas", self, extract::dependenceOnProcessedGroupWidth); +} + +// Get +// Returns by value +XMLName +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthGet(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DependenceOnProcessedGroupWidthGet", self, extract::dependenceOnProcessedGroupWidth); +} + +// Set +void +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthSet(ConstHandle2ShortRangeSelfScalingVariance self, const XMLName dependenceOnProcessedGroupWidth) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DependenceOnProcessedGroupWidthSet", self, extract::dependenceOnProcessedGroupWidth, dependenceOnProcessedGroupWidth); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ShortRangeSelfScalingVarianceLabelHas(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ShortRangeSelfScalingVarianceLabelGet(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ShortRangeSelfScalingVarianceLabelSet(ConstHandle2ShortRangeSelfScalingVariance self, const XMLName 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 +XMLName +ShortRangeSelfScalingVarianceTypeGet(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +ShortRangeSelfScalingVarianceTypeSet(ConstHandle2ShortRangeSelfScalingVariance self, const XMLName type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// 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/covariance/ShortRangeSelfScalingVariance/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ShortRangeSelfScalingVariance.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ShortRangeSelfScalingVariance.h new file mode 100644 index 000000000..f77d8a7a7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/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_TEST_V2_0_COVARIANCE_SHORTRANGESELFSCALINGVARIANCE +#define C_INTERFACE_TEST_V2_0_COVARIANCE_SHORTRANGESELFSCALINGVARIANCE + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2ShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceCreateConst( + const XMLName dependenceOnProcessedGroupWidth, + const XMLName label, + const XMLName type, + ConstHandle2ConstGridded2d gridded2d +); + +// +++ Create, general +extern_c Handle2ShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceCreate( + const XMLName dependenceOnProcessedGroupWidth, + const XMLName label, + const XMLName type, + 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: dependenceOnProcessedGroupWidth +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthHas(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthGet(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Set +extern_c void +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthSet(ConstHandle2ShortRangeSelfScalingVariance self, const XMLName dependenceOnProcessedGroupWidth); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShortRangeSelfScalingVarianceLabelHas(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ShortRangeSelfScalingVarianceLabelGet(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Set +extern_c void +ShortRangeSelfScalingVarianceLabelSet(ConstHandle2ShortRangeSelfScalingVariance self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShortRangeSelfScalingVarianceTypeHas(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ShortRangeSelfScalingVarianceTypeGet(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Set +extern_c void +ShortRangeSelfScalingVarianceTypeSet(ConstHandle2ShortRangeSelfScalingVariance self, const XMLName type); + + +// ----------------------------------------------------------------------------- +// 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/covariance/ShortRangeSelfScalingVariance/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ShortRangeSelfScalingVariance/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/ShortRangeSelfScalingVariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/ShortRangeSelfScalingVariance/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/ShortRangeSelfScalingVariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Slice.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slice.cpp new file mode 100644 index 000000000..3223b5b91 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slice.cpp @@ -0,0 +1,312 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/Slice.hpp" +#include "Slice.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = SliceClass; +using CPP = multigroup::Slice; + +static const std::string CLASSNAME = "Slice"; + +namespace extract { + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto domainValue = [](auto &obj) { return &obj.domainValue; }; + static auto domainUnit = [](auto &obj) { return &obj.domainUnit; }; + static auto dimension = [](auto &obj) { return &obj.dimension; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSlice +SliceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Slice +SliceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSlice +SliceCreateConst( + const Float64 domainMin, + const Float64 domainMax, + const Float64 domainValue, + const XMLName domainUnit, + const Integer32 dimension +) { + ConstHandle2Slice handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + domainMin, + domainMax, + domainValue, + domainUnit, + dimension + ); + return handle; +} + +// Create, general +Handle2Slice +SliceCreate( + const Float64 domainMin, + const Float64 domainMax, + const Float64 domainValue, + const XMLName domainUnit, + const Integer32 dimension +) { + ConstHandle2Slice handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + domainMin, + domainMax, + domainValue, + domainUnit, + dimension + ); + return handle; +} + +// Assign +// Use this to assign 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: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +SliceDomainMinHas(ConstHandle2ConstSlice self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +Float64 +SliceDomainMinGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +SliceDomainMinSet(ConstHandle2Slice self, const Float64 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 +Float64 +SliceDomainMaxGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +SliceDomainMaxSet(ConstHandle2Slice self, const Float64 domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainValue +// ----------------------------------------------------------------------------- + +// Has +int +SliceDomainValueHas(ConstHandle2ConstSlice self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainValueHas", self, extract::domainValue); +} + +// Get +// Returns by value +Float64 +SliceDomainValueGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainValueGet", self, extract::domainValue); +} + +// Set +void +SliceDomainValueSet(ConstHandle2Slice self, const Float64 domainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainValueSet", self, extract::domainValue, domainValue); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// Has +int +SliceDomainUnitHas(ConstHandle2ConstSlice self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainUnitHas", self, extract::domainUnit); +} + +// Get +// Returns by value +XMLName +SliceDomainUnitGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainUnitGet", self, extract::domainUnit); +} + +// Set +void +SliceDomainUnitSet(ConstHandle2Slice self, const XMLName domainUnit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainUnitSet", self, extract::domainUnit, domainUnit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// Has +int +SliceDimensionHas(ConstHandle2ConstSlice self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DimensionHas", self, extract::dimension); +} + +// Get +// Returns by value +Integer32 +SliceDimensionGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DimensionGet", self, extract::dimension); +} + +// Set +void +SliceDimensionSet(ConstHandle2Slice self, const Integer32 dimension) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DimensionSet", self, extract::dimension, dimension); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/Slice/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Slice.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slice.h new file mode 100644 index 000000000..c5afe8184 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/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_TEST_V2_0_COVARIANCE_SLICE +#define C_INTERFACE_TEST_V2_0_COVARIANCE_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 +extern_c Handle2Slice +SliceDefault(); + +// --- Create, general, const +extern_c Handle2ConstSlice +SliceCreateConst( + const Float64 domainMin, + const Float64 domainMax, + const Float64 domainValue, + const XMLName domainUnit, + const Integer32 dimension +); + +// +++ Create, general +extern_c Handle2Slice +SliceCreate( + const Float64 domainMin, + const Float64 domainMax, + const Float64 domainValue, + const XMLName domainUnit, + const Integer32 dimension +); + +// +++ Assign +// +++ Use this to assign one handled 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: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDomainMinHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +SliceDomainMinGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDomainMinSet(ConstHandle2Slice self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDomainMaxHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +SliceDomainMaxGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDomainMaxSet(ConstHandle2Slice self, const Float64 domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDomainValueHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +SliceDomainValueGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDomainValueSet(ConstHandle2Slice self, const Float64 domainValue); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDomainUnitHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SliceDomainUnitGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDomainUnitSet(ConstHandle2Slice self, const XMLName domainUnit); + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDimensionHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +SliceDimensionGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDimensionSet(ConstHandle2Slice self, const Integer32 dimension); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/Slice/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Slice/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slice/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Slice/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slice/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices.cpp new file mode 100644 index 000000000..8c9c85fbc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices.cpp @@ -0,0 +1,437 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/Slices.hpp" +#include "Slices.h" + +using namespace njoy::GNDStk; +using namespace test::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 = covariance::Slice; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSlices +SlicesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by domainMin +int +SlicesSliceHasByDomainMin( + ConstHandle2ConstSlices self, + const Float64 domainMin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDomainMin", + self, extract::slice, meta::domainMin, domainMin); +} + +// Get, by domainMin, const +Handle2ConstSlice +SlicesSliceGetByDomainMinConst( + ConstHandle2ConstSlices self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainMinConst", + self, extract::slice, meta::domainMin, domainMin); +} + +// Get, by domainMin, non-const +Handle2Slice +SlicesSliceGetByDomainMin( + ConstHandle2Slices self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainMin", + self, extract::slice, meta::domainMin, domainMin); +} + +// Set, by domainMin +void +SlicesSliceSetByDomainMin( + ConstHandle2Slices self, + const Float64 domainMin, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDomainMin", + self, extract::slice, meta::domainMin, domainMin, slice); +} + +// Has, by domainMax +int +SlicesSliceHasByDomainMax( + ConstHandle2ConstSlices self, + const Float64 domainMax +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDomainMax", + self, extract::slice, meta::domainMax, domainMax); +} + +// Get, by domainMax, const +Handle2ConstSlice +SlicesSliceGetByDomainMaxConst( + ConstHandle2ConstSlices self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainMaxConst", + self, extract::slice, meta::domainMax, domainMax); +} + +// Get, by domainMax, non-const +Handle2Slice +SlicesSliceGetByDomainMax( + ConstHandle2Slices self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainMax", + self, extract::slice, meta::domainMax, domainMax); +} + +// Set, by domainMax +void +SlicesSliceSetByDomainMax( + ConstHandle2Slices self, + const Float64 domainMax, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDomainMax", + self, extract::slice, meta::domainMax, domainMax, slice); +} + +// Has, by domainValue +int +SlicesSliceHasByDomainValue( + ConstHandle2ConstSlices self, + const Float64 domainValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDomainValue", + self, extract::slice, meta::domainValue, domainValue); +} + +// Get, by domainValue, const +Handle2ConstSlice +SlicesSliceGetByDomainValueConst( + ConstHandle2ConstSlices self, + const Float64 domainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainValueConst", + self, extract::slice, meta::domainValue, domainValue); +} + +// Get, by domainValue, non-const +Handle2Slice +SlicesSliceGetByDomainValue( + ConstHandle2Slices self, + const Float64 domainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainValue", + self, extract::slice, meta::domainValue, domainValue); +} + +// Set, by domainValue +void +SlicesSliceSetByDomainValue( + ConstHandle2Slices self, + const Float64 domainValue, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDomainValue", + self, extract::slice, meta::domainValue, domainValue, slice); +} + +// Has, by domainUnit +int +SlicesSliceHasByDomainUnit( + ConstHandle2ConstSlices self, + const XMLName domainUnit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDomainUnit", + self, extract::slice, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, const +Handle2ConstSlice +SlicesSliceGetByDomainUnitConst( + ConstHandle2ConstSlices self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainUnitConst", + self, extract::slice, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, non-const +Handle2Slice +SlicesSliceGetByDomainUnit( + ConstHandle2Slices self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainUnit", + self, extract::slice, meta::domainUnit, domainUnit); +} + +// Set, by domainUnit +void +SlicesSliceSetByDomainUnit( + ConstHandle2Slices self, + const XMLName domainUnit, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDomainUnit", + self, extract::slice, meta::domainUnit, domainUnit, slice); +} + +// Has, by dimension +int +SlicesSliceHasByDimension( + ConstHandle2ConstSlices self, + const Integer32 dimension +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDimension", + self, extract::slice, meta::dimension, dimension); +} + +// Get, by dimension, const +Handle2ConstSlice +SlicesSliceGetByDimensionConst( + ConstHandle2ConstSlices self, + const Integer32 dimension +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDimensionConst", + self, extract::slice, meta::dimension, dimension); +} + +// Get, by dimension, non-const +Handle2Slice +SlicesSliceGetByDimension( + ConstHandle2Slices self, + const Integer32 dimension +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDimension", + self, extract::slice, meta::dimension, dimension); +} + +// Set, by dimension +void +SlicesSliceSetByDimension( + ConstHandle2Slices self, + const Integer32 dimension, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDimension", + self, extract::slice, meta::dimension, dimension, slice); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/Slices/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices.h new file mode 100644 index 000000000..73d94742b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices.h @@ -0,0 +1,322 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COVARIANCE_SLICES +#define C_INTERFACE_TEST_V2_0_COVARIANCE_SLICES + +#include "GNDStk.h" +#include "v2.0/covariance/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 +extern_c Handle2Slices +SlicesDefault(); + +// --- Create, general, const +extern_c Handle2ConstSlices +SlicesCreateConst( + ConstHandle2Slice *const slice, const size_t sliceSize +); + +// +++ Create, general +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 +); + +// +++ Has, by domainMin +extern_c int +SlicesSliceHasByDomainMin( + ConstHandle2ConstSlices self, + const Float64 domainMin +); + +// --- Get, by domainMin, const +extern_c Handle2ConstSlice +SlicesSliceGetByDomainMinConst( + ConstHandle2ConstSlices self, + const Float64 domainMin +); + +// +++ Get, by domainMin, non-const +extern_c Handle2Slice +SlicesSliceGetByDomainMin( + ConstHandle2Slices self, + const Float64 domainMin +); + +// +++ Set, by domainMin +extern_c void +SlicesSliceSetByDomainMin( + ConstHandle2Slices self, + const Float64 domainMin, + ConstHandle2ConstSlice slice +); + +// +++ Has, by domainMax +extern_c int +SlicesSliceHasByDomainMax( + ConstHandle2ConstSlices self, + const Float64 domainMax +); + +// --- Get, by domainMax, const +extern_c Handle2ConstSlice +SlicesSliceGetByDomainMaxConst( + ConstHandle2ConstSlices self, + const Float64 domainMax +); + +// +++ Get, by domainMax, non-const +extern_c Handle2Slice +SlicesSliceGetByDomainMax( + ConstHandle2Slices self, + const Float64 domainMax +); + +// +++ Set, by domainMax +extern_c void +SlicesSliceSetByDomainMax( + ConstHandle2Slices self, + const Float64 domainMax, + ConstHandle2ConstSlice slice +); + +// +++ Has, by domainValue +extern_c int +SlicesSliceHasByDomainValue( + ConstHandle2ConstSlices self, + const Float64 domainValue +); + +// --- Get, by domainValue, const +extern_c Handle2ConstSlice +SlicesSliceGetByDomainValueConst( + ConstHandle2ConstSlices self, + const Float64 domainValue +); + +// +++ Get, by domainValue, non-const +extern_c Handle2Slice +SlicesSliceGetByDomainValue( + ConstHandle2Slices self, + const Float64 domainValue +); + +// +++ Set, by domainValue +extern_c void +SlicesSliceSetByDomainValue( + ConstHandle2Slices self, + const Float64 domainValue, + ConstHandle2ConstSlice slice +); + +// +++ Has, by domainUnit +extern_c int +SlicesSliceHasByDomainUnit( + ConstHandle2ConstSlices self, + const XMLName domainUnit +); + +// --- Get, by domainUnit, const +extern_c Handle2ConstSlice +SlicesSliceGetByDomainUnitConst( + ConstHandle2ConstSlices self, + const XMLName domainUnit +); + +// +++ Get, by domainUnit, non-const +extern_c Handle2Slice +SlicesSliceGetByDomainUnit( + ConstHandle2Slices self, + const XMLName domainUnit +); + +// +++ Set, by domainUnit +extern_c void +SlicesSliceSetByDomainUnit( + ConstHandle2Slices self, + const XMLName domainUnit, + ConstHandle2ConstSlice slice +); + +// +++ Has, by dimension +extern_c int +SlicesSliceHasByDimension( + ConstHandle2ConstSlices self, + const Integer32 dimension +); + +// --- Get, by dimension, const +extern_c Handle2ConstSlice +SlicesSliceGetByDimensionConst( + ConstHandle2ConstSlices self, + const Integer32 dimension +); + +// +++ Get, by dimension, non-const +extern_c Handle2Slice +SlicesSliceGetByDimension( + ConstHandle2Slices self, + const Integer32 dimension +); + +// +++ Set, by dimension +extern_c void +SlicesSliceSetByDimension( + ConstHandle2Slices self, + const Integer32 dimension, + ConstHandle2ConstSlice slice +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/covariance/Slices/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Slices/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum.cpp new file mode 100644 index 000000000..4c3c73a9e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum.cpp @@ -0,0 +1,487 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/Sum.hpp" +#include "Sum.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = SumClass; +using CPP = multigroup::Sum; + +static const std::string CLASSNAME = "Sum"; + +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 label = [](auto &obj) { return &obj.label; }; + static auto summand = [](auto &obj) { return &obj.summand; }; +} + +using CPPSummand = covariance::Summand; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSum +SumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Sum +SumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSum +SumCreateConst( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, + const XMLName label, + ConstHandle2Summand *const summand, const size_t summandSize +) { + ConstHandle2Sum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + domainMin, + domainMax, + domainUnit, + label, + std::vector{} + ); + for (size_t SummandN = 0; SummandN < summandSize; ++SummandN) + SumSummandAdd(handle, summand[SummandN]); + return handle; +} + +// Create, general +Handle2Sum +SumCreate( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, + const XMLName label, + ConstHandle2Summand *const summand, const size_t summandSize +) { + ConstHandle2Sum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + domainMin, + domainMax, + domainUnit, + label, + 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: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +SumDomainMinHas(ConstHandle2ConstSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +Float64 +SumDomainMinGet(ConstHandle2ConstSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +SumDomainMinSet(ConstHandle2Sum self, const Float64 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 +Float64 +SumDomainMaxGet(ConstHandle2ConstSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +SumDomainMaxSet(ConstHandle2Sum self, const Float64 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 +XMLName +SumDomainUnitGet(ConstHandle2ConstSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainUnitGet", self, extract::domainUnit); +} + +// Set +void +SumDomainUnitSet(ConstHandle2Sum self, const XMLName domainUnit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainUnitSet", self, extract::domainUnit, domainUnit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +SumLabelHas(ConstHandle2ConstSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +SumLabelGet(ConstHandle2ConstSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +SumLabelSet(ConstHandle2Sum self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + +// Has, by ENDF_MFMT +int +SumSummandHasByENDFMFMT( + ConstHandle2ConstSum self, + const XMLName 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 XMLName 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 XMLName 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 XMLName ENDF_MFMT, + ConstHandle2ConstSummand summand +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SummandSetByENDFMFMT", + self, extract::summand, meta::ENDF_MFMT, ENDF_MFMT, summand); +} + +// Has, by coefficient +int +SumSummandHasByCoefficient( + ConstHandle2ConstSum self, + const Float64 coefficient +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SummandHasByCoefficient", + self, extract::summand, meta::coefficient, coefficient); +} + +// Get, by coefficient, const +Handle2ConstSummand +SumSummandGetByCoefficientConst( + ConstHandle2ConstSum self, + const Float64 coefficient +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SummandGetByCoefficientConst", + self, extract::summand, meta::coefficient, coefficient); +} + +// Get, by coefficient, non-const +Handle2Summand +SumSummandGetByCoefficient( + ConstHandle2Sum self, + const Float64 coefficient +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SummandGetByCoefficient", + self, extract::summand, meta::coefficient, coefficient); +} + +// Set, by coefficient +void +SumSummandSetByCoefficient( + ConstHandle2Sum self, + const Float64 coefficient, + ConstHandle2ConstSummand summand +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SummandSetByCoefficient", + self, extract::summand, meta::coefficient, coefficient, summand); +} + +// 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/covariance/Sum/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum.h new file mode 100644 index 000000000..cac79a425 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum.h @@ -0,0 +1,344 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_COVARIANCE_SUM +#define C_INTERFACE_TEST_V2_0_COVARIANCE_SUM + +#include "GNDStk.h" +#include "v2.0/covariance/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 +extern_c Handle2Sum +SumDefault(); + +// --- Create, general, const +extern_c Handle2ConstSum +SumCreateConst( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, + const XMLName label, + ConstHandle2Summand *const summand, const size_t summandSize +); + +// +++ Create, general +extern_c Handle2Sum +SumCreate( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, + const XMLName label, + 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: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumDomainMinHas(ConstHandle2ConstSum self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +SumDomainMinGet(ConstHandle2ConstSum self); + +// +++ Set +extern_c void +SumDomainMinSet(ConstHandle2Sum self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumDomainMaxHas(ConstHandle2ConstSum self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +SumDomainMaxGet(ConstHandle2ConstSum self); + +// +++ Set +extern_c void +SumDomainMaxSet(ConstHandle2Sum self, const Float64 domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumDomainUnitHas(ConstHandle2ConstSum self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SumDomainUnitGet(ConstHandle2ConstSum self); + +// +++ Set +extern_c void +SumDomainUnitSet(ConstHandle2Sum self, const XMLName domainUnit); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumLabelHas(ConstHandle2ConstSum self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SumLabelGet(ConstHandle2ConstSum self); + +// +++ Set +extern_c void +SumLabelSet(ConstHandle2Sum self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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 +); + +// +++ Has, by ENDF_MFMT +extern_c int +SumSummandHasByENDFMFMT( + ConstHandle2ConstSum self, + const XMLName ENDF_MFMT +); + +// --- Get, by ENDF_MFMT, const +extern_c Handle2ConstSummand +SumSummandGetByENDFMFMTConst( + ConstHandle2ConstSum self, + const XMLName ENDF_MFMT +); + +// +++ Get, by ENDF_MFMT, non-const +extern_c Handle2Summand +SumSummandGetByENDFMFMT( + ConstHandle2Sum self, + const XMLName ENDF_MFMT +); + +// +++ Set, by ENDF_MFMT +extern_c void +SumSummandSetByENDFMFMT( + ConstHandle2Sum self, + const XMLName ENDF_MFMT, + ConstHandle2ConstSummand summand +); + +// +++ Has, by coefficient +extern_c int +SumSummandHasByCoefficient( + ConstHandle2ConstSum self, + const Float64 coefficient +); + +// --- Get, by coefficient, const +extern_c Handle2ConstSummand +SumSummandGetByCoefficientConst( + ConstHandle2ConstSum self, + const Float64 coefficient +); + +// +++ Get, by coefficient, non-const +extern_c Handle2Summand +SumSummandGetByCoefficient( + ConstHandle2Sum self, + const Float64 coefficient +); + +// +++ Set, by coefficient +extern_c void +SumSummandSetByCoefficient( + ConstHandle2Sum self, + const Float64 coefficient, + ConstHandle2ConstSummand summand +); + +// +++ 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/covariance/Sum/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Sum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Summand.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Summand.cpp new file mode 100644 index 000000000..3dd6e7dbf --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/Summand.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/covariance/Summand.hpp" +#include "Summand.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2Summand +SummandDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSummand +SummandCreateConst( + const XMLName ENDF_MFMT, + const Float64 coefficient, + const char *const href +) { + ConstHandle2Summand handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MFMT, + coefficient, + href + ); + return handle; +} + +// Create, general +Handle2Summand +SummandCreate( + const XMLName ENDF_MFMT, + const Float64 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 +XMLName +SummandENDFMFMTGet(ConstHandle2ConstSummand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMFMTGet", self, extract::ENDF_MFMT); +} + +// Set +void +SummandENDFMFMTSet(ConstHandle2Summand self, const XMLName 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 +Float64 +SummandCoefficientGet(ConstHandle2ConstSummand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoefficientGet", self, extract::coefficient); +} + +// Set +void +SummandCoefficientSet(ConstHandle2Summand self, const Float64 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/covariance/Summand/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Summand.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Summand.h new file mode 100644 index 000000000..5bc61d40b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/covariance/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_TEST_V2_0_COVARIANCE_SUMMAND +#define C_INTERFACE_TEST_V2_0_COVARIANCE_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 +extern_c Handle2Summand +SummandDefault(); + +// --- Create, general, const +extern_c Handle2ConstSummand +SummandCreateConst( + const XMLName ENDF_MFMT, + const Float64 coefficient, + const char *const href +); + +// +++ Create, general +extern_c Handle2Summand +SummandCreate( + const XMLName ENDF_MFMT, + const Float64 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 XMLName +SummandENDFMFMTGet(ConstHandle2ConstSummand self); + +// +++ Set +extern_c void +SummandENDFMFMTSet(ConstHandle2Summand self, const XMLName ENDF_MFMT); + + +// ----------------------------------------------------------------------------- +// Metadatum: coefficient +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SummandCoefficientHas(ConstHandle2ConstSummand self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +SummandCoefficientGet(ConstHandle2ConstSummand self); + +// +++ Set +extern_c void +SummandCoefficientSet(ConstHandle2Summand self, const Float64 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/covariance/Summand/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Summand/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/covariance/Summand/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/covariance/Summand/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/covariance/Summand/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic.cpp new file mode 100644 index 000000000..3ecbe5980 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic.cpp @@ -0,0 +1,399 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp" +#include "CoulombPlusNuclearElastic.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CoulombPlusNuclearElasticClass; +using CPP = multigroup::CoulombPlusNuclearElastic; + +static const std::string CLASSNAME = "CoulombPlusNuclearElastic"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; + static auto identicalParticles = [](auto &obj) { return &obj.identicalParticles; }; + 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 RutherfordScattering = [](auto &obj) { return &obj.RutherfordScattering; }; + static auto nuclearAmplitudeExpansion = [](auto &obj) { return &obj.nuclearAmplitudeExpansion; }; +} + +using CPPRutherfordScattering = cpTransport::RutherfordScattering; +using CPPNuclearAmplitudeExpansion = cpTransport::NuclearAmplitudeExpansion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCoulombPlusNuclearElastic +CoulombPlusNuclearElasticDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CoulombPlusNuclearElastic +CoulombPlusNuclearElasticDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCoulombPlusNuclearElastic +CoulombPlusNuclearElasticCreateConst( + const XMLName href, + const bool identicalParticles, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstRutherfordScattering RutherfordScattering, + ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion +) { + ConstHandle2CoulombPlusNuclearElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href, + identicalParticles, + label, + pid, + productFrame, + detail::tocpp(RutherfordScattering), + detail::tocpp(nuclearAmplitudeExpansion) + ); + return handle; +} + +// Create, general +Handle2CoulombPlusNuclearElastic +CoulombPlusNuclearElasticCreate( + const XMLName href, + const bool identicalParticles, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstRutherfordScattering RutherfordScattering, + ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion +) { + ConstHandle2CoulombPlusNuclearElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href, + identicalParticles, + label, + pid, + productFrame, + detail::tocpp(RutherfordScattering), + detail::tocpp(nuclearAmplitudeExpansion) + ); + return handle; +} + +// Assign +// Use this to assign 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: href +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticHrefHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +XMLName +CoulombPlusNuclearElasticHrefGet(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +CoulombPlusNuclearElasticHrefSet(ConstHandle2CoulombPlusNuclearElastic self, const XMLName href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticLabelHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CoulombPlusNuclearElasticLabelGet(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CoulombPlusNuclearElasticLabelSet(ConstHandle2CoulombPlusNuclearElastic self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticPidHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +XMLName +CoulombPlusNuclearElasticPidGet(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +CoulombPlusNuclearElasticPidSet(ConstHandle2CoulombPlusNuclearElastic self, const XMLName 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 +enums::Frame +CoulombPlusNuclearElasticProductFrameGet(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +CoulombPlusNuclearElasticProductFrameSet(ConstHandle2CoulombPlusNuclearElastic self, const enums::Frame productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic.h new file mode 100644 index 000000000..fc397e57a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic.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. +// +// 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_TEST_V2_0_CPTRANSPORT_COULOMBPLUSNUCLEARELASTIC +#define C_INTERFACE_TEST_V2_0_CPTRANSPORT_COULOMBPLUSNUCLEARELASTIC + +#include "GNDStk.h" +#include "v2.0/cpTransport/RutherfordScattering.h" +#include "v2.0/cpTransport/NuclearAmplitudeExpansion.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 +extern_c Handle2CoulombPlusNuclearElastic +CoulombPlusNuclearElasticDefault(); + +// --- Create, general, const +extern_c Handle2ConstCoulombPlusNuclearElastic +CoulombPlusNuclearElasticCreateConst( + const XMLName href, + const bool identicalParticles, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstRutherfordScattering RutherfordScattering, + ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion +); + +// +++ Create, general +extern_c Handle2CoulombPlusNuclearElastic +CoulombPlusNuclearElasticCreate( + const XMLName href, + const bool identicalParticles, + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstRutherfordScattering RutherfordScattering, + ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion +); + +// +++ Assign +// +++ Use this to assign one handled 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: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticHrefHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CoulombPlusNuclearElasticHrefGet(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticHrefSet(ConstHandle2CoulombPlusNuclearElastic self, const XMLName href); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticLabelHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CoulombPlusNuclearElasticLabelGet(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticLabelSet(ConstHandle2CoulombPlusNuclearElastic self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticPidHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CoulombPlusNuclearElasticPidGet(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticPidSet(ConstHandle2CoulombPlusNuclearElastic self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticProductFrameHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get +// +++ Returns by value +extern_c enums::Frame +CoulombPlusNuclearElasticProductFrameGet(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticProductFrameSet(ConstHandle2CoulombPlusNuclearElastic self, const enums::Frame productFrame); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/ImaginaryInterferenceTerm.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/ImaginaryInterferenceTerm.cpp new file mode 100644 index 000000000..0ca4ab4c5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/ImaginaryInterferenceTerm.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/cpTransport/ImaginaryInterferenceTerm.hpp" +#include "ImaginaryInterferenceTerm.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ImaginaryInterferenceTermClass; +using CPP = multigroup::ImaginaryInterferenceTerm; + +static const std::string CLASSNAME = "ImaginaryInterferenceTerm"; + +namespace extract { + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; + static auto regions2d = [](auto &obj) { return &obj.regions2d; }; +} + +using CPPXYs2d = containers::XYs2d; +using CPPRegions2d = containers::Regions2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstImaginaryInterferenceTerm +ImaginaryInterferenceTermDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ImaginaryInterferenceTerm +ImaginaryInterferenceTermDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstImaginaryInterferenceTerm +ImaginaryInterferenceTermCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +) { + ConstHandle2ImaginaryInterferenceTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs2d), + detail::tocpp(regions2d) + ); + return handle; +} + +// Create, general +Handle2ImaginaryInterferenceTerm +ImaginaryInterferenceTermCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +) { + ConstHandle2ImaginaryInterferenceTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs2d), + detail::tocpp(regions2d) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/ImaginaryInterferenceTerm.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/ImaginaryInterferenceTerm.h new file mode 100644 index 000000000..77e688313 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/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_TEST_V2_0_CPTRANSPORT_IMAGINARYINTERFERENCETERM +#define C_INTERFACE_TEST_V2_0_CPTRANSPORT_IMAGINARYINTERFERENCETERM + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Regions2d.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 +extern_c Handle2ImaginaryInterferenceTerm +ImaginaryInterferenceTermDefault(); + +// --- Create, general, const +extern_c Handle2ConstImaginaryInterferenceTerm +ImaginaryInterferenceTermCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +); + +// +++ Create, general +extern_c Handle2ImaginaryInterferenceTerm +ImaginaryInterferenceTermCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearAmplitudeExpansion.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearAmplitudeExpansion.cpp new file mode 100644 index 000000000..76173bbdc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearAmplitudeExpansion.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/cpTransport/NuclearAmplitudeExpansion.hpp" +#include "NuclearAmplitudeExpansion.h" + +using namespace njoy::GNDStk; +using namespace test::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 = cpTransport::NuclearTerm; +using CPPRealInterferenceTerm = cpTransport::RealInterferenceTerm; +using CPPImaginaryInterferenceTerm = cpTransport::ImaginaryInterferenceTerm; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclearAmplitudeExpansion +NuclearAmplitudeExpansionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/cpTransport/NuclearAmplitudeExpansion/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearAmplitudeExpansion.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearAmplitudeExpansion.h new file mode 100644 index 000000000..ded958180 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/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_TEST_V2_0_CPTRANSPORT_NUCLEARAMPLITUDEEXPANSION +#define C_INTERFACE_TEST_V2_0_CPTRANSPORT_NUCLEARAMPLITUDEEXPANSION + +#include "GNDStk.h" +#include "v2.0/cpTransport/NuclearTerm.h" +#include "v2.0/cpTransport/RealInterferenceTerm.h" +#include "v2.0/cpTransport/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 +extern_c Handle2NuclearAmplitudeExpansion +NuclearAmplitudeExpansionDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclearAmplitudeExpansion +NuclearAmplitudeExpansionCreateConst( + ConstHandle2ConstNuclearTerm nuclearTerm, + ConstHandle2ConstRealInterferenceTerm realInterferenceTerm, + ConstHandle2ConstImaginaryInterferenceTerm imaginaryInterferenceTerm +); + +// +++ Create, general +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/cpTransport/NuclearAmplitudeExpansion/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearAmplitudeExpansion/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearAmplitudeExpansion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearAmplitudeExpansion/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearAmplitudeExpansion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearPlusInterference.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearPlusInterference.cpp new file mode 100644 index 000000000..4e2e00b33 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearPlusInterference.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/cpTransport/NuclearPlusInterference.hpp" +#include "NuclearPlusInterference.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::CrossSection; +using CPPDistribution = transport::Distribution; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclearPlusInterference +NuclearPlusInterferenceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2NuclearPlusInterference +NuclearPlusInterferenceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNuclearPlusInterference +NuclearPlusInterferenceCreateConst( + const Float64 muCutoff, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstDistribution distribution +) { + ConstHandle2NuclearPlusInterference handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + muCutoff, + detail::tocpp(crossSection), + detail::tocpp(distribution) + ); + return handle; +} + +// Create, general +Handle2NuclearPlusInterference +NuclearPlusInterferenceCreate( + const Float64 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 +Float64 +NuclearPlusInterferenceMuCutoffGet(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MuCutoffGet", self, extract::muCutoff); +} + +// Set +void +NuclearPlusInterferenceMuCutoffSet(ConstHandle2NuclearPlusInterference self, const Float64 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/cpTransport/NuclearPlusInterference/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearPlusInterference.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearPlusInterference.h new file mode 100644 index 000000000..5644b1839 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/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_TEST_V2_0_CPTRANSPORT_NUCLEARPLUSINTERFERENCE +#define C_INTERFACE_TEST_V2_0_CPTRANSPORT_NUCLEARPLUSINTERFERENCE + +#include "GNDStk.h" +#include "v2.0/transport/CrossSection.h" +#include "v2.0/transport/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 +extern_c Handle2NuclearPlusInterference +NuclearPlusInterferenceDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclearPlusInterference +NuclearPlusInterferenceCreateConst( + const Float64 muCutoff, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstDistribution distribution +); + +// +++ Create, general +extern_c Handle2NuclearPlusInterference +NuclearPlusInterferenceCreate( + const Float64 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 Float64 +NuclearPlusInterferenceMuCutoffGet(ConstHandle2ConstNuclearPlusInterference self); + +// +++ Set +extern_c void +NuclearPlusInterferenceMuCutoffSet(ConstHandle2NuclearPlusInterference self, const Float64 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/cpTransport/NuclearPlusInterference/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearPlusInterference/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearPlusInterference/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearPlusInterference/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearPlusInterference/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearTerm.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearTerm.cpp new file mode 100644 index 000000000..013d59252 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearTerm.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/cpTransport/NuclearTerm.hpp" +#include "NuclearTerm.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = NuclearTermClass; +using CPP = multigroup::NuclearTerm; + +static const std::string CLASSNAME = "NuclearTerm"; + +namespace extract { + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; + static auto regions2d = [](auto &obj) { return &obj.regions2d; }; +} + +using CPPXYs2d = containers::XYs2d; +using CPPRegions2d = containers::Regions2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclearTerm +NuclearTermDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2NuclearTerm +NuclearTermDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNuclearTerm +NuclearTermCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +) { + ConstHandle2NuclearTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs2d), + detail::tocpp(regions2d) + ); + return handle; +} + +// Create, general +Handle2NuclearTerm +NuclearTermCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +) { + ConstHandle2NuclearTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs2d), + detail::tocpp(regions2d) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/cpTransport/NuclearTerm/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearTerm.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearTerm.h new file mode 100644 index 000000000..33032fa93 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/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_TEST_V2_0_CPTRANSPORT_NUCLEARTERM +#define C_INTERFACE_TEST_V2_0_CPTRANSPORT_NUCLEARTERM + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Regions2d.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 +extern_c Handle2NuclearTerm +NuclearTermDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclearTerm +NuclearTermCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +); + +// +++ Create, general +extern_c Handle2NuclearTerm +NuclearTermCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/cpTransport/NuclearTerm/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearTerm/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearTerm/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearTerm/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/NuclearTerm/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RealInterferenceTerm.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RealInterferenceTerm.cpp new file mode 100644 index 000000000..72cc46790 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RealInterferenceTerm.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/cpTransport/RealInterferenceTerm.hpp" +#include "RealInterferenceTerm.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = RealInterferenceTermClass; +using CPP = multigroup::RealInterferenceTerm; + +static const std::string CLASSNAME = "RealInterferenceTerm"; + +namespace extract { + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; + static auto regions2d = [](auto &obj) { return &obj.regions2d; }; +} + +using CPPXYs2d = containers::XYs2d; +using CPPRegions2d = containers::Regions2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRealInterferenceTerm +RealInterferenceTermDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2RealInterferenceTerm +RealInterferenceTermDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRealInterferenceTerm +RealInterferenceTermCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +) { + ConstHandle2RealInterferenceTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs2d), + detail::tocpp(regions2d) + ); + return handle; +} + +// Create, general +Handle2RealInterferenceTerm +RealInterferenceTermCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +) { + ConstHandle2RealInterferenceTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs2d), + detail::tocpp(regions2d) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/cpTransport/RealInterferenceTerm/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RealInterferenceTerm.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RealInterferenceTerm.h new file mode 100644 index 000000000..03b0e6f60 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/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_TEST_V2_0_CPTRANSPORT_REALINTERFERENCETERM +#define C_INTERFACE_TEST_V2_0_CPTRANSPORT_REALINTERFERENCETERM + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Regions2d.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 +extern_c Handle2RealInterferenceTerm +RealInterferenceTermDefault(); + +// --- Create, general, const +extern_c Handle2ConstRealInterferenceTerm +RealInterferenceTermCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +); + +// +++ Create, general +extern_c Handle2RealInterferenceTerm +RealInterferenceTermCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/cpTransport/RealInterferenceTerm/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RealInterferenceTerm/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RealInterferenceTerm/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RealInterferenceTerm/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RealInterferenceTerm/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RutherfordScattering.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RutherfordScattering.cpp new file mode 100644 index 000000000..000cb9b83 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RutherfordScattering.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/cpTransport/RutherfordScattering.hpp" +#include "RutherfordScattering.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2RutherfordScattering +RutherfordScatteringDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRutherfordScattering +RutherfordScatteringCreateConst() +{ + ConstHandle2RutherfordScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/cpTransport/RutherfordScattering/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RutherfordScattering.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RutherfordScattering.h new file mode 100644 index 000000000..0c509bb57 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/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_TEST_V2_0_CPTRANSPORT_RUTHERFORDSCATTERING +#define C_INTERFACE_TEST_V2_0_CPTRANSPORT_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 +extern_c Handle2RutherfordScattering +RutherfordScatteringDefault(); + +// --- Create, general, const +extern_c Handle2ConstRutherfordScattering +RutherfordScatteringCreateConst(); + +// +++ Create, general +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/cpTransport/RutherfordScattering/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RutherfordScattering/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RutherfordScattering/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RutherfordScattering/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/cpTransport/RutherfordScattering/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract.cpp new file mode 100644 index 000000000..28c65e24d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Abstract.hpp" +#include "Abstract.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AbstractClass; +using CPP = multigroup::Abstract; + +static const std::string CLASSNAME = "Abstract"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAbstract +AbstractDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Abstract +AbstractDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAbstract +AbstractCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Abstract handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label + ); + return handle; +} + +// Create, general +Handle2Abstract +AbstractCreate( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Abstract handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +AbstractAssign(ConstHandle2Abstract self, ConstHandle2ConstAbstract from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AbstractDelete(ConstHandle2ConstAbstract self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AbstractRead(ConstHandle2Abstract self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AbstractWrite(ConstHandle2ConstAbstract self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AbstractPrint(ConstHandle2ConstAbstract self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AbstractPrintXML(ConstHandle2ConstAbstract self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AbstractPrintJSON(ConstHandle2ConstAbstract self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +AbstractIntsClear(ConstHandle2Abstract self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +AbstractIntsSize(ConstHandle2ConstAbstract self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +AbstractIntsGet(ConstHandle2ConstAbstract self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +AbstractIntsSet(ConstHandle2Abstract self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +AbstractIntsGetArrayConst(ConstHandle2ConstAbstract self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +AbstractIntsGetArray(ConstHandle2Abstract self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +AbstractIntsSetArray(ConstHandle2Abstract self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +AbstractUnsignedsClear(ConstHandle2Abstract self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +AbstractUnsignedsSize(ConstHandle2ConstAbstract self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +AbstractUnsignedsGet(ConstHandle2ConstAbstract self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +AbstractUnsignedsSet(ConstHandle2Abstract self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +AbstractUnsignedsGetArrayConst(ConstHandle2ConstAbstract self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +AbstractUnsignedsGetArray(ConstHandle2Abstract self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +AbstractUnsignedsSetArray(ConstHandle2Abstract self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +AbstractFloatsClear(ConstHandle2Abstract self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +AbstractFloatsSize(ConstHandle2ConstAbstract self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +AbstractFloatsGet(ConstHandle2ConstAbstract self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +AbstractFloatsSet(ConstHandle2Abstract self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +AbstractFloatsGetArrayConst(ConstHandle2ConstAbstract self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +AbstractFloatsGetArray(ConstHandle2Abstract self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +AbstractFloatsSetArray(ConstHandle2Abstract self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +AbstractDoublesClear(ConstHandle2Abstract self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +AbstractDoublesSize(ConstHandle2ConstAbstract self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +AbstractDoublesGet(ConstHandle2ConstAbstract self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +AbstractDoublesSet(ConstHandle2Abstract self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +AbstractDoublesGetArrayConst(ConstHandle2ConstAbstract self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +AbstractDoublesGetArray(ConstHandle2Abstract self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +AbstractDoublesSetArray(ConstHandle2Abstract self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +AbstractEncodingHas(ConstHandle2ConstAbstract self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +AbstractEncodingGet(ConstHandle2ConstAbstract self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +AbstractEncodingSet(ConstHandle2Abstract self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +AbstractMarkupHas(ConstHandle2ConstAbstract self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +AbstractMarkupGet(ConstHandle2ConstAbstract self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +AbstractMarkupSet(ConstHandle2Abstract self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AbstractLabelHas(ConstHandle2ConstAbstract self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +AbstractLabelGet(ConstHandle2ConstAbstract self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AbstractLabelSet(ConstHandle2Abstract self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Abstract/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract.h new file mode 100644 index 000000000..c94a10887 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract.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. +// +// Abstract is the basic handle type in this file. Example: +// // Create a default Abstract object: +// Abstract handle = AbstractDefault(); +// Functions involving Abstract are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_ABSTRACT +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_ABSTRACT + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AbstractClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Abstract +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AbstractClass *Abstract; + +// --- Const-aware handles. +typedef const struct AbstractClass *const ConstHandle2ConstAbstract; +typedef struct AbstractClass *const ConstHandle2Abstract; +typedef const struct AbstractClass * Handle2ConstAbstract; +typedef struct AbstractClass * Handle2Abstract; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAbstract +AbstractDefaultConst(); + +// +++ Create, default +extern_c Handle2Abstract +AbstractDefault(); + +// --- Create, general, const +extern_c Handle2ConstAbstract +AbstractCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +); + +// +++ Create, general +extern_c Handle2Abstract +AbstractCreate( + const XMLName encoding, + const char *const markup, + const XMLName 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 +AbstractAssign(ConstHandle2Abstract self, ConstHandle2ConstAbstract from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AbstractDelete(ConstHandle2ConstAbstract self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AbstractRead(ConstHandle2Abstract self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AbstractWrite(ConstHandle2ConstAbstract self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AbstractPrint(ConstHandle2ConstAbstract self); + +// +++ Print to standard output, as XML +extern_c int +AbstractPrintXML(ConstHandle2ConstAbstract self); + +// +++ Print to standard output, as JSON +extern_c int +AbstractPrintJSON(ConstHandle2ConstAbstract self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +AbstractIntsClear(ConstHandle2Abstract self); + +// +++ Get size +extern_c size_t +AbstractIntsSize(ConstHandle2ConstAbstract self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +AbstractIntsGet(ConstHandle2ConstAbstract self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +AbstractIntsSet(ConstHandle2Abstract self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +AbstractIntsGetArrayConst(ConstHandle2ConstAbstract self); + +// +++ Get pointer to existing values, non-const +extern_c int * +AbstractIntsGetArray(ConstHandle2Abstract self); + +// +++ Set completely new values and size +extern_c void +AbstractIntsSetArray(ConstHandle2Abstract self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +AbstractUnsignedsClear(ConstHandle2Abstract self); + +// +++ Get size +extern_c size_t +AbstractUnsignedsSize(ConstHandle2ConstAbstract self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +AbstractUnsignedsGet(ConstHandle2ConstAbstract self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +AbstractUnsignedsSet(ConstHandle2Abstract self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +AbstractUnsignedsGetArrayConst(ConstHandle2ConstAbstract self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +AbstractUnsignedsGetArray(ConstHandle2Abstract self); + +// +++ Set completely new values and size +extern_c void +AbstractUnsignedsSetArray(ConstHandle2Abstract self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +AbstractFloatsClear(ConstHandle2Abstract self); + +// +++ Get size +extern_c size_t +AbstractFloatsSize(ConstHandle2ConstAbstract self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +AbstractFloatsGet(ConstHandle2ConstAbstract self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +AbstractFloatsSet(ConstHandle2Abstract self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +AbstractFloatsGetArrayConst(ConstHandle2ConstAbstract self); + +// +++ Get pointer to existing values, non-const +extern_c float * +AbstractFloatsGetArray(ConstHandle2Abstract self); + +// +++ Set completely new values and size +extern_c void +AbstractFloatsSetArray(ConstHandle2Abstract self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +AbstractDoublesClear(ConstHandle2Abstract self); + +// +++ Get size +extern_c size_t +AbstractDoublesSize(ConstHandle2ConstAbstract self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +AbstractDoublesGet(ConstHandle2ConstAbstract self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +AbstractDoublesSet(ConstHandle2Abstract self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +AbstractDoublesGetArrayConst(ConstHandle2ConstAbstract self); + +// +++ Get pointer to existing values, non-const +extern_c double * +AbstractDoublesGetArray(ConstHandle2Abstract self); + +// +++ Set completely new values and size +extern_c void +AbstractDoublesSetArray(ConstHandle2Abstract self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AbstractEncodingHas(ConstHandle2ConstAbstract self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AbstractEncodingGet(ConstHandle2ConstAbstract self); + +// +++ Set +extern_c void +AbstractEncodingSet(ConstHandle2Abstract self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AbstractMarkupHas(ConstHandle2ConstAbstract self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AbstractMarkupGet(ConstHandle2ConstAbstract self); + +// +++ Set +extern_c void +AbstractMarkupSet(ConstHandle2Abstract self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AbstractLabelHas(ConstHandle2ConstAbstract self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AbstractLabelGet(ConstHandle2ConstAbstract self); + +// +++ Set +extern_c void +AbstractLabelSet(ConstHandle2Abstract self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Abstract/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Abstract/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement.cpp new file mode 100644 index 000000000..73773e75a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement.cpp @@ -0,0 +1,530 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Acknowledgement.hpp" +#include "Acknowledgement.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AcknowledgementClass; +using CPP = multigroup::Acknowledgement; + +static const std::string CLASSNAME = "Acknowledgement"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto type = [](auto &obj) { return &obj.type; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAcknowledgement +AcknowledgementDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Acknowledgement +AcknowledgementDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAcknowledgement +AcknowledgementCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName type +) { + ConstHandle2Acknowledgement handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label, + type + ); + return handle; +} + +// Create, general +Handle2Acknowledgement +AcknowledgementCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName type +) { + ConstHandle2Acknowledgement handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + label, + type + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AcknowledgementAssign(ConstHandle2Acknowledgement self, ConstHandle2ConstAcknowledgement from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AcknowledgementDelete(ConstHandle2ConstAcknowledgement self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AcknowledgementRead(ConstHandle2Acknowledgement self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AcknowledgementWrite(ConstHandle2ConstAcknowledgement self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AcknowledgementPrint(ConstHandle2ConstAcknowledgement self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AcknowledgementPrintXML(ConstHandle2ConstAcknowledgement self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AcknowledgementPrintJSON(ConstHandle2ConstAcknowledgement self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +AcknowledgementIntsClear(ConstHandle2Acknowledgement self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +AcknowledgementIntsSize(ConstHandle2ConstAcknowledgement self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +AcknowledgementIntsGet(ConstHandle2ConstAcknowledgement self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +AcknowledgementIntsSet(ConstHandle2Acknowledgement self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +AcknowledgementIntsGetArrayConst(ConstHandle2ConstAcknowledgement self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +AcknowledgementIntsGetArray(ConstHandle2Acknowledgement self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +AcknowledgementIntsSetArray(ConstHandle2Acknowledgement self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +AcknowledgementUnsignedsClear(ConstHandle2Acknowledgement self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +AcknowledgementUnsignedsSize(ConstHandle2ConstAcknowledgement self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +AcknowledgementUnsignedsGet(ConstHandle2ConstAcknowledgement self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +AcknowledgementUnsignedsSet(ConstHandle2Acknowledgement self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +AcknowledgementUnsignedsGetArrayConst(ConstHandle2ConstAcknowledgement self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +AcknowledgementUnsignedsGetArray(ConstHandle2Acknowledgement self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +AcknowledgementUnsignedsSetArray(ConstHandle2Acknowledgement self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +AcknowledgementFloatsClear(ConstHandle2Acknowledgement self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +AcknowledgementFloatsSize(ConstHandle2ConstAcknowledgement self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +AcknowledgementFloatsGet(ConstHandle2ConstAcknowledgement self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +AcknowledgementFloatsSet(ConstHandle2Acknowledgement self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +AcknowledgementFloatsGetArrayConst(ConstHandle2ConstAcknowledgement self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +AcknowledgementFloatsGetArray(ConstHandle2Acknowledgement self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +AcknowledgementFloatsSetArray(ConstHandle2Acknowledgement self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +AcknowledgementDoublesClear(ConstHandle2Acknowledgement self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +AcknowledgementDoublesSize(ConstHandle2ConstAcknowledgement self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +AcknowledgementDoublesGet(ConstHandle2ConstAcknowledgement self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +AcknowledgementDoublesSet(ConstHandle2Acknowledgement self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +AcknowledgementDoublesGetArrayConst(ConstHandle2ConstAcknowledgement self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +AcknowledgementDoublesGetArray(ConstHandle2Acknowledgement self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +AcknowledgementDoublesSetArray(ConstHandle2Acknowledgement self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +AcknowledgementEncodingHas(ConstHandle2ConstAcknowledgement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +AcknowledgementEncodingGet(ConstHandle2ConstAcknowledgement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +AcknowledgementEncodingSet(ConstHandle2Acknowledgement self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +AcknowledgementMarkupHas(ConstHandle2ConstAcknowledgement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +AcknowledgementMarkupGet(ConstHandle2ConstAcknowledgement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +AcknowledgementMarkupSet(ConstHandle2Acknowledgement self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AcknowledgementLabelHas(ConstHandle2ConstAcknowledgement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +AcknowledgementLabelGet(ConstHandle2ConstAcknowledgement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AcknowledgementLabelSet(ConstHandle2Acknowledgement self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// Has +int +AcknowledgementTypeHas(ConstHandle2ConstAcknowledgement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TypeHas", self, extract::type); +} + +// Get +// Returns by value +XMLName +AcknowledgementTypeGet(ConstHandle2ConstAcknowledgement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +AcknowledgementTypeSet(ConstHandle2Acknowledgement self, const XMLName type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Acknowledgement/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement.h new file mode 100644 index 000000000..cd1657a00 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement.h @@ -0,0 +1,358 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Acknowledgement is the basic handle type in this file. Example: +// // Create a default Acknowledgement object: +// Acknowledgement handle = AcknowledgementDefault(); +// Functions involving Acknowledgement are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_ACKNOWLEDGEMENT +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_ACKNOWLEDGEMENT + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AcknowledgementClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Acknowledgement +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AcknowledgementClass *Acknowledgement; + +// --- Const-aware handles. +typedef const struct AcknowledgementClass *const ConstHandle2ConstAcknowledgement; +typedef struct AcknowledgementClass *const ConstHandle2Acknowledgement; +typedef const struct AcknowledgementClass * Handle2ConstAcknowledgement; +typedef struct AcknowledgementClass * Handle2Acknowledgement; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAcknowledgement +AcknowledgementDefaultConst(); + +// +++ Create, default +extern_c Handle2Acknowledgement +AcknowledgementDefault(); + +// --- Create, general, const +extern_c Handle2ConstAcknowledgement +AcknowledgementCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName type +); + +// +++ Create, general +extern_c Handle2Acknowledgement +AcknowledgementCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName type +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AcknowledgementAssign(ConstHandle2Acknowledgement self, ConstHandle2ConstAcknowledgement from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AcknowledgementDelete(ConstHandle2ConstAcknowledgement self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AcknowledgementRead(ConstHandle2Acknowledgement self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AcknowledgementWrite(ConstHandle2ConstAcknowledgement self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AcknowledgementPrint(ConstHandle2ConstAcknowledgement self); + +// +++ Print to standard output, as XML +extern_c int +AcknowledgementPrintXML(ConstHandle2ConstAcknowledgement self); + +// +++ Print to standard output, as JSON +extern_c int +AcknowledgementPrintJSON(ConstHandle2ConstAcknowledgement self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +AcknowledgementIntsClear(ConstHandle2Acknowledgement self); + +// +++ Get size +extern_c size_t +AcknowledgementIntsSize(ConstHandle2ConstAcknowledgement self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +AcknowledgementIntsGet(ConstHandle2ConstAcknowledgement self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +AcknowledgementIntsSet(ConstHandle2Acknowledgement self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +AcknowledgementIntsGetArrayConst(ConstHandle2ConstAcknowledgement self); + +// +++ Get pointer to existing values, non-const +extern_c int * +AcknowledgementIntsGetArray(ConstHandle2Acknowledgement self); + +// +++ Set completely new values and size +extern_c void +AcknowledgementIntsSetArray(ConstHandle2Acknowledgement self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +AcknowledgementUnsignedsClear(ConstHandle2Acknowledgement self); + +// +++ Get size +extern_c size_t +AcknowledgementUnsignedsSize(ConstHandle2ConstAcknowledgement self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +AcknowledgementUnsignedsGet(ConstHandle2ConstAcknowledgement self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +AcknowledgementUnsignedsSet(ConstHandle2Acknowledgement self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +AcknowledgementUnsignedsGetArrayConst(ConstHandle2ConstAcknowledgement self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +AcknowledgementUnsignedsGetArray(ConstHandle2Acknowledgement self); + +// +++ Set completely new values and size +extern_c void +AcknowledgementUnsignedsSetArray(ConstHandle2Acknowledgement self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +AcknowledgementFloatsClear(ConstHandle2Acknowledgement self); + +// +++ Get size +extern_c size_t +AcknowledgementFloatsSize(ConstHandle2ConstAcknowledgement self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +AcknowledgementFloatsGet(ConstHandle2ConstAcknowledgement self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +AcknowledgementFloatsSet(ConstHandle2Acknowledgement self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +AcknowledgementFloatsGetArrayConst(ConstHandle2ConstAcknowledgement self); + +// +++ Get pointer to existing values, non-const +extern_c float * +AcknowledgementFloatsGetArray(ConstHandle2Acknowledgement self); + +// +++ Set completely new values and size +extern_c void +AcknowledgementFloatsSetArray(ConstHandle2Acknowledgement self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +AcknowledgementDoublesClear(ConstHandle2Acknowledgement self); + +// +++ Get size +extern_c size_t +AcknowledgementDoublesSize(ConstHandle2ConstAcknowledgement self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +AcknowledgementDoublesGet(ConstHandle2ConstAcknowledgement self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +AcknowledgementDoublesSet(ConstHandle2Acknowledgement self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +AcknowledgementDoublesGetArrayConst(ConstHandle2ConstAcknowledgement self); + +// +++ Get pointer to existing values, non-const +extern_c double * +AcknowledgementDoublesGetArray(ConstHandle2Acknowledgement self); + +// +++ Set completely new values and size +extern_c void +AcknowledgementDoublesSetArray(ConstHandle2Acknowledgement self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AcknowledgementEncodingHas(ConstHandle2ConstAcknowledgement self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AcknowledgementEncodingGet(ConstHandle2ConstAcknowledgement self); + +// +++ Set +extern_c void +AcknowledgementEncodingSet(ConstHandle2Acknowledgement self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AcknowledgementMarkupHas(ConstHandle2ConstAcknowledgement self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AcknowledgementMarkupGet(ConstHandle2ConstAcknowledgement self); + +// +++ Set +extern_c void +AcknowledgementMarkupSet(ConstHandle2Acknowledgement self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AcknowledgementLabelHas(ConstHandle2ConstAcknowledgement self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AcknowledgementLabelGet(ConstHandle2ConstAcknowledgement self); + +// +++ Set +extern_c void +AcknowledgementLabelSet(ConstHandle2Acknowledgement self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AcknowledgementTypeHas(ConstHandle2ConstAcknowledgement self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AcknowledgementTypeGet(ConstHandle2ConstAcknowledgement self); + +// +++ Set +extern_c void +AcknowledgementTypeSet(ConstHandle2Acknowledgement self, const XMLName type); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Acknowledgement/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgement/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements.cpp new file mode 100644 index 000000000..597671e22 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Acknowledgements.hpp" +#include "Acknowledgements.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AcknowledgementsClass; +using CPP = multigroup::Acknowledgements; + +static const std::string CLASSNAME = "Acknowledgements"; + +namespace extract { + static auto acknowledgement = [](auto &obj) { return &obj.acknowledgement; }; +} + +using CPPAcknowledgement = documentation::Acknowledgement; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAcknowledgements +AcknowledgementsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Acknowledgements +AcknowledgementsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAcknowledgements +AcknowledgementsCreateConst( + ConstHandle2Acknowledgement *const acknowledgement, const size_t acknowledgementSize +) { + ConstHandle2Acknowledgements handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t AcknowledgementN = 0; AcknowledgementN < acknowledgementSize; ++AcknowledgementN) + AcknowledgementsAcknowledgementAdd(handle, acknowledgement[AcknowledgementN]); + return handle; +} + +// Create, general +Handle2Acknowledgements +AcknowledgementsCreate( + ConstHandle2Acknowledgement *const acknowledgement, const size_t acknowledgementSize +) { + ConstHandle2Acknowledgements handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t AcknowledgementN = 0; AcknowledgementN < acknowledgementSize; ++AcknowledgementN) + AcknowledgementsAcknowledgementAdd(handle, acknowledgement[AcknowledgementN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AcknowledgementsAssign(ConstHandle2Acknowledgements self, ConstHandle2ConstAcknowledgements from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AcknowledgementsDelete(ConstHandle2ConstAcknowledgements self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AcknowledgementsRead(ConstHandle2Acknowledgements self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AcknowledgementsWrite(ConstHandle2ConstAcknowledgements self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AcknowledgementsPrint(ConstHandle2ConstAcknowledgements self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AcknowledgementsPrintXML(ConstHandle2ConstAcknowledgements self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AcknowledgementsPrintJSON(ConstHandle2ConstAcknowledgements self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: acknowledgement +// ----------------------------------------------------------------------------- + +// Has +int +AcknowledgementsAcknowledgementHas(ConstHandle2ConstAcknowledgements self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AcknowledgementHas", self, extract::acknowledgement); +} + +// Clear +void +AcknowledgementsAcknowledgementClear(ConstHandle2Acknowledgements self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AcknowledgementClear", self, extract::acknowledgement); +} + +// Size +size_t +AcknowledgementsAcknowledgementSize(ConstHandle2ConstAcknowledgements self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AcknowledgementSize", self, extract::acknowledgement); +} + +// Add +void +AcknowledgementsAcknowledgementAdd(ConstHandle2Acknowledgements self, ConstHandle2ConstAcknowledgement acknowledgement) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AcknowledgementAdd", self, extract::acknowledgement, acknowledgement); +} + +// Get, by index \in [0,size), const +Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetConst(ConstHandle2ConstAcknowledgements self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AcknowledgementGetConst", self, extract::acknowledgement, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Acknowledgement +AcknowledgementsAcknowledgementGet(ConstHandle2Acknowledgements self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AcknowledgementGet", self, extract::acknowledgement, index_); +} + +// Set, by index \in [0,size) +void +AcknowledgementsAcknowledgementSet( + ConstHandle2Acknowledgements self, + const size_t index_, + ConstHandle2ConstAcknowledgement acknowledgement +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AcknowledgementSet", self, extract::acknowledgement, index_, acknowledgement); +} + +// Has, by encoding +int +AcknowledgementsAcknowledgementHasByEncoding( + ConstHandle2ConstAcknowledgements self, + const XMLName encoding +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementHasByEncoding", + self, extract::acknowledgement, meta::encoding, encoding); +} + +// Get, by encoding, const +Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetByEncodingConst( + ConstHandle2ConstAcknowledgements self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementGetByEncodingConst", + self, extract::acknowledgement, meta::encoding, encoding); +} + +// Get, by encoding, non-const +Handle2Acknowledgement +AcknowledgementsAcknowledgementGetByEncoding( + ConstHandle2Acknowledgements self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementGetByEncoding", + self, extract::acknowledgement, meta::encoding, encoding); +} + +// Set, by encoding +void +AcknowledgementsAcknowledgementSetByEncoding( + ConstHandle2Acknowledgements self, + const XMLName encoding, + ConstHandle2ConstAcknowledgement acknowledgement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementSetByEncoding", + self, extract::acknowledgement, meta::encoding, encoding, acknowledgement); +} + +// Has, by markup +int +AcknowledgementsAcknowledgementHasByMarkup( + ConstHandle2ConstAcknowledgements self, + const char *const markup +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementHasByMarkup", + self, extract::acknowledgement, meta::markup, markup); +} + +// Get, by markup, const +Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetByMarkupConst( + ConstHandle2ConstAcknowledgements self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementGetByMarkupConst", + self, extract::acknowledgement, meta::markup, markup); +} + +// Get, by markup, non-const +Handle2Acknowledgement +AcknowledgementsAcknowledgementGetByMarkup( + ConstHandle2Acknowledgements self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementGetByMarkup", + self, extract::acknowledgement, meta::markup, markup); +} + +// Set, by markup +void +AcknowledgementsAcknowledgementSetByMarkup( + ConstHandle2Acknowledgements self, + const char *const markup, + ConstHandle2ConstAcknowledgement acknowledgement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementSetByMarkup", + self, extract::acknowledgement, meta::markup, markup, acknowledgement); +} + +// Has, by label +int +AcknowledgementsAcknowledgementHasByLabel( + ConstHandle2ConstAcknowledgements self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementHasByLabel", + self, extract::acknowledgement, meta::label, label); +} + +// Get, by label, const +Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetByLabelConst( + ConstHandle2ConstAcknowledgements self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementGetByLabelConst", + self, extract::acknowledgement, meta::label, label); +} + +// Get, by label, non-const +Handle2Acknowledgement +AcknowledgementsAcknowledgementGetByLabel( + ConstHandle2Acknowledgements self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementGetByLabel", + self, extract::acknowledgement, meta::label, label); +} + +// Set, by label +void +AcknowledgementsAcknowledgementSetByLabel( + ConstHandle2Acknowledgements self, + const XMLName label, + ConstHandle2ConstAcknowledgement acknowledgement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementSetByLabel", + self, extract::acknowledgement, meta::label, label, acknowledgement); +} + +// Has, by type +int +AcknowledgementsAcknowledgementHasByType( + ConstHandle2ConstAcknowledgements self, + const XMLName type +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementHasByType", + self, extract::acknowledgement, meta::type, type); +} + +// Get, by type, const +Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetByTypeConst( + ConstHandle2ConstAcknowledgements self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementGetByTypeConst", + self, extract::acknowledgement, meta::type, type); +} + +// Get, by type, non-const +Handle2Acknowledgement +AcknowledgementsAcknowledgementGetByType( + ConstHandle2Acknowledgements self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementGetByType", + self, extract::acknowledgement, meta::type, type); +} + +// Set, by type +void +AcknowledgementsAcknowledgementSetByType( + ConstHandle2Acknowledgements self, + const XMLName type, + ConstHandle2ConstAcknowledgement acknowledgement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AcknowledgementSetByType", + self, extract::acknowledgement, meta::type, type, acknowledgement); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Acknowledgements/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements.h new file mode 100644 index 000000000..31a82d045 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements.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. +// +// Acknowledgements is the basic handle type in this file. Example: +// // Create a default Acknowledgements object: +// Acknowledgements handle = AcknowledgementsDefault(); +// Functions involving Acknowledgements are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_ACKNOWLEDGEMENTS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_ACKNOWLEDGEMENTS + +#include "GNDStk.h" +#include "v2.0/documentation/Acknowledgement.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AcknowledgementsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Acknowledgements +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AcknowledgementsClass *Acknowledgements; + +// --- Const-aware handles. +typedef const struct AcknowledgementsClass *const ConstHandle2ConstAcknowledgements; +typedef struct AcknowledgementsClass *const ConstHandle2Acknowledgements; +typedef const struct AcknowledgementsClass * Handle2ConstAcknowledgements; +typedef struct AcknowledgementsClass * Handle2Acknowledgements; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAcknowledgements +AcknowledgementsDefaultConst(); + +// +++ Create, default +extern_c Handle2Acknowledgements +AcknowledgementsDefault(); + +// --- Create, general, const +extern_c Handle2ConstAcknowledgements +AcknowledgementsCreateConst( + ConstHandle2Acknowledgement *const acknowledgement, const size_t acknowledgementSize +); + +// +++ Create, general +extern_c Handle2Acknowledgements +AcknowledgementsCreate( + ConstHandle2Acknowledgement *const acknowledgement, const size_t acknowledgementSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AcknowledgementsAssign(ConstHandle2Acknowledgements self, ConstHandle2ConstAcknowledgements from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AcknowledgementsDelete(ConstHandle2ConstAcknowledgements self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AcknowledgementsRead(ConstHandle2Acknowledgements self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AcknowledgementsWrite(ConstHandle2ConstAcknowledgements self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AcknowledgementsPrint(ConstHandle2ConstAcknowledgements self); + +// +++ Print to standard output, as XML +extern_c int +AcknowledgementsPrintXML(ConstHandle2ConstAcknowledgements self); + +// +++ Print to standard output, as JSON +extern_c int +AcknowledgementsPrintJSON(ConstHandle2ConstAcknowledgements self); + + +// ----------------------------------------------------------------------------- +// Child: acknowledgement +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AcknowledgementsAcknowledgementHas(ConstHandle2ConstAcknowledgements self); + +// +++ Clear +extern_c void +AcknowledgementsAcknowledgementClear(ConstHandle2Acknowledgements self); + +// +++ Size +extern_c size_t +AcknowledgementsAcknowledgementSize(ConstHandle2ConstAcknowledgements self); + +// +++ Add +extern_c void +AcknowledgementsAcknowledgementAdd(ConstHandle2Acknowledgements self, ConstHandle2ConstAcknowledgement acknowledgement); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetConst(ConstHandle2ConstAcknowledgements self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Acknowledgement +AcknowledgementsAcknowledgementGet(ConstHandle2Acknowledgements self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +AcknowledgementsAcknowledgementSet( + ConstHandle2Acknowledgements self, + const size_t index_, + ConstHandle2ConstAcknowledgement acknowledgement +); + +// +++ Has, by encoding +extern_c int +AcknowledgementsAcknowledgementHasByEncoding( + ConstHandle2ConstAcknowledgements self, + const XMLName encoding +); + +// --- Get, by encoding, const +extern_c Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetByEncodingConst( + ConstHandle2ConstAcknowledgements self, + const XMLName encoding +); + +// +++ Get, by encoding, non-const +extern_c Handle2Acknowledgement +AcknowledgementsAcknowledgementGetByEncoding( + ConstHandle2Acknowledgements self, + const XMLName encoding +); + +// +++ Set, by encoding +extern_c void +AcknowledgementsAcknowledgementSetByEncoding( + ConstHandle2Acknowledgements self, + const XMLName encoding, + ConstHandle2ConstAcknowledgement acknowledgement +); + +// +++ Has, by markup +extern_c int +AcknowledgementsAcknowledgementHasByMarkup( + ConstHandle2ConstAcknowledgements self, + const char *const markup +); + +// --- Get, by markup, const +extern_c Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetByMarkupConst( + ConstHandle2ConstAcknowledgements self, + const char *const markup +); + +// +++ Get, by markup, non-const +extern_c Handle2Acknowledgement +AcknowledgementsAcknowledgementGetByMarkup( + ConstHandle2Acknowledgements self, + const char *const markup +); + +// +++ Set, by markup +extern_c void +AcknowledgementsAcknowledgementSetByMarkup( + ConstHandle2Acknowledgements self, + const char *const markup, + ConstHandle2ConstAcknowledgement acknowledgement +); + +// +++ Has, by label +extern_c int +AcknowledgementsAcknowledgementHasByLabel( + ConstHandle2ConstAcknowledgements self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetByLabelConst( + ConstHandle2ConstAcknowledgements self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Acknowledgement +AcknowledgementsAcknowledgementGetByLabel( + ConstHandle2Acknowledgements self, + const XMLName label +); + +// +++ Set, by label +extern_c void +AcknowledgementsAcknowledgementSetByLabel( + ConstHandle2Acknowledgements self, + const XMLName label, + ConstHandle2ConstAcknowledgement acknowledgement +); + +// +++ Has, by type +extern_c int +AcknowledgementsAcknowledgementHasByType( + ConstHandle2ConstAcknowledgements self, + const XMLName type +); + +// --- Get, by type, const +extern_c Handle2ConstAcknowledgement +AcknowledgementsAcknowledgementGetByTypeConst( + ConstHandle2ConstAcknowledgements self, + const XMLName type +); + +// +++ Get, by type, non-const +extern_c Handle2Acknowledgement +AcknowledgementsAcknowledgementGetByType( + ConstHandle2Acknowledgements self, + const XMLName type +); + +// +++ Set, by type +extern_c void +AcknowledgementsAcknowledgementSetByType( + ConstHandle2Acknowledgements self, + const XMLName type, + ConstHandle2ConstAcknowledgement acknowledgement +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Acknowledgements/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Acknowledgements/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation.cpp new file mode 100644 index 000000000..561b20937 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Affiliation.hpp" +#include "Affiliation.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AffiliationClass; +using CPP = multigroup::Affiliation; + +static const std::string CLASSNAME = "Affiliation"; + +namespace extract { + static auto name = [](auto &obj) { return &obj.name; }; + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAffiliation +AffiliationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Affiliation +AffiliationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAffiliation +AffiliationCreateConst( + const UTF8Text name, + const UTF8Text href +) { + ConstHandle2Affiliation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name, + href + ); + return handle; +} + +// Create, general +Handle2Affiliation +AffiliationCreate( + const UTF8Text name, + const UTF8Text href +) { + ConstHandle2Affiliation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name, + 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 +AffiliationAssign(ConstHandle2Affiliation self, ConstHandle2ConstAffiliation from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AffiliationDelete(ConstHandle2ConstAffiliation self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AffiliationRead(ConstHandle2Affiliation self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AffiliationWrite(ConstHandle2ConstAffiliation self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AffiliationPrint(ConstHandle2ConstAffiliation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AffiliationPrintXML(ConstHandle2ConstAffiliation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AffiliationPrintJSON(ConstHandle2ConstAffiliation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +AffiliationNameHas(ConstHandle2ConstAffiliation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +UTF8Text +AffiliationNameGet(ConstHandle2ConstAffiliation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +AffiliationNameSet(ConstHandle2Affiliation self, const UTF8Text name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +AffiliationHrefHas(ConstHandle2ConstAffiliation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +UTF8Text +AffiliationHrefGet(ConstHandle2ConstAffiliation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +AffiliationHrefSet(ConstHandle2Affiliation self, const UTF8Text href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Affiliation/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation.h new file mode 100644 index 000000000..3ddb749e7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation.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. +// +// Affiliation is the basic handle type in this file. Example: +// // Create a default Affiliation object: +// Affiliation handle = AffiliationDefault(); +// Functions involving Affiliation are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_AFFILIATION +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_AFFILIATION + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AffiliationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Affiliation +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AffiliationClass *Affiliation; + +// --- Const-aware handles. +typedef const struct AffiliationClass *const ConstHandle2ConstAffiliation; +typedef struct AffiliationClass *const ConstHandle2Affiliation; +typedef const struct AffiliationClass * Handle2ConstAffiliation; +typedef struct AffiliationClass * Handle2Affiliation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAffiliation +AffiliationDefaultConst(); + +// +++ Create, default +extern_c Handle2Affiliation +AffiliationDefault(); + +// --- Create, general, const +extern_c Handle2ConstAffiliation +AffiliationCreateConst( + const UTF8Text name, + const UTF8Text href +); + +// +++ Create, general +extern_c Handle2Affiliation +AffiliationCreate( + const UTF8Text name, + const UTF8Text 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 +AffiliationAssign(ConstHandle2Affiliation self, ConstHandle2ConstAffiliation from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AffiliationDelete(ConstHandle2ConstAffiliation self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AffiliationRead(ConstHandle2Affiliation self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AffiliationWrite(ConstHandle2ConstAffiliation self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AffiliationPrint(ConstHandle2ConstAffiliation self); + +// +++ Print to standard output, as XML +extern_c int +AffiliationPrintXML(ConstHandle2ConstAffiliation self); + +// +++ Print to standard output, as JSON +extern_c int +AffiliationPrintJSON(ConstHandle2ConstAffiliation self); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AffiliationNameHas(ConstHandle2ConstAffiliation self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +AffiliationNameGet(ConstHandle2ConstAffiliation self); + +// +++ Set +extern_c void +AffiliationNameSet(ConstHandle2Affiliation self, const UTF8Text name); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AffiliationHrefHas(ConstHandle2ConstAffiliation self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +AffiliationHrefGet(ConstHandle2ConstAffiliation self); + +// +++ Set +extern_c void +AffiliationHrefSet(ConstHandle2Affiliation self, const UTF8Text href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Affiliation/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations.cpp new file mode 100644 index 000000000..c70c5d147 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Affiliations.hpp" +#include "Affiliations.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AffiliationsClass; +using CPP = multigroup::Affiliations; + +static const std::string CLASSNAME = "Affiliations"; + +namespace extract { + static auto affiliation = [](auto &obj) { return &obj.affiliation; }; +} + +using CPPAffiliation = documentation::Affiliation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAffiliations +AffiliationsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Affiliations +AffiliationsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAffiliations +AffiliationsCreateConst( + ConstHandle2Affiliation *const affiliation, const size_t affiliationSize +) { + ConstHandle2Affiliations handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t AffiliationN = 0; AffiliationN < affiliationSize; ++AffiliationN) + AffiliationsAffiliationAdd(handle, affiliation[AffiliationN]); + return handle; +} + +// Create, general +Handle2Affiliations +AffiliationsCreate( + ConstHandle2Affiliation *const affiliation, const size_t affiliationSize +) { + ConstHandle2Affiliations handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t AffiliationN = 0; AffiliationN < affiliationSize; ++AffiliationN) + AffiliationsAffiliationAdd(handle, affiliation[AffiliationN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AffiliationsAssign(ConstHandle2Affiliations self, ConstHandle2ConstAffiliations from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AffiliationsDelete(ConstHandle2ConstAffiliations self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AffiliationsRead(ConstHandle2Affiliations self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AffiliationsWrite(ConstHandle2ConstAffiliations self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AffiliationsPrint(ConstHandle2ConstAffiliations self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AffiliationsPrintXML(ConstHandle2ConstAffiliations self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AffiliationsPrintJSON(ConstHandle2ConstAffiliations self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: affiliation +// ----------------------------------------------------------------------------- + +// Has +int +AffiliationsAffiliationHas(ConstHandle2ConstAffiliations self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AffiliationHas", self, extract::affiliation); +} + +// Clear +void +AffiliationsAffiliationClear(ConstHandle2Affiliations self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AffiliationClear", self, extract::affiliation); +} + +// Size +size_t +AffiliationsAffiliationSize(ConstHandle2ConstAffiliations self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AffiliationSize", self, extract::affiliation); +} + +// Add +void +AffiliationsAffiliationAdd(ConstHandle2Affiliations self, ConstHandle2ConstAffiliation affiliation) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AffiliationAdd", self, extract::affiliation, affiliation); +} + +// Get, by index \in [0,size), const +Handle2ConstAffiliation +AffiliationsAffiliationGetConst(ConstHandle2ConstAffiliations self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AffiliationGetConst", self, extract::affiliation, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Affiliation +AffiliationsAffiliationGet(ConstHandle2Affiliations self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AffiliationGet", self, extract::affiliation, index_); +} + +// Set, by index \in [0,size) +void +AffiliationsAffiliationSet( + ConstHandle2Affiliations self, + const size_t index_, + ConstHandle2ConstAffiliation affiliation +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AffiliationSet", self, extract::affiliation, index_, affiliation); +} + +// Has, by name +int +AffiliationsAffiliationHasByName( + ConstHandle2ConstAffiliations self, + const UTF8Text name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AffiliationHasByName", + self, extract::affiliation, meta::name, name); +} + +// Get, by name, const +Handle2ConstAffiliation +AffiliationsAffiliationGetByNameConst( + ConstHandle2ConstAffiliations self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AffiliationGetByNameConst", + self, extract::affiliation, meta::name, name); +} + +// Get, by name, non-const +Handle2Affiliation +AffiliationsAffiliationGetByName( + ConstHandle2Affiliations self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AffiliationGetByName", + self, extract::affiliation, meta::name, name); +} + +// Set, by name +void +AffiliationsAffiliationSetByName( + ConstHandle2Affiliations self, + const UTF8Text name, + ConstHandle2ConstAffiliation affiliation +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AffiliationSetByName", + self, extract::affiliation, meta::name, name, affiliation); +} + +// Has, by href +int +AffiliationsAffiliationHasByHref( + ConstHandle2ConstAffiliations self, + const UTF8Text href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AffiliationHasByHref", + self, extract::affiliation, meta::href, href); +} + +// Get, by href, const +Handle2ConstAffiliation +AffiliationsAffiliationGetByHrefConst( + ConstHandle2ConstAffiliations self, + const UTF8Text href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AffiliationGetByHrefConst", + self, extract::affiliation, meta::href, href); +} + +// Get, by href, non-const +Handle2Affiliation +AffiliationsAffiliationGetByHref( + ConstHandle2Affiliations self, + const UTF8Text href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AffiliationGetByHref", + self, extract::affiliation, meta::href, href); +} + +// Set, by href +void +AffiliationsAffiliationSetByHref( + ConstHandle2Affiliations self, + const UTF8Text href, + ConstHandle2ConstAffiliation affiliation +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AffiliationSetByHref", + self, extract::affiliation, meta::href, href, affiliation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Affiliations/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations.h new file mode 100644 index 000000000..b7c8fcd38 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Affiliations is the basic handle type in this file. Example: +// // Create a default Affiliations object: +// Affiliations handle = AffiliationsDefault(); +// Functions involving Affiliations are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_AFFILIATIONS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_AFFILIATIONS + +#include "GNDStk.h" +#include "v2.0/documentation/Affiliation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AffiliationsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Affiliations +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AffiliationsClass *Affiliations; + +// --- Const-aware handles. +typedef const struct AffiliationsClass *const ConstHandle2ConstAffiliations; +typedef struct AffiliationsClass *const ConstHandle2Affiliations; +typedef const struct AffiliationsClass * Handle2ConstAffiliations; +typedef struct AffiliationsClass * Handle2Affiliations; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAffiliations +AffiliationsDefaultConst(); + +// +++ Create, default +extern_c Handle2Affiliations +AffiliationsDefault(); + +// --- Create, general, const +extern_c Handle2ConstAffiliations +AffiliationsCreateConst( + ConstHandle2Affiliation *const affiliation, const size_t affiliationSize +); + +// +++ Create, general +extern_c Handle2Affiliations +AffiliationsCreate( + ConstHandle2Affiliation *const affiliation, const size_t affiliationSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AffiliationsAssign(ConstHandle2Affiliations self, ConstHandle2ConstAffiliations from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AffiliationsDelete(ConstHandle2ConstAffiliations self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AffiliationsRead(ConstHandle2Affiliations self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AffiliationsWrite(ConstHandle2ConstAffiliations self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AffiliationsPrint(ConstHandle2ConstAffiliations self); + +// +++ Print to standard output, as XML +extern_c int +AffiliationsPrintXML(ConstHandle2ConstAffiliations self); + +// +++ Print to standard output, as JSON +extern_c int +AffiliationsPrintJSON(ConstHandle2ConstAffiliations self); + + +// ----------------------------------------------------------------------------- +// Child: affiliation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AffiliationsAffiliationHas(ConstHandle2ConstAffiliations self); + +// +++ Clear +extern_c void +AffiliationsAffiliationClear(ConstHandle2Affiliations self); + +// +++ Size +extern_c size_t +AffiliationsAffiliationSize(ConstHandle2ConstAffiliations self); + +// +++ Add +extern_c void +AffiliationsAffiliationAdd(ConstHandle2Affiliations self, ConstHandle2ConstAffiliation affiliation); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAffiliation +AffiliationsAffiliationGetConst(ConstHandle2ConstAffiliations self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Affiliation +AffiliationsAffiliationGet(ConstHandle2Affiliations self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +AffiliationsAffiliationSet( + ConstHandle2Affiliations self, + const size_t index_, + ConstHandle2ConstAffiliation affiliation +); + +// +++ Has, by name +extern_c int +AffiliationsAffiliationHasByName( + ConstHandle2ConstAffiliations self, + const UTF8Text name +); + +// --- Get, by name, const +extern_c Handle2ConstAffiliation +AffiliationsAffiliationGetByNameConst( + ConstHandle2ConstAffiliations self, + const UTF8Text name +); + +// +++ Get, by name, non-const +extern_c Handle2Affiliation +AffiliationsAffiliationGetByName( + ConstHandle2Affiliations self, + const UTF8Text name +); + +// +++ Set, by name +extern_c void +AffiliationsAffiliationSetByName( + ConstHandle2Affiliations self, + const UTF8Text name, + ConstHandle2ConstAffiliation affiliation +); + +// +++ Has, by href +extern_c int +AffiliationsAffiliationHasByHref( + ConstHandle2ConstAffiliations self, + const UTF8Text href +); + +// --- Get, by href, const +extern_c Handle2ConstAffiliation +AffiliationsAffiliationGetByHrefConst( + ConstHandle2ConstAffiliations self, + const UTF8Text href +); + +// +++ Get, by href, non-const +extern_c Handle2Affiliation +AffiliationsAffiliationGetByHref( + ConstHandle2Affiliations self, + const UTF8Text href +); + +// +++ Set, by href +extern_c void +AffiliationsAffiliationSetByHref( + ConstHandle2Affiliations self, + const UTF8Text href, + ConstHandle2ConstAffiliation affiliation +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Affiliations/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Affiliations/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Author.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Author.cpp new file mode 100644 index 000000000..f88f5f181 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Author.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Author.hpp" +#include "Author.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto orcid = [](auto &obj) { return &obj.orcid; }; + static auto email = [](auto &obj) { return &obj.email; }; + static auto affiliations = [](auto &obj) { return &obj.affiliations; }; + static auto note = [](auto &obj) { return &obj.note; }; +} + +using CPPAffiliations = documentation::Affiliations; +using CPPNote = documentation::Note; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAuthor +AuthorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Author +AuthorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAuthor +AuthorCreateConst( + const UTF8Text name, + const UTF8Text orcid, + const UTF8Text email, + ConstHandle2ConstAffiliations affiliations, + ConstHandle2ConstNote note +) { + ConstHandle2Author handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name, + orcid, + email, + detail::tocpp(affiliations), + detail::tocpp(note) + ); + return handle; +} + +// Create, general +Handle2Author +AuthorCreate( + const UTF8Text name, + const UTF8Text orcid, + const UTF8Text email, + ConstHandle2ConstAffiliations affiliations, + ConstHandle2ConstNote note +) { + ConstHandle2Author handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name, + orcid, + email, + detail::tocpp(affiliations), + detail::tocpp(note) + ); + return handle; +} + +// Assign +// Use this to assign 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 +UTF8Text +AuthorNameGet(ConstHandle2ConstAuthor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +AuthorNameSet(ConstHandle2Author self, const UTF8Text name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: orcid +// ----------------------------------------------------------------------------- + +// Has +int +AuthorOrcidHas(ConstHandle2ConstAuthor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OrcidHas", self, extract::orcid); +} + +// Get +// Returns by value +UTF8Text +AuthorOrcidGet(ConstHandle2ConstAuthor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OrcidGet", self, extract::orcid); +} + +// Set +void +AuthorOrcidSet(ConstHandle2Author self, const UTF8Text orcid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OrcidSet", self, extract::orcid, orcid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: email +// ----------------------------------------------------------------------------- + +// Has +int +AuthorEmailHas(ConstHandle2ConstAuthor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EmailHas", self, extract::email); +} + +// Get +// Returns by value +UTF8Text +AuthorEmailGet(ConstHandle2ConstAuthor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EmailGet", self, extract::email); +} + +// Set +void +AuthorEmailSet(ConstHandle2Author self, const UTF8Text email) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EmailSet", self, extract::email, email); +} + + +// ----------------------------------------------------------------------------- +// Child: affiliations +// ----------------------------------------------------------------------------- + +// Has +int +AuthorAffiliationsHas(ConstHandle2ConstAuthor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AffiliationsHas", self, extract::affiliations); +} + +// Get, const +Handle2ConstAffiliations +AuthorAffiliationsGetConst(ConstHandle2ConstAuthor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AffiliationsGetConst", self, extract::affiliations); +} + +// Get, non-const +Handle2Affiliations +AuthorAffiliationsGet(ConstHandle2Author self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AffiliationsGet", self, extract::affiliations); +} + +// Set +void +AuthorAffiliationsSet(ConstHandle2Author self, ConstHandle2ConstAffiliations affiliations) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AffiliationsSet", self, extract::affiliations, affiliations); +} + + +// ----------------------------------------------------------------------------- +// Child: note +// ----------------------------------------------------------------------------- + +// Has +int +AuthorNoteHas(ConstHandle2ConstAuthor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NoteHas", self, extract::note); +} + +// Get, const +Handle2ConstNote +AuthorNoteGetConst(ConstHandle2ConstAuthor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NoteGetConst", self, extract::note); +} + +// Get, non-const +Handle2Note +AuthorNoteGet(ConstHandle2Author self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NoteGet", self, extract::note); +} + +// Set +void +AuthorNoteSet(ConstHandle2Author self, ConstHandle2ConstNote note) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NoteSet", self, extract::note, note); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Author/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Author.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Author.h new file mode 100644 index 000000000..ffa834e9b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Author.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. +// +// 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_TEST_V2_0_DOCUMENTATION_AUTHOR +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_AUTHOR + +#include "GNDStk.h" +#include "v2.0/documentation/Affiliations.h" +#include "v2.0/documentation/Note.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 +extern_c Handle2Author +AuthorDefault(); + +// --- Create, general, const +extern_c Handle2ConstAuthor +AuthorCreateConst( + const UTF8Text name, + const UTF8Text orcid, + const UTF8Text email, + ConstHandle2ConstAffiliations affiliations, + ConstHandle2ConstNote note +); + +// +++ Create, general +extern_c Handle2Author +AuthorCreate( + const UTF8Text name, + const UTF8Text orcid, + const UTF8Text email, + ConstHandle2ConstAffiliations affiliations, + ConstHandle2ConstNote note +); + +// +++ Assign +// +++ Use this to assign one handled 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 UTF8Text +AuthorNameGet(ConstHandle2ConstAuthor self); + +// +++ Set +extern_c void +AuthorNameSet(ConstHandle2Author self, const UTF8Text name); + + +// ----------------------------------------------------------------------------- +// Metadatum: orcid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AuthorOrcidHas(ConstHandle2ConstAuthor self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +AuthorOrcidGet(ConstHandle2ConstAuthor self); + +// +++ Set +extern_c void +AuthorOrcidSet(ConstHandle2Author self, const UTF8Text orcid); + + +// ----------------------------------------------------------------------------- +// Metadatum: email +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AuthorEmailHas(ConstHandle2ConstAuthor self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +AuthorEmailGet(ConstHandle2ConstAuthor self); + +// +++ Set +extern_c void +AuthorEmailSet(ConstHandle2Author self, const UTF8Text email); + + +// ----------------------------------------------------------------------------- +// Child: affiliations +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AuthorAffiliationsHas(ConstHandle2ConstAuthor self); + +// --- Get, const +extern_c Handle2ConstAffiliations +AuthorAffiliationsGetConst(ConstHandle2ConstAuthor self); + +// +++ Get, non-const +extern_c Handle2Affiliations +AuthorAffiliationsGet(ConstHandle2Author self); + +// +++ Set +extern_c void +AuthorAffiliationsSet(ConstHandle2Author self, ConstHandle2ConstAffiliations affiliations); + + +// ----------------------------------------------------------------------------- +// Child: note +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AuthorNoteHas(ConstHandle2ConstAuthor self); + +// --- Get, const +extern_c Handle2ConstNote +AuthorNoteGetConst(ConstHandle2ConstAuthor self); + +// +++ Get, non-const +extern_c Handle2Note +AuthorNoteGet(ConstHandle2Author self); + +// +++ Set +extern_c void +AuthorNoteSet(ConstHandle2Author self, ConstHandle2ConstNote note); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Author/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Author/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Author/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Author/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Author/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors.cpp new file mode 100644 index 000000000..c756c485f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Authors.hpp" +#include "Authors.h" + +using namespace njoy::GNDStk; +using namespace test::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 = documentation::Author; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAuthors +AuthorsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by name +int +AuthorsAuthorHasByName( + ConstHandle2ConstAuthors self, + const UTF8Text name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AuthorHasByName", + self, extract::author, meta::name, name); +} + +// Get, by name, const +Handle2ConstAuthor +AuthorsAuthorGetByNameConst( + ConstHandle2ConstAuthors self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByNameConst", + self, extract::author, meta::name, name); +} + +// Get, by name, non-const +Handle2Author +AuthorsAuthorGetByName( + ConstHandle2Authors self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByName", + self, extract::author, meta::name, name); +} + +// Set, by name +void +AuthorsAuthorSetByName( + ConstHandle2Authors self, + const UTF8Text name, + ConstHandle2ConstAuthor author +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AuthorSetByName", + self, extract::author, meta::name, name, author); +} + +// Has, by orcid +int +AuthorsAuthorHasByOrcid( + ConstHandle2ConstAuthors self, + const UTF8Text orcid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AuthorHasByOrcid", + self, extract::author, meta::orcid, orcid); +} + +// Get, by orcid, const +Handle2ConstAuthor +AuthorsAuthorGetByOrcidConst( + ConstHandle2ConstAuthors self, + const UTF8Text orcid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByOrcidConst", + self, extract::author, meta::orcid, orcid); +} + +// Get, by orcid, non-const +Handle2Author +AuthorsAuthorGetByOrcid( + ConstHandle2Authors self, + const UTF8Text orcid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByOrcid", + self, extract::author, meta::orcid, orcid); +} + +// Set, by orcid +void +AuthorsAuthorSetByOrcid( + ConstHandle2Authors self, + const UTF8Text orcid, + ConstHandle2ConstAuthor author +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AuthorSetByOrcid", + self, extract::author, meta::orcid, orcid, author); +} + +// Has, by email +int +AuthorsAuthorHasByEmail( + ConstHandle2ConstAuthors self, + const UTF8Text email +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AuthorHasByEmail", + self, extract::author, meta::email, email); +} + +// Get, by email, const +Handle2ConstAuthor +AuthorsAuthorGetByEmailConst( + ConstHandle2ConstAuthors self, + const UTF8Text email +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByEmailConst", + self, extract::author, meta::email, email); +} + +// Get, by email, non-const +Handle2Author +AuthorsAuthorGetByEmail( + ConstHandle2Authors self, + const UTF8Text email +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByEmail", + self, extract::author, meta::email, email); +} + +// Set, by email +void +AuthorsAuthorSetByEmail( + ConstHandle2Authors self, + const UTF8Text email, + ConstHandle2ConstAuthor author +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AuthorSetByEmail", + self, extract::author, meta::email, email, author); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Authors/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors.h new file mode 100644 index 000000000..69602bb71 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors.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. +// +// 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_TEST_V2_0_DOCUMENTATION_AUTHORS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_AUTHORS + +#include "GNDStk.h" +#include "v2.0/documentation/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 +extern_c Handle2Authors +AuthorsDefault(); + +// --- Create, general, const +extern_c Handle2ConstAuthors +AuthorsCreateConst( + ConstHandle2Author *const author, const size_t authorSize +); + +// +++ Create, general +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 +); + +// +++ Has, by name +extern_c int +AuthorsAuthorHasByName( + ConstHandle2ConstAuthors self, + const UTF8Text name +); + +// --- Get, by name, const +extern_c Handle2ConstAuthor +AuthorsAuthorGetByNameConst( + ConstHandle2ConstAuthors self, + const UTF8Text name +); + +// +++ Get, by name, non-const +extern_c Handle2Author +AuthorsAuthorGetByName( + ConstHandle2Authors self, + const UTF8Text name +); + +// +++ Set, by name +extern_c void +AuthorsAuthorSetByName( + ConstHandle2Authors self, + const UTF8Text name, + ConstHandle2ConstAuthor author +); + +// +++ Has, by orcid +extern_c int +AuthorsAuthorHasByOrcid( + ConstHandle2ConstAuthors self, + const UTF8Text orcid +); + +// --- Get, by orcid, const +extern_c Handle2ConstAuthor +AuthorsAuthorGetByOrcidConst( + ConstHandle2ConstAuthors self, + const UTF8Text orcid +); + +// +++ Get, by orcid, non-const +extern_c Handle2Author +AuthorsAuthorGetByOrcid( + ConstHandle2Authors self, + const UTF8Text orcid +); + +// +++ Set, by orcid +extern_c void +AuthorsAuthorSetByOrcid( + ConstHandle2Authors self, + const UTF8Text orcid, + ConstHandle2ConstAuthor author +); + +// +++ Has, by email +extern_c int +AuthorsAuthorHasByEmail( + ConstHandle2ConstAuthors self, + const UTF8Text email +); + +// --- Get, by email, const +extern_c Handle2ConstAuthor +AuthorsAuthorGetByEmailConst( + ConstHandle2ConstAuthors self, + const UTF8Text email +); + +// +++ Get, by email, non-const +extern_c Handle2Author +AuthorsAuthorGetByEmail( + ConstHandle2Authors self, + const UTF8Text email +); + +// +++ Set, by email +extern_c void +AuthorsAuthorSetByEmail( + ConstHandle2Authors self, + const UTF8Text email, + ConstHandle2ConstAuthor author +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Authors/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Authors/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem.cpp new file mode 100644 index 000000000..189f0bdd7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem.cpp @@ -0,0 +1,530 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Bibitem.hpp" +#include "Bibitem.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BibitemClass; +using CPP = multigroup::Bibitem; + +static const std::string CLASSNAME = "Bibitem"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto xref = [](auto &obj) { return &obj.xref; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBibitem +BibitemDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Bibitem +BibitemDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBibitem +BibitemCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName xref +) { + ConstHandle2Bibitem handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label, + xref + ); + return handle; +} + +// Create, general +Handle2Bibitem +BibitemCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName xref +) { + ConstHandle2Bibitem handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + label, + xref + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BibitemAssign(ConstHandle2Bibitem self, ConstHandle2ConstBibitem from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BibitemDelete(ConstHandle2ConstBibitem self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BibitemRead(ConstHandle2Bibitem self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BibitemWrite(ConstHandle2ConstBibitem self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BibitemPrint(ConstHandle2ConstBibitem self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BibitemPrintXML(ConstHandle2ConstBibitem self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BibitemPrintJSON(ConstHandle2ConstBibitem self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +BibitemIntsClear(ConstHandle2Bibitem self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +BibitemIntsSize(ConstHandle2ConstBibitem self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +BibitemIntsGet(ConstHandle2ConstBibitem self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BibitemIntsSet(ConstHandle2Bibitem self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +BibitemIntsGetArrayConst(ConstHandle2ConstBibitem self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +BibitemIntsGetArray(ConstHandle2Bibitem self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +BibitemIntsSetArray(ConstHandle2Bibitem self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +BibitemUnsignedsClear(ConstHandle2Bibitem self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +BibitemUnsignedsSize(ConstHandle2ConstBibitem self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +BibitemUnsignedsGet(ConstHandle2ConstBibitem self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BibitemUnsignedsSet(ConstHandle2Bibitem self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +BibitemUnsignedsGetArrayConst(ConstHandle2ConstBibitem self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +BibitemUnsignedsGetArray(ConstHandle2Bibitem self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +BibitemUnsignedsSetArray(ConstHandle2Bibitem self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +BibitemFloatsClear(ConstHandle2Bibitem self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +BibitemFloatsSize(ConstHandle2ConstBibitem self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +BibitemFloatsGet(ConstHandle2ConstBibitem self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BibitemFloatsSet(ConstHandle2Bibitem self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +BibitemFloatsGetArrayConst(ConstHandle2ConstBibitem self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +BibitemFloatsGetArray(ConstHandle2Bibitem self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +BibitemFloatsSetArray(ConstHandle2Bibitem self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +BibitemDoublesClear(ConstHandle2Bibitem self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +BibitemDoublesSize(ConstHandle2ConstBibitem self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +BibitemDoublesGet(ConstHandle2ConstBibitem self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BibitemDoublesSet(ConstHandle2Bibitem self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +BibitemDoublesGetArrayConst(ConstHandle2ConstBibitem self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +BibitemDoublesGetArray(ConstHandle2Bibitem self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +BibitemDoublesSetArray(ConstHandle2Bibitem self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +BibitemEncodingHas(ConstHandle2ConstBibitem self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +BibitemEncodingGet(ConstHandle2ConstBibitem self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +BibitemEncodingSet(ConstHandle2Bibitem self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +BibitemMarkupHas(ConstHandle2ConstBibitem self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +BibitemMarkupGet(ConstHandle2ConstBibitem self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +BibitemMarkupSet(ConstHandle2Bibitem self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +BibitemLabelHas(ConstHandle2ConstBibitem self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +BibitemLabelGet(ConstHandle2ConstBibitem self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +BibitemLabelSet(ConstHandle2Bibitem self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: xref +// ----------------------------------------------------------------------------- + +// Has +int +BibitemXrefHas(ConstHandle2ConstBibitem self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XrefHas", self, extract::xref); +} + +// Get +// Returns by value +XMLName +BibitemXrefGet(ConstHandle2ConstBibitem self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XrefGet", self, extract::xref); +} + +// Set +void +BibitemXrefSet(ConstHandle2Bibitem self, const XMLName xref) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XrefSet", self, extract::xref, xref); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Bibitem/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem.h new file mode 100644 index 000000000..186103d5d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem.h @@ -0,0 +1,358 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Bibitem is the basic handle type in this file. Example: +// // Create a default Bibitem object: +// Bibitem handle = BibitemDefault(); +// Functions involving Bibitem are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_BIBITEM +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_BIBITEM + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BibitemClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Bibitem +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BibitemClass *Bibitem; + +// --- Const-aware handles. +typedef const struct BibitemClass *const ConstHandle2ConstBibitem; +typedef struct BibitemClass *const ConstHandle2Bibitem; +typedef const struct BibitemClass * Handle2ConstBibitem; +typedef struct BibitemClass * Handle2Bibitem; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBibitem +BibitemDefaultConst(); + +// +++ Create, default +extern_c Handle2Bibitem +BibitemDefault(); + +// --- Create, general, const +extern_c Handle2ConstBibitem +BibitemCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName xref +); + +// +++ Create, general +extern_c Handle2Bibitem +BibitemCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName xref +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BibitemAssign(ConstHandle2Bibitem self, ConstHandle2ConstBibitem from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BibitemDelete(ConstHandle2ConstBibitem self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BibitemRead(ConstHandle2Bibitem self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BibitemWrite(ConstHandle2ConstBibitem self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BibitemPrint(ConstHandle2ConstBibitem self); + +// +++ Print to standard output, as XML +extern_c int +BibitemPrintXML(ConstHandle2ConstBibitem self); + +// +++ Print to standard output, as JSON +extern_c int +BibitemPrintJSON(ConstHandle2ConstBibitem self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +BibitemIntsClear(ConstHandle2Bibitem self); + +// +++ Get size +extern_c size_t +BibitemIntsSize(ConstHandle2ConstBibitem self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +BibitemIntsGet(ConstHandle2ConstBibitem self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BibitemIntsSet(ConstHandle2Bibitem self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +BibitemIntsGetArrayConst(ConstHandle2ConstBibitem self); + +// +++ Get pointer to existing values, non-const +extern_c int * +BibitemIntsGetArray(ConstHandle2Bibitem self); + +// +++ Set completely new values and size +extern_c void +BibitemIntsSetArray(ConstHandle2Bibitem self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +BibitemUnsignedsClear(ConstHandle2Bibitem self); + +// +++ Get size +extern_c size_t +BibitemUnsignedsSize(ConstHandle2ConstBibitem self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +BibitemUnsignedsGet(ConstHandle2ConstBibitem self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BibitemUnsignedsSet(ConstHandle2Bibitem self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +BibitemUnsignedsGetArrayConst(ConstHandle2ConstBibitem self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +BibitemUnsignedsGetArray(ConstHandle2Bibitem self); + +// +++ Set completely new values and size +extern_c void +BibitemUnsignedsSetArray(ConstHandle2Bibitem self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +BibitemFloatsClear(ConstHandle2Bibitem self); + +// +++ Get size +extern_c size_t +BibitemFloatsSize(ConstHandle2ConstBibitem self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +BibitemFloatsGet(ConstHandle2ConstBibitem self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BibitemFloatsSet(ConstHandle2Bibitem self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +BibitemFloatsGetArrayConst(ConstHandle2ConstBibitem self); + +// +++ Get pointer to existing values, non-const +extern_c float * +BibitemFloatsGetArray(ConstHandle2Bibitem self); + +// +++ Set completely new values and size +extern_c void +BibitemFloatsSetArray(ConstHandle2Bibitem self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +BibitemDoublesClear(ConstHandle2Bibitem self); + +// +++ Get size +extern_c size_t +BibitemDoublesSize(ConstHandle2ConstBibitem self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +BibitemDoublesGet(ConstHandle2ConstBibitem self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BibitemDoublesSet(ConstHandle2Bibitem self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +BibitemDoublesGetArrayConst(ConstHandle2ConstBibitem self); + +// +++ Get pointer to existing values, non-const +extern_c double * +BibitemDoublesGetArray(ConstHandle2Bibitem self); + +// +++ Set completely new values and size +extern_c void +BibitemDoublesSetArray(ConstHandle2Bibitem self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BibitemEncodingHas(ConstHandle2ConstBibitem self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BibitemEncodingGet(ConstHandle2ConstBibitem self); + +// +++ Set +extern_c void +BibitemEncodingSet(ConstHandle2Bibitem self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BibitemMarkupHas(ConstHandle2ConstBibitem self); + +// +++ Get +// +++ Returns by value +extern_c const char * +BibitemMarkupGet(ConstHandle2ConstBibitem self); + +// +++ Set +extern_c void +BibitemMarkupSet(ConstHandle2Bibitem self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BibitemLabelHas(ConstHandle2ConstBibitem self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BibitemLabelGet(ConstHandle2ConstBibitem self); + +// +++ Set +extern_c void +BibitemLabelSet(ConstHandle2Bibitem self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: xref +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BibitemXrefHas(ConstHandle2ConstBibitem self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BibitemXrefGet(ConstHandle2ConstBibitem self); + +// +++ Set +extern_c void +BibitemXrefSet(ConstHandle2Bibitem self, const XMLName xref); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Bibitem/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibitem/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography.cpp new file mode 100644 index 000000000..52de3c89c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Bibliography.hpp" +#include "Bibliography.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BibliographyClass; +using CPP = multigroup::Bibliography; + +static const std::string CLASSNAME = "Bibliography"; + +namespace extract { + static auto bibitem = [](auto &obj) { return &obj.bibitem; }; +} + +using CPPBibitem = documentation::Bibitem; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBibliography +BibliographyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Bibliography +BibliographyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBibliography +BibliographyCreateConst( + ConstHandle2Bibitem *const bibitem, const size_t bibitemSize +) { + ConstHandle2Bibliography handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t BibitemN = 0; BibitemN < bibitemSize; ++BibitemN) + BibliographyBibitemAdd(handle, bibitem[BibitemN]); + return handle; +} + +// Create, general +Handle2Bibliography +BibliographyCreate( + ConstHandle2Bibitem *const bibitem, const size_t bibitemSize +) { + ConstHandle2Bibliography handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t BibitemN = 0; BibitemN < bibitemSize; ++BibitemN) + BibliographyBibitemAdd(handle, bibitem[BibitemN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BibliographyAssign(ConstHandle2Bibliography self, ConstHandle2ConstBibliography from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BibliographyDelete(ConstHandle2ConstBibliography self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BibliographyRead(ConstHandle2Bibliography self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BibliographyWrite(ConstHandle2ConstBibliography self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BibliographyPrint(ConstHandle2ConstBibliography self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BibliographyPrintXML(ConstHandle2ConstBibliography self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BibliographyPrintJSON(ConstHandle2ConstBibliography self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: bibitem +// ----------------------------------------------------------------------------- + +// Has +int +BibliographyBibitemHas(ConstHandle2ConstBibliography self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BibitemHas", self, extract::bibitem); +} + +// Clear +void +BibliographyBibitemClear(ConstHandle2Bibliography self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"BibitemClear", self, extract::bibitem); +} + +// Size +size_t +BibliographyBibitemSize(ConstHandle2ConstBibliography self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"BibitemSize", self, extract::bibitem); +} + +// Add +void +BibliographyBibitemAdd(ConstHandle2Bibliography self, ConstHandle2ConstBibitem bibitem) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"BibitemAdd", self, extract::bibitem, bibitem); +} + +// Get, by index \in [0,size), const +Handle2ConstBibitem +BibliographyBibitemGetConst(ConstHandle2ConstBibliography self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"BibitemGetConst", self, extract::bibitem, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Bibitem +BibliographyBibitemGet(ConstHandle2Bibliography self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"BibitemGet", self, extract::bibitem, index_); +} + +// Set, by index \in [0,size) +void +BibliographyBibitemSet( + ConstHandle2Bibliography self, + const size_t index_, + ConstHandle2ConstBibitem bibitem +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"BibitemSet", self, extract::bibitem, index_, bibitem); +} + +// Has, by encoding +int +BibliographyBibitemHasByEncoding( + ConstHandle2ConstBibliography self, + const XMLName encoding +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"BibitemHasByEncoding", + self, extract::bibitem, meta::encoding, encoding); +} + +// Get, by encoding, const +Handle2ConstBibitem +BibliographyBibitemGetByEncodingConst( + ConstHandle2ConstBibliography self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BibitemGetByEncodingConst", + self, extract::bibitem, meta::encoding, encoding); +} + +// Get, by encoding, non-const +Handle2Bibitem +BibliographyBibitemGetByEncoding( + ConstHandle2Bibliography self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BibitemGetByEncoding", + self, extract::bibitem, meta::encoding, encoding); +} + +// Set, by encoding +void +BibliographyBibitemSetByEncoding( + ConstHandle2Bibliography self, + const XMLName encoding, + ConstHandle2ConstBibitem bibitem +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"BibitemSetByEncoding", + self, extract::bibitem, meta::encoding, encoding, bibitem); +} + +// Has, by markup +int +BibliographyBibitemHasByMarkup( + ConstHandle2ConstBibliography self, + const char *const markup +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"BibitemHasByMarkup", + self, extract::bibitem, meta::markup, markup); +} + +// Get, by markup, const +Handle2ConstBibitem +BibliographyBibitemGetByMarkupConst( + ConstHandle2ConstBibliography self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BibitemGetByMarkupConst", + self, extract::bibitem, meta::markup, markup); +} + +// Get, by markup, non-const +Handle2Bibitem +BibliographyBibitemGetByMarkup( + ConstHandle2Bibliography self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BibitemGetByMarkup", + self, extract::bibitem, meta::markup, markup); +} + +// Set, by markup +void +BibliographyBibitemSetByMarkup( + ConstHandle2Bibliography self, + const char *const markup, + ConstHandle2ConstBibitem bibitem +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"BibitemSetByMarkup", + self, extract::bibitem, meta::markup, markup, bibitem); +} + +// Has, by label +int +BibliographyBibitemHasByLabel( + ConstHandle2ConstBibliography self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"BibitemHasByLabel", + self, extract::bibitem, meta::label, label); +} + +// Get, by label, const +Handle2ConstBibitem +BibliographyBibitemGetByLabelConst( + ConstHandle2ConstBibliography self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BibitemGetByLabelConst", + self, extract::bibitem, meta::label, label); +} + +// Get, by label, non-const +Handle2Bibitem +BibliographyBibitemGetByLabel( + ConstHandle2Bibliography self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BibitemGetByLabel", + self, extract::bibitem, meta::label, label); +} + +// Set, by label +void +BibliographyBibitemSetByLabel( + ConstHandle2Bibliography self, + const XMLName label, + ConstHandle2ConstBibitem bibitem +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"BibitemSetByLabel", + self, extract::bibitem, meta::label, label, bibitem); +} + +// Has, by xref +int +BibliographyBibitemHasByXref( + ConstHandle2ConstBibliography self, + const XMLName xref +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"BibitemHasByXref", + self, extract::bibitem, meta::xref, xref); +} + +// Get, by xref, const +Handle2ConstBibitem +BibliographyBibitemGetByXrefConst( + ConstHandle2ConstBibliography self, + const XMLName xref +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BibitemGetByXrefConst", + self, extract::bibitem, meta::xref, xref); +} + +// Get, by xref, non-const +Handle2Bibitem +BibliographyBibitemGetByXref( + ConstHandle2Bibliography self, + const XMLName xref +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BibitemGetByXref", + self, extract::bibitem, meta::xref, xref); +} + +// Set, by xref +void +BibliographyBibitemSetByXref( + ConstHandle2Bibliography self, + const XMLName xref, + ConstHandle2ConstBibitem bibitem +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"BibitemSetByXref", + self, extract::bibitem, meta::xref, xref, bibitem); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Bibliography/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography.h new file mode 100644 index 000000000..6f17337f6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography.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. +// +// Bibliography is the basic handle type in this file. Example: +// // Create a default Bibliography object: +// Bibliography handle = BibliographyDefault(); +// Functions involving Bibliography are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_BIBLIOGRAPHY +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_BIBLIOGRAPHY + +#include "GNDStk.h" +#include "v2.0/documentation/Bibitem.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BibliographyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Bibliography +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BibliographyClass *Bibliography; + +// --- Const-aware handles. +typedef const struct BibliographyClass *const ConstHandle2ConstBibliography; +typedef struct BibliographyClass *const ConstHandle2Bibliography; +typedef const struct BibliographyClass * Handle2ConstBibliography; +typedef struct BibliographyClass * Handle2Bibliography; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBibliography +BibliographyDefaultConst(); + +// +++ Create, default +extern_c Handle2Bibliography +BibliographyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBibliography +BibliographyCreateConst( + ConstHandle2Bibitem *const bibitem, const size_t bibitemSize +); + +// +++ Create, general +extern_c Handle2Bibliography +BibliographyCreate( + ConstHandle2Bibitem *const bibitem, const size_t bibitemSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BibliographyAssign(ConstHandle2Bibliography self, ConstHandle2ConstBibliography from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BibliographyDelete(ConstHandle2ConstBibliography self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BibliographyRead(ConstHandle2Bibliography self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BibliographyWrite(ConstHandle2ConstBibliography self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BibliographyPrint(ConstHandle2ConstBibliography self); + +// +++ Print to standard output, as XML +extern_c int +BibliographyPrintXML(ConstHandle2ConstBibliography self); + +// +++ Print to standard output, as JSON +extern_c int +BibliographyPrintJSON(ConstHandle2ConstBibliography self); + + +// ----------------------------------------------------------------------------- +// Child: bibitem +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BibliographyBibitemHas(ConstHandle2ConstBibliography self); + +// +++ Clear +extern_c void +BibliographyBibitemClear(ConstHandle2Bibliography self); + +// +++ Size +extern_c size_t +BibliographyBibitemSize(ConstHandle2ConstBibliography self); + +// +++ Add +extern_c void +BibliographyBibitemAdd(ConstHandle2Bibliography self, ConstHandle2ConstBibitem bibitem); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstBibitem +BibliographyBibitemGetConst(ConstHandle2ConstBibliography self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Bibitem +BibliographyBibitemGet(ConstHandle2Bibliography self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +BibliographyBibitemSet( + ConstHandle2Bibliography self, + const size_t index_, + ConstHandle2ConstBibitem bibitem +); + +// +++ Has, by encoding +extern_c int +BibliographyBibitemHasByEncoding( + ConstHandle2ConstBibliography self, + const XMLName encoding +); + +// --- Get, by encoding, const +extern_c Handle2ConstBibitem +BibliographyBibitemGetByEncodingConst( + ConstHandle2ConstBibliography self, + const XMLName encoding +); + +// +++ Get, by encoding, non-const +extern_c Handle2Bibitem +BibliographyBibitemGetByEncoding( + ConstHandle2Bibliography self, + const XMLName encoding +); + +// +++ Set, by encoding +extern_c void +BibliographyBibitemSetByEncoding( + ConstHandle2Bibliography self, + const XMLName encoding, + ConstHandle2ConstBibitem bibitem +); + +// +++ Has, by markup +extern_c int +BibliographyBibitemHasByMarkup( + ConstHandle2ConstBibliography self, + const char *const markup +); + +// --- Get, by markup, const +extern_c Handle2ConstBibitem +BibliographyBibitemGetByMarkupConst( + ConstHandle2ConstBibliography self, + const char *const markup +); + +// +++ Get, by markup, non-const +extern_c Handle2Bibitem +BibliographyBibitemGetByMarkup( + ConstHandle2Bibliography self, + const char *const markup +); + +// +++ Set, by markup +extern_c void +BibliographyBibitemSetByMarkup( + ConstHandle2Bibliography self, + const char *const markup, + ConstHandle2ConstBibitem bibitem +); + +// +++ Has, by label +extern_c int +BibliographyBibitemHasByLabel( + ConstHandle2ConstBibliography self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstBibitem +BibliographyBibitemGetByLabelConst( + ConstHandle2ConstBibliography self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Bibitem +BibliographyBibitemGetByLabel( + ConstHandle2Bibliography self, + const XMLName label +); + +// +++ Set, by label +extern_c void +BibliographyBibitemSetByLabel( + ConstHandle2Bibliography self, + const XMLName label, + ConstHandle2ConstBibitem bibitem +); + +// +++ Has, by xref +extern_c int +BibliographyBibitemHasByXref( + ConstHandle2ConstBibliography self, + const XMLName xref +); + +// --- Get, by xref, const +extern_c Handle2ConstBibitem +BibliographyBibitemGetByXrefConst( + ConstHandle2ConstBibliography self, + const XMLName xref +); + +// +++ Get, by xref, non-const +extern_c Handle2Bibitem +BibliographyBibitemGetByXref( + ConstHandle2Bibliography self, + const XMLName xref +); + +// +++ Set, by xref +extern_c void +BibliographyBibitemSetByXref( + ConstHandle2Bibliography self, + const XMLName xref, + ConstHandle2ConstBibitem bibitem +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Bibliography/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Bibliography/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Body.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Body.cpp new file mode 100644 index 000000000..a7b2c484d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Body.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Body.hpp" +#include "Body.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BodyClass; +using CPP = multigroup::Body; + +static const std::string CLASSNAME = "Body"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBody +BodyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Body +BodyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBody +BodyCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Body handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label + ); + return handle; +} + +// Create, general +Handle2Body +BodyCreate( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Body handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +BodyIntsClear(ConstHandle2Body self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +BodyIntsSize(ConstHandle2ConstBody self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +BodyIntsGet(ConstHandle2ConstBody self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BodyIntsSet(ConstHandle2Body self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +BodyIntsGetArrayConst(ConstHandle2ConstBody self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +BodyIntsGetArray(ConstHandle2Body self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +BodyIntsSetArray(ConstHandle2Body self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +BodyUnsignedsClear(ConstHandle2Body self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +BodyUnsignedsSize(ConstHandle2ConstBody self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +BodyUnsignedsGet(ConstHandle2ConstBody self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BodyUnsignedsSet(ConstHandle2Body self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +BodyUnsignedsGetArrayConst(ConstHandle2ConstBody self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +BodyUnsignedsGetArray(ConstHandle2Body self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +BodyUnsignedsSetArray(ConstHandle2Body self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +BodyFloatsClear(ConstHandle2Body self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +BodyFloatsSize(ConstHandle2ConstBody self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +BodyFloatsGet(ConstHandle2ConstBody self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BodyFloatsSet(ConstHandle2Body self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +BodyFloatsGetArrayConst(ConstHandle2ConstBody self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +BodyFloatsGetArray(ConstHandle2Body self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +BodyFloatsSetArray(ConstHandle2Body self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +BodyDoublesClear(ConstHandle2Body self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +BodyDoublesSize(ConstHandle2ConstBody self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +BodyDoublesGet(ConstHandle2ConstBody self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BodyDoublesSet(ConstHandle2Body self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +BodyDoublesGetArrayConst(ConstHandle2ConstBody self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +BodyDoublesGetArray(ConstHandle2Body self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +BodyDoublesSetArray(ConstHandle2Body self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +BodyEncodingHas(ConstHandle2ConstBody self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +BodyEncodingGet(ConstHandle2ConstBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +BodyEncodingSet(ConstHandle2Body self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +BodyMarkupHas(ConstHandle2ConstBody self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +BodyMarkupGet(ConstHandle2ConstBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +BodyMarkupSet(ConstHandle2Body self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +BodyLabelHas(ConstHandle2ConstBody self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +BodyLabelGet(ConstHandle2ConstBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +BodyLabelSet(ConstHandle2Body self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Body/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Body.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Body.h new file mode 100644 index 000000000..49022979a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Body.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. +// +// 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_TEST_V2_0_DOCUMENTATION_BODY +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_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 +extern_c Handle2Body +BodyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBody +BodyCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +); + +// +++ Create, general +extern_c Handle2Body +BodyCreate( + const XMLName encoding, + const char *const markup, + const XMLName 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 +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); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +BodyIntsClear(ConstHandle2Body self); + +// +++ Get size +extern_c size_t +BodyIntsSize(ConstHandle2ConstBody self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +BodyIntsGet(ConstHandle2ConstBody self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BodyIntsSet(ConstHandle2Body self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +BodyIntsGetArrayConst(ConstHandle2ConstBody self); + +// +++ Get pointer to existing values, non-const +extern_c int * +BodyIntsGetArray(ConstHandle2Body self); + +// +++ Set completely new values and size +extern_c void +BodyIntsSetArray(ConstHandle2Body self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +BodyUnsignedsClear(ConstHandle2Body self); + +// +++ Get size +extern_c size_t +BodyUnsignedsSize(ConstHandle2ConstBody self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +BodyUnsignedsGet(ConstHandle2ConstBody self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BodyUnsignedsSet(ConstHandle2Body self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +BodyUnsignedsGetArrayConst(ConstHandle2ConstBody self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +BodyUnsignedsGetArray(ConstHandle2Body self); + +// +++ Set completely new values and size +extern_c void +BodyUnsignedsSetArray(ConstHandle2Body self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +BodyFloatsClear(ConstHandle2Body self); + +// +++ Get size +extern_c size_t +BodyFloatsSize(ConstHandle2ConstBody self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +BodyFloatsGet(ConstHandle2ConstBody self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BodyFloatsSet(ConstHandle2Body self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +BodyFloatsGetArrayConst(ConstHandle2ConstBody self); + +// +++ Get pointer to existing values, non-const +extern_c float * +BodyFloatsGetArray(ConstHandle2Body self); + +// +++ Set completely new values and size +extern_c void +BodyFloatsSetArray(ConstHandle2Body self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +BodyDoublesClear(ConstHandle2Body self); + +// +++ Get size +extern_c size_t +BodyDoublesSize(ConstHandle2ConstBody self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +BodyDoublesGet(ConstHandle2ConstBody self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BodyDoublesSet(ConstHandle2Body self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +BodyDoublesGetArrayConst(ConstHandle2ConstBody self); + +// +++ Get pointer to existing values, non-const +extern_c double * +BodyDoublesGetArray(ConstHandle2Body self); + +// +++ Set completely new values and size +extern_c void +BodyDoublesSetArray(ConstHandle2Body self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BodyEncodingHas(ConstHandle2ConstBody self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BodyEncodingGet(ConstHandle2ConstBody self); + +// +++ Set +extern_c void +BodyEncodingSet(ConstHandle2Body self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BodyMarkupHas(ConstHandle2ConstBody self); + +// +++ Get +// +++ Returns by value +extern_c const char * +BodyMarkupGet(ConstHandle2ConstBody self); + +// +++ Set +extern_c void +BodyMarkupSet(ConstHandle2Body self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BodyLabelHas(ConstHandle2ConstBody self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BodyLabelGet(ConstHandle2ConstBody self); + +// +++ Set +extern_c void +BodyLabelSet(ConstHandle2Body self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Body/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Body/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Body/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Body/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Body/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo.cpp new file mode 100644 index 000000000..026b4ba1a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo.cpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/CodeRepo.hpp" +#include "CodeRepo.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CodeRepoClass; +using CPP = multigroup::CodeRepo; + +static const std::string CLASSNAME = "CodeRepo"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto revisionSystem = [](auto &obj) { return &obj.revisionSystem; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto revisionID = [](auto &obj) { return &obj.revisionID; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCodeRepo +CodeRepoDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CodeRepo +CodeRepoDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCodeRepo +CodeRepoCreateConst( + const XMLName label, + const XMLName revisionSystem, + const XMLName href, + const XMLName revisionID +) { + ConstHandle2CodeRepo handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + revisionSystem, + href, + revisionID + ); + return handle; +} + +// Create, general +Handle2CodeRepo +CodeRepoCreate( + const XMLName label, + const XMLName revisionSystem, + const XMLName href, + const XMLName revisionID +) { + ConstHandle2CodeRepo handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + revisionSystem, + href, + revisionID + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CodeRepoAssign(ConstHandle2CodeRepo self, ConstHandle2ConstCodeRepo from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CodeRepoDelete(ConstHandle2ConstCodeRepo self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CodeRepoRead(ConstHandle2CodeRepo self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CodeRepoWrite(ConstHandle2ConstCodeRepo self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CodeRepoPrint(ConstHandle2ConstCodeRepo self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CodeRepoPrintXML(ConstHandle2ConstCodeRepo self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CodeRepoPrintJSON(ConstHandle2ConstCodeRepo self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CodeRepoLabelHas(ConstHandle2ConstCodeRepo self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CodeRepoLabelGet(ConstHandle2ConstCodeRepo self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CodeRepoLabelSet(ConstHandle2CodeRepo self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: revisionSystem +// ----------------------------------------------------------------------------- + +// Has +int +CodeRepoRevisionSystemHas(ConstHandle2ConstCodeRepo self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RevisionSystemHas", self, extract::revisionSystem); +} + +// Get +// Returns by value +XMLName +CodeRepoRevisionSystemGet(ConstHandle2ConstCodeRepo self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RevisionSystemGet", self, extract::revisionSystem); +} + +// Set +void +CodeRepoRevisionSystemSet(ConstHandle2CodeRepo self, const XMLName revisionSystem) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RevisionSystemSet", self, extract::revisionSystem, revisionSystem); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +CodeRepoHrefHas(ConstHandle2ConstCodeRepo self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +XMLName +CodeRepoHrefGet(ConstHandle2ConstCodeRepo self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +CodeRepoHrefSet(ConstHandle2CodeRepo self, const XMLName href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: revisionID +// ----------------------------------------------------------------------------- + +// Has +int +CodeRepoRevisionIDHas(ConstHandle2ConstCodeRepo self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RevisionIDHas", self, extract::revisionID); +} + +// Get +// Returns by value +XMLName +CodeRepoRevisionIDGet(ConstHandle2ConstCodeRepo self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RevisionIDGet", self, extract::revisionID); +} + +// Set +void +CodeRepoRevisionIDSet(ConstHandle2CodeRepo self, const XMLName revisionID) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RevisionIDSet", self, extract::revisionID, revisionID); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/CodeRepo/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo.h new file mode 100644 index 000000000..cbd774b31 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo.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. +// +// CodeRepo is the basic handle type in this file. Example: +// // Create a default CodeRepo object: +// CodeRepo handle = CodeRepoDefault(); +// Functions involving CodeRepo are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_CODEREPO +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_CODEREPO + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CodeRepoClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CodeRepo +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CodeRepoClass *CodeRepo; + +// --- Const-aware handles. +typedef const struct CodeRepoClass *const ConstHandle2ConstCodeRepo; +typedef struct CodeRepoClass *const ConstHandle2CodeRepo; +typedef const struct CodeRepoClass * Handle2ConstCodeRepo; +typedef struct CodeRepoClass * Handle2CodeRepo; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCodeRepo +CodeRepoDefaultConst(); + +// +++ Create, default +extern_c Handle2CodeRepo +CodeRepoDefault(); + +// --- Create, general, const +extern_c Handle2ConstCodeRepo +CodeRepoCreateConst( + const XMLName label, + const XMLName revisionSystem, + const XMLName href, + const XMLName revisionID +); + +// +++ Create, general +extern_c Handle2CodeRepo +CodeRepoCreate( + const XMLName label, + const XMLName revisionSystem, + const XMLName href, + const XMLName revisionID +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CodeRepoAssign(ConstHandle2CodeRepo self, ConstHandle2ConstCodeRepo from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CodeRepoDelete(ConstHandle2ConstCodeRepo self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CodeRepoRead(ConstHandle2CodeRepo self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CodeRepoWrite(ConstHandle2ConstCodeRepo self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CodeRepoPrint(ConstHandle2ConstCodeRepo self); + +// +++ Print to standard output, as XML +extern_c int +CodeRepoPrintXML(ConstHandle2ConstCodeRepo self); + +// +++ Print to standard output, as JSON +extern_c int +CodeRepoPrintJSON(ConstHandle2ConstCodeRepo self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CodeRepoLabelHas(ConstHandle2ConstCodeRepo self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CodeRepoLabelGet(ConstHandle2ConstCodeRepo self); + +// +++ Set +extern_c void +CodeRepoLabelSet(ConstHandle2CodeRepo self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: revisionSystem +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CodeRepoRevisionSystemHas(ConstHandle2ConstCodeRepo self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CodeRepoRevisionSystemGet(ConstHandle2ConstCodeRepo self); + +// +++ Set +extern_c void +CodeRepoRevisionSystemSet(ConstHandle2CodeRepo self, const XMLName revisionSystem); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CodeRepoHrefHas(ConstHandle2ConstCodeRepo self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CodeRepoHrefGet(ConstHandle2ConstCodeRepo self); + +// +++ Set +extern_c void +CodeRepoHrefSet(ConstHandle2CodeRepo self, const XMLName href); + + +// ----------------------------------------------------------------------------- +// Metadatum: revisionID +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CodeRepoRevisionIDHas(ConstHandle2ConstCodeRepo self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CodeRepoRevisionIDGet(ConstHandle2ConstCodeRepo self); + +// +++ Set +extern_c void +CodeRepoRevisionIDSet(ConstHandle2CodeRepo self, const XMLName revisionID); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/CodeRepo/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/CodeRepo/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration.cpp new file mode 100644 index 000000000..afb31e14d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Collaboration.hpp" +#include "Collaboration.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CollaborationClass; +using CPP = multigroup::Collaboration; + +static const std::string CLASSNAME = "Collaboration"; + +namespace extract { + static auto name = [](auto &obj) { return &obj.name; }; + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCollaboration +CollaborationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Collaboration +CollaborationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCollaboration +CollaborationCreateConst( + const UTF8Text name, + const UTF8Text href +) { + ConstHandle2Collaboration handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name, + href + ); + return handle; +} + +// Create, general +Handle2Collaboration +CollaborationCreate( + const UTF8Text name, + const UTF8Text href +) { + ConstHandle2Collaboration handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name, + 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 +CollaborationAssign(ConstHandle2Collaboration self, ConstHandle2ConstCollaboration from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CollaborationDelete(ConstHandle2ConstCollaboration self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CollaborationRead(ConstHandle2Collaboration self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CollaborationWrite(ConstHandle2ConstCollaboration self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CollaborationPrint(ConstHandle2ConstCollaboration self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CollaborationPrintXML(ConstHandle2ConstCollaboration self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CollaborationPrintJSON(ConstHandle2ConstCollaboration self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +CollaborationNameHas(ConstHandle2ConstCollaboration self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +UTF8Text +CollaborationNameGet(ConstHandle2ConstCollaboration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +CollaborationNameSet(ConstHandle2Collaboration self, const UTF8Text name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +CollaborationHrefHas(ConstHandle2ConstCollaboration self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +UTF8Text +CollaborationHrefGet(ConstHandle2ConstCollaboration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +CollaborationHrefSet(ConstHandle2Collaboration self, const UTF8Text href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Collaboration/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration.h new file mode 100644 index 000000000..4ab7eb44c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration.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. +// +// Collaboration is the basic handle type in this file. Example: +// // Create a default Collaboration object: +// Collaboration handle = CollaborationDefault(); +// Functions involving Collaboration are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_COLLABORATION +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_COLLABORATION + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CollaborationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Collaboration +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CollaborationClass *Collaboration; + +// --- Const-aware handles. +typedef const struct CollaborationClass *const ConstHandle2ConstCollaboration; +typedef struct CollaborationClass *const ConstHandle2Collaboration; +typedef const struct CollaborationClass * Handle2ConstCollaboration; +typedef struct CollaborationClass * Handle2Collaboration; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCollaboration +CollaborationDefaultConst(); + +// +++ Create, default +extern_c Handle2Collaboration +CollaborationDefault(); + +// --- Create, general, const +extern_c Handle2ConstCollaboration +CollaborationCreateConst( + const UTF8Text name, + const UTF8Text href +); + +// +++ Create, general +extern_c Handle2Collaboration +CollaborationCreate( + const UTF8Text name, + const UTF8Text 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 +CollaborationAssign(ConstHandle2Collaboration self, ConstHandle2ConstCollaboration from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CollaborationDelete(ConstHandle2ConstCollaboration self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CollaborationRead(ConstHandle2Collaboration self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CollaborationWrite(ConstHandle2ConstCollaboration self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CollaborationPrint(ConstHandle2ConstCollaboration self); + +// +++ Print to standard output, as XML +extern_c int +CollaborationPrintXML(ConstHandle2ConstCollaboration self); + +// +++ Print to standard output, as JSON +extern_c int +CollaborationPrintJSON(ConstHandle2ConstCollaboration self); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CollaborationNameHas(ConstHandle2ConstCollaboration self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +CollaborationNameGet(ConstHandle2ConstCollaboration self); + +// +++ Set +extern_c void +CollaborationNameSet(ConstHandle2Collaboration self, const UTF8Text name); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CollaborationHrefHas(ConstHandle2ConstCollaboration self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +CollaborationHrefGet(ConstHandle2ConstCollaboration self); + +// +++ Set +extern_c void +CollaborationHrefSet(ConstHandle2Collaboration self, const UTF8Text href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Collaboration/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaboration/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations.cpp new file mode 100644 index 000000000..71c66d720 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Collaborations.hpp" +#include "Collaborations.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CollaborationsClass; +using CPP = multigroup::Collaborations; + +static const std::string CLASSNAME = "Collaborations"; + +namespace extract { + static auto collaboration = [](auto &obj) { return &obj.collaboration; }; +} + +using CPPCollaboration = documentation::Collaboration; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCollaborations +CollaborationsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Collaborations +CollaborationsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCollaborations +CollaborationsCreateConst( + ConstHandle2Collaboration *const collaboration, const size_t collaborationSize +) { + ConstHandle2Collaborations handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t CollaborationN = 0; CollaborationN < collaborationSize; ++CollaborationN) + CollaborationsCollaborationAdd(handle, collaboration[CollaborationN]); + return handle; +} + +// Create, general +Handle2Collaborations +CollaborationsCreate( + ConstHandle2Collaboration *const collaboration, const size_t collaborationSize +) { + ConstHandle2Collaborations handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t CollaborationN = 0; CollaborationN < collaborationSize; ++CollaborationN) + CollaborationsCollaborationAdd(handle, collaboration[CollaborationN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CollaborationsAssign(ConstHandle2Collaborations self, ConstHandle2ConstCollaborations from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CollaborationsDelete(ConstHandle2ConstCollaborations self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CollaborationsRead(ConstHandle2Collaborations self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CollaborationsWrite(ConstHandle2ConstCollaborations self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CollaborationsPrint(ConstHandle2ConstCollaborations self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CollaborationsPrintXML(ConstHandle2ConstCollaborations self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CollaborationsPrintJSON(ConstHandle2ConstCollaborations self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: collaboration +// ----------------------------------------------------------------------------- + +// Has +int +CollaborationsCollaborationHas(ConstHandle2ConstCollaborations self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CollaborationHas", self, extract::collaboration); +} + +// Clear +void +CollaborationsCollaborationClear(ConstHandle2Collaborations self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"CollaborationClear", self, extract::collaboration); +} + +// Size +size_t +CollaborationsCollaborationSize(ConstHandle2ConstCollaborations self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"CollaborationSize", self, extract::collaboration); +} + +// Add +void +CollaborationsCollaborationAdd(ConstHandle2Collaborations self, ConstHandle2ConstCollaboration collaboration) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"CollaborationAdd", self, extract::collaboration, collaboration); +} + +// Get, by index \in [0,size), const +Handle2ConstCollaboration +CollaborationsCollaborationGetConst(ConstHandle2ConstCollaborations self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CollaborationGetConst", self, extract::collaboration, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Collaboration +CollaborationsCollaborationGet(ConstHandle2Collaborations self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CollaborationGet", self, extract::collaboration, index_); +} + +// Set, by index \in [0,size) +void +CollaborationsCollaborationSet( + ConstHandle2Collaborations self, + const size_t index_, + ConstHandle2ConstCollaboration collaboration +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"CollaborationSet", self, extract::collaboration, index_, collaboration); +} + +// Has, by name +int +CollaborationsCollaborationHasByName( + ConstHandle2ConstCollaborations self, + const UTF8Text name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CollaborationHasByName", + self, extract::collaboration, meta::name, name); +} + +// Get, by name, const +Handle2ConstCollaboration +CollaborationsCollaborationGetByNameConst( + ConstHandle2ConstCollaborations self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CollaborationGetByNameConst", + self, extract::collaboration, meta::name, name); +} + +// Get, by name, non-const +Handle2Collaboration +CollaborationsCollaborationGetByName( + ConstHandle2Collaborations self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CollaborationGetByName", + self, extract::collaboration, meta::name, name); +} + +// Set, by name +void +CollaborationsCollaborationSetByName( + ConstHandle2Collaborations self, + const UTF8Text name, + ConstHandle2ConstCollaboration collaboration +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CollaborationSetByName", + self, extract::collaboration, meta::name, name, collaboration); +} + +// Has, by href +int +CollaborationsCollaborationHasByHref( + ConstHandle2ConstCollaborations self, + const UTF8Text href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CollaborationHasByHref", + self, extract::collaboration, meta::href, href); +} + +// Get, by href, const +Handle2ConstCollaboration +CollaborationsCollaborationGetByHrefConst( + ConstHandle2ConstCollaborations self, + const UTF8Text href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CollaborationGetByHrefConst", + self, extract::collaboration, meta::href, href); +} + +// Get, by href, non-const +Handle2Collaboration +CollaborationsCollaborationGetByHref( + ConstHandle2Collaborations self, + const UTF8Text href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CollaborationGetByHref", + self, extract::collaboration, meta::href, href); +} + +// Set, by href +void +CollaborationsCollaborationSetByHref( + ConstHandle2Collaborations self, + const UTF8Text href, + ConstHandle2ConstCollaboration collaboration +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CollaborationSetByHref", + self, extract::collaboration, meta::href, href, collaboration); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Collaborations/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations.h new file mode 100644 index 000000000..077c32832 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Collaborations is the basic handle type in this file. Example: +// // Create a default Collaborations object: +// Collaborations handle = CollaborationsDefault(); +// Functions involving Collaborations are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_COLLABORATIONS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_COLLABORATIONS + +#include "GNDStk.h" +#include "v2.0/documentation/Collaboration.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CollaborationsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Collaborations +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CollaborationsClass *Collaborations; + +// --- Const-aware handles. +typedef const struct CollaborationsClass *const ConstHandle2ConstCollaborations; +typedef struct CollaborationsClass *const ConstHandle2Collaborations; +typedef const struct CollaborationsClass * Handle2ConstCollaborations; +typedef struct CollaborationsClass * Handle2Collaborations; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCollaborations +CollaborationsDefaultConst(); + +// +++ Create, default +extern_c Handle2Collaborations +CollaborationsDefault(); + +// --- Create, general, const +extern_c Handle2ConstCollaborations +CollaborationsCreateConst( + ConstHandle2Collaboration *const collaboration, const size_t collaborationSize +); + +// +++ Create, general +extern_c Handle2Collaborations +CollaborationsCreate( + ConstHandle2Collaboration *const collaboration, const size_t collaborationSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CollaborationsAssign(ConstHandle2Collaborations self, ConstHandle2ConstCollaborations from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CollaborationsDelete(ConstHandle2ConstCollaborations self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CollaborationsRead(ConstHandle2Collaborations self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CollaborationsWrite(ConstHandle2ConstCollaborations self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CollaborationsPrint(ConstHandle2ConstCollaborations self); + +// +++ Print to standard output, as XML +extern_c int +CollaborationsPrintXML(ConstHandle2ConstCollaborations self); + +// +++ Print to standard output, as JSON +extern_c int +CollaborationsPrintJSON(ConstHandle2ConstCollaborations self); + + +// ----------------------------------------------------------------------------- +// Child: collaboration +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CollaborationsCollaborationHas(ConstHandle2ConstCollaborations self); + +// +++ Clear +extern_c void +CollaborationsCollaborationClear(ConstHandle2Collaborations self); + +// +++ Size +extern_c size_t +CollaborationsCollaborationSize(ConstHandle2ConstCollaborations self); + +// +++ Add +extern_c void +CollaborationsCollaborationAdd(ConstHandle2Collaborations self, ConstHandle2ConstCollaboration collaboration); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstCollaboration +CollaborationsCollaborationGetConst(ConstHandle2ConstCollaborations self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Collaboration +CollaborationsCollaborationGet(ConstHandle2Collaborations self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +CollaborationsCollaborationSet( + ConstHandle2Collaborations self, + const size_t index_, + ConstHandle2ConstCollaboration collaboration +); + +// +++ Has, by name +extern_c int +CollaborationsCollaborationHasByName( + ConstHandle2ConstCollaborations self, + const UTF8Text name +); + +// --- Get, by name, const +extern_c Handle2ConstCollaboration +CollaborationsCollaborationGetByNameConst( + ConstHandle2ConstCollaborations self, + const UTF8Text name +); + +// +++ Get, by name, non-const +extern_c Handle2Collaboration +CollaborationsCollaborationGetByName( + ConstHandle2Collaborations self, + const UTF8Text name +); + +// +++ Set, by name +extern_c void +CollaborationsCollaborationSetByName( + ConstHandle2Collaborations self, + const UTF8Text name, + ConstHandle2ConstCollaboration collaboration +); + +// +++ Has, by href +extern_c int +CollaborationsCollaborationHasByHref( + ConstHandle2ConstCollaborations self, + const UTF8Text href +); + +// --- Get, by href, const +extern_c Handle2ConstCollaboration +CollaborationsCollaborationGetByHrefConst( + ConstHandle2ConstCollaborations self, + const UTF8Text href +); + +// +++ Get, by href, non-const +extern_c Handle2Collaboration +CollaborationsCollaborationGetByHref( + ConstHandle2Collaborations self, + const UTF8Text href +); + +// +++ Set, by href +extern_c void +CollaborationsCollaborationSetByHref( + ConstHandle2Collaborations self, + const UTF8Text href, + ConstHandle2ConstCollaboration collaboration +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Collaborations/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Collaborations/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode.cpp new file mode 100644 index 000000000..45e30b0ec --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode.cpp @@ -0,0 +1,458 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/ComputerCode.hpp" +#include "ComputerCode.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ComputerCodeClass; +using CPP = multigroup::ComputerCode; + +static const std::string CLASSNAME = "ComputerCode"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto name = [](auto &obj) { return &obj.name; }; + static auto version = [](auto &obj) { return &obj.version; }; + static auto executionArguments = [](auto &obj) { return &obj.executionArguments; }; + static auto codeRepo = [](auto &obj) { return &obj.codeRepo; }; + static auto note = [](auto &obj) { return &obj.note; }; + static auto inputDecks = [](auto &obj) { return &obj.inputDecks; }; + static auto outputDecks = [](auto &obj) { return &obj.outputDecks; }; +} + +using CPPExecutionArguments = documentation::ExecutionArguments; +using CPPCodeRepo = documentation::CodeRepo; +using CPPNote = documentation::Note; +using CPPInputDecks = documentation::InputDecks; +using CPPOutputDecks = documentation::OutputDecks; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstComputerCode +ComputerCodeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ComputerCode +ComputerCodeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstComputerCode +ComputerCodeCreateConst( + const XMLName label, + const UTF8Text name, + const XMLName version, + ConstHandle2ConstExecutionArguments executionArguments, + ConstHandle2ConstCodeRepo codeRepo, + ConstHandle2ConstNote note, + ConstHandle2ConstInputDecks inputDecks, + ConstHandle2ConstOutputDecks outputDecks +) { + ConstHandle2ComputerCode handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + name, + version, + detail::tocpp(executionArguments), + detail::tocpp(codeRepo), + detail::tocpp(note), + detail::tocpp(inputDecks), + detail::tocpp(outputDecks) + ); + return handle; +} + +// Create, general +Handle2ComputerCode +ComputerCodeCreate( + const XMLName label, + const UTF8Text name, + const XMLName version, + ConstHandle2ConstExecutionArguments executionArguments, + ConstHandle2ConstCodeRepo codeRepo, + ConstHandle2ConstNote note, + ConstHandle2ConstInputDecks inputDecks, + ConstHandle2ConstOutputDecks outputDecks +) { + ConstHandle2ComputerCode handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + name, + version, + detail::tocpp(executionArguments), + detail::tocpp(codeRepo), + detail::tocpp(note), + detail::tocpp(inputDecks), + detail::tocpp(outputDecks) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ComputerCodeAssign(ConstHandle2ComputerCode self, ConstHandle2ConstComputerCode from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ComputerCodeDelete(ConstHandle2ConstComputerCode self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ComputerCodeRead(ConstHandle2ComputerCode self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ComputerCodeWrite(ConstHandle2ConstComputerCode self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ComputerCodePrint(ConstHandle2ConstComputerCode self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ComputerCodePrintXML(ConstHandle2ConstComputerCode self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ComputerCodePrintJSON(ConstHandle2ConstComputerCode self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ComputerCodeLabelHas(ConstHandle2ConstComputerCode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ComputerCodeLabelGet(ConstHandle2ConstComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ComputerCodeLabelSet(ConstHandle2ComputerCode self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +ComputerCodeNameHas(ConstHandle2ConstComputerCode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +UTF8Text +ComputerCodeNameGet(ConstHandle2ConstComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +ComputerCodeNameSet(ConstHandle2ComputerCode self, const UTF8Text name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// Has +int +ComputerCodeVersionHas(ConstHandle2ConstComputerCode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"VersionHas", self, extract::version); +} + +// Get +// Returns by value +XMLName +ComputerCodeVersionGet(ConstHandle2ConstComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"VersionGet", self, extract::version); +} + +// Set +void +ComputerCodeVersionSet(ConstHandle2ComputerCode self, const XMLName version) +{ + detail::setField + (CLASSNAME, CLASSNAME+"VersionSet", self, extract::version, version); +} + + +// ----------------------------------------------------------------------------- +// Child: executionArguments +// ----------------------------------------------------------------------------- + +// Has +int +ComputerCodeExecutionArgumentsHas(ConstHandle2ConstComputerCode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ExecutionArgumentsHas", self, extract::executionArguments); +} + +// Get, const +Handle2ConstExecutionArguments +ComputerCodeExecutionArgumentsGetConst(ConstHandle2ConstComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExecutionArgumentsGetConst", self, extract::executionArguments); +} + +// Get, non-const +Handle2ExecutionArguments +ComputerCodeExecutionArgumentsGet(ConstHandle2ComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExecutionArgumentsGet", self, extract::executionArguments); +} + +// Set +void +ComputerCodeExecutionArgumentsSet(ConstHandle2ComputerCode self, ConstHandle2ConstExecutionArguments executionArguments) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ExecutionArgumentsSet", self, extract::executionArguments, executionArguments); +} + + +// ----------------------------------------------------------------------------- +// Child: codeRepo +// ----------------------------------------------------------------------------- + +// Has +int +ComputerCodeCodeRepoHas(ConstHandle2ConstComputerCode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CodeRepoHas", self, extract::codeRepo); +} + +// Get, const +Handle2ConstCodeRepo +ComputerCodeCodeRepoGetConst(ConstHandle2ConstComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CodeRepoGetConst", self, extract::codeRepo); +} + +// Get, non-const +Handle2CodeRepo +ComputerCodeCodeRepoGet(ConstHandle2ComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CodeRepoGet", self, extract::codeRepo); +} + +// Set +void +ComputerCodeCodeRepoSet(ConstHandle2ComputerCode self, ConstHandle2ConstCodeRepo codeRepo) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CodeRepoSet", self, extract::codeRepo, codeRepo); +} + + +// ----------------------------------------------------------------------------- +// Child: note +// ----------------------------------------------------------------------------- + +// Has +int +ComputerCodeNoteHas(ConstHandle2ConstComputerCode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NoteHas", self, extract::note); +} + +// Get, const +Handle2ConstNote +ComputerCodeNoteGetConst(ConstHandle2ConstComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NoteGetConst", self, extract::note); +} + +// Get, non-const +Handle2Note +ComputerCodeNoteGet(ConstHandle2ComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NoteGet", self, extract::note); +} + +// Set +void +ComputerCodeNoteSet(ConstHandle2ComputerCode self, ConstHandle2ConstNote note) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NoteSet", self, extract::note, note); +} + + +// ----------------------------------------------------------------------------- +// Child: inputDecks +// ----------------------------------------------------------------------------- + +// Has +int +ComputerCodeInputDecksHas(ConstHandle2ConstComputerCode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InputDecksHas", self, extract::inputDecks); +} + +// Get, const +Handle2ConstInputDecks +ComputerCodeInputDecksGetConst(ConstHandle2ConstComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InputDecksGetConst", self, extract::inputDecks); +} + +// Get, non-const +Handle2InputDecks +ComputerCodeInputDecksGet(ConstHandle2ComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InputDecksGet", self, extract::inputDecks); +} + +// Set +void +ComputerCodeInputDecksSet(ConstHandle2ComputerCode self, ConstHandle2ConstInputDecks inputDecks) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InputDecksSet", self, extract::inputDecks, inputDecks); +} + + +// ----------------------------------------------------------------------------- +// Child: outputDecks +// ----------------------------------------------------------------------------- + +// Has +int +ComputerCodeOutputDecksHas(ConstHandle2ConstComputerCode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OutputDecksHas", self, extract::outputDecks); +} + +// Get, const +Handle2ConstOutputDecks +ComputerCodeOutputDecksGetConst(ConstHandle2ConstComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputDecksGetConst", self, extract::outputDecks); +} + +// Get, non-const +Handle2OutputDecks +ComputerCodeOutputDecksGet(ConstHandle2ComputerCode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputDecksGet", self, extract::outputDecks); +} + +// Set +void +ComputerCodeOutputDecksSet(ConstHandle2ComputerCode self, ConstHandle2ConstOutputDecks outputDecks) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OutputDecksSet", self, extract::outputDecks, outputDecks); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ComputerCode/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode.h new file mode 100644 index 000000000..edcab72fa --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode.h @@ -0,0 +1,317 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ComputerCode is the basic handle type in this file. Example: +// // Create a default ComputerCode object: +// ComputerCode handle = ComputerCodeDefault(); +// Functions involving ComputerCode are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_COMPUTERCODE +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_COMPUTERCODE + +#include "GNDStk.h" +#include "v2.0/documentation/ExecutionArguments.h" +#include "v2.0/documentation/CodeRepo.h" +#include "v2.0/documentation/Note.h" +#include "v2.0/documentation/InputDecks.h" +#include "v2.0/documentation/OutputDecks.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ComputerCodeClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ComputerCode +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ComputerCodeClass *ComputerCode; + +// --- Const-aware handles. +typedef const struct ComputerCodeClass *const ConstHandle2ConstComputerCode; +typedef struct ComputerCodeClass *const ConstHandle2ComputerCode; +typedef const struct ComputerCodeClass * Handle2ConstComputerCode; +typedef struct ComputerCodeClass * Handle2ComputerCode; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstComputerCode +ComputerCodeDefaultConst(); + +// +++ Create, default +extern_c Handle2ComputerCode +ComputerCodeDefault(); + +// --- Create, general, const +extern_c Handle2ConstComputerCode +ComputerCodeCreateConst( + const XMLName label, + const UTF8Text name, + const XMLName version, + ConstHandle2ConstExecutionArguments executionArguments, + ConstHandle2ConstCodeRepo codeRepo, + ConstHandle2ConstNote note, + ConstHandle2ConstInputDecks inputDecks, + ConstHandle2ConstOutputDecks outputDecks +); + +// +++ Create, general +extern_c Handle2ComputerCode +ComputerCodeCreate( + const XMLName label, + const UTF8Text name, + const XMLName version, + ConstHandle2ConstExecutionArguments executionArguments, + ConstHandle2ConstCodeRepo codeRepo, + ConstHandle2ConstNote note, + ConstHandle2ConstInputDecks inputDecks, + ConstHandle2ConstOutputDecks outputDecks +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ComputerCodeAssign(ConstHandle2ComputerCode self, ConstHandle2ConstComputerCode from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ComputerCodeDelete(ConstHandle2ConstComputerCode self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ComputerCodeRead(ConstHandle2ComputerCode self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ComputerCodeWrite(ConstHandle2ConstComputerCode self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ComputerCodePrint(ConstHandle2ConstComputerCode self); + +// +++ Print to standard output, as XML +extern_c int +ComputerCodePrintXML(ConstHandle2ConstComputerCode self); + +// +++ Print to standard output, as JSON +extern_c int +ComputerCodePrintJSON(ConstHandle2ConstComputerCode self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ComputerCodeLabelHas(ConstHandle2ConstComputerCode self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ComputerCodeLabelGet(ConstHandle2ConstComputerCode self); + +// +++ Set +extern_c void +ComputerCodeLabelSet(ConstHandle2ComputerCode self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ComputerCodeNameHas(ConstHandle2ConstComputerCode self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +ComputerCodeNameGet(ConstHandle2ConstComputerCode self); + +// +++ Set +extern_c void +ComputerCodeNameSet(ConstHandle2ComputerCode self, const UTF8Text name); + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ComputerCodeVersionHas(ConstHandle2ConstComputerCode self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ComputerCodeVersionGet(ConstHandle2ConstComputerCode self); + +// +++ Set +extern_c void +ComputerCodeVersionSet(ConstHandle2ComputerCode self, const XMLName version); + + +// ----------------------------------------------------------------------------- +// Child: executionArguments +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ComputerCodeExecutionArgumentsHas(ConstHandle2ConstComputerCode self); + +// --- Get, const +extern_c Handle2ConstExecutionArguments +ComputerCodeExecutionArgumentsGetConst(ConstHandle2ConstComputerCode self); + +// +++ Get, non-const +extern_c Handle2ExecutionArguments +ComputerCodeExecutionArgumentsGet(ConstHandle2ComputerCode self); + +// +++ Set +extern_c void +ComputerCodeExecutionArgumentsSet(ConstHandle2ComputerCode self, ConstHandle2ConstExecutionArguments executionArguments); + + +// ----------------------------------------------------------------------------- +// Child: codeRepo +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ComputerCodeCodeRepoHas(ConstHandle2ConstComputerCode self); + +// --- Get, const +extern_c Handle2ConstCodeRepo +ComputerCodeCodeRepoGetConst(ConstHandle2ConstComputerCode self); + +// +++ Get, non-const +extern_c Handle2CodeRepo +ComputerCodeCodeRepoGet(ConstHandle2ComputerCode self); + +// +++ Set +extern_c void +ComputerCodeCodeRepoSet(ConstHandle2ComputerCode self, ConstHandle2ConstCodeRepo codeRepo); + + +// ----------------------------------------------------------------------------- +// Child: note +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ComputerCodeNoteHas(ConstHandle2ConstComputerCode self); + +// --- Get, const +extern_c Handle2ConstNote +ComputerCodeNoteGetConst(ConstHandle2ConstComputerCode self); + +// +++ Get, non-const +extern_c Handle2Note +ComputerCodeNoteGet(ConstHandle2ComputerCode self); + +// +++ Set +extern_c void +ComputerCodeNoteSet(ConstHandle2ComputerCode self, ConstHandle2ConstNote note); + + +// ----------------------------------------------------------------------------- +// Child: inputDecks +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ComputerCodeInputDecksHas(ConstHandle2ConstComputerCode self); + +// --- Get, const +extern_c Handle2ConstInputDecks +ComputerCodeInputDecksGetConst(ConstHandle2ConstComputerCode self); + +// +++ Get, non-const +extern_c Handle2InputDecks +ComputerCodeInputDecksGet(ConstHandle2ComputerCode self); + +// +++ Set +extern_c void +ComputerCodeInputDecksSet(ConstHandle2ComputerCode self, ConstHandle2ConstInputDecks inputDecks); + + +// ----------------------------------------------------------------------------- +// Child: outputDecks +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ComputerCodeOutputDecksHas(ConstHandle2ConstComputerCode self); + +// --- Get, const +extern_c Handle2ConstOutputDecks +ComputerCodeOutputDecksGetConst(ConstHandle2ConstComputerCode self); + +// +++ Get, non-const +extern_c Handle2OutputDecks +ComputerCodeOutputDecksGet(ConstHandle2ComputerCode self); + +// +++ Set +extern_c void +ComputerCodeOutputDecksSet(ConstHandle2ComputerCode self, ConstHandle2ConstOutputDecks outputDecks); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ComputerCode/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCode/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes.cpp new file mode 100644 index 000000000..77ddf18fa --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/ComputerCodes.hpp" +#include "ComputerCodes.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ComputerCodesClass; +using CPP = multigroup::ComputerCodes; + +static const std::string CLASSNAME = "ComputerCodes"; + +namespace extract { + static auto computerCode = [](auto &obj) { return &obj.computerCode; }; +} + +using CPPComputerCode = documentation::ComputerCode; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstComputerCodes +ComputerCodesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ComputerCodes +ComputerCodesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstComputerCodes +ComputerCodesCreateConst( + ConstHandle2ComputerCode *const computerCode, const size_t computerCodeSize +) { + ConstHandle2ComputerCodes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ComputerCodeN = 0; ComputerCodeN < computerCodeSize; ++ComputerCodeN) + ComputerCodesComputerCodeAdd(handle, computerCode[ComputerCodeN]); + return handle; +} + +// Create, general +Handle2ComputerCodes +ComputerCodesCreate( + ConstHandle2ComputerCode *const computerCode, const size_t computerCodeSize +) { + ConstHandle2ComputerCodes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ComputerCodeN = 0; ComputerCodeN < computerCodeSize; ++ComputerCodeN) + ComputerCodesComputerCodeAdd(handle, computerCode[ComputerCodeN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ComputerCodesAssign(ConstHandle2ComputerCodes self, ConstHandle2ConstComputerCodes from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ComputerCodesDelete(ConstHandle2ConstComputerCodes self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ComputerCodesRead(ConstHandle2ComputerCodes self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ComputerCodesWrite(ConstHandle2ConstComputerCodes self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ComputerCodesPrint(ConstHandle2ConstComputerCodes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ComputerCodesPrintXML(ConstHandle2ConstComputerCodes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ComputerCodesPrintJSON(ConstHandle2ConstComputerCodes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: computerCode +// ----------------------------------------------------------------------------- + +// Has +int +ComputerCodesComputerCodeHas(ConstHandle2ConstComputerCodes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ComputerCodeHas", self, extract::computerCode); +} + +// Clear +void +ComputerCodesComputerCodeClear(ConstHandle2ComputerCodes self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ComputerCodeClear", self, extract::computerCode); +} + +// Size +size_t +ComputerCodesComputerCodeSize(ConstHandle2ConstComputerCodes self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ComputerCodeSize", self, extract::computerCode); +} + +// Add +void +ComputerCodesComputerCodeAdd(ConstHandle2ComputerCodes self, ConstHandle2ConstComputerCode computerCode) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ComputerCodeAdd", self, extract::computerCode, computerCode); +} + +// Get, by index \in [0,size), const +Handle2ConstComputerCode +ComputerCodesComputerCodeGetConst(ConstHandle2ConstComputerCodes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ComputerCodeGetConst", self, extract::computerCode, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ComputerCode +ComputerCodesComputerCodeGet(ConstHandle2ComputerCodes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ComputerCodeGet", self, extract::computerCode, index_); +} + +// Set, by index \in [0,size) +void +ComputerCodesComputerCodeSet( + ConstHandle2ComputerCodes self, + const size_t index_, + ConstHandle2ConstComputerCode computerCode +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ComputerCodeSet", self, extract::computerCode, index_, computerCode); +} + +// Has, by label +int +ComputerCodesComputerCodeHasByLabel( + ConstHandle2ConstComputerCodes self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeHasByLabel", + self, extract::computerCode, meta::label, label); +} + +// Get, by label, const +Handle2ConstComputerCode +ComputerCodesComputerCodeGetByLabelConst( + ConstHandle2ConstComputerCodes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeGetByLabelConst", + self, extract::computerCode, meta::label, label); +} + +// Get, by label, non-const +Handle2ComputerCode +ComputerCodesComputerCodeGetByLabel( + ConstHandle2ComputerCodes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeGetByLabel", + self, extract::computerCode, meta::label, label); +} + +// Set, by label +void +ComputerCodesComputerCodeSetByLabel( + ConstHandle2ComputerCodes self, + const XMLName label, + ConstHandle2ConstComputerCode computerCode +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeSetByLabel", + self, extract::computerCode, meta::label, label, computerCode); +} + +// Has, by name +int +ComputerCodesComputerCodeHasByName( + ConstHandle2ConstComputerCodes self, + const UTF8Text name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeHasByName", + self, extract::computerCode, meta::name, name); +} + +// Get, by name, const +Handle2ConstComputerCode +ComputerCodesComputerCodeGetByNameConst( + ConstHandle2ConstComputerCodes self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeGetByNameConst", + self, extract::computerCode, meta::name, name); +} + +// Get, by name, non-const +Handle2ComputerCode +ComputerCodesComputerCodeGetByName( + ConstHandle2ComputerCodes self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeGetByName", + self, extract::computerCode, meta::name, name); +} + +// Set, by name +void +ComputerCodesComputerCodeSetByName( + ConstHandle2ComputerCodes self, + const UTF8Text name, + ConstHandle2ConstComputerCode computerCode +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeSetByName", + self, extract::computerCode, meta::name, name, computerCode); +} + +// Has, by version +int +ComputerCodesComputerCodeHasByVersion( + ConstHandle2ConstComputerCodes self, + const XMLName version +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeHasByVersion", + self, extract::computerCode, meta::version, version); +} + +// Get, by version, const +Handle2ConstComputerCode +ComputerCodesComputerCodeGetByVersionConst( + ConstHandle2ConstComputerCodes self, + const XMLName version +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeGetByVersionConst", + self, extract::computerCode, meta::version, version); +} + +// Get, by version, non-const +Handle2ComputerCode +ComputerCodesComputerCodeGetByVersion( + ConstHandle2ComputerCodes self, + const XMLName version +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeGetByVersion", + self, extract::computerCode, meta::version, version); +} + +// Set, by version +void +ComputerCodesComputerCodeSetByVersion( + ConstHandle2ComputerCodes self, + const XMLName version, + ConstHandle2ConstComputerCode computerCode +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ComputerCodeSetByVersion", + self, extract::computerCode, meta::version, version, computerCode); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ComputerCodes/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes.h new file mode 100644 index 000000000..f2fc15596 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes.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. +// +// ComputerCodes is the basic handle type in this file. Example: +// // Create a default ComputerCodes object: +// ComputerCodes handle = ComputerCodesDefault(); +// Functions involving ComputerCodes are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_COMPUTERCODES +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_COMPUTERCODES + +#include "GNDStk.h" +#include "v2.0/documentation/ComputerCode.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ComputerCodesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ComputerCodes +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ComputerCodesClass *ComputerCodes; + +// --- Const-aware handles. +typedef const struct ComputerCodesClass *const ConstHandle2ConstComputerCodes; +typedef struct ComputerCodesClass *const ConstHandle2ComputerCodes; +typedef const struct ComputerCodesClass * Handle2ConstComputerCodes; +typedef struct ComputerCodesClass * Handle2ComputerCodes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstComputerCodes +ComputerCodesDefaultConst(); + +// +++ Create, default +extern_c Handle2ComputerCodes +ComputerCodesDefault(); + +// --- Create, general, const +extern_c Handle2ConstComputerCodes +ComputerCodesCreateConst( + ConstHandle2ComputerCode *const computerCode, const size_t computerCodeSize +); + +// +++ Create, general +extern_c Handle2ComputerCodes +ComputerCodesCreate( + ConstHandle2ComputerCode *const computerCode, const size_t computerCodeSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ComputerCodesAssign(ConstHandle2ComputerCodes self, ConstHandle2ConstComputerCodes from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ComputerCodesDelete(ConstHandle2ConstComputerCodes self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ComputerCodesRead(ConstHandle2ComputerCodes self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ComputerCodesWrite(ConstHandle2ConstComputerCodes self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ComputerCodesPrint(ConstHandle2ConstComputerCodes self); + +// +++ Print to standard output, as XML +extern_c int +ComputerCodesPrintXML(ConstHandle2ConstComputerCodes self); + +// +++ Print to standard output, as JSON +extern_c int +ComputerCodesPrintJSON(ConstHandle2ConstComputerCodes self); + + +// ----------------------------------------------------------------------------- +// Child: computerCode +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ComputerCodesComputerCodeHas(ConstHandle2ConstComputerCodes self); + +// +++ Clear +extern_c void +ComputerCodesComputerCodeClear(ConstHandle2ComputerCodes self); + +// +++ Size +extern_c size_t +ComputerCodesComputerCodeSize(ConstHandle2ConstComputerCodes self); + +// +++ Add +extern_c void +ComputerCodesComputerCodeAdd(ConstHandle2ComputerCodes self, ConstHandle2ConstComputerCode computerCode); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstComputerCode +ComputerCodesComputerCodeGetConst(ConstHandle2ConstComputerCodes self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ComputerCode +ComputerCodesComputerCodeGet(ConstHandle2ComputerCodes self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ComputerCodesComputerCodeSet( + ConstHandle2ComputerCodes self, + const size_t index_, + ConstHandle2ConstComputerCode computerCode +); + +// +++ Has, by label +extern_c int +ComputerCodesComputerCodeHasByLabel( + ConstHandle2ConstComputerCodes self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstComputerCode +ComputerCodesComputerCodeGetByLabelConst( + ConstHandle2ConstComputerCodes self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2ComputerCode +ComputerCodesComputerCodeGetByLabel( + ConstHandle2ComputerCodes self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ComputerCodesComputerCodeSetByLabel( + ConstHandle2ComputerCodes self, + const XMLName label, + ConstHandle2ConstComputerCode computerCode +); + +// +++ Has, by name +extern_c int +ComputerCodesComputerCodeHasByName( + ConstHandle2ConstComputerCodes self, + const UTF8Text name +); + +// --- Get, by name, const +extern_c Handle2ConstComputerCode +ComputerCodesComputerCodeGetByNameConst( + ConstHandle2ConstComputerCodes self, + const UTF8Text name +); + +// +++ Get, by name, non-const +extern_c Handle2ComputerCode +ComputerCodesComputerCodeGetByName( + ConstHandle2ComputerCodes self, + const UTF8Text name +); + +// +++ Set, by name +extern_c void +ComputerCodesComputerCodeSetByName( + ConstHandle2ComputerCodes self, + const UTF8Text name, + ConstHandle2ConstComputerCode computerCode +); + +// +++ Has, by version +extern_c int +ComputerCodesComputerCodeHasByVersion( + ConstHandle2ConstComputerCodes self, + const XMLName version +); + +// --- Get, by version, const +extern_c Handle2ConstComputerCode +ComputerCodesComputerCodeGetByVersionConst( + ConstHandle2ConstComputerCodes self, + const XMLName version +); + +// +++ Get, by version, non-const +extern_c Handle2ComputerCode +ComputerCodesComputerCodeGetByVersion( + ConstHandle2ComputerCodes self, + const XMLName version +); + +// +++ Set, by version +extern_c void +ComputerCodesComputerCodeSetByVersion( + ConstHandle2ComputerCodes self, + const XMLName version, + ConstHandle2ConstComputerCode computerCode +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ComputerCodes/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ComputerCodes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor.cpp new file mode 100644 index 000000000..8584c7250 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor.cpp @@ -0,0 +1,364 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Contributor.hpp" +#include "Contributor.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ContributorClass; +using CPP = multigroup::Contributor; + +static const std::string CLASSNAME = "Contributor"; + +namespace extract { + static auto name = [](auto &obj) { return &obj.name; }; + static auto contributorType = [](auto &obj) { return &obj.contributorType; }; + static auto orcid = [](auto &obj) { return &obj.orcid; }; + static auto email = [](auto &obj) { return &obj.email; }; + static auto affiliations = [](auto &obj) { return &obj.affiliations; }; + static auto note = [](auto &obj) { return &obj.note; }; +} + +using CPPAffiliations = documentation::Affiliations; +using CPPNote = documentation::Note; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstContributor +ContributorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Contributor +ContributorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstContributor +ContributorCreateConst( + const UTF8Text name, + const enums::ContributorType contributorType, + const UTF8Text orcid, + const UTF8Text email, + ConstHandle2ConstAffiliations affiliations, + ConstHandle2ConstNote note +) { + ConstHandle2Contributor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name, + contributorType, + orcid, + email, + detail::tocpp(affiliations), + detail::tocpp(note) + ); + return handle; +} + +// Create, general +Handle2Contributor +ContributorCreate( + const UTF8Text name, + const enums::ContributorType contributorType, + const UTF8Text orcid, + const UTF8Text email, + ConstHandle2ConstAffiliations affiliations, + ConstHandle2ConstNote note +) { + ConstHandle2Contributor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name, + contributorType, + orcid, + email, + detail::tocpp(affiliations), + detail::tocpp(note) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ContributorAssign(ConstHandle2Contributor self, ConstHandle2ConstContributor from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ContributorDelete(ConstHandle2ConstContributor self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ContributorRead(ConstHandle2Contributor self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ContributorWrite(ConstHandle2ConstContributor self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ContributorPrint(ConstHandle2ConstContributor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ContributorPrintXML(ConstHandle2ConstContributor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ContributorPrintJSON(ConstHandle2ConstContributor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +ContributorNameHas(ConstHandle2ConstContributor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +UTF8Text +ContributorNameGet(ConstHandle2ConstContributor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +ContributorNameSet(ConstHandle2Contributor self, const UTF8Text name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: contributorType +// ----------------------------------------------------------------------------- + +// Has +int +ContributorContributorTypeHas(ConstHandle2ConstContributor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ContributorTypeHas", self, extract::contributorType); +} + +// Get +// Returns by value +enums::ContributorType +ContributorContributorTypeGet(ConstHandle2ConstContributor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ContributorTypeGet", self, extract::contributorType); +} + +// Set +void +ContributorContributorTypeSet(ConstHandle2Contributor self, const enums::ContributorType contributorType) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ContributorTypeSet", self, extract::contributorType, contributorType); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: orcid +// ----------------------------------------------------------------------------- + +// Has +int +ContributorOrcidHas(ConstHandle2ConstContributor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OrcidHas", self, extract::orcid); +} + +// Get +// Returns by value +UTF8Text +ContributorOrcidGet(ConstHandle2ConstContributor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OrcidGet", self, extract::orcid); +} + +// Set +void +ContributorOrcidSet(ConstHandle2Contributor self, const UTF8Text orcid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OrcidSet", self, extract::orcid, orcid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: email +// ----------------------------------------------------------------------------- + +// Has +int +ContributorEmailHas(ConstHandle2ConstContributor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EmailHas", self, extract::email); +} + +// Get +// Returns by value +UTF8Text +ContributorEmailGet(ConstHandle2ConstContributor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EmailGet", self, extract::email); +} + +// Set +void +ContributorEmailSet(ConstHandle2Contributor self, const UTF8Text email) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EmailSet", self, extract::email, email); +} + + +// ----------------------------------------------------------------------------- +// Child: affiliations +// ----------------------------------------------------------------------------- + +// Has +int +ContributorAffiliationsHas(ConstHandle2ConstContributor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AffiliationsHas", self, extract::affiliations); +} + +// Get, const +Handle2ConstAffiliations +ContributorAffiliationsGetConst(ConstHandle2ConstContributor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AffiliationsGetConst", self, extract::affiliations); +} + +// Get, non-const +Handle2Affiliations +ContributorAffiliationsGet(ConstHandle2Contributor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AffiliationsGet", self, extract::affiliations); +} + +// Set +void +ContributorAffiliationsSet(ConstHandle2Contributor self, ConstHandle2ConstAffiliations affiliations) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AffiliationsSet", self, extract::affiliations, affiliations); +} + + +// ----------------------------------------------------------------------------- +// Child: note +// ----------------------------------------------------------------------------- + +// Has +int +ContributorNoteHas(ConstHandle2ConstContributor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NoteHas", self, extract::note); +} + +// Get, const +Handle2ConstNote +ContributorNoteGetConst(ConstHandle2ConstContributor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NoteGetConst", self, extract::note); +} + +// Get, non-const +Handle2Note +ContributorNoteGet(ConstHandle2Contributor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NoteGet", self, extract::note); +} + +// Set +void +ContributorNoteSet(ConstHandle2Contributor self, ConstHandle2ConstNote note) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NoteSet", self, extract::note, note); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Contributor/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor.h new file mode 100644 index 000000000..6e534e9d6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor.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. +// +// Contributor is the basic handle type in this file. Example: +// // Create a default Contributor object: +// Contributor handle = ContributorDefault(); +// Functions involving Contributor are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_CONTRIBUTOR +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_CONTRIBUTOR + +#include "GNDStk.h" +#include "v2.0/documentation/Affiliations.h" +#include "v2.0/documentation/Note.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ContributorClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Contributor +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ContributorClass *Contributor; + +// --- Const-aware handles. +typedef const struct ContributorClass *const ConstHandle2ConstContributor; +typedef struct ContributorClass *const ConstHandle2Contributor; +typedef const struct ContributorClass * Handle2ConstContributor; +typedef struct ContributorClass * Handle2Contributor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstContributor +ContributorDefaultConst(); + +// +++ Create, default +extern_c Handle2Contributor +ContributorDefault(); + +// --- Create, general, const +extern_c Handle2ConstContributor +ContributorCreateConst( + const UTF8Text name, + const enums::ContributorType contributorType, + const UTF8Text orcid, + const UTF8Text email, + ConstHandle2ConstAffiliations affiliations, + ConstHandle2ConstNote note +); + +// +++ Create, general +extern_c Handle2Contributor +ContributorCreate( + const UTF8Text name, + const enums::ContributorType contributorType, + const UTF8Text orcid, + const UTF8Text email, + ConstHandle2ConstAffiliations affiliations, + ConstHandle2ConstNote note +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ContributorAssign(ConstHandle2Contributor self, ConstHandle2ConstContributor from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ContributorDelete(ConstHandle2ConstContributor self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ContributorRead(ConstHandle2Contributor self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ContributorWrite(ConstHandle2ConstContributor self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ContributorPrint(ConstHandle2ConstContributor self); + +// +++ Print to standard output, as XML +extern_c int +ContributorPrintXML(ConstHandle2ConstContributor self); + +// +++ Print to standard output, as JSON +extern_c int +ContributorPrintJSON(ConstHandle2ConstContributor self); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ContributorNameHas(ConstHandle2ConstContributor self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +ContributorNameGet(ConstHandle2ConstContributor self); + +// +++ Set +extern_c void +ContributorNameSet(ConstHandle2Contributor self, const UTF8Text name); + + +// ----------------------------------------------------------------------------- +// Metadatum: contributorType +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ContributorContributorTypeHas(ConstHandle2ConstContributor self); + +// +++ Get +// +++ Returns by value +extern_c enums::ContributorType +ContributorContributorTypeGet(ConstHandle2ConstContributor self); + +// +++ Set +extern_c void +ContributorContributorTypeSet(ConstHandle2Contributor self, const enums::ContributorType contributorType); + + +// ----------------------------------------------------------------------------- +// Metadatum: orcid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ContributorOrcidHas(ConstHandle2ConstContributor self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +ContributorOrcidGet(ConstHandle2ConstContributor self); + +// +++ Set +extern_c void +ContributorOrcidSet(ConstHandle2Contributor self, const UTF8Text orcid); + + +// ----------------------------------------------------------------------------- +// Metadatum: email +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ContributorEmailHas(ConstHandle2ConstContributor self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +ContributorEmailGet(ConstHandle2ConstContributor self); + +// +++ Set +extern_c void +ContributorEmailSet(ConstHandle2Contributor self, const UTF8Text email); + + +// ----------------------------------------------------------------------------- +// Child: affiliations +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ContributorAffiliationsHas(ConstHandle2ConstContributor self); + +// --- Get, const +extern_c Handle2ConstAffiliations +ContributorAffiliationsGetConst(ConstHandle2ConstContributor self); + +// +++ Get, non-const +extern_c Handle2Affiliations +ContributorAffiliationsGet(ConstHandle2Contributor self); + +// +++ Set +extern_c void +ContributorAffiliationsSet(ConstHandle2Contributor self, ConstHandle2ConstAffiliations affiliations); + + +// ----------------------------------------------------------------------------- +// Child: note +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ContributorNoteHas(ConstHandle2ConstContributor self); + +// --- Get, const +extern_c Handle2ConstNote +ContributorNoteGetConst(ConstHandle2ConstContributor self); + +// +++ Get, non-const +extern_c Handle2Note +ContributorNoteGet(ConstHandle2Contributor self); + +// +++ Set +extern_c void +ContributorNoteSet(ConstHandle2Contributor self, ConstHandle2ConstNote note); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Contributor/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors.cpp new file mode 100644 index 000000000..4913de8b8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Contributors.hpp" +#include "Contributors.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ContributorsClass; +using CPP = multigroup::Contributors; + +static const std::string CLASSNAME = "Contributors"; + +namespace extract { + static auto author = [](auto &obj) { return &obj.author; }; +} + +using CPPAuthor = documentation::Author; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstContributors +ContributorsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Contributors +ContributorsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstContributors +ContributorsCreateConst( + ConstHandle2Author *const author, const size_t authorSize +) { + ConstHandle2Contributors handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t AuthorN = 0; AuthorN < authorSize; ++AuthorN) + ContributorsAuthorAdd(handle, author[AuthorN]); + return handle; +} + +// Create, general +Handle2Contributors +ContributorsCreate( + ConstHandle2Author *const author, const size_t authorSize +) { + ConstHandle2Contributors handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t AuthorN = 0; AuthorN < authorSize; ++AuthorN) + ContributorsAuthorAdd(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 +ContributorsAssign(ConstHandle2Contributors self, ConstHandle2ConstContributors from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ContributorsDelete(ConstHandle2ConstContributors self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ContributorsRead(ConstHandle2Contributors self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ContributorsWrite(ConstHandle2ConstContributors self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ContributorsPrint(ConstHandle2ConstContributors self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ContributorsPrintXML(ConstHandle2ConstContributors self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ContributorsPrintJSON(ConstHandle2ConstContributors self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: author +// ----------------------------------------------------------------------------- + +// Has +int +ContributorsAuthorHas(ConstHandle2ConstContributors self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AuthorHas", self, extract::author); +} + +// Clear +void +ContributorsAuthorClear(ConstHandle2Contributors self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AuthorClear", self, extract::author); +} + +// Size +size_t +ContributorsAuthorSize(ConstHandle2ConstContributors self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AuthorSize", self, extract::author); +} + +// Add +void +ContributorsAuthorAdd(ConstHandle2Contributors self, ConstHandle2ConstAuthor author) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AuthorAdd", self, extract::author, author); +} + +// Get, by index \in [0,size), const +Handle2ConstAuthor +ContributorsAuthorGetConst(ConstHandle2ConstContributors self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AuthorGetConst", self, extract::author, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Author +ContributorsAuthorGet(ConstHandle2Contributors self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AuthorGet", self, extract::author, index_); +} + +// Set, by index \in [0,size) +void +ContributorsAuthorSet( + ConstHandle2Contributors self, + const size_t index_, + ConstHandle2ConstAuthor author +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AuthorSet", self, extract::author, index_, author); +} + +// Has, by name +int +ContributorsAuthorHasByName( + ConstHandle2ConstContributors self, + const UTF8Text name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AuthorHasByName", + self, extract::author, meta::name, name); +} + +// Get, by name, const +Handle2ConstAuthor +ContributorsAuthorGetByNameConst( + ConstHandle2ConstContributors self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByNameConst", + self, extract::author, meta::name, name); +} + +// Get, by name, non-const +Handle2Author +ContributorsAuthorGetByName( + ConstHandle2Contributors self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByName", + self, extract::author, meta::name, name); +} + +// Set, by name +void +ContributorsAuthorSetByName( + ConstHandle2Contributors self, + const UTF8Text name, + ConstHandle2ConstAuthor author +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AuthorSetByName", + self, extract::author, meta::name, name, author); +} + +// Has, by orcid +int +ContributorsAuthorHasByOrcid( + ConstHandle2ConstContributors self, + const UTF8Text orcid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AuthorHasByOrcid", + self, extract::author, meta::orcid, orcid); +} + +// Get, by orcid, const +Handle2ConstAuthor +ContributorsAuthorGetByOrcidConst( + ConstHandle2ConstContributors self, + const UTF8Text orcid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByOrcidConst", + self, extract::author, meta::orcid, orcid); +} + +// Get, by orcid, non-const +Handle2Author +ContributorsAuthorGetByOrcid( + ConstHandle2Contributors self, + const UTF8Text orcid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByOrcid", + self, extract::author, meta::orcid, orcid); +} + +// Set, by orcid +void +ContributorsAuthorSetByOrcid( + ConstHandle2Contributors self, + const UTF8Text orcid, + ConstHandle2ConstAuthor author +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AuthorSetByOrcid", + self, extract::author, meta::orcid, orcid, author); +} + +// Has, by email +int +ContributorsAuthorHasByEmail( + ConstHandle2ConstContributors self, + const UTF8Text email +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AuthorHasByEmail", + self, extract::author, meta::email, email); +} + +// Get, by email, const +Handle2ConstAuthor +ContributorsAuthorGetByEmailConst( + ConstHandle2ConstContributors self, + const UTF8Text email +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByEmailConst", + self, extract::author, meta::email, email); +} + +// Get, by email, non-const +Handle2Author +ContributorsAuthorGetByEmail( + ConstHandle2Contributors self, + const UTF8Text email +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByEmail", + self, extract::author, meta::email, email); +} + +// Set, by email +void +ContributorsAuthorSetByEmail( + ConstHandle2Contributors self, + const UTF8Text email, + ConstHandle2ConstAuthor author +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AuthorSetByEmail", + self, extract::author, meta::email, email, author); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Contributors/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors.h new file mode 100644 index 000000000..5a8ff2b0c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors.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. +// +// Contributors is the basic handle type in this file. Example: +// // Create a default Contributors object: +// Contributors handle = ContributorsDefault(); +// Functions involving Contributors are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_CONTRIBUTORS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_CONTRIBUTORS + +#include "GNDStk.h" +#include "v2.0/documentation/Author.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ContributorsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Contributors +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ContributorsClass *Contributors; + +// --- Const-aware handles. +typedef const struct ContributorsClass *const ConstHandle2ConstContributors; +typedef struct ContributorsClass *const ConstHandle2Contributors; +typedef const struct ContributorsClass * Handle2ConstContributors; +typedef struct ContributorsClass * Handle2Contributors; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstContributors +ContributorsDefaultConst(); + +// +++ Create, default +extern_c Handle2Contributors +ContributorsDefault(); + +// --- Create, general, const +extern_c Handle2ConstContributors +ContributorsCreateConst( + ConstHandle2Author *const author, const size_t authorSize +); + +// +++ Create, general +extern_c Handle2Contributors +ContributorsCreate( + 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 +ContributorsAssign(ConstHandle2Contributors self, ConstHandle2ConstContributors from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ContributorsDelete(ConstHandle2ConstContributors self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ContributorsRead(ConstHandle2Contributors self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ContributorsWrite(ConstHandle2ConstContributors self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ContributorsPrint(ConstHandle2ConstContributors self); + +// +++ Print to standard output, as XML +extern_c int +ContributorsPrintXML(ConstHandle2ConstContributors self); + +// +++ Print to standard output, as JSON +extern_c int +ContributorsPrintJSON(ConstHandle2ConstContributors self); + + +// ----------------------------------------------------------------------------- +// Child: author +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ContributorsAuthorHas(ConstHandle2ConstContributors self); + +// +++ Clear +extern_c void +ContributorsAuthorClear(ConstHandle2Contributors self); + +// +++ Size +extern_c size_t +ContributorsAuthorSize(ConstHandle2ConstContributors self); + +// +++ Add +extern_c void +ContributorsAuthorAdd(ConstHandle2Contributors self, ConstHandle2ConstAuthor author); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAuthor +ContributorsAuthorGetConst(ConstHandle2ConstContributors self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Author +ContributorsAuthorGet(ConstHandle2Contributors self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ContributorsAuthorSet( + ConstHandle2Contributors self, + const size_t index_, + ConstHandle2ConstAuthor author +); + +// +++ Has, by name +extern_c int +ContributorsAuthorHasByName( + ConstHandle2ConstContributors self, + const UTF8Text name +); + +// --- Get, by name, const +extern_c Handle2ConstAuthor +ContributorsAuthorGetByNameConst( + ConstHandle2ConstContributors self, + const UTF8Text name +); + +// +++ Get, by name, non-const +extern_c Handle2Author +ContributorsAuthorGetByName( + ConstHandle2Contributors self, + const UTF8Text name +); + +// +++ Set, by name +extern_c void +ContributorsAuthorSetByName( + ConstHandle2Contributors self, + const UTF8Text name, + ConstHandle2ConstAuthor author +); + +// +++ Has, by orcid +extern_c int +ContributorsAuthorHasByOrcid( + ConstHandle2ConstContributors self, + const UTF8Text orcid +); + +// --- Get, by orcid, const +extern_c Handle2ConstAuthor +ContributorsAuthorGetByOrcidConst( + ConstHandle2ConstContributors self, + const UTF8Text orcid +); + +// +++ Get, by orcid, non-const +extern_c Handle2Author +ContributorsAuthorGetByOrcid( + ConstHandle2Contributors self, + const UTF8Text orcid +); + +// +++ Set, by orcid +extern_c void +ContributorsAuthorSetByOrcid( + ConstHandle2Contributors self, + const UTF8Text orcid, + ConstHandle2ConstAuthor author +); + +// +++ Has, by email +extern_c int +ContributorsAuthorHasByEmail( + ConstHandle2ConstContributors self, + const UTF8Text email +); + +// --- Get, by email, const +extern_c Handle2ConstAuthor +ContributorsAuthorGetByEmailConst( + ConstHandle2ConstContributors self, + const UTF8Text email +); + +// +++ Get, by email, non-const +extern_c Handle2Author +ContributorsAuthorGetByEmail( + ConstHandle2Contributors self, + const UTF8Text email +); + +// +++ Set, by email +extern_c void +ContributorsAuthorSetByEmail( + ConstHandle2Contributors self, + const UTF8Text email, + ConstHandle2ConstAuthor author +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Contributors/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Contributors/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright.cpp new file mode 100644 index 000000000..d322b3225 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright.cpp @@ -0,0 +1,530 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Copyright.hpp" +#include "Copyright.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CopyrightClass; +using CPP = multigroup::Copyright; + +static const std::string CLASSNAME = "Copyright"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCopyright +CopyrightDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Copyright +CopyrightDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCopyright +CopyrightCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const UTF8Text href +) { + ConstHandle2Copyright handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label, + href + ); + return handle; +} + +// Create, general +Handle2Copyright +CopyrightCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const UTF8Text href +) { + ConstHandle2Copyright handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +CopyrightAssign(ConstHandle2Copyright self, ConstHandle2ConstCopyright from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CopyrightDelete(ConstHandle2ConstCopyright self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CopyrightRead(ConstHandle2Copyright self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CopyrightWrite(ConstHandle2ConstCopyright self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CopyrightPrint(ConstHandle2ConstCopyright self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CopyrightPrintXML(ConstHandle2ConstCopyright self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CopyrightPrintJSON(ConstHandle2ConstCopyright self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +CopyrightIntsClear(ConstHandle2Copyright self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +CopyrightIntsSize(ConstHandle2ConstCopyright self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +CopyrightIntsGet(ConstHandle2ConstCopyright self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CopyrightIntsSet(ConstHandle2Copyright self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +CopyrightIntsGetArrayConst(ConstHandle2ConstCopyright self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +CopyrightIntsGetArray(ConstHandle2Copyright self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +CopyrightIntsSetArray(ConstHandle2Copyright self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +CopyrightUnsignedsClear(ConstHandle2Copyright self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +CopyrightUnsignedsSize(ConstHandle2ConstCopyright self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +CopyrightUnsignedsGet(ConstHandle2ConstCopyright self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CopyrightUnsignedsSet(ConstHandle2Copyright self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +CopyrightUnsignedsGetArrayConst(ConstHandle2ConstCopyright self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +CopyrightUnsignedsGetArray(ConstHandle2Copyright self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +CopyrightUnsignedsSetArray(ConstHandle2Copyright self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +CopyrightFloatsClear(ConstHandle2Copyright self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +CopyrightFloatsSize(ConstHandle2ConstCopyright self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +CopyrightFloatsGet(ConstHandle2ConstCopyright self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CopyrightFloatsSet(ConstHandle2Copyright self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +CopyrightFloatsGetArrayConst(ConstHandle2ConstCopyright self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +CopyrightFloatsGetArray(ConstHandle2Copyright self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +CopyrightFloatsSetArray(ConstHandle2Copyright self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +CopyrightDoublesClear(ConstHandle2Copyright self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +CopyrightDoublesSize(ConstHandle2ConstCopyright self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +CopyrightDoublesGet(ConstHandle2ConstCopyright self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CopyrightDoublesSet(ConstHandle2Copyright self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +CopyrightDoublesGetArrayConst(ConstHandle2ConstCopyright self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +CopyrightDoublesGetArray(ConstHandle2Copyright self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +CopyrightDoublesSetArray(ConstHandle2Copyright self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +CopyrightEncodingHas(ConstHandle2ConstCopyright self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +CopyrightEncodingGet(ConstHandle2ConstCopyright self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +CopyrightEncodingSet(ConstHandle2Copyright self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +CopyrightMarkupHas(ConstHandle2ConstCopyright self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +CopyrightMarkupGet(ConstHandle2ConstCopyright self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +CopyrightMarkupSet(ConstHandle2Copyright self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CopyrightLabelHas(ConstHandle2ConstCopyright self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CopyrightLabelGet(ConstHandle2ConstCopyright self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CopyrightLabelSet(ConstHandle2Copyright self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +CopyrightHrefHas(ConstHandle2ConstCopyright self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +UTF8Text +CopyrightHrefGet(ConstHandle2ConstCopyright self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +CopyrightHrefSet(ConstHandle2Copyright self, const UTF8Text href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Copyright/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright.h new file mode 100644 index 000000000..862a6906b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright.h @@ -0,0 +1,358 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Copyright is the basic handle type in this file. Example: +// // Create a default Copyright object: +// Copyright handle = CopyrightDefault(); +// Functions involving Copyright are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_COPYRIGHT +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_COPYRIGHT + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CopyrightClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Copyright +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CopyrightClass *Copyright; + +// --- Const-aware handles. +typedef const struct CopyrightClass *const ConstHandle2ConstCopyright; +typedef struct CopyrightClass *const ConstHandle2Copyright; +typedef const struct CopyrightClass * Handle2ConstCopyright; +typedef struct CopyrightClass * Handle2Copyright; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCopyright +CopyrightDefaultConst(); + +// +++ Create, default +extern_c Handle2Copyright +CopyrightDefault(); + +// --- Create, general, const +extern_c Handle2ConstCopyright +CopyrightCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const UTF8Text href +); + +// +++ Create, general +extern_c Handle2Copyright +CopyrightCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const UTF8Text 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 +CopyrightAssign(ConstHandle2Copyright self, ConstHandle2ConstCopyright from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CopyrightDelete(ConstHandle2ConstCopyright self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CopyrightRead(ConstHandle2Copyright self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CopyrightWrite(ConstHandle2ConstCopyright self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CopyrightPrint(ConstHandle2ConstCopyright self); + +// +++ Print to standard output, as XML +extern_c int +CopyrightPrintXML(ConstHandle2ConstCopyright self); + +// +++ Print to standard output, as JSON +extern_c int +CopyrightPrintJSON(ConstHandle2ConstCopyright self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +CopyrightIntsClear(ConstHandle2Copyright self); + +// +++ Get size +extern_c size_t +CopyrightIntsSize(ConstHandle2ConstCopyright self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +CopyrightIntsGet(ConstHandle2ConstCopyright self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CopyrightIntsSet(ConstHandle2Copyright self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +CopyrightIntsGetArrayConst(ConstHandle2ConstCopyright self); + +// +++ Get pointer to existing values, non-const +extern_c int * +CopyrightIntsGetArray(ConstHandle2Copyright self); + +// +++ Set completely new values and size +extern_c void +CopyrightIntsSetArray(ConstHandle2Copyright self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +CopyrightUnsignedsClear(ConstHandle2Copyright self); + +// +++ Get size +extern_c size_t +CopyrightUnsignedsSize(ConstHandle2ConstCopyright self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +CopyrightUnsignedsGet(ConstHandle2ConstCopyright self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CopyrightUnsignedsSet(ConstHandle2Copyright self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +CopyrightUnsignedsGetArrayConst(ConstHandle2ConstCopyright self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +CopyrightUnsignedsGetArray(ConstHandle2Copyright self); + +// +++ Set completely new values and size +extern_c void +CopyrightUnsignedsSetArray(ConstHandle2Copyright self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +CopyrightFloatsClear(ConstHandle2Copyright self); + +// +++ Get size +extern_c size_t +CopyrightFloatsSize(ConstHandle2ConstCopyright self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +CopyrightFloatsGet(ConstHandle2ConstCopyright self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CopyrightFloatsSet(ConstHandle2Copyright self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +CopyrightFloatsGetArrayConst(ConstHandle2ConstCopyright self); + +// +++ Get pointer to existing values, non-const +extern_c float * +CopyrightFloatsGetArray(ConstHandle2Copyright self); + +// +++ Set completely new values and size +extern_c void +CopyrightFloatsSetArray(ConstHandle2Copyright self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +CopyrightDoublesClear(ConstHandle2Copyright self); + +// +++ Get size +extern_c size_t +CopyrightDoublesSize(ConstHandle2ConstCopyright self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +CopyrightDoublesGet(ConstHandle2ConstCopyright self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CopyrightDoublesSet(ConstHandle2Copyright self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +CopyrightDoublesGetArrayConst(ConstHandle2ConstCopyright self); + +// +++ Get pointer to existing values, non-const +extern_c double * +CopyrightDoublesGetArray(ConstHandle2Copyright self); + +// +++ Set completely new values and size +extern_c void +CopyrightDoublesSetArray(ConstHandle2Copyright self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CopyrightEncodingHas(ConstHandle2ConstCopyright self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CopyrightEncodingGet(ConstHandle2ConstCopyright self); + +// +++ Set +extern_c void +CopyrightEncodingSet(ConstHandle2Copyright self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CopyrightMarkupHas(ConstHandle2ConstCopyright self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CopyrightMarkupGet(ConstHandle2ConstCopyright self); + +// +++ Set +extern_c void +CopyrightMarkupSet(ConstHandle2Copyright self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CopyrightLabelHas(ConstHandle2ConstCopyright self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CopyrightLabelGet(ConstHandle2ConstCopyright self); + +// +++ Set +extern_c void +CopyrightLabelSet(ConstHandle2Copyright self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CopyrightHrefHas(ConstHandle2ConstCopyright self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +CopyrightHrefGet(ConstHandle2ConstCopyright self); + +// +++ Set +extern_c void +CopyrightHrefSet(ConstHandle2Copyright self, const UTF8Text href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Copyright/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Copyright/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript.cpp new file mode 100644 index 000000000..a12c460e5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/CorrectionScript.hpp" +#include "CorrectionScript.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CorrectionScriptClass; +using CPP = multigroup::CorrectionScript; + +static const std::string CLASSNAME = "CorrectionScript"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCorrectionScript +CorrectionScriptDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CorrectionScript +CorrectionScriptDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCorrectionScript +CorrectionScriptCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2CorrectionScript handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label + ); + return handle; +} + +// Create, general +Handle2CorrectionScript +CorrectionScriptCreate( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2CorrectionScript handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +CorrectionScriptAssign(ConstHandle2CorrectionScript self, ConstHandle2ConstCorrectionScript from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CorrectionScriptDelete(ConstHandle2ConstCorrectionScript self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CorrectionScriptRead(ConstHandle2CorrectionScript self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CorrectionScriptWrite(ConstHandle2ConstCorrectionScript self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CorrectionScriptPrint(ConstHandle2ConstCorrectionScript self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CorrectionScriptPrintXML(ConstHandle2ConstCorrectionScript self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CorrectionScriptPrintJSON(ConstHandle2ConstCorrectionScript self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +CorrectionScriptIntsClear(ConstHandle2CorrectionScript self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +CorrectionScriptIntsSize(ConstHandle2ConstCorrectionScript self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +CorrectionScriptIntsGet(ConstHandle2ConstCorrectionScript self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CorrectionScriptIntsSet(ConstHandle2CorrectionScript self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +CorrectionScriptIntsGetArrayConst(ConstHandle2ConstCorrectionScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +CorrectionScriptIntsGetArray(ConstHandle2CorrectionScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +CorrectionScriptIntsSetArray(ConstHandle2CorrectionScript self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +CorrectionScriptUnsignedsClear(ConstHandle2CorrectionScript self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +CorrectionScriptUnsignedsSize(ConstHandle2ConstCorrectionScript self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +CorrectionScriptUnsignedsGet(ConstHandle2ConstCorrectionScript self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CorrectionScriptUnsignedsSet(ConstHandle2CorrectionScript self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +CorrectionScriptUnsignedsGetArrayConst(ConstHandle2ConstCorrectionScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +CorrectionScriptUnsignedsGetArray(ConstHandle2CorrectionScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +CorrectionScriptUnsignedsSetArray(ConstHandle2CorrectionScript self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +CorrectionScriptFloatsClear(ConstHandle2CorrectionScript self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +CorrectionScriptFloatsSize(ConstHandle2ConstCorrectionScript self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +CorrectionScriptFloatsGet(ConstHandle2ConstCorrectionScript self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CorrectionScriptFloatsSet(ConstHandle2CorrectionScript self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +CorrectionScriptFloatsGetArrayConst(ConstHandle2ConstCorrectionScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +CorrectionScriptFloatsGetArray(ConstHandle2CorrectionScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +CorrectionScriptFloatsSetArray(ConstHandle2CorrectionScript self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +CorrectionScriptDoublesClear(ConstHandle2CorrectionScript self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +CorrectionScriptDoublesSize(ConstHandle2ConstCorrectionScript self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +CorrectionScriptDoublesGet(ConstHandle2ConstCorrectionScript self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CorrectionScriptDoublesSet(ConstHandle2CorrectionScript self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +CorrectionScriptDoublesGetArrayConst(ConstHandle2ConstCorrectionScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +CorrectionScriptDoublesGetArray(ConstHandle2CorrectionScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +CorrectionScriptDoublesSetArray(ConstHandle2CorrectionScript self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +CorrectionScriptEncodingHas(ConstHandle2ConstCorrectionScript self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +CorrectionScriptEncodingGet(ConstHandle2ConstCorrectionScript self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +CorrectionScriptEncodingSet(ConstHandle2CorrectionScript self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +CorrectionScriptMarkupHas(ConstHandle2ConstCorrectionScript self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +CorrectionScriptMarkupGet(ConstHandle2ConstCorrectionScript self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +CorrectionScriptMarkupSet(ConstHandle2CorrectionScript self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CorrectionScriptLabelHas(ConstHandle2ConstCorrectionScript self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CorrectionScriptLabelGet(ConstHandle2ConstCorrectionScript self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CorrectionScriptLabelSet(ConstHandle2CorrectionScript self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/CorrectionScript/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript.h new file mode 100644 index 000000000..c25b4de6d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript.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. +// +// CorrectionScript is the basic handle type in this file. Example: +// // Create a default CorrectionScript object: +// CorrectionScript handle = CorrectionScriptDefault(); +// Functions involving CorrectionScript are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_CORRECTIONSCRIPT +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_CORRECTIONSCRIPT + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CorrectionScriptClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CorrectionScript +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CorrectionScriptClass *CorrectionScript; + +// --- Const-aware handles. +typedef const struct CorrectionScriptClass *const ConstHandle2ConstCorrectionScript; +typedef struct CorrectionScriptClass *const ConstHandle2CorrectionScript; +typedef const struct CorrectionScriptClass * Handle2ConstCorrectionScript; +typedef struct CorrectionScriptClass * Handle2CorrectionScript; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCorrectionScript +CorrectionScriptDefaultConst(); + +// +++ Create, default +extern_c Handle2CorrectionScript +CorrectionScriptDefault(); + +// --- Create, general, const +extern_c Handle2ConstCorrectionScript +CorrectionScriptCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +); + +// +++ Create, general +extern_c Handle2CorrectionScript +CorrectionScriptCreate( + const XMLName encoding, + const char *const markup, + const XMLName 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 +CorrectionScriptAssign(ConstHandle2CorrectionScript self, ConstHandle2ConstCorrectionScript from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CorrectionScriptDelete(ConstHandle2ConstCorrectionScript self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CorrectionScriptRead(ConstHandle2CorrectionScript self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CorrectionScriptWrite(ConstHandle2ConstCorrectionScript self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CorrectionScriptPrint(ConstHandle2ConstCorrectionScript self); + +// +++ Print to standard output, as XML +extern_c int +CorrectionScriptPrintXML(ConstHandle2ConstCorrectionScript self); + +// +++ Print to standard output, as JSON +extern_c int +CorrectionScriptPrintJSON(ConstHandle2ConstCorrectionScript self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +CorrectionScriptIntsClear(ConstHandle2CorrectionScript self); + +// +++ Get size +extern_c size_t +CorrectionScriptIntsSize(ConstHandle2ConstCorrectionScript self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +CorrectionScriptIntsGet(ConstHandle2ConstCorrectionScript self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CorrectionScriptIntsSet(ConstHandle2CorrectionScript self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +CorrectionScriptIntsGetArrayConst(ConstHandle2ConstCorrectionScript self); + +// +++ Get pointer to existing values, non-const +extern_c int * +CorrectionScriptIntsGetArray(ConstHandle2CorrectionScript self); + +// +++ Set completely new values and size +extern_c void +CorrectionScriptIntsSetArray(ConstHandle2CorrectionScript self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +CorrectionScriptUnsignedsClear(ConstHandle2CorrectionScript self); + +// +++ Get size +extern_c size_t +CorrectionScriptUnsignedsSize(ConstHandle2ConstCorrectionScript self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +CorrectionScriptUnsignedsGet(ConstHandle2ConstCorrectionScript self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CorrectionScriptUnsignedsSet(ConstHandle2CorrectionScript self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +CorrectionScriptUnsignedsGetArrayConst(ConstHandle2ConstCorrectionScript self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +CorrectionScriptUnsignedsGetArray(ConstHandle2CorrectionScript self); + +// +++ Set completely new values and size +extern_c void +CorrectionScriptUnsignedsSetArray(ConstHandle2CorrectionScript self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +CorrectionScriptFloatsClear(ConstHandle2CorrectionScript self); + +// +++ Get size +extern_c size_t +CorrectionScriptFloatsSize(ConstHandle2ConstCorrectionScript self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +CorrectionScriptFloatsGet(ConstHandle2ConstCorrectionScript self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CorrectionScriptFloatsSet(ConstHandle2CorrectionScript self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +CorrectionScriptFloatsGetArrayConst(ConstHandle2ConstCorrectionScript self); + +// +++ Get pointer to existing values, non-const +extern_c float * +CorrectionScriptFloatsGetArray(ConstHandle2CorrectionScript self); + +// +++ Set completely new values and size +extern_c void +CorrectionScriptFloatsSetArray(ConstHandle2CorrectionScript self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +CorrectionScriptDoublesClear(ConstHandle2CorrectionScript self); + +// +++ Get size +extern_c size_t +CorrectionScriptDoublesSize(ConstHandle2ConstCorrectionScript self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +CorrectionScriptDoublesGet(ConstHandle2ConstCorrectionScript self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CorrectionScriptDoublesSet(ConstHandle2CorrectionScript self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +CorrectionScriptDoublesGetArrayConst(ConstHandle2ConstCorrectionScript self); + +// +++ Get pointer to existing values, non-const +extern_c double * +CorrectionScriptDoublesGetArray(ConstHandle2CorrectionScript self); + +// +++ Set completely new values and size +extern_c void +CorrectionScriptDoublesSetArray(ConstHandle2CorrectionScript self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CorrectionScriptEncodingHas(ConstHandle2ConstCorrectionScript self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CorrectionScriptEncodingGet(ConstHandle2ConstCorrectionScript self); + +// +++ Set +extern_c void +CorrectionScriptEncodingSet(ConstHandle2CorrectionScript self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CorrectionScriptMarkupHas(ConstHandle2ConstCorrectionScript self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CorrectionScriptMarkupGet(ConstHandle2ConstCorrectionScript self); + +// +++ Set +extern_c void +CorrectionScriptMarkupSet(ConstHandle2CorrectionScript self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CorrectionScriptLabelHas(ConstHandle2ConstCorrectionScript self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CorrectionScriptLabelGet(ConstHandle2ConstCorrectionScript self); + +// +++ Set +extern_c void +CorrectionScriptLabelSet(ConstHandle2CorrectionScript self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/CorrectionScript/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/CorrectionScript/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript.cpp new file mode 100644 index 000000000..1a655aa21 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/CovarianceScript.hpp" +#include "CovarianceScript.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CovarianceScriptClass; +using CPP = multigroup::CovarianceScript; + +static const std::string CLASSNAME = "CovarianceScript"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovarianceScript +CovarianceScriptDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CovarianceScript +CovarianceScriptDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovarianceScript +CovarianceScriptCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2CovarianceScript handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label + ); + return handle; +} + +// Create, general +Handle2CovarianceScript +CovarianceScriptCreate( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2CovarianceScript handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +CovarianceScriptAssign(ConstHandle2CovarianceScript self, ConstHandle2ConstCovarianceScript from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CovarianceScriptDelete(ConstHandle2ConstCovarianceScript self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CovarianceScriptRead(ConstHandle2CovarianceScript self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CovarianceScriptWrite(ConstHandle2ConstCovarianceScript self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CovarianceScriptPrint(ConstHandle2ConstCovarianceScript self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CovarianceScriptPrintXML(ConstHandle2ConstCovarianceScript self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CovarianceScriptPrintJSON(ConstHandle2ConstCovarianceScript self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +CovarianceScriptIntsClear(ConstHandle2CovarianceScript self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +CovarianceScriptIntsSize(ConstHandle2ConstCovarianceScript self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +CovarianceScriptIntsGet(ConstHandle2ConstCovarianceScript self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CovarianceScriptIntsSet(ConstHandle2CovarianceScript self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +CovarianceScriptIntsGetArrayConst(ConstHandle2ConstCovarianceScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +CovarianceScriptIntsGetArray(ConstHandle2CovarianceScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +CovarianceScriptIntsSetArray(ConstHandle2CovarianceScript self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +CovarianceScriptUnsignedsClear(ConstHandle2CovarianceScript self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +CovarianceScriptUnsignedsSize(ConstHandle2ConstCovarianceScript self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +CovarianceScriptUnsignedsGet(ConstHandle2ConstCovarianceScript self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CovarianceScriptUnsignedsSet(ConstHandle2CovarianceScript self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +CovarianceScriptUnsignedsGetArrayConst(ConstHandle2ConstCovarianceScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +CovarianceScriptUnsignedsGetArray(ConstHandle2CovarianceScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +CovarianceScriptUnsignedsSetArray(ConstHandle2CovarianceScript self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +CovarianceScriptFloatsClear(ConstHandle2CovarianceScript self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +CovarianceScriptFloatsSize(ConstHandle2ConstCovarianceScript self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +CovarianceScriptFloatsGet(ConstHandle2ConstCovarianceScript self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CovarianceScriptFloatsSet(ConstHandle2CovarianceScript self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +CovarianceScriptFloatsGetArrayConst(ConstHandle2ConstCovarianceScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +CovarianceScriptFloatsGetArray(ConstHandle2CovarianceScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +CovarianceScriptFloatsSetArray(ConstHandle2CovarianceScript self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +CovarianceScriptDoublesClear(ConstHandle2CovarianceScript self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +CovarianceScriptDoublesSize(ConstHandle2ConstCovarianceScript self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +CovarianceScriptDoublesGet(ConstHandle2ConstCovarianceScript self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +CovarianceScriptDoublesSet(ConstHandle2CovarianceScript self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +CovarianceScriptDoublesGetArrayConst(ConstHandle2ConstCovarianceScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +CovarianceScriptDoublesGetArray(ConstHandle2CovarianceScript self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +CovarianceScriptDoublesSetArray(ConstHandle2CovarianceScript self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceScriptEncodingHas(ConstHandle2ConstCovarianceScript self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +CovarianceScriptEncodingGet(ConstHandle2ConstCovarianceScript self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +CovarianceScriptEncodingSet(ConstHandle2CovarianceScript self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceScriptMarkupHas(ConstHandle2ConstCovarianceScript self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +CovarianceScriptMarkupGet(ConstHandle2ConstCovarianceScript self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +CovarianceScriptMarkupSet(ConstHandle2CovarianceScript self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceScriptLabelHas(ConstHandle2ConstCovarianceScript self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CovarianceScriptLabelGet(ConstHandle2ConstCovarianceScript self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CovarianceScriptLabelSet(ConstHandle2CovarianceScript self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/CovarianceScript/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript.h new file mode 100644 index 000000000..6045e3805 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript.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. +// +// CovarianceScript is the basic handle type in this file. Example: +// // Create a default CovarianceScript object: +// CovarianceScript handle = CovarianceScriptDefault(); +// Functions involving CovarianceScript are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_COVARIANCESCRIPT +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_COVARIANCESCRIPT + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CovarianceScriptClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CovarianceScript +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CovarianceScriptClass *CovarianceScript; + +// --- Const-aware handles. +typedef const struct CovarianceScriptClass *const ConstHandle2ConstCovarianceScript; +typedef struct CovarianceScriptClass *const ConstHandle2CovarianceScript; +typedef const struct CovarianceScriptClass * Handle2ConstCovarianceScript; +typedef struct CovarianceScriptClass * Handle2CovarianceScript; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCovarianceScript +CovarianceScriptDefaultConst(); + +// +++ Create, default +extern_c Handle2CovarianceScript +CovarianceScriptDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceScript +CovarianceScriptCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +); + +// +++ Create, general +extern_c Handle2CovarianceScript +CovarianceScriptCreate( + const XMLName encoding, + const char *const markup, + const XMLName 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 +CovarianceScriptAssign(ConstHandle2CovarianceScript self, ConstHandle2ConstCovarianceScript from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CovarianceScriptDelete(ConstHandle2ConstCovarianceScript self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CovarianceScriptRead(ConstHandle2CovarianceScript self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CovarianceScriptWrite(ConstHandle2ConstCovarianceScript self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CovarianceScriptPrint(ConstHandle2ConstCovarianceScript self); + +// +++ Print to standard output, as XML +extern_c int +CovarianceScriptPrintXML(ConstHandle2ConstCovarianceScript self); + +// +++ Print to standard output, as JSON +extern_c int +CovarianceScriptPrintJSON(ConstHandle2ConstCovarianceScript self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +CovarianceScriptIntsClear(ConstHandle2CovarianceScript self); + +// +++ Get size +extern_c size_t +CovarianceScriptIntsSize(ConstHandle2ConstCovarianceScript self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +CovarianceScriptIntsGet(ConstHandle2ConstCovarianceScript self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CovarianceScriptIntsSet(ConstHandle2CovarianceScript self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +CovarianceScriptIntsGetArrayConst(ConstHandle2ConstCovarianceScript self); + +// +++ Get pointer to existing values, non-const +extern_c int * +CovarianceScriptIntsGetArray(ConstHandle2CovarianceScript self); + +// +++ Set completely new values and size +extern_c void +CovarianceScriptIntsSetArray(ConstHandle2CovarianceScript self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +CovarianceScriptUnsignedsClear(ConstHandle2CovarianceScript self); + +// +++ Get size +extern_c size_t +CovarianceScriptUnsignedsSize(ConstHandle2ConstCovarianceScript self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +CovarianceScriptUnsignedsGet(ConstHandle2ConstCovarianceScript self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CovarianceScriptUnsignedsSet(ConstHandle2CovarianceScript self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +CovarianceScriptUnsignedsGetArrayConst(ConstHandle2ConstCovarianceScript self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +CovarianceScriptUnsignedsGetArray(ConstHandle2CovarianceScript self); + +// +++ Set completely new values and size +extern_c void +CovarianceScriptUnsignedsSetArray(ConstHandle2CovarianceScript self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +CovarianceScriptFloatsClear(ConstHandle2CovarianceScript self); + +// +++ Get size +extern_c size_t +CovarianceScriptFloatsSize(ConstHandle2ConstCovarianceScript self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +CovarianceScriptFloatsGet(ConstHandle2ConstCovarianceScript self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CovarianceScriptFloatsSet(ConstHandle2CovarianceScript self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +CovarianceScriptFloatsGetArrayConst(ConstHandle2ConstCovarianceScript self); + +// +++ Get pointer to existing values, non-const +extern_c float * +CovarianceScriptFloatsGetArray(ConstHandle2CovarianceScript self); + +// +++ Set completely new values and size +extern_c void +CovarianceScriptFloatsSetArray(ConstHandle2CovarianceScript self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +CovarianceScriptDoublesClear(ConstHandle2CovarianceScript self); + +// +++ Get size +extern_c size_t +CovarianceScriptDoublesSize(ConstHandle2ConstCovarianceScript self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +CovarianceScriptDoublesGet(ConstHandle2ConstCovarianceScript self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +CovarianceScriptDoublesSet(ConstHandle2CovarianceScript self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +CovarianceScriptDoublesGetArrayConst(ConstHandle2ConstCovarianceScript self); + +// +++ Get pointer to existing values, non-const +extern_c double * +CovarianceScriptDoublesGetArray(ConstHandle2CovarianceScript self); + +// +++ Set completely new values and size +extern_c void +CovarianceScriptDoublesSetArray(ConstHandle2CovarianceScript self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceScriptEncodingHas(ConstHandle2ConstCovarianceScript self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CovarianceScriptEncodingGet(ConstHandle2ConstCovarianceScript self); + +// +++ Set +extern_c void +CovarianceScriptEncodingSet(ConstHandle2CovarianceScript self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceScriptMarkupHas(ConstHandle2ConstCovarianceScript self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceScriptMarkupGet(ConstHandle2ConstCovarianceScript self); + +// +++ Set +extern_c void +CovarianceScriptMarkupSet(ConstHandle2CovarianceScript self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceScriptLabelHas(ConstHandle2ConstCovarianceScript self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CovarianceScriptLabelGet(ConstHandle2ConstCovarianceScript self); + +// +++ Set +extern_c void +CovarianceScriptLabelSet(ConstHandle2CovarianceScript self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/CovarianceScript/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/CovarianceScript/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Date.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Date.cpp new file mode 100644 index 000000000..315764e8d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Date.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Date.hpp" +#include "Date.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = DateClass; +using CPP = multigroup::Date; + +static const std::string CLASSNAME = "Date"; + +namespace extract { + static auto dateType = [](auto &obj) { return &obj.dateType; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDate +DateDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Date +DateDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDate +DateCreateConst( + const enums::DateType dateType, + const char *const value +) { + ConstHandle2Date handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + dateType, + value + ); + return handle; +} + +// Create, general +Handle2Date +DateCreate( + const enums::DateType dateType, + const char *const value +) { + ConstHandle2Date handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + dateType, + 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 +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: dateType +// ----------------------------------------------------------------------------- + +// Has +int +DateDateTypeHas(ConstHandle2ConstDate self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateTypeHas", self, extract::dateType); +} + +// Get +// Returns by value +enums::DateType +DateDateTypeGet(ConstHandle2ConstDate self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateTypeGet", self, extract::dateType); +} + +// Set +void +DateDateTypeSet(ConstHandle2Date self, const enums::DateType dateType) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateTypeSet", self, extract::dateType, dateType); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Date/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Date.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Date.h new file mode 100644 index 000000000..b341e23e1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/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_TEST_V2_0_DOCUMENTATION_DATE +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_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 +extern_c Handle2Date +DateDefault(); + +// --- Create, general, const +extern_c Handle2ConstDate +DateCreateConst( + const enums::DateType dateType, + const char *const value +); + +// +++ Create, general +extern_c Handle2Date +DateCreate( + const enums::DateType dateType, + 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 +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: dateType +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DateDateTypeHas(ConstHandle2ConstDate self); + +// +++ Get +// +++ Returns by value +extern_c enums::DateType +DateDateTypeGet(ConstHandle2ConstDate self); + +// +++ Set +extern_c void +DateDateTypeSet(ConstHandle2Date self, const enums::DateType dateType); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Date/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Date/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Date/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Date/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Date/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates.cpp new file mode 100644 index 000000000..0cbabf9a0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Dates.hpp" +#include "Dates.h" + +using namespace njoy::GNDStk; +using namespace test::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 = documentation::Date; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDates +DatesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by dateType +int +DatesDateHasByDateType( + ConstHandle2ConstDates self, + const enums::DateType dateType +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DateHasByDateType", + self, extract::date, meta::dateType, dateType); +} + +// Get, by dateType, const +Handle2ConstDate +DatesDateGetByDateTypeConst( + ConstHandle2ConstDates self, + const enums::DateType dateType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DateGetByDateTypeConst", + self, extract::date, meta::dateType, dateType); +} + +// Get, by dateType, non-const +Handle2Date +DatesDateGetByDateType( + ConstHandle2Dates self, + const enums::DateType dateType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DateGetByDateType", + self, extract::date, meta::dateType, dateType); +} + +// Set, by dateType +void +DatesDateSetByDateType( + ConstHandle2Dates self, + const enums::DateType dateType, + ConstHandle2ConstDate date +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DateSetByDateType", + self, extract::date, meta::dateType, dateType, date); +} + +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Dates/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates.h new file mode 100644 index 000000000..6c558d51a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_DOCUMENTATION_DATES +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_DATES + +#include "GNDStk.h" +#include "v2.0/documentation/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 +extern_c Handle2Dates +DatesDefault(); + +// --- Create, general, const +extern_c Handle2ConstDates +DatesCreateConst( + ConstHandle2Date *const date, const size_t dateSize +); + +// +++ Create, general +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 +); + +// +++ Has, by dateType +extern_c int +DatesDateHasByDateType( + ConstHandle2ConstDates self, + const enums::DateType dateType +); + +// --- Get, by dateType, const +extern_c Handle2ConstDate +DatesDateGetByDateTypeConst( + ConstHandle2ConstDates self, + const enums::DateType dateType +); + +// +++ Get, by dateType, non-const +extern_c Handle2Date +DatesDateGetByDateType( + ConstHandle2Dates self, + const enums::DateType dateType +); + +// +++ Set, by dateType +extern_c void +DatesDateSetByDateType( + ConstHandle2Dates self, + const enums::DateType dateType, + ConstHandle2ConstDate date +); + +// +++ 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 +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Dates/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Dates/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation.cpp new file mode 100644 index 000000000..af5e04a7a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation.cpp @@ -0,0 +1,888 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Documentation.hpp" +#include "Documentation.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = DocumentationClass; +using CPP = multigroup::Documentation; + +static const std::string CLASSNAME = "Documentation"; + +namespace extract { + static auto doi = [](auto &obj) { return &obj.doi; }; + static auto publicationDate = [](auto &obj) { return &obj.publicationDate; }; + static auto version = [](auto &obj) { return &obj.version; }; + static auto authors = [](auto &obj) { return &obj.authors; }; + static auto contributors = [](auto &obj) { return &obj.contributors; }; + static auto collaborations = [](auto &obj) { return &obj.collaborations; }; + static auto dates = [](auto &obj) { return &obj.dates; }; + static auto copyright = [](auto &obj) { return &obj.copyright; }; + static auto acknowledgements = [](auto &obj) { return &obj.acknowledgements; }; + static auto keywords = [](auto &obj) { return &obj.keywords; }; + static auto relatedItems = [](auto &obj) { return &obj.relatedItems; }; + static auto title = [](auto &obj) { return &obj.title; }; + static auto abstract = [](auto &obj) { return &obj.abstract; }; + static auto body = [](auto &obj) { return &obj.body; }; + static auto computerCodes = [](auto &obj) { return &obj.computerCodes; }; + static auto experimentalDataSets = [](auto &obj) { return &obj.experimentalDataSets; }; + static auto bibliography = [](auto &obj) { return &obj.bibliography; }; + static auto endfCompatible = [](auto &obj) { return &obj.endfCompatible; }; +} + +using CPPAuthors = documentation::Authors; +using CPPContributors = documentation::Contributors; +using CPPCollaborations = documentation::Collaborations; +using CPPDates = documentation::Dates; +using CPPCopyright = documentation::Copyright; +using CPPAcknowledgements = documentation::Acknowledgements; +using CPPKeywords = documentation::Keywords; +using CPPRelatedItems = documentation::RelatedItems; +using CPPTitle = documentation::Title; +using CPPAbstract = documentation::Abstract; +using CPPBody = documentation::Body; +using CPPComputerCodes = documentation::ComputerCodes; +using CPPExperimentalDataSets = documentation::ExperimentalDataSets; +using CPPBibliography = documentation::Bibliography; +using CPPEndfCompatible = documentation::EndfCompatible; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDocumentation +DocumentationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Documentation +DocumentationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDocumentation +DocumentationCreateConst( + const UTF8Text doi, + const char *const publicationDate, + const UTF8Text version, + ConstHandle2ConstAuthors authors, + ConstHandle2ConstContributors contributors, + ConstHandle2ConstCollaborations collaborations, + ConstHandle2ConstDates dates, + ConstHandle2ConstCopyright copyright, + ConstHandle2ConstAcknowledgements acknowledgements, + ConstHandle2ConstKeywords keywords, + ConstHandle2ConstRelatedItems relatedItems, + ConstHandle2ConstTitle title, + ConstHandle2ConstAbstract abstract, + ConstHandle2ConstBody body, + ConstHandle2ConstComputerCodes computerCodes, + ConstHandle2ConstExperimentalDataSets experimentalDataSets, + ConstHandle2ConstBibliography bibliography, + ConstHandle2ConstEndfCompatible endfCompatible +) { + ConstHandle2Documentation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + doi, + publicationDate, + version, + detail::tocpp(authors), + detail::tocpp(contributors), + detail::tocpp(collaborations), + detail::tocpp(dates), + detail::tocpp(copyright), + detail::tocpp(acknowledgements), + detail::tocpp(keywords), + detail::tocpp(relatedItems), + detail::tocpp(title), + detail::tocpp(abstract), + detail::tocpp(body), + detail::tocpp(computerCodes), + detail::tocpp(experimentalDataSets), + detail::tocpp(bibliography), + detail::tocpp(endfCompatible) + ); + return handle; +} + +// Create, general +Handle2Documentation +DocumentationCreate( + const UTF8Text doi, + const char *const publicationDate, + const UTF8Text version, + ConstHandle2ConstAuthors authors, + ConstHandle2ConstContributors contributors, + ConstHandle2ConstCollaborations collaborations, + ConstHandle2ConstDates dates, + ConstHandle2ConstCopyright copyright, + ConstHandle2ConstAcknowledgements acknowledgements, + ConstHandle2ConstKeywords keywords, + ConstHandle2ConstRelatedItems relatedItems, + ConstHandle2ConstTitle title, + ConstHandle2ConstAbstract abstract, + ConstHandle2ConstBody body, + ConstHandle2ConstComputerCodes computerCodes, + ConstHandle2ConstExperimentalDataSets experimentalDataSets, + ConstHandle2ConstBibliography bibliography, + ConstHandle2ConstEndfCompatible endfCompatible +) { + ConstHandle2Documentation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + doi, + publicationDate, + version, + detail::tocpp(authors), + detail::tocpp(contributors), + detail::tocpp(collaborations), + detail::tocpp(dates), + detail::tocpp(copyright), + detail::tocpp(acknowledgements), + detail::tocpp(keywords), + detail::tocpp(relatedItems), + detail::tocpp(title), + detail::tocpp(abstract), + detail::tocpp(body), + detail::tocpp(computerCodes), + detail::tocpp(experimentalDataSets), + detail::tocpp(bibliography), + 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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: doi +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationDoiHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoiHas", self, extract::doi); +} + +// Get +// Returns by value +UTF8Text +DocumentationDoiGet(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoiGet", self, extract::doi); +} + +// Set +void +DocumentationDoiSet(ConstHandle2Documentation self, const UTF8Text doi) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoiSet", self, extract::doi, doi); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: publicationDate +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationPublicationDateHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PublicationDateHas", self, extract::publicationDate); +} + +// Get +// Returns by value +const char * +DocumentationPublicationDateGet(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PublicationDateGet", self, extract::publicationDate); +} + +// Set +void +DocumentationPublicationDateSet(ConstHandle2Documentation self, const char *const publicationDate) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PublicationDateSet", self, extract::publicationDate, publicationDate); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationVersionHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"VersionHas", self, extract::version); +} + +// Get +// Returns by value +UTF8Text +DocumentationVersionGet(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"VersionGet", self, extract::version); +} + +// Set +void +DocumentationVersionSet(ConstHandle2Documentation self, const UTF8Text version) +{ + detail::setField + (CLASSNAME, CLASSNAME+"VersionSet", self, extract::version, version); +} + + +// ----------------------------------------------------------------------------- +// 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: contributors +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationContributorsHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ContributorsHas", self, extract::contributors); +} + +// Get, const +Handle2ConstContributors +DocumentationContributorsGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ContributorsGetConst", self, extract::contributors); +} + +// Get, non-const +Handle2Contributors +DocumentationContributorsGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ContributorsGet", self, extract::contributors); +} + +// Set +void +DocumentationContributorsSet(ConstHandle2Documentation self, ConstHandle2ConstContributors contributors) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ContributorsSet", self, extract::contributors, contributors); +} + + +// ----------------------------------------------------------------------------- +// Child: collaborations +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationCollaborationsHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CollaborationsHas", self, extract::collaborations); +} + +// Get, const +Handle2ConstCollaborations +DocumentationCollaborationsGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CollaborationsGetConst", self, extract::collaborations); +} + +// Get, non-const +Handle2Collaborations +DocumentationCollaborationsGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CollaborationsGet", self, extract::collaborations); +} + +// Set +void +DocumentationCollaborationsSet(ConstHandle2Documentation self, ConstHandle2ConstCollaborations collaborations) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CollaborationsSet", self, extract::collaborations, collaborations); +} + + +// ----------------------------------------------------------------------------- +// 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: copyright +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationCopyrightHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CopyrightHas", self, extract::copyright); +} + +// Get, const +Handle2ConstCopyright +DocumentationCopyrightGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CopyrightGetConst", self, extract::copyright); +} + +// Get, non-const +Handle2Copyright +DocumentationCopyrightGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CopyrightGet", self, extract::copyright); +} + +// Set +void +DocumentationCopyrightSet(ConstHandle2Documentation self, ConstHandle2ConstCopyright copyright) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CopyrightSet", self, extract::copyright, copyright); +} + + +// ----------------------------------------------------------------------------- +// Child: acknowledgements +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationAcknowledgementsHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AcknowledgementsHas", self, extract::acknowledgements); +} + +// Get, const +Handle2ConstAcknowledgements +DocumentationAcknowledgementsGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AcknowledgementsGetConst", self, extract::acknowledgements); +} + +// Get, non-const +Handle2Acknowledgements +DocumentationAcknowledgementsGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AcknowledgementsGet", self, extract::acknowledgements); +} + +// Set +void +DocumentationAcknowledgementsSet(ConstHandle2Documentation self, ConstHandle2ConstAcknowledgements acknowledgements) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AcknowledgementsSet", self, extract::acknowledgements, acknowledgements); +} + + +// ----------------------------------------------------------------------------- +// Child: keywords +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationKeywordsHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"KeywordsHas", self, extract::keywords); +} + +// Get, const +Handle2ConstKeywords +DocumentationKeywordsGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"KeywordsGetConst", self, extract::keywords); +} + +// Get, non-const +Handle2Keywords +DocumentationKeywordsGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"KeywordsGet", self, extract::keywords); +} + +// Set +void +DocumentationKeywordsSet(ConstHandle2Documentation self, ConstHandle2ConstKeywords keywords) +{ + detail::setField + (CLASSNAME, CLASSNAME+"KeywordsSet", self, extract::keywords, keywords); +} + + +// ----------------------------------------------------------------------------- +// Child: relatedItems +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationRelatedItemsHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RelatedItemsHas", self, extract::relatedItems); +} + +// Get, const +Handle2ConstRelatedItems +DocumentationRelatedItemsGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RelatedItemsGetConst", self, extract::relatedItems); +} + +// Get, non-const +Handle2RelatedItems +DocumentationRelatedItemsGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RelatedItemsGet", self, extract::relatedItems); +} + +// Set +void +DocumentationRelatedItemsSet(ConstHandle2Documentation self, ConstHandle2ConstRelatedItems relatedItems) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RelatedItemsSet", self, extract::relatedItems, relatedItems); +} + + +// ----------------------------------------------------------------------------- +// 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: abstract +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationAbstractHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AbstractHas", self, extract::abstract); +} + +// Get, const +Handle2ConstAbstract +DocumentationAbstractGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AbstractGetConst", self, extract::abstract); +} + +// Get, non-const +Handle2Abstract +DocumentationAbstractGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AbstractGet", self, extract::abstract); +} + +// Set +void +DocumentationAbstractSet(ConstHandle2Documentation self, ConstHandle2ConstAbstract abstract) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AbstractSet", self, extract::abstract, abstract); +} + + +// ----------------------------------------------------------------------------- +// 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: computerCodes +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationComputerCodesHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ComputerCodesHas", self, extract::computerCodes); +} + +// Get, const +Handle2ConstComputerCodes +DocumentationComputerCodesGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ComputerCodesGetConst", self, extract::computerCodes); +} + +// Get, non-const +Handle2ComputerCodes +DocumentationComputerCodesGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ComputerCodesGet", self, extract::computerCodes); +} + +// Set +void +DocumentationComputerCodesSet(ConstHandle2Documentation self, ConstHandle2ConstComputerCodes computerCodes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ComputerCodesSet", self, extract::computerCodes, computerCodes); +} + + +// ----------------------------------------------------------------------------- +// Child: experimentalDataSets +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationExperimentalDataSetsHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ExperimentalDataSetsHas", self, extract::experimentalDataSets); +} + +// Get, const +Handle2ConstExperimentalDataSets +DocumentationExperimentalDataSetsGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExperimentalDataSetsGetConst", self, extract::experimentalDataSets); +} + +// Get, non-const +Handle2ExperimentalDataSets +DocumentationExperimentalDataSetsGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExperimentalDataSetsGet", self, extract::experimentalDataSets); +} + +// Set +void +DocumentationExperimentalDataSetsSet(ConstHandle2Documentation self, ConstHandle2ConstExperimentalDataSets experimentalDataSets) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ExperimentalDataSetsSet", self, extract::experimentalDataSets, experimentalDataSets); +} + + +// ----------------------------------------------------------------------------- +// Child: bibliography +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationBibliographyHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BibliographyHas", self, extract::bibliography); +} + +// Get, const +Handle2ConstBibliography +DocumentationBibliographyGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BibliographyGetConst", self, extract::bibliography); +} + +// Get, non-const +Handle2Bibliography +DocumentationBibliographyGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BibliographyGet", self, extract::bibliography); +} + +// Set +void +DocumentationBibliographySet(ConstHandle2Documentation self, ConstHandle2ConstBibliography bibliography) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BibliographySet", self, extract::bibliography, bibliography); +} + + +// ----------------------------------------------------------------------------- +// 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/documentation/Documentation/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation.h new file mode 100644 index 000000000..e3961d984 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation.h @@ -0,0 +1,557 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_DOCUMENTATION_DOCUMENTATION +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_DOCUMENTATION + +#include "GNDStk.h" +#include "v2.0/documentation/Authors.h" +#include "v2.0/documentation/Contributors.h" +#include "v2.0/documentation/Collaborations.h" +#include "v2.0/documentation/Dates.h" +#include "v2.0/documentation/Copyright.h" +#include "v2.0/documentation/Acknowledgements.h" +#include "v2.0/documentation/Keywords.h" +#include "v2.0/documentation/RelatedItems.h" +#include "v2.0/documentation/Title.h" +#include "v2.0/documentation/Abstract.h" +#include "v2.0/documentation/Body.h" +#include "v2.0/documentation/ComputerCodes.h" +#include "v2.0/documentation/ExperimentalDataSets.h" +#include "v2.0/documentation/Bibliography.h" +#include "v2.0/documentation/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 +extern_c Handle2Documentation +DocumentationDefault(); + +// --- Create, general, const +extern_c Handle2ConstDocumentation +DocumentationCreateConst( + const UTF8Text doi, + const char *const publicationDate, + const UTF8Text version, + ConstHandle2ConstAuthors authors, + ConstHandle2ConstContributors contributors, + ConstHandle2ConstCollaborations collaborations, + ConstHandle2ConstDates dates, + ConstHandle2ConstCopyright copyright, + ConstHandle2ConstAcknowledgements acknowledgements, + ConstHandle2ConstKeywords keywords, + ConstHandle2ConstRelatedItems relatedItems, + ConstHandle2ConstTitle title, + ConstHandle2ConstAbstract abstract, + ConstHandle2ConstBody body, + ConstHandle2ConstComputerCodes computerCodes, + ConstHandle2ConstExperimentalDataSets experimentalDataSets, + ConstHandle2ConstBibliography bibliography, + ConstHandle2ConstEndfCompatible endfCompatible +); + +// +++ Create, general +extern_c Handle2Documentation +DocumentationCreate( + const UTF8Text doi, + const char *const publicationDate, + const UTF8Text version, + ConstHandle2ConstAuthors authors, + ConstHandle2ConstContributors contributors, + ConstHandle2ConstCollaborations collaborations, + ConstHandle2ConstDates dates, + ConstHandle2ConstCopyright copyright, + ConstHandle2ConstAcknowledgements acknowledgements, + ConstHandle2ConstKeywords keywords, + ConstHandle2ConstRelatedItems relatedItems, + ConstHandle2ConstTitle title, + ConstHandle2ConstAbstract abstract, + ConstHandle2ConstBody body, + ConstHandle2ConstComputerCodes computerCodes, + ConstHandle2ConstExperimentalDataSets experimentalDataSets, + ConstHandle2ConstBibliography bibliography, + 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: doi +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationDoiHas(ConstHandle2ConstDocumentation self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +DocumentationDoiGet(ConstHandle2ConstDocumentation self); + +// +++ Set +extern_c void +DocumentationDoiSet(ConstHandle2Documentation self, const UTF8Text doi); + + +// ----------------------------------------------------------------------------- +// Metadatum: publicationDate +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationPublicationDateHas(ConstHandle2ConstDocumentation self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DocumentationPublicationDateGet(ConstHandle2ConstDocumentation self); + +// +++ Set +extern_c void +DocumentationPublicationDateSet(ConstHandle2Documentation self, const char *const publicationDate); + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationVersionHas(ConstHandle2ConstDocumentation self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +DocumentationVersionGet(ConstHandle2ConstDocumentation self); + +// +++ Set +extern_c void +DocumentationVersionSet(ConstHandle2Documentation self, const UTF8Text version); + + +// ----------------------------------------------------------------------------- +// 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: contributors +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationContributorsHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstContributors +DocumentationContributorsGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Contributors +DocumentationContributorsGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationContributorsSet(ConstHandle2Documentation self, ConstHandle2ConstContributors contributors); + + +// ----------------------------------------------------------------------------- +// Child: collaborations +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationCollaborationsHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstCollaborations +DocumentationCollaborationsGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Collaborations +DocumentationCollaborationsGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationCollaborationsSet(ConstHandle2Documentation self, ConstHandle2ConstCollaborations collaborations); + + +// ----------------------------------------------------------------------------- +// 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: copyright +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationCopyrightHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstCopyright +DocumentationCopyrightGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Copyright +DocumentationCopyrightGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationCopyrightSet(ConstHandle2Documentation self, ConstHandle2ConstCopyright copyright); + + +// ----------------------------------------------------------------------------- +// Child: acknowledgements +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationAcknowledgementsHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstAcknowledgements +DocumentationAcknowledgementsGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Acknowledgements +DocumentationAcknowledgementsGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationAcknowledgementsSet(ConstHandle2Documentation self, ConstHandle2ConstAcknowledgements acknowledgements); + + +// ----------------------------------------------------------------------------- +// Child: keywords +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationKeywordsHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstKeywords +DocumentationKeywordsGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Keywords +DocumentationKeywordsGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationKeywordsSet(ConstHandle2Documentation self, ConstHandle2ConstKeywords keywords); + + +// ----------------------------------------------------------------------------- +// Child: relatedItems +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationRelatedItemsHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstRelatedItems +DocumentationRelatedItemsGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2RelatedItems +DocumentationRelatedItemsGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationRelatedItemsSet(ConstHandle2Documentation self, ConstHandle2ConstRelatedItems relatedItems); + + +// ----------------------------------------------------------------------------- +// 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: abstract +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationAbstractHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstAbstract +DocumentationAbstractGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Abstract +DocumentationAbstractGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationAbstractSet(ConstHandle2Documentation self, ConstHandle2ConstAbstract abstract); + + +// ----------------------------------------------------------------------------- +// 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: computerCodes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationComputerCodesHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstComputerCodes +DocumentationComputerCodesGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2ComputerCodes +DocumentationComputerCodesGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationComputerCodesSet(ConstHandle2Documentation self, ConstHandle2ConstComputerCodes computerCodes); + + +// ----------------------------------------------------------------------------- +// Child: experimentalDataSets +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationExperimentalDataSetsHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstExperimentalDataSets +DocumentationExperimentalDataSetsGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2ExperimentalDataSets +DocumentationExperimentalDataSetsGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationExperimentalDataSetsSet(ConstHandle2Documentation self, ConstHandle2ConstExperimentalDataSets experimentalDataSets); + + +// ----------------------------------------------------------------------------- +// Child: bibliography +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationBibliographyHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstBibliography +DocumentationBibliographyGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Bibliography +DocumentationBibliographyGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationBibliographySet(ConstHandle2Documentation self, ConstHandle2ConstBibliography bibliography); + + +// ----------------------------------------------------------------------------- +// 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/documentation/Documentation/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Documentation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible.cpp new file mode 100644 index 000000000..6401f179d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/EndfCompatible.hpp" +#include "EndfCompatible.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EndfCompatibleClass; +using CPP = multigroup::EndfCompatible; + +static const std::string CLASSNAME = "EndfCompatible"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEndfCompatible +EndfCompatibleDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2EndfCompatible +EndfCompatibleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEndfCompatible +EndfCompatibleCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2EndfCompatible handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label + ); + return handle; +} + +// Create, general +Handle2EndfCompatible +EndfCompatibleCreate( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2EndfCompatible handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +EndfCompatibleIntsClear(ConstHandle2EndfCompatible self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +EndfCompatibleIntsSize(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +EndfCompatibleIntsGet(ConstHandle2ConstEndfCompatible self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +EndfCompatibleIntsSet(ConstHandle2EndfCompatible self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +EndfCompatibleIntsGetArrayConst(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +EndfCompatibleIntsGetArray(ConstHandle2EndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +EndfCompatibleIntsSetArray(ConstHandle2EndfCompatible self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +EndfCompatibleUnsignedsClear(ConstHandle2EndfCompatible self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +EndfCompatibleUnsignedsSize(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +EndfCompatibleUnsignedsGet(ConstHandle2ConstEndfCompatible self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +EndfCompatibleUnsignedsSet(ConstHandle2EndfCompatible self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +EndfCompatibleUnsignedsGetArrayConst(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +EndfCompatibleUnsignedsGetArray(ConstHandle2EndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +EndfCompatibleUnsignedsSetArray(ConstHandle2EndfCompatible self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +EndfCompatibleFloatsClear(ConstHandle2EndfCompatible self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +EndfCompatibleFloatsSize(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +EndfCompatibleFloatsGet(ConstHandle2ConstEndfCompatible self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +EndfCompatibleFloatsSet(ConstHandle2EndfCompatible self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +EndfCompatibleFloatsGetArrayConst(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +EndfCompatibleFloatsGetArray(ConstHandle2EndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +EndfCompatibleFloatsSetArray(ConstHandle2EndfCompatible self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +EndfCompatibleDoublesClear(ConstHandle2EndfCompatible self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +EndfCompatibleDoublesSize(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +EndfCompatibleDoublesGet(ConstHandle2ConstEndfCompatible self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +EndfCompatibleDoublesSet(ConstHandle2EndfCompatible self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +EndfCompatibleDoublesGetArrayConst(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +EndfCompatibleDoublesGetArray(ConstHandle2EndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +EndfCompatibleDoublesSetArray(ConstHandle2EndfCompatible self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +EndfCompatibleEncodingHas(ConstHandle2ConstEndfCompatible self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +EndfCompatibleEncodingGet(ConstHandle2ConstEndfCompatible self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +EndfCompatibleEncodingSet(ConstHandle2EndfCompatible self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +EndfCompatibleMarkupHas(ConstHandle2ConstEndfCompatible self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +EndfCompatibleMarkupGet(ConstHandle2ConstEndfCompatible self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +EndfCompatibleMarkupSet(ConstHandle2EndfCompatible self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +EndfCompatibleLabelHas(ConstHandle2ConstEndfCompatible self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +EndfCompatibleLabelGet(ConstHandle2ConstEndfCompatible self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EndfCompatibleLabelSet(ConstHandle2EndfCompatible self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/EndfCompatible/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible.h new file mode 100644 index 000000000..6abf4265d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible.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. +// +// 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_TEST_V2_0_DOCUMENTATION_ENDFCOMPATIBLE +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_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 +extern_c Handle2EndfCompatible +EndfCompatibleDefault(); + +// --- Create, general, const +extern_c Handle2ConstEndfCompatible +EndfCompatibleCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +); + +// +++ Create, general +extern_c Handle2EndfCompatible +EndfCompatibleCreate( + const XMLName encoding, + const char *const markup, + const XMLName 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 +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); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +EndfCompatibleIntsClear(ConstHandle2EndfCompatible self); + +// +++ Get size +extern_c size_t +EndfCompatibleIntsSize(ConstHandle2ConstEndfCompatible self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +EndfCompatibleIntsGet(ConstHandle2ConstEndfCompatible self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +EndfCompatibleIntsSet(ConstHandle2EndfCompatible self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +EndfCompatibleIntsGetArrayConst(ConstHandle2ConstEndfCompatible self); + +// +++ Get pointer to existing values, non-const +extern_c int * +EndfCompatibleIntsGetArray(ConstHandle2EndfCompatible self); + +// +++ Set completely new values and size +extern_c void +EndfCompatibleIntsSetArray(ConstHandle2EndfCompatible self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +EndfCompatibleUnsignedsClear(ConstHandle2EndfCompatible self); + +// +++ Get size +extern_c size_t +EndfCompatibleUnsignedsSize(ConstHandle2ConstEndfCompatible self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +EndfCompatibleUnsignedsGet(ConstHandle2ConstEndfCompatible self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +EndfCompatibleUnsignedsSet(ConstHandle2EndfCompatible self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +EndfCompatibleUnsignedsGetArrayConst(ConstHandle2ConstEndfCompatible self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +EndfCompatibleUnsignedsGetArray(ConstHandle2EndfCompatible self); + +// +++ Set completely new values and size +extern_c void +EndfCompatibleUnsignedsSetArray(ConstHandle2EndfCompatible self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +EndfCompatibleFloatsClear(ConstHandle2EndfCompatible self); + +// +++ Get size +extern_c size_t +EndfCompatibleFloatsSize(ConstHandle2ConstEndfCompatible self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +EndfCompatibleFloatsGet(ConstHandle2ConstEndfCompatible self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +EndfCompatibleFloatsSet(ConstHandle2EndfCompatible self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +EndfCompatibleFloatsGetArrayConst(ConstHandle2ConstEndfCompatible self); + +// +++ Get pointer to existing values, non-const +extern_c float * +EndfCompatibleFloatsGetArray(ConstHandle2EndfCompatible self); + +// +++ Set completely new values and size +extern_c void +EndfCompatibleFloatsSetArray(ConstHandle2EndfCompatible self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +EndfCompatibleDoublesClear(ConstHandle2EndfCompatible self); + +// +++ Get size +extern_c size_t +EndfCompatibleDoublesSize(ConstHandle2ConstEndfCompatible self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +EndfCompatibleDoublesGet(ConstHandle2ConstEndfCompatible self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +EndfCompatibleDoublesSet(ConstHandle2EndfCompatible self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +EndfCompatibleDoublesGetArrayConst(ConstHandle2ConstEndfCompatible self); + +// +++ Get pointer to existing values, non-const +extern_c double * +EndfCompatibleDoublesGetArray(ConstHandle2EndfCompatible self); + +// +++ Set completely new values and size +extern_c void +EndfCompatibleDoublesSetArray(ConstHandle2EndfCompatible self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EndfCompatibleEncodingHas(ConstHandle2ConstEndfCompatible self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EndfCompatibleEncodingGet(ConstHandle2ConstEndfCompatible self); + +// +++ Set +extern_c void +EndfCompatibleEncodingSet(ConstHandle2EndfCompatible self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EndfCompatibleMarkupHas(ConstHandle2ConstEndfCompatible self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EndfCompatibleMarkupGet(ConstHandle2ConstEndfCompatible self); + +// +++ Set +extern_c void +EndfCompatibleMarkupSet(ConstHandle2EndfCompatible self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EndfCompatibleLabelHas(ConstHandle2ConstEndfCompatible self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EndfCompatibleLabelGet(ConstHandle2ConstEndfCompatible self); + +// +++ Set +extern_c void +EndfCompatibleLabelSet(ConstHandle2EndfCompatible self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/EndfCompatible/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/EndfCompatible/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments.cpp new file mode 100644 index 000000000..e3633f422 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/ExecutionArguments.hpp" +#include "ExecutionArguments.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ExecutionArgumentsClass; +using CPP = multigroup::ExecutionArguments; + +static const std::string CLASSNAME = "ExecutionArguments"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstExecutionArguments +ExecutionArgumentsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ExecutionArguments +ExecutionArgumentsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstExecutionArguments +ExecutionArgumentsCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2ExecutionArguments handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label + ); + return handle; +} + +// Create, general +Handle2ExecutionArguments +ExecutionArgumentsCreate( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2ExecutionArguments handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +ExecutionArgumentsAssign(ConstHandle2ExecutionArguments self, ConstHandle2ConstExecutionArguments from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ExecutionArgumentsDelete(ConstHandle2ConstExecutionArguments self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ExecutionArgumentsRead(ConstHandle2ExecutionArguments self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ExecutionArgumentsWrite(ConstHandle2ConstExecutionArguments self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ExecutionArgumentsPrint(ConstHandle2ConstExecutionArguments self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ExecutionArgumentsPrintXML(ConstHandle2ConstExecutionArguments self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ExecutionArgumentsPrintJSON(ConstHandle2ConstExecutionArguments self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +ExecutionArgumentsIntsClear(ConstHandle2ExecutionArguments self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +ExecutionArgumentsIntsSize(ConstHandle2ConstExecutionArguments self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +ExecutionArgumentsIntsGet(ConstHandle2ConstExecutionArguments self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +ExecutionArgumentsIntsSet(ConstHandle2ExecutionArguments self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +ExecutionArgumentsIntsGetArrayConst(ConstHandle2ConstExecutionArguments self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +ExecutionArgumentsIntsGetArray(ConstHandle2ExecutionArguments self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +ExecutionArgumentsIntsSetArray(ConstHandle2ExecutionArguments self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +ExecutionArgumentsUnsignedsClear(ConstHandle2ExecutionArguments self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +ExecutionArgumentsUnsignedsSize(ConstHandle2ConstExecutionArguments self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +ExecutionArgumentsUnsignedsGet(ConstHandle2ConstExecutionArguments self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +ExecutionArgumentsUnsignedsSet(ConstHandle2ExecutionArguments self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +ExecutionArgumentsUnsignedsGetArrayConst(ConstHandle2ConstExecutionArguments self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +ExecutionArgumentsUnsignedsGetArray(ConstHandle2ExecutionArguments self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +ExecutionArgumentsUnsignedsSetArray(ConstHandle2ExecutionArguments self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +ExecutionArgumentsFloatsClear(ConstHandle2ExecutionArguments self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +ExecutionArgumentsFloatsSize(ConstHandle2ConstExecutionArguments self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +ExecutionArgumentsFloatsGet(ConstHandle2ConstExecutionArguments self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +ExecutionArgumentsFloatsSet(ConstHandle2ExecutionArguments self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +ExecutionArgumentsFloatsGetArrayConst(ConstHandle2ConstExecutionArguments self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +ExecutionArgumentsFloatsGetArray(ConstHandle2ExecutionArguments self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +ExecutionArgumentsFloatsSetArray(ConstHandle2ExecutionArguments self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +ExecutionArgumentsDoublesClear(ConstHandle2ExecutionArguments self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +ExecutionArgumentsDoublesSize(ConstHandle2ConstExecutionArguments self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +ExecutionArgumentsDoublesGet(ConstHandle2ConstExecutionArguments self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +ExecutionArgumentsDoublesSet(ConstHandle2ExecutionArguments self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +ExecutionArgumentsDoublesGetArrayConst(ConstHandle2ConstExecutionArguments self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +ExecutionArgumentsDoublesGetArray(ConstHandle2ExecutionArguments self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +ExecutionArgumentsDoublesSetArray(ConstHandle2ExecutionArguments self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +ExecutionArgumentsEncodingHas(ConstHandle2ConstExecutionArguments self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +ExecutionArgumentsEncodingGet(ConstHandle2ConstExecutionArguments self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +ExecutionArgumentsEncodingSet(ConstHandle2ExecutionArguments self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +ExecutionArgumentsMarkupHas(ConstHandle2ConstExecutionArguments self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +ExecutionArgumentsMarkupGet(ConstHandle2ConstExecutionArguments self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +ExecutionArgumentsMarkupSet(ConstHandle2ExecutionArguments self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ExecutionArgumentsLabelHas(ConstHandle2ConstExecutionArguments self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ExecutionArgumentsLabelGet(ConstHandle2ConstExecutionArguments self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ExecutionArgumentsLabelSet(ConstHandle2ExecutionArguments self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ExecutionArguments/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments.h new file mode 100644 index 000000000..1f92922ad --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments.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. +// +// ExecutionArguments is the basic handle type in this file. Example: +// // Create a default ExecutionArguments object: +// ExecutionArguments handle = ExecutionArgumentsDefault(); +// Functions involving ExecutionArguments are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_EXECUTIONARGUMENTS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_EXECUTIONARGUMENTS + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ExecutionArgumentsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ExecutionArguments +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ExecutionArgumentsClass *ExecutionArguments; + +// --- Const-aware handles. +typedef const struct ExecutionArgumentsClass *const ConstHandle2ConstExecutionArguments; +typedef struct ExecutionArgumentsClass *const ConstHandle2ExecutionArguments; +typedef const struct ExecutionArgumentsClass * Handle2ConstExecutionArguments; +typedef struct ExecutionArgumentsClass * Handle2ExecutionArguments; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstExecutionArguments +ExecutionArgumentsDefaultConst(); + +// +++ Create, default +extern_c Handle2ExecutionArguments +ExecutionArgumentsDefault(); + +// --- Create, general, const +extern_c Handle2ConstExecutionArguments +ExecutionArgumentsCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +); + +// +++ Create, general +extern_c Handle2ExecutionArguments +ExecutionArgumentsCreate( + const XMLName encoding, + const char *const markup, + const XMLName 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 +ExecutionArgumentsAssign(ConstHandle2ExecutionArguments self, ConstHandle2ConstExecutionArguments from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ExecutionArgumentsDelete(ConstHandle2ConstExecutionArguments self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ExecutionArgumentsRead(ConstHandle2ExecutionArguments self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ExecutionArgumentsWrite(ConstHandle2ConstExecutionArguments self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ExecutionArgumentsPrint(ConstHandle2ConstExecutionArguments self); + +// +++ Print to standard output, as XML +extern_c int +ExecutionArgumentsPrintXML(ConstHandle2ConstExecutionArguments self); + +// +++ Print to standard output, as JSON +extern_c int +ExecutionArgumentsPrintJSON(ConstHandle2ConstExecutionArguments self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +ExecutionArgumentsIntsClear(ConstHandle2ExecutionArguments self); + +// +++ Get size +extern_c size_t +ExecutionArgumentsIntsSize(ConstHandle2ConstExecutionArguments self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +ExecutionArgumentsIntsGet(ConstHandle2ConstExecutionArguments self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +ExecutionArgumentsIntsSet(ConstHandle2ExecutionArguments self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +ExecutionArgumentsIntsGetArrayConst(ConstHandle2ConstExecutionArguments self); + +// +++ Get pointer to existing values, non-const +extern_c int * +ExecutionArgumentsIntsGetArray(ConstHandle2ExecutionArguments self); + +// +++ Set completely new values and size +extern_c void +ExecutionArgumentsIntsSetArray(ConstHandle2ExecutionArguments self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +ExecutionArgumentsUnsignedsClear(ConstHandle2ExecutionArguments self); + +// +++ Get size +extern_c size_t +ExecutionArgumentsUnsignedsSize(ConstHandle2ConstExecutionArguments self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +ExecutionArgumentsUnsignedsGet(ConstHandle2ConstExecutionArguments self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +ExecutionArgumentsUnsignedsSet(ConstHandle2ExecutionArguments self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +ExecutionArgumentsUnsignedsGetArrayConst(ConstHandle2ConstExecutionArguments self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +ExecutionArgumentsUnsignedsGetArray(ConstHandle2ExecutionArguments self); + +// +++ Set completely new values and size +extern_c void +ExecutionArgumentsUnsignedsSetArray(ConstHandle2ExecutionArguments self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +ExecutionArgumentsFloatsClear(ConstHandle2ExecutionArguments self); + +// +++ Get size +extern_c size_t +ExecutionArgumentsFloatsSize(ConstHandle2ConstExecutionArguments self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +ExecutionArgumentsFloatsGet(ConstHandle2ConstExecutionArguments self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +ExecutionArgumentsFloatsSet(ConstHandle2ExecutionArguments self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +ExecutionArgumentsFloatsGetArrayConst(ConstHandle2ConstExecutionArguments self); + +// +++ Get pointer to existing values, non-const +extern_c float * +ExecutionArgumentsFloatsGetArray(ConstHandle2ExecutionArguments self); + +// +++ Set completely new values and size +extern_c void +ExecutionArgumentsFloatsSetArray(ConstHandle2ExecutionArguments self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +ExecutionArgumentsDoublesClear(ConstHandle2ExecutionArguments self); + +// +++ Get size +extern_c size_t +ExecutionArgumentsDoublesSize(ConstHandle2ConstExecutionArguments self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +ExecutionArgumentsDoublesGet(ConstHandle2ConstExecutionArguments self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +ExecutionArgumentsDoublesSet(ConstHandle2ExecutionArguments self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +ExecutionArgumentsDoublesGetArrayConst(ConstHandle2ConstExecutionArguments self); + +// +++ Get pointer to existing values, non-const +extern_c double * +ExecutionArgumentsDoublesGetArray(ConstHandle2ExecutionArguments self); + +// +++ Set completely new values and size +extern_c void +ExecutionArgumentsDoublesSetArray(ConstHandle2ExecutionArguments self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExecutionArgumentsEncodingHas(ConstHandle2ConstExecutionArguments self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ExecutionArgumentsEncodingGet(ConstHandle2ConstExecutionArguments self); + +// +++ Set +extern_c void +ExecutionArgumentsEncodingSet(ConstHandle2ExecutionArguments self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExecutionArgumentsMarkupHas(ConstHandle2ConstExecutionArguments self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ExecutionArgumentsMarkupGet(ConstHandle2ConstExecutionArguments self); + +// +++ Set +extern_c void +ExecutionArgumentsMarkupSet(ConstHandle2ExecutionArguments self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExecutionArgumentsLabelHas(ConstHandle2ConstExecutionArguments self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ExecutionArgumentsLabelGet(ConstHandle2ConstExecutionArguments self); + +// +++ Set +extern_c void +ExecutionArgumentsLabelSet(ConstHandle2ExecutionArguments self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ExecutionArguments/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExecutionArguments/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet.cpp new file mode 100644 index 000000000..5a5ac19fb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/ExforDataSet.hpp" +#include "ExforDataSet.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ExforDataSetClass; +using CPP = multigroup::ExforDataSet; + +static const std::string CLASSNAME = "ExforDataSet"; + +namespace extract { + static auto subentry = [](auto &obj) { return &obj.subentry; }; + static auto retrievalDate = [](auto &obj) { return &obj.retrievalDate; }; + static auto covarianceScript = [](auto &obj) { return &obj.covarianceScript; }; + static auto correctionScript = [](auto &obj) { return &obj.correctionScript; }; + static auto note = [](auto &obj) { return &obj.note; }; +} + +using CPPCovarianceScript = documentation::CovarianceScript; +using CPPCorrectionScript = documentation::CorrectionScript; +using CPPNote = documentation::Note; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstExforDataSet +ExforDataSetDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ExforDataSet +ExforDataSetDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstExforDataSet +ExforDataSetCreateConst( + const XMLName subentry, + const char *const retrievalDate, + ConstHandle2ConstCovarianceScript covarianceScript, + ConstHandle2ConstCorrectionScript correctionScript, + ConstHandle2ConstNote note +) { + ConstHandle2ExforDataSet handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + subentry, + retrievalDate, + detail::tocpp(covarianceScript), + detail::tocpp(correctionScript), + detail::tocpp(note) + ); + return handle; +} + +// Create, general +Handle2ExforDataSet +ExforDataSetCreate( + const XMLName subentry, + const char *const retrievalDate, + ConstHandle2ConstCovarianceScript covarianceScript, + ConstHandle2ConstCorrectionScript correctionScript, + ConstHandle2ConstNote note +) { + ConstHandle2ExforDataSet handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + subentry, + retrievalDate, + detail::tocpp(covarianceScript), + detail::tocpp(correctionScript), + detail::tocpp(note) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ExforDataSetAssign(ConstHandle2ExforDataSet self, ConstHandle2ConstExforDataSet from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ExforDataSetDelete(ConstHandle2ConstExforDataSet self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ExforDataSetRead(ConstHandle2ExforDataSet self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ExforDataSetWrite(ConstHandle2ConstExforDataSet self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ExforDataSetPrint(ConstHandle2ConstExforDataSet self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ExforDataSetPrintXML(ConstHandle2ConstExforDataSet self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ExforDataSetPrintJSON(ConstHandle2ConstExforDataSet self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: subentry +// ----------------------------------------------------------------------------- + +// Has +int +ExforDataSetSubentryHas(ConstHandle2ConstExforDataSet self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SubentryHas", self, extract::subentry); +} + +// Get +// Returns by value +XMLName +ExforDataSetSubentryGet(ConstHandle2ConstExforDataSet self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SubentryGet", self, extract::subentry); +} + +// Set +void +ExforDataSetSubentrySet(ConstHandle2ExforDataSet self, const XMLName subentry) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SubentrySet", self, extract::subentry, subentry); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: retrievalDate +// ----------------------------------------------------------------------------- + +// Has +int +ExforDataSetRetrievalDateHas(ConstHandle2ConstExforDataSet self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RetrievalDateHas", self, extract::retrievalDate); +} + +// Get +// Returns by value +const char * +ExforDataSetRetrievalDateGet(ConstHandle2ConstExforDataSet self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RetrievalDateGet", self, extract::retrievalDate); +} + +// Set +void +ExforDataSetRetrievalDateSet(ConstHandle2ExforDataSet self, const char *const retrievalDate) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RetrievalDateSet", self, extract::retrievalDate, retrievalDate); +} + + +// ----------------------------------------------------------------------------- +// Child: covarianceScript +// ----------------------------------------------------------------------------- + +// Has +int +ExforDataSetCovarianceScriptHas(ConstHandle2ConstExforDataSet self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CovarianceScriptHas", self, extract::covarianceScript); +} + +// Get, const +Handle2ConstCovarianceScript +ExforDataSetCovarianceScriptGetConst(ConstHandle2ConstExforDataSet self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceScriptGetConst", self, extract::covarianceScript); +} + +// Get, non-const +Handle2CovarianceScript +ExforDataSetCovarianceScriptGet(ConstHandle2ExforDataSet self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceScriptGet", self, extract::covarianceScript); +} + +// Set +void +ExforDataSetCovarianceScriptSet(ConstHandle2ExforDataSet self, ConstHandle2ConstCovarianceScript covarianceScript) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CovarianceScriptSet", self, extract::covarianceScript, covarianceScript); +} + + +// ----------------------------------------------------------------------------- +// Child: correctionScript +// ----------------------------------------------------------------------------- + +// Has +int +ExforDataSetCorrectionScriptHas(ConstHandle2ConstExforDataSet self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CorrectionScriptHas", self, extract::correctionScript); +} + +// Get, const +Handle2ConstCorrectionScript +ExforDataSetCorrectionScriptGetConst(ConstHandle2ConstExforDataSet self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CorrectionScriptGetConst", self, extract::correctionScript); +} + +// Get, non-const +Handle2CorrectionScript +ExforDataSetCorrectionScriptGet(ConstHandle2ExforDataSet self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CorrectionScriptGet", self, extract::correctionScript); +} + +// Set +void +ExforDataSetCorrectionScriptSet(ConstHandle2ExforDataSet self, ConstHandle2ConstCorrectionScript correctionScript) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CorrectionScriptSet", self, extract::correctionScript, correctionScript); +} + + +// ----------------------------------------------------------------------------- +// Child: note +// ----------------------------------------------------------------------------- + +// Has +int +ExforDataSetNoteHas(ConstHandle2ConstExforDataSet self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NoteHas", self, extract::note); +} + +// Get, const +Handle2ConstNote +ExforDataSetNoteGetConst(ConstHandle2ConstExforDataSet self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NoteGetConst", self, extract::note); +} + +// Get, non-const +Handle2Note +ExforDataSetNoteGet(ConstHandle2ExforDataSet self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NoteGet", self, extract::note); +} + +// Set +void +ExforDataSetNoteSet(ConstHandle2ExforDataSet self, ConstHandle2ConstNote note) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NoteSet", self, extract::note, note); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ExforDataSet/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet.h new file mode 100644 index 000000000..edf8eb480 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet.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. +// +// ExforDataSet is the basic handle type in this file. Example: +// // Create a default ExforDataSet object: +// ExforDataSet handle = ExforDataSetDefault(); +// Functions involving ExforDataSet are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_EXFORDATASET +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_EXFORDATASET + +#include "GNDStk.h" +#include "v2.0/documentation/CovarianceScript.h" +#include "v2.0/documentation/CorrectionScript.h" +#include "v2.0/documentation/Note.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ExforDataSetClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ExforDataSet +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ExforDataSetClass *ExforDataSet; + +// --- Const-aware handles. +typedef const struct ExforDataSetClass *const ConstHandle2ConstExforDataSet; +typedef struct ExforDataSetClass *const ConstHandle2ExforDataSet; +typedef const struct ExforDataSetClass * Handle2ConstExforDataSet; +typedef struct ExforDataSetClass * Handle2ExforDataSet; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstExforDataSet +ExforDataSetDefaultConst(); + +// +++ Create, default +extern_c Handle2ExforDataSet +ExforDataSetDefault(); + +// --- Create, general, const +extern_c Handle2ConstExforDataSet +ExforDataSetCreateConst( + const XMLName subentry, + const char *const retrievalDate, + ConstHandle2ConstCovarianceScript covarianceScript, + ConstHandle2ConstCorrectionScript correctionScript, + ConstHandle2ConstNote note +); + +// +++ Create, general +extern_c Handle2ExforDataSet +ExforDataSetCreate( + const XMLName subentry, + const char *const retrievalDate, + ConstHandle2ConstCovarianceScript covarianceScript, + ConstHandle2ConstCorrectionScript correctionScript, + ConstHandle2ConstNote note +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ExforDataSetAssign(ConstHandle2ExforDataSet self, ConstHandle2ConstExforDataSet from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ExforDataSetDelete(ConstHandle2ConstExforDataSet self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ExforDataSetRead(ConstHandle2ExforDataSet self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ExforDataSetWrite(ConstHandle2ConstExforDataSet self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ExforDataSetPrint(ConstHandle2ConstExforDataSet self); + +// +++ Print to standard output, as XML +extern_c int +ExforDataSetPrintXML(ConstHandle2ConstExforDataSet self); + +// +++ Print to standard output, as JSON +extern_c int +ExforDataSetPrintJSON(ConstHandle2ConstExforDataSet self); + + +// ----------------------------------------------------------------------------- +// Metadatum: subentry +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExforDataSetSubentryHas(ConstHandle2ConstExforDataSet self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ExforDataSetSubentryGet(ConstHandle2ConstExforDataSet self); + +// +++ Set +extern_c void +ExforDataSetSubentrySet(ConstHandle2ExforDataSet self, const XMLName subentry); + + +// ----------------------------------------------------------------------------- +// Metadatum: retrievalDate +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExforDataSetRetrievalDateHas(ConstHandle2ConstExforDataSet self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ExforDataSetRetrievalDateGet(ConstHandle2ConstExforDataSet self); + +// +++ Set +extern_c void +ExforDataSetRetrievalDateSet(ConstHandle2ExforDataSet self, const char *const retrievalDate); + + +// ----------------------------------------------------------------------------- +// Child: covarianceScript +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExforDataSetCovarianceScriptHas(ConstHandle2ConstExforDataSet self); + +// --- Get, const +extern_c Handle2ConstCovarianceScript +ExforDataSetCovarianceScriptGetConst(ConstHandle2ConstExforDataSet self); + +// +++ Get, non-const +extern_c Handle2CovarianceScript +ExforDataSetCovarianceScriptGet(ConstHandle2ExforDataSet self); + +// +++ Set +extern_c void +ExforDataSetCovarianceScriptSet(ConstHandle2ExforDataSet self, ConstHandle2ConstCovarianceScript covarianceScript); + + +// ----------------------------------------------------------------------------- +// Child: correctionScript +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExforDataSetCorrectionScriptHas(ConstHandle2ConstExforDataSet self); + +// --- Get, const +extern_c Handle2ConstCorrectionScript +ExforDataSetCorrectionScriptGetConst(ConstHandle2ConstExforDataSet self); + +// +++ Get, non-const +extern_c Handle2CorrectionScript +ExforDataSetCorrectionScriptGet(ConstHandle2ExforDataSet self); + +// +++ Set +extern_c void +ExforDataSetCorrectionScriptSet(ConstHandle2ExforDataSet self, ConstHandle2ConstCorrectionScript correctionScript); + + +// ----------------------------------------------------------------------------- +// Child: note +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExforDataSetNoteHas(ConstHandle2ConstExforDataSet self); + +// --- Get, const +extern_c Handle2ConstNote +ExforDataSetNoteGetConst(ConstHandle2ConstExforDataSet self); + +// +++ Get, non-const +extern_c Handle2Note +ExforDataSetNoteGet(ConstHandle2ExforDataSet self); + +// +++ Set +extern_c void +ExforDataSetNoteSet(ConstHandle2ExforDataSet self, ConstHandle2ConstNote note); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ExforDataSet/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSet/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets.cpp new file mode 100644 index 000000000..6ff04d393 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/ExforDataSets.hpp" +#include "ExforDataSets.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ExforDataSetsClass; +using CPP = multigroup::ExforDataSets; + +static const std::string CLASSNAME = "ExforDataSets"; + +namespace extract { + static auto exforDataSet = [](auto &obj) { return &obj.exforDataSet; }; +} + +using CPPExforDataSet = documentation::ExforDataSet; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstExforDataSets +ExforDataSetsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ExforDataSets +ExforDataSetsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstExforDataSets +ExforDataSetsCreateConst( + ConstHandle2ExforDataSet *const exforDataSet, const size_t exforDataSetSize +) { + ConstHandle2ExforDataSets handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ExforDataSetN = 0; ExforDataSetN < exforDataSetSize; ++ExforDataSetN) + ExforDataSetsExforDataSetAdd(handle, exforDataSet[ExforDataSetN]); + return handle; +} + +// Create, general +Handle2ExforDataSets +ExforDataSetsCreate( + ConstHandle2ExforDataSet *const exforDataSet, const size_t exforDataSetSize +) { + ConstHandle2ExforDataSets handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ExforDataSetN = 0; ExforDataSetN < exforDataSetSize; ++ExforDataSetN) + ExforDataSetsExforDataSetAdd(handle, exforDataSet[ExforDataSetN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ExforDataSetsAssign(ConstHandle2ExforDataSets self, ConstHandle2ConstExforDataSets from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ExforDataSetsDelete(ConstHandle2ConstExforDataSets self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ExforDataSetsRead(ConstHandle2ExforDataSets self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ExforDataSetsWrite(ConstHandle2ConstExforDataSets self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ExforDataSetsPrint(ConstHandle2ConstExforDataSets self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ExforDataSetsPrintXML(ConstHandle2ConstExforDataSets self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ExforDataSetsPrintJSON(ConstHandle2ConstExforDataSets self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: exforDataSet +// ----------------------------------------------------------------------------- + +// Has +int +ExforDataSetsExforDataSetHas(ConstHandle2ConstExforDataSets self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ExforDataSetHas", self, extract::exforDataSet); +} + +// Clear +void +ExforDataSetsExforDataSetClear(ConstHandle2ExforDataSets self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ExforDataSetClear", self, extract::exforDataSet); +} + +// Size +size_t +ExforDataSetsExforDataSetSize(ConstHandle2ConstExforDataSets self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ExforDataSetSize", self, extract::exforDataSet); +} + +// Add +void +ExforDataSetsExforDataSetAdd(ConstHandle2ExforDataSets self, ConstHandle2ConstExforDataSet exforDataSet) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ExforDataSetAdd", self, extract::exforDataSet, exforDataSet); +} + +// Get, by index \in [0,size), const +Handle2ConstExforDataSet +ExforDataSetsExforDataSetGetConst(ConstHandle2ConstExforDataSets self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ExforDataSetGetConst", self, extract::exforDataSet, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ExforDataSet +ExforDataSetsExforDataSetGet(ConstHandle2ExforDataSets self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ExforDataSetGet", self, extract::exforDataSet, index_); +} + +// Set, by index \in [0,size) +void +ExforDataSetsExforDataSetSet( + ConstHandle2ExforDataSets self, + const size_t index_, + ConstHandle2ConstExforDataSet exforDataSet +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ExforDataSetSet", self, extract::exforDataSet, index_, exforDataSet); +} + +// Has, by subentry +int +ExforDataSetsExforDataSetHasBySubentry( + ConstHandle2ConstExforDataSets self, + const XMLName subentry +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ExforDataSetHasBySubentry", + self, extract::exforDataSet, meta::subentry, subentry); +} + +// Get, by subentry, const +Handle2ConstExforDataSet +ExforDataSetsExforDataSetGetBySubentryConst( + ConstHandle2ConstExforDataSets self, + const XMLName subentry +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExforDataSetGetBySubentryConst", + self, extract::exforDataSet, meta::subentry, subentry); +} + +// Get, by subentry, non-const +Handle2ExforDataSet +ExforDataSetsExforDataSetGetBySubentry( + ConstHandle2ExforDataSets self, + const XMLName subentry +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExforDataSetGetBySubentry", + self, extract::exforDataSet, meta::subentry, subentry); +} + +// Set, by subentry +void +ExforDataSetsExforDataSetSetBySubentry( + ConstHandle2ExforDataSets self, + const XMLName subentry, + ConstHandle2ConstExforDataSet exforDataSet +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ExforDataSetSetBySubentry", + self, extract::exforDataSet, meta::subentry, subentry, exforDataSet); +} + +// Has, by retrievalDate +int +ExforDataSetsExforDataSetHasByRetrievalDate( + ConstHandle2ConstExforDataSets self, + const char *const retrievalDate +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ExforDataSetHasByRetrievalDate", + self, extract::exforDataSet, meta::retrievalDate, retrievalDate); +} + +// Get, by retrievalDate, const +Handle2ConstExforDataSet +ExforDataSetsExforDataSetGetByRetrievalDateConst( + ConstHandle2ConstExforDataSets self, + const char *const retrievalDate +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExforDataSetGetByRetrievalDateConst", + self, extract::exforDataSet, meta::retrievalDate, retrievalDate); +} + +// Get, by retrievalDate, non-const +Handle2ExforDataSet +ExforDataSetsExforDataSetGetByRetrievalDate( + ConstHandle2ExforDataSets self, + const char *const retrievalDate +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExforDataSetGetByRetrievalDate", + self, extract::exforDataSet, meta::retrievalDate, retrievalDate); +} + +// Set, by retrievalDate +void +ExforDataSetsExforDataSetSetByRetrievalDate( + ConstHandle2ExforDataSets self, + const char *const retrievalDate, + ConstHandle2ConstExforDataSet exforDataSet +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ExforDataSetSetByRetrievalDate", + self, extract::exforDataSet, meta::retrievalDate, retrievalDate, exforDataSet); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ExforDataSets/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets.h new file mode 100644 index 000000000..5e882a91f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ExforDataSets is the basic handle type in this file. Example: +// // Create a default ExforDataSets object: +// ExforDataSets handle = ExforDataSetsDefault(); +// Functions involving ExforDataSets are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_EXFORDATASETS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_EXFORDATASETS + +#include "GNDStk.h" +#include "v2.0/documentation/ExforDataSet.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ExforDataSetsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ExforDataSets +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ExforDataSetsClass *ExforDataSets; + +// --- Const-aware handles. +typedef const struct ExforDataSetsClass *const ConstHandle2ConstExforDataSets; +typedef struct ExforDataSetsClass *const ConstHandle2ExforDataSets; +typedef const struct ExforDataSetsClass * Handle2ConstExforDataSets; +typedef struct ExforDataSetsClass * Handle2ExforDataSets; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstExforDataSets +ExforDataSetsDefaultConst(); + +// +++ Create, default +extern_c Handle2ExforDataSets +ExforDataSetsDefault(); + +// --- Create, general, const +extern_c Handle2ConstExforDataSets +ExforDataSetsCreateConst( + ConstHandle2ExforDataSet *const exforDataSet, const size_t exforDataSetSize +); + +// +++ Create, general +extern_c Handle2ExforDataSets +ExforDataSetsCreate( + ConstHandle2ExforDataSet *const exforDataSet, const size_t exforDataSetSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ExforDataSetsAssign(ConstHandle2ExforDataSets self, ConstHandle2ConstExforDataSets from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ExforDataSetsDelete(ConstHandle2ConstExforDataSets self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ExforDataSetsRead(ConstHandle2ExforDataSets self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ExforDataSetsWrite(ConstHandle2ConstExforDataSets self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ExforDataSetsPrint(ConstHandle2ConstExforDataSets self); + +// +++ Print to standard output, as XML +extern_c int +ExforDataSetsPrintXML(ConstHandle2ConstExforDataSets self); + +// +++ Print to standard output, as JSON +extern_c int +ExforDataSetsPrintJSON(ConstHandle2ConstExforDataSets self); + + +// ----------------------------------------------------------------------------- +// Child: exforDataSet +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExforDataSetsExforDataSetHas(ConstHandle2ConstExforDataSets self); + +// +++ Clear +extern_c void +ExforDataSetsExforDataSetClear(ConstHandle2ExforDataSets self); + +// +++ Size +extern_c size_t +ExforDataSetsExforDataSetSize(ConstHandle2ConstExforDataSets self); + +// +++ Add +extern_c void +ExforDataSetsExforDataSetAdd(ConstHandle2ExforDataSets self, ConstHandle2ConstExforDataSet exforDataSet); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstExforDataSet +ExforDataSetsExforDataSetGetConst(ConstHandle2ConstExforDataSets self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ExforDataSet +ExforDataSetsExforDataSetGet(ConstHandle2ExforDataSets self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ExforDataSetsExforDataSetSet( + ConstHandle2ExforDataSets self, + const size_t index_, + ConstHandle2ConstExforDataSet exforDataSet +); + +// +++ Has, by subentry +extern_c int +ExforDataSetsExforDataSetHasBySubentry( + ConstHandle2ConstExforDataSets self, + const XMLName subentry +); + +// --- Get, by subentry, const +extern_c Handle2ConstExforDataSet +ExforDataSetsExforDataSetGetBySubentryConst( + ConstHandle2ConstExforDataSets self, + const XMLName subentry +); + +// +++ Get, by subentry, non-const +extern_c Handle2ExforDataSet +ExforDataSetsExforDataSetGetBySubentry( + ConstHandle2ExforDataSets self, + const XMLName subentry +); + +// +++ Set, by subentry +extern_c void +ExforDataSetsExforDataSetSetBySubentry( + ConstHandle2ExforDataSets self, + const XMLName subentry, + ConstHandle2ConstExforDataSet exforDataSet +); + +// +++ Has, by retrievalDate +extern_c int +ExforDataSetsExforDataSetHasByRetrievalDate( + ConstHandle2ConstExforDataSets self, + const char *const retrievalDate +); + +// --- Get, by retrievalDate, const +extern_c Handle2ConstExforDataSet +ExforDataSetsExforDataSetGetByRetrievalDateConst( + ConstHandle2ConstExforDataSets self, + const char *const retrievalDate +); + +// +++ Get, by retrievalDate, non-const +extern_c Handle2ExforDataSet +ExforDataSetsExforDataSetGetByRetrievalDate( + ConstHandle2ExforDataSets self, + const char *const retrievalDate +); + +// +++ Set, by retrievalDate +extern_c void +ExforDataSetsExforDataSetSetByRetrievalDate( + ConstHandle2ExforDataSets self, + const char *const retrievalDate, + ConstHandle2ConstExforDataSet exforDataSet +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ExforDataSets/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExforDataSets/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets.cpp new file mode 100644 index 000000000..4e79f6049 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/ExperimentalDataSets.hpp" +#include "ExperimentalDataSets.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ExperimentalDataSetsClass; +using CPP = multigroup::ExperimentalDataSets; + +static const std::string CLASSNAME = "ExperimentalDataSets"; + +namespace extract { + static auto exforDataSets = [](auto &obj) { return &obj.exforDataSets; }; +} + +using CPPExforDataSets = documentation::ExforDataSets; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstExperimentalDataSets +ExperimentalDataSetsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ExperimentalDataSets +ExperimentalDataSetsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstExperimentalDataSets +ExperimentalDataSetsCreateConst( + ConstHandle2ConstExforDataSets exforDataSets +) { + ConstHandle2ExperimentalDataSets handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(exforDataSets) + ); + return handle; +} + +// Create, general +Handle2ExperimentalDataSets +ExperimentalDataSetsCreate( + ConstHandle2ConstExforDataSets exforDataSets +) { + ConstHandle2ExperimentalDataSets handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(exforDataSets) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ExperimentalDataSetsAssign(ConstHandle2ExperimentalDataSets self, ConstHandle2ConstExperimentalDataSets from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ExperimentalDataSetsDelete(ConstHandle2ConstExperimentalDataSets self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ExperimentalDataSetsRead(ConstHandle2ExperimentalDataSets self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ExperimentalDataSetsWrite(ConstHandle2ConstExperimentalDataSets self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ExperimentalDataSetsPrint(ConstHandle2ConstExperimentalDataSets self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ExperimentalDataSetsPrintXML(ConstHandle2ConstExperimentalDataSets self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ExperimentalDataSetsPrintJSON(ConstHandle2ConstExperimentalDataSets self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: exforDataSets +// ----------------------------------------------------------------------------- + +// Has +int +ExperimentalDataSetsExforDataSetsHas(ConstHandle2ConstExperimentalDataSets self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ExforDataSetsHas", self, extract::exforDataSets); +} + +// Get, const +Handle2ConstExforDataSets +ExperimentalDataSetsExforDataSetsGetConst(ConstHandle2ConstExperimentalDataSets self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExforDataSetsGetConst", self, extract::exforDataSets); +} + +// Get, non-const +Handle2ExforDataSets +ExperimentalDataSetsExforDataSetsGet(ConstHandle2ExperimentalDataSets self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExforDataSetsGet", self, extract::exforDataSets); +} + +// Set +void +ExperimentalDataSetsExforDataSetsSet(ConstHandle2ExperimentalDataSets self, ConstHandle2ConstExforDataSets exforDataSets) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ExforDataSetsSet", self, extract::exforDataSets, exforDataSets); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ExperimentalDataSets/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets.h new file mode 100644 index 000000000..fadcc4ae3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets.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. +// +// ExperimentalDataSets is the basic handle type in this file. Example: +// // Create a default ExperimentalDataSets object: +// ExperimentalDataSets handle = ExperimentalDataSetsDefault(); +// Functions involving ExperimentalDataSets are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_EXPERIMENTALDATASETS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_EXPERIMENTALDATASETS + +#include "GNDStk.h" +#include "v2.0/documentation/ExforDataSets.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ExperimentalDataSetsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ExperimentalDataSets +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ExperimentalDataSetsClass *ExperimentalDataSets; + +// --- Const-aware handles. +typedef const struct ExperimentalDataSetsClass *const ConstHandle2ConstExperimentalDataSets; +typedef struct ExperimentalDataSetsClass *const ConstHandle2ExperimentalDataSets; +typedef const struct ExperimentalDataSetsClass * Handle2ConstExperimentalDataSets; +typedef struct ExperimentalDataSetsClass * Handle2ExperimentalDataSets; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstExperimentalDataSets +ExperimentalDataSetsDefaultConst(); + +// +++ Create, default +extern_c Handle2ExperimentalDataSets +ExperimentalDataSetsDefault(); + +// --- Create, general, const +extern_c Handle2ConstExperimentalDataSets +ExperimentalDataSetsCreateConst( + ConstHandle2ConstExforDataSets exforDataSets +); + +// +++ Create, general +extern_c Handle2ExperimentalDataSets +ExperimentalDataSetsCreate( + ConstHandle2ConstExforDataSets exforDataSets +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ExperimentalDataSetsAssign(ConstHandle2ExperimentalDataSets self, ConstHandle2ConstExperimentalDataSets from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ExperimentalDataSetsDelete(ConstHandle2ConstExperimentalDataSets self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ExperimentalDataSetsRead(ConstHandle2ExperimentalDataSets self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ExperimentalDataSetsWrite(ConstHandle2ConstExperimentalDataSets self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ExperimentalDataSetsPrint(ConstHandle2ConstExperimentalDataSets self); + +// +++ Print to standard output, as XML +extern_c int +ExperimentalDataSetsPrintXML(ConstHandle2ConstExperimentalDataSets self); + +// +++ Print to standard output, as JSON +extern_c int +ExperimentalDataSetsPrintJSON(ConstHandle2ConstExperimentalDataSets self); + + +// ----------------------------------------------------------------------------- +// Child: exforDataSets +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExperimentalDataSetsExforDataSetsHas(ConstHandle2ConstExperimentalDataSets self); + +// --- Get, const +extern_c Handle2ConstExforDataSets +ExperimentalDataSetsExforDataSetsGetConst(ConstHandle2ConstExperimentalDataSets self); + +// +++ Get, non-const +extern_c Handle2ExforDataSets +ExperimentalDataSetsExforDataSetsGet(ConstHandle2ExperimentalDataSets self); + +// +++ Set +extern_c void +ExperimentalDataSetsExforDataSetsSet(ConstHandle2ExperimentalDataSets self, ConstHandle2ConstExforDataSets exforDataSets); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/ExperimentalDataSets/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/ExperimentalDataSets/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck.cpp new file mode 100644 index 000000000..677832713 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck.cpp @@ -0,0 +1,530 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/InputDeck.hpp" +#include "InputDeck.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = InputDeckClass; +using CPP = multigroup::InputDeck; + +static const std::string CLASSNAME = "InputDeck"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto filename = [](auto &obj) { return &obj.filename; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInputDeck +InputDeckDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2InputDeck +InputDeckDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInputDeck +InputDeckCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName filename +) { + ConstHandle2InputDeck handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label, + filename + ); + return handle; +} + +// Create, general +Handle2InputDeck +InputDeckCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName filename +) { + ConstHandle2InputDeck handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + label, + filename + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +InputDeckAssign(ConstHandle2InputDeck self, ConstHandle2ConstInputDeck from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +InputDeckDelete(ConstHandle2ConstInputDeck self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +InputDeckRead(ConstHandle2InputDeck self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +InputDeckWrite(ConstHandle2ConstInputDeck self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +InputDeckPrint(ConstHandle2ConstInputDeck self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +InputDeckPrintXML(ConstHandle2ConstInputDeck self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +InputDeckPrintJSON(ConstHandle2ConstInputDeck self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +InputDeckIntsClear(ConstHandle2InputDeck self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +InputDeckIntsSize(ConstHandle2ConstInputDeck self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +InputDeckIntsGet(ConstHandle2ConstInputDeck self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +InputDeckIntsSet(ConstHandle2InputDeck self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +InputDeckIntsGetArrayConst(ConstHandle2ConstInputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +InputDeckIntsGetArray(ConstHandle2InputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +InputDeckIntsSetArray(ConstHandle2InputDeck self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +InputDeckUnsignedsClear(ConstHandle2InputDeck self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +InputDeckUnsignedsSize(ConstHandle2ConstInputDeck self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +InputDeckUnsignedsGet(ConstHandle2ConstInputDeck self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +InputDeckUnsignedsSet(ConstHandle2InputDeck self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +InputDeckUnsignedsGetArrayConst(ConstHandle2ConstInputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +InputDeckUnsignedsGetArray(ConstHandle2InputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +InputDeckUnsignedsSetArray(ConstHandle2InputDeck self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +InputDeckFloatsClear(ConstHandle2InputDeck self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +InputDeckFloatsSize(ConstHandle2ConstInputDeck self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +InputDeckFloatsGet(ConstHandle2ConstInputDeck self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +InputDeckFloatsSet(ConstHandle2InputDeck self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +InputDeckFloatsGetArrayConst(ConstHandle2ConstInputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +InputDeckFloatsGetArray(ConstHandle2InputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +InputDeckFloatsSetArray(ConstHandle2InputDeck self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +InputDeckDoublesClear(ConstHandle2InputDeck self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +InputDeckDoublesSize(ConstHandle2ConstInputDeck self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +InputDeckDoublesGet(ConstHandle2ConstInputDeck self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +InputDeckDoublesSet(ConstHandle2InputDeck self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +InputDeckDoublesGetArrayConst(ConstHandle2ConstInputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +InputDeckDoublesGetArray(ConstHandle2InputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +InputDeckDoublesSetArray(ConstHandle2InputDeck self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +InputDeckEncodingHas(ConstHandle2ConstInputDeck self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +InputDeckEncodingGet(ConstHandle2ConstInputDeck self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +InputDeckEncodingSet(ConstHandle2InputDeck self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +InputDeckMarkupHas(ConstHandle2ConstInputDeck self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +InputDeckMarkupGet(ConstHandle2ConstInputDeck self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +InputDeckMarkupSet(ConstHandle2InputDeck self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +InputDeckLabelHas(ConstHandle2ConstInputDeck self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +InputDeckLabelGet(ConstHandle2ConstInputDeck self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +InputDeckLabelSet(ConstHandle2InputDeck self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: filename +// ----------------------------------------------------------------------------- + +// Has +int +InputDeckFilenameHas(ConstHandle2ConstInputDeck self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FilenameHas", self, extract::filename); +} + +// Get +// Returns by value +XMLName +InputDeckFilenameGet(ConstHandle2ConstInputDeck self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FilenameGet", self, extract::filename); +} + +// Set +void +InputDeckFilenameSet(ConstHandle2InputDeck self, const XMLName filename) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FilenameSet", self, extract::filename, filename); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/InputDeck/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck.h new file mode 100644 index 000000000..ccd445a83 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck.h @@ -0,0 +1,358 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// InputDeck is the basic handle type in this file. Example: +// // Create a default InputDeck object: +// InputDeck handle = InputDeckDefault(); +// Functions involving InputDeck are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_INPUTDECK +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_INPUTDECK + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct InputDeckClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ InputDeck +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct InputDeckClass *InputDeck; + +// --- Const-aware handles. +typedef const struct InputDeckClass *const ConstHandle2ConstInputDeck; +typedef struct InputDeckClass *const ConstHandle2InputDeck; +typedef const struct InputDeckClass * Handle2ConstInputDeck; +typedef struct InputDeckClass * Handle2InputDeck; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstInputDeck +InputDeckDefaultConst(); + +// +++ Create, default +extern_c Handle2InputDeck +InputDeckDefault(); + +// --- Create, general, const +extern_c Handle2ConstInputDeck +InputDeckCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName filename +); + +// +++ Create, general +extern_c Handle2InputDeck +InputDeckCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName filename +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +InputDeckAssign(ConstHandle2InputDeck self, ConstHandle2ConstInputDeck from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +InputDeckDelete(ConstHandle2ConstInputDeck self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +InputDeckRead(ConstHandle2InputDeck self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +InputDeckWrite(ConstHandle2ConstInputDeck self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +InputDeckPrint(ConstHandle2ConstInputDeck self); + +// +++ Print to standard output, as XML +extern_c int +InputDeckPrintXML(ConstHandle2ConstInputDeck self); + +// +++ Print to standard output, as JSON +extern_c int +InputDeckPrintJSON(ConstHandle2ConstInputDeck self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +InputDeckIntsClear(ConstHandle2InputDeck self); + +// +++ Get size +extern_c size_t +InputDeckIntsSize(ConstHandle2ConstInputDeck self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +InputDeckIntsGet(ConstHandle2ConstInputDeck self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +InputDeckIntsSet(ConstHandle2InputDeck self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +InputDeckIntsGetArrayConst(ConstHandle2ConstInputDeck self); + +// +++ Get pointer to existing values, non-const +extern_c int * +InputDeckIntsGetArray(ConstHandle2InputDeck self); + +// +++ Set completely new values and size +extern_c void +InputDeckIntsSetArray(ConstHandle2InputDeck self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +InputDeckUnsignedsClear(ConstHandle2InputDeck self); + +// +++ Get size +extern_c size_t +InputDeckUnsignedsSize(ConstHandle2ConstInputDeck self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +InputDeckUnsignedsGet(ConstHandle2ConstInputDeck self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +InputDeckUnsignedsSet(ConstHandle2InputDeck self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +InputDeckUnsignedsGetArrayConst(ConstHandle2ConstInputDeck self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +InputDeckUnsignedsGetArray(ConstHandle2InputDeck self); + +// +++ Set completely new values and size +extern_c void +InputDeckUnsignedsSetArray(ConstHandle2InputDeck self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +InputDeckFloatsClear(ConstHandle2InputDeck self); + +// +++ Get size +extern_c size_t +InputDeckFloatsSize(ConstHandle2ConstInputDeck self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +InputDeckFloatsGet(ConstHandle2ConstInputDeck self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +InputDeckFloatsSet(ConstHandle2InputDeck self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +InputDeckFloatsGetArrayConst(ConstHandle2ConstInputDeck self); + +// +++ Get pointer to existing values, non-const +extern_c float * +InputDeckFloatsGetArray(ConstHandle2InputDeck self); + +// +++ Set completely new values and size +extern_c void +InputDeckFloatsSetArray(ConstHandle2InputDeck self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +InputDeckDoublesClear(ConstHandle2InputDeck self); + +// +++ Get size +extern_c size_t +InputDeckDoublesSize(ConstHandle2ConstInputDeck self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +InputDeckDoublesGet(ConstHandle2ConstInputDeck self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +InputDeckDoublesSet(ConstHandle2InputDeck self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +InputDeckDoublesGetArrayConst(ConstHandle2ConstInputDeck self); + +// +++ Get pointer to existing values, non-const +extern_c double * +InputDeckDoublesGetArray(ConstHandle2InputDeck self); + +// +++ Set completely new values and size +extern_c void +InputDeckDoublesSetArray(ConstHandle2InputDeck self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InputDeckEncodingHas(ConstHandle2ConstInputDeck self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +InputDeckEncodingGet(ConstHandle2ConstInputDeck self); + +// +++ Set +extern_c void +InputDeckEncodingSet(ConstHandle2InputDeck self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InputDeckMarkupHas(ConstHandle2ConstInputDeck self); + +// +++ Get +// +++ Returns by value +extern_c const char * +InputDeckMarkupGet(ConstHandle2ConstInputDeck self); + +// +++ Set +extern_c void +InputDeckMarkupSet(ConstHandle2InputDeck self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InputDeckLabelHas(ConstHandle2ConstInputDeck self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +InputDeckLabelGet(ConstHandle2ConstInputDeck self); + +// +++ Set +extern_c void +InputDeckLabelSet(ConstHandle2InputDeck self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: filename +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InputDeckFilenameHas(ConstHandle2ConstInputDeck self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +InputDeckFilenameGet(ConstHandle2ConstInputDeck self); + +// +++ Set +extern_c void +InputDeckFilenameSet(ConstHandle2InputDeck self, const XMLName filename); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/InputDeck/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDeck/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks.cpp new file mode 100644 index 000000000..7c36645b3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/InputDecks.hpp" +#include "InputDecks.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = InputDecksClass; +using CPP = multigroup::InputDecks; + +static const std::string CLASSNAME = "InputDecks"; + +namespace extract { + static auto inputDeck = [](auto &obj) { return &obj.inputDeck; }; +} + +using CPPInputDeck = documentation::InputDeck; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInputDecks +InputDecksDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2InputDecks +InputDecksDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInputDecks +InputDecksCreateConst( + ConstHandle2InputDeck *const inputDeck, const size_t inputDeckSize +) { + ConstHandle2InputDecks handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t InputDeckN = 0; InputDeckN < inputDeckSize; ++InputDeckN) + InputDecksInputDeckAdd(handle, inputDeck[InputDeckN]); + return handle; +} + +// Create, general +Handle2InputDecks +InputDecksCreate( + ConstHandle2InputDeck *const inputDeck, const size_t inputDeckSize +) { + ConstHandle2InputDecks handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t InputDeckN = 0; InputDeckN < inputDeckSize; ++InputDeckN) + InputDecksInputDeckAdd(handle, inputDeck[InputDeckN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +InputDecksAssign(ConstHandle2InputDecks self, ConstHandle2ConstInputDecks from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +InputDecksDelete(ConstHandle2ConstInputDecks self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +InputDecksRead(ConstHandle2InputDecks self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +InputDecksWrite(ConstHandle2ConstInputDecks self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +InputDecksPrint(ConstHandle2ConstInputDecks self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +InputDecksPrintXML(ConstHandle2ConstInputDecks self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +InputDecksPrintJSON(ConstHandle2ConstInputDecks self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: inputDeck +// ----------------------------------------------------------------------------- + +// Has +int +InputDecksInputDeckHas(ConstHandle2ConstInputDecks self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InputDeckHas", self, extract::inputDeck); +} + +// Clear +void +InputDecksInputDeckClear(ConstHandle2InputDecks self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"InputDeckClear", self, extract::inputDeck); +} + +// Size +size_t +InputDecksInputDeckSize(ConstHandle2ConstInputDecks self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"InputDeckSize", self, extract::inputDeck); +} + +// Add +void +InputDecksInputDeckAdd(ConstHandle2InputDecks self, ConstHandle2ConstInputDeck inputDeck) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"InputDeckAdd", self, extract::inputDeck, inputDeck); +} + +// Get, by index \in [0,size), const +Handle2ConstInputDeck +InputDecksInputDeckGetConst(ConstHandle2ConstInputDecks self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"InputDeckGetConst", self, extract::inputDeck, index_); +} + +// Get, by index \in [0,size), non-const +Handle2InputDeck +InputDecksInputDeckGet(ConstHandle2InputDecks self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"InputDeckGet", self, extract::inputDeck, index_); +} + +// Set, by index \in [0,size) +void +InputDecksInputDeckSet( + ConstHandle2InputDecks self, + const size_t index_, + ConstHandle2ConstInputDeck inputDeck +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"InputDeckSet", self, extract::inputDeck, index_, inputDeck); +} + +// Has, by encoding +int +InputDecksInputDeckHasByEncoding( + ConstHandle2ConstInputDecks self, + const XMLName encoding +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckHasByEncoding", + self, extract::inputDeck, meta::encoding, encoding); +} + +// Get, by encoding, const +Handle2ConstInputDeck +InputDecksInputDeckGetByEncodingConst( + ConstHandle2ConstInputDecks self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckGetByEncodingConst", + self, extract::inputDeck, meta::encoding, encoding); +} + +// Get, by encoding, non-const +Handle2InputDeck +InputDecksInputDeckGetByEncoding( + ConstHandle2InputDecks self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckGetByEncoding", + self, extract::inputDeck, meta::encoding, encoding); +} + +// Set, by encoding +void +InputDecksInputDeckSetByEncoding( + ConstHandle2InputDecks self, + const XMLName encoding, + ConstHandle2ConstInputDeck inputDeck +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckSetByEncoding", + self, extract::inputDeck, meta::encoding, encoding, inputDeck); +} + +// Has, by markup +int +InputDecksInputDeckHasByMarkup( + ConstHandle2ConstInputDecks self, + const char *const markup +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckHasByMarkup", + self, extract::inputDeck, meta::markup, markup); +} + +// Get, by markup, const +Handle2ConstInputDeck +InputDecksInputDeckGetByMarkupConst( + ConstHandle2ConstInputDecks self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckGetByMarkupConst", + self, extract::inputDeck, meta::markup, markup); +} + +// Get, by markup, non-const +Handle2InputDeck +InputDecksInputDeckGetByMarkup( + ConstHandle2InputDecks self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckGetByMarkup", + self, extract::inputDeck, meta::markup, markup); +} + +// Set, by markup +void +InputDecksInputDeckSetByMarkup( + ConstHandle2InputDecks self, + const char *const markup, + ConstHandle2ConstInputDeck inputDeck +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckSetByMarkup", + self, extract::inputDeck, meta::markup, markup, inputDeck); +} + +// Has, by label +int +InputDecksInputDeckHasByLabel( + ConstHandle2ConstInputDecks self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckHasByLabel", + self, extract::inputDeck, meta::label, label); +} + +// Get, by label, const +Handle2ConstInputDeck +InputDecksInputDeckGetByLabelConst( + ConstHandle2ConstInputDecks self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckGetByLabelConst", + self, extract::inputDeck, meta::label, label); +} + +// Get, by label, non-const +Handle2InputDeck +InputDecksInputDeckGetByLabel( + ConstHandle2InputDecks self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckGetByLabel", + self, extract::inputDeck, meta::label, label); +} + +// Set, by label +void +InputDecksInputDeckSetByLabel( + ConstHandle2InputDecks self, + const XMLName label, + ConstHandle2ConstInputDeck inputDeck +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckSetByLabel", + self, extract::inputDeck, meta::label, label, inputDeck); +} + +// Has, by filename +int +InputDecksInputDeckHasByFilename( + ConstHandle2ConstInputDecks self, + const XMLName filename +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckHasByFilename", + self, extract::inputDeck, meta::filename, filename); +} + +// Get, by filename, const +Handle2ConstInputDeck +InputDecksInputDeckGetByFilenameConst( + ConstHandle2ConstInputDecks self, + const XMLName filename +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckGetByFilenameConst", + self, extract::inputDeck, meta::filename, filename); +} + +// Get, by filename, non-const +Handle2InputDeck +InputDecksInputDeckGetByFilename( + ConstHandle2InputDecks self, + const XMLName filename +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckGetByFilename", + self, extract::inputDeck, meta::filename, filename); +} + +// Set, by filename +void +InputDecksInputDeckSetByFilename( + ConstHandle2InputDecks self, + const XMLName filename, + ConstHandle2ConstInputDeck inputDeck +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"InputDeckSetByFilename", + self, extract::inputDeck, meta::filename, filename, inputDeck); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/InputDecks/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks.h new file mode 100644 index 000000000..5d579277c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks.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. +// +// InputDecks is the basic handle type in this file. Example: +// // Create a default InputDecks object: +// InputDecks handle = InputDecksDefault(); +// Functions involving InputDecks are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_INPUTDECKS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_INPUTDECKS + +#include "GNDStk.h" +#include "v2.0/documentation/InputDeck.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct InputDecksClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ InputDecks +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct InputDecksClass *InputDecks; + +// --- Const-aware handles. +typedef const struct InputDecksClass *const ConstHandle2ConstInputDecks; +typedef struct InputDecksClass *const ConstHandle2InputDecks; +typedef const struct InputDecksClass * Handle2ConstInputDecks; +typedef struct InputDecksClass * Handle2InputDecks; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstInputDecks +InputDecksDefaultConst(); + +// +++ Create, default +extern_c Handle2InputDecks +InputDecksDefault(); + +// --- Create, general, const +extern_c Handle2ConstInputDecks +InputDecksCreateConst( + ConstHandle2InputDeck *const inputDeck, const size_t inputDeckSize +); + +// +++ Create, general +extern_c Handle2InputDecks +InputDecksCreate( + ConstHandle2InputDeck *const inputDeck, const size_t inputDeckSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +InputDecksAssign(ConstHandle2InputDecks self, ConstHandle2ConstInputDecks from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +InputDecksDelete(ConstHandle2ConstInputDecks self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +InputDecksRead(ConstHandle2InputDecks self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +InputDecksWrite(ConstHandle2ConstInputDecks self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +InputDecksPrint(ConstHandle2ConstInputDecks self); + +// +++ Print to standard output, as XML +extern_c int +InputDecksPrintXML(ConstHandle2ConstInputDecks self); + +// +++ Print to standard output, as JSON +extern_c int +InputDecksPrintJSON(ConstHandle2ConstInputDecks self); + + +// ----------------------------------------------------------------------------- +// Child: inputDeck +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InputDecksInputDeckHas(ConstHandle2ConstInputDecks self); + +// +++ Clear +extern_c void +InputDecksInputDeckClear(ConstHandle2InputDecks self); + +// +++ Size +extern_c size_t +InputDecksInputDeckSize(ConstHandle2ConstInputDecks self); + +// +++ Add +extern_c void +InputDecksInputDeckAdd(ConstHandle2InputDecks self, ConstHandle2ConstInputDeck inputDeck); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstInputDeck +InputDecksInputDeckGetConst(ConstHandle2ConstInputDecks self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2InputDeck +InputDecksInputDeckGet(ConstHandle2InputDecks self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +InputDecksInputDeckSet( + ConstHandle2InputDecks self, + const size_t index_, + ConstHandle2ConstInputDeck inputDeck +); + +// +++ Has, by encoding +extern_c int +InputDecksInputDeckHasByEncoding( + ConstHandle2ConstInputDecks self, + const XMLName encoding +); + +// --- Get, by encoding, const +extern_c Handle2ConstInputDeck +InputDecksInputDeckGetByEncodingConst( + ConstHandle2ConstInputDecks self, + const XMLName encoding +); + +// +++ Get, by encoding, non-const +extern_c Handle2InputDeck +InputDecksInputDeckGetByEncoding( + ConstHandle2InputDecks self, + const XMLName encoding +); + +// +++ Set, by encoding +extern_c void +InputDecksInputDeckSetByEncoding( + ConstHandle2InputDecks self, + const XMLName encoding, + ConstHandle2ConstInputDeck inputDeck +); + +// +++ Has, by markup +extern_c int +InputDecksInputDeckHasByMarkup( + ConstHandle2ConstInputDecks self, + const char *const markup +); + +// --- Get, by markup, const +extern_c Handle2ConstInputDeck +InputDecksInputDeckGetByMarkupConst( + ConstHandle2ConstInputDecks self, + const char *const markup +); + +// +++ Get, by markup, non-const +extern_c Handle2InputDeck +InputDecksInputDeckGetByMarkup( + ConstHandle2InputDecks self, + const char *const markup +); + +// +++ Set, by markup +extern_c void +InputDecksInputDeckSetByMarkup( + ConstHandle2InputDecks self, + const char *const markup, + ConstHandle2ConstInputDeck inputDeck +); + +// +++ Has, by label +extern_c int +InputDecksInputDeckHasByLabel( + ConstHandle2ConstInputDecks self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstInputDeck +InputDecksInputDeckGetByLabelConst( + ConstHandle2ConstInputDecks self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2InputDeck +InputDecksInputDeckGetByLabel( + ConstHandle2InputDecks self, + const XMLName label +); + +// +++ Set, by label +extern_c void +InputDecksInputDeckSetByLabel( + ConstHandle2InputDecks self, + const XMLName label, + ConstHandle2ConstInputDeck inputDeck +); + +// +++ Has, by filename +extern_c int +InputDecksInputDeckHasByFilename( + ConstHandle2ConstInputDecks self, + const XMLName filename +); + +// --- Get, by filename, const +extern_c Handle2ConstInputDeck +InputDecksInputDeckGetByFilenameConst( + ConstHandle2ConstInputDecks self, + const XMLName filename +); + +// +++ Get, by filename, non-const +extern_c Handle2InputDeck +InputDecksInputDeckGetByFilename( + ConstHandle2InputDecks self, + const XMLName filename +); + +// +++ Set, by filename +extern_c void +InputDecksInputDeckSetByFilename( + ConstHandle2InputDecks self, + const XMLName filename, + ConstHandle2ConstInputDeck inputDeck +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/InputDecks/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/InputDecks/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword.cpp new file mode 100644 index 000000000..4564bcdee --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword.cpp @@ -0,0 +1,530 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Keyword.hpp" +#include "Keyword.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = KeywordClass; +using CPP = multigroup::Keyword; + +static const std::string CLASSNAME = "Keyword"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto type = [](auto &obj) { return &obj.type; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstKeyword +KeywordDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Keyword +KeywordDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstKeyword +KeywordCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName type +) { + ConstHandle2Keyword handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label, + type + ); + return handle; +} + +// Create, general +Handle2Keyword +KeywordCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName type +) { + ConstHandle2Keyword handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + label, + type + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +KeywordAssign(ConstHandle2Keyword self, ConstHandle2ConstKeyword from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +KeywordDelete(ConstHandle2ConstKeyword self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +KeywordRead(ConstHandle2Keyword self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +KeywordWrite(ConstHandle2ConstKeyword self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +KeywordPrint(ConstHandle2ConstKeyword self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +KeywordPrintXML(ConstHandle2ConstKeyword self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +KeywordPrintJSON(ConstHandle2ConstKeyword self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +KeywordIntsClear(ConstHandle2Keyword self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +KeywordIntsSize(ConstHandle2ConstKeyword self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +KeywordIntsGet(ConstHandle2ConstKeyword self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +KeywordIntsSet(ConstHandle2Keyword self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +KeywordIntsGetArrayConst(ConstHandle2ConstKeyword self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +KeywordIntsGetArray(ConstHandle2Keyword self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +KeywordIntsSetArray(ConstHandle2Keyword self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +KeywordUnsignedsClear(ConstHandle2Keyword self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +KeywordUnsignedsSize(ConstHandle2ConstKeyword self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +KeywordUnsignedsGet(ConstHandle2ConstKeyword self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +KeywordUnsignedsSet(ConstHandle2Keyword self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +KeywordUnsignedsGetArrayConst(ConstHandle2ConstKeyword self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +KeywordUnsignedsGetArray(ConstHandle2Keyword self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +KeywordUnsignedsSetArray(ConstHandle2Keyword self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +KeywordFloatsClear(ConstHandle2Keyword self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +KeywordFloatsSize(ConstHandle2ConstKeyword self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +KeywordFloatsGet(ConstHandle2ConstKeyword self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +KeywordFloatsSet(ConstHandle2Keyword self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +KeywordFloatsGetArrayConst(ConstHandle2ConstKeyword self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +KeywordFloatsGetArray(ConstHandle2Keyword self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +KeywordFloatsSetArray(ConstHandle2Keyword self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +KeywordDoublesClear(ConstHandle2Keyword self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +KeywordDoublesSize(ConstHandle2ConstKeyword self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +KeywordDoublesGet(ConstHandle2ConstKeyword self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +KeywordDoublesSet(ConstHandle2Keyword self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +KeywordDoublesGetArrayConst(ConstHandle2ConstKeyword self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +KeywordDoublesGetArray(ConstHandle2Keyword self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +KeywordDoublesSetArray(ConstHandle2Keyword self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +KeywordEncodingHas(ConstHandle2ConstKeyword self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +KeywordEncodingGet(ConstHandle2ConstKeyword self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +KeywordEncodingSet(ConstHandle2Keyword self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +KeywordMarkupHas(ConstHandle2ConstKeyword self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +KeywordMarkupGet(ConstHandle2ConstKeyword self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +KeywordMarkupSet(ConstHandle2Keyword self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +KeywordLabelHas(ConstHandle2ConstKeyword self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +KeywordLabelGet(ConstHandle2ConstKeyword self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +KeywordLabelSet(ConstHandle2Keyword self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// Has +int +KeywordTypeHas(ConstHandle2ConstKeyword self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TypeHas", self, extract::type); +} + +// Get +// Returns by value +XMLName +KeywordTypeGet(ConstHandle2ConstKeyword self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +KeywordTypeSet(ConstHandle2Keyword self, const XMLName type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Keyword/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword.h new file mode 100644 index 000000000..c563a601c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword.h @@ -0,0 +1,358 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Keyword is the basic handle type in this file. Example: +// // Create a default Keyword object: +// Keyword handle = KeywordDefault(); +// Functions involving Keyword are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_KEYWORD +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_KEYWORD + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct KeywordClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Keyword +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct KeywordClass *Keyword; + +// --- Const-aware handles. +typedef const struct KeywordClass *const ConstHandle2ConstKeyword; +typedef struct KeywordClass *const ConstHandle2Keyword; +typedef const struct KeywordClass * Handle2ConstKeyword; +typedef struct KeywordClass * Handle2Keyword; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstKeyword +KeywordDefaultConst(); + +// +++ Create, default +extern_c Handle2Keyword +KeywordDefault(); + +// --- Create, general, const +extern_c Handle2ConstKeyword +KeywordCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName type +); + +// +++ Create, general +extern_c Handle2Keyword +KeywordCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName type +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +KeywordAssign(ConstHandle2Keyword self, ConstHandle2ConstKeyword from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +KeywordDelete(ConstHandle2ConstKeyword self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +KeywordRead(ConstHandle2Keyword self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +KeywordWrite(ConstHandle2ConstKeyword self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +KeywordPrint(ConstHandle2ConstKeyword self); + +// +++ Print to standard output, as XML +extern_c int +KeywordPrintXML(ConstHandle2ConstKeyword self); + +// +++ Print to standard output, as JSON +extern_c int +KeywordPrintJSON(ConstHandle2ConstKeyword self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +KeywordIntsClear(ConstHandle2Keyword self); + +// +++ Get size +extern_c size_t +KeywordIntsSize(ConstHandle2ConstKeyword self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +KeywordIntsGet(ConstHandle2ConstKeyword self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +KeywordIntsSet(ConstHandle2Keyword self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +KeywordIntsGetArrayConst(ConstHandle2ConstKeyword self); + +// +++ Get pointer to existing values, non-const +extern_c int * +KeywordIntsGetArray(ConstHandle2Keyword self); + +// +++ Set completely new values and size +extern_c void +KeywordIntsSetArray(ConstHandle2Keyword self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +KeywordUnsignedsClear(ConstHandle2Keyword self); + +// +++ Get size +extern_c size_t +KeywordUnsignedsSize(ConstHandle2ConstKeyword self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +KeywordUnsignedsGet(ConstHandle2ConstKeyword self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +KeywordUnsignedsSet(ConstHandle2Keyword self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +KeywordUnsignedsGetArrayConst(ConstHandle2ConstKeyword self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +KeywordUnsignedsGetArray(ConstHandle2Keyword self); + +// +++ Set completely new values and size +extern_c void +KeywordUnsignedsSetArray(ConstHandle2Keyword self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +KeywordFloatsClear(ConstHandle2Keyword self); + +// +++ Get size +extern_c size_t +KeywordFloatsSize(ConstHandle2ConstKeyword self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +KeywordFloatsGet(ConstHandle2ConstKeyword self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +KeywordFloatsSet(ConstHandle2Keyword self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +KeywordFloatsGetArrayConst(ConstHandle2ConstKeyword self); + +// +++ Get pointer to existing values, non-const +extern_c float * +KeywordFloatsGetArray(ConstHandle2Keyword self); + +// +++ Set completely new values and size +extern_c void +KeywordFloatsSetArray(ConstHandle2Keyword self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +KeywordDoublesClear(ConstHandle2Keyword self); + +// +++ Get size +extern_c size_t +KeywordDoublesSize(ConstHandle2ConstKeyword self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +KeywordDoublesGet(ConstHandle2ConstKeyword self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +KeywordDoublesSet(ConstHandle2Keyword self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +KeywordDoublesGetArrayConst(ConstHandle2ConstKeyword self); + +// +++ Get pointer to existing values, non-const +extern_c double * +KeywordDoublesGetArray(ConstHandle2Keyword self); + +// +++ Set completely new values and size +extern_c void +KeywordDoublesSetArray(ConstHandle2Keyword self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KeywordEncodingHas(ConstHandle2ConstKeyword self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +KeywordEncodingGet(ConstHandle2ConstKeyword self); + +// +++ Set +extern_c void +KeywordEncodingSet(ConstHandle2Keyword self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KeywordMarkupHas(ConstHandle2ConstKeyword self); + +// +++ Get +// +++ Returns by value +extern_c const char * +KeywordMarkupGet(ConstHandle2ConstKeyword self); + +// +++ Set +extern_c void +KeywordMarkupSet(ConstHandle2Keyword self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KeywordLabelHas(ConstHandle2ConstKeyword self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +KeywordLabelGet(ConstHandle2ConstKeyword self); + +// +++ Set +extern_c void +KeywordLabelSet(ConstHandle2Keyword self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KeywordTypeHas(ConstHandle2ConstKeyword self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +KeywordTypeGet(ConstHandle2ConstKeyword self); + +// +++ Set +extern_c void +KeywordTypeSet(ConstHandle2Keyword self, const XMLName type); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Keyword/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keyword/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords.cpp new file mode 100644 index 000000000..aecaa7eb9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Keywords.hpp" +#include "Keywords.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = KeywordsClass; +using CPP = multigroup::Keywords; + +static const std::string CLASSNAME = "Keywords"; + +namespace extract { + static auto keyword = [](auto &obj) { return &obj.keyword; }; +} + +using CPPKeyword = documentation::Keyword; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstKeywords +KeywordsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Keywords +KeywordsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstKeywords +KeywordsCreateConst( + ConstHandle2Keyword *const keyword, const size_t keywordSize +) { + ConstHandle2Keywords handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t KeywordN = 0; KeywordN < keywordSize; ++KeywordN) + KeywordsKeywordAdd(handle, keyword[KeywordN]); + return handle; +} + +// Create, general +Handle2Keywords +KeywordsCreate( + ConstHandle2Keyword *const keyword, const size_t keywordSize +) { + ConstHandle2Keywords handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t KeywordN = 0; KeywordN < keywordSize; ++KeywordN) + KeywordsKeywordAdd(handle, keyword[KeywordN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +KeywordsAssign(ConstHandle2Keywords self, ConstHandle2ConstKeywords from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +KeywordsDelete(ConstHandle2ConstKeywords self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +KeywordsRead(ConstHandle2Keywords self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +KeywordsWrite(ConstHandle2ConstKeywords self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +KeywordsPrint(ConstHandle2ConstKeywords self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +KeywordsPrintXML(ConstHandle2ConstKeywords self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +KeywordsPrintJSON(ConstHandle2ConstKeywords self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: keyword +// ----------------------------------------------------------------------------- + +// Has +int +KeywordsKeywordHas(ConstHandle2ConstKeywords self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"KeywordHas", self, extract::keyword); +} + +// Clear +void +KeywordsKeywordClear(ConstHandle2Keywords self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"KeywordClear", self, extract::keyword); +} + +// Size +size_t +KeywordsKeywordSize(ConstHandle2ConstKeywords self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"KeywordSize", self, extract::keyword); +} + +// Add +void +KeywordsKeywordAdd(ConstHandle2Keywords self, ConstHandle2ConstKeyword keyword) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"KeywordAdd", self, extract::keyword, keyword); +} + +// Get, by index \in [0,size), const +Handle2ConstKeyword +KeywordsKeywordGetConst(ConstHandle2ConstKeywords self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"KeywordGetConst", self, extract::keyword, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Keyword +KeywordsKeywordGet(ConstHandle2Keywords self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"KeywordGet", self, extract::keyword, index_); +} + +// Set, by index \in [0,size) +void +KeywordsKeywordSet( + ConstHandle2Keywords self, + const size_t index_, + ConstHandle2ConstKeyword keyword +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"KeywordSet", self, extract::keyword, index_, keyword); +} + +// Has, by encoding +int +KeywordsKeywordHasByEncoding( + ConstHandle2ConstKeywords self, + const XMLName encoding +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"KeywordHasByEncoding", + self, extract::keyword, meta::encoding, encoding); +} + +// Get, by encoding, const +Handle2ConstKeyword +KeywordsKeywordGetByEncodingConst( + ConstHandle2ConstKeywords self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"KeywordGetByEncodingConst", + self, extract::keyword, meta::encoding, encoding); +} + +// Get, by encoding, non-const +Handle2Keyword +KeywordsKeywordGetByEncoding( + ConstHandle2Keywords self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"KeywordGetByEncoding", + self, extract::keyword, meta::encoding, encoding); +} + +// Set, by encoding +void +KeywordsKeywordSetByEncoding( + ConstHandle2Keywords self, + const XMLName encoding, + ConstHandle2ConstKeyword keyword +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"KeywordSetByEncoding", + self, extract::keyword, meta::encoding, encoding, keyword); +} + +// Has, by markup +int +KeywordsKeywordHasByMarkup( + ConstHandle2ConstKeywords self, + const char *const markup +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"KeywordHasByMarkup", + self, extract::keyword, meta::markup, markup); +} + +// Get, by markup, const +Handle2ConstKeyword +KeywordsKeywordGetByMarkupConst( + ConstHandle2ConstKeywords self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"KeywordGetByMarkupConst", + self, extract::keyword, meta::markup, markup); +} + +// Get, by markup, non-const +Handle2Keyword +KeywordsKeywordGetByMarkup( + ConstHandle2Keywords self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"KeywordGetByMarkup", + self, extract::keyword, meta::markup, markup); +} + +// Set, by markup +void +KeywordsKeywordSetByMarkup( + ConstHandle2Keywords self, + const char *const markup, + ConstHandle2ConstKeyword keyword +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"KeywordSetByMarkup", + self, extract::keyword, meta::markup, markup, keyword); +} + +// Has, by label +int +KeywordsKeywordHasByLabel( + ConstHandle2ConstKeywords self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"KeywordHasByLabel", + self, extract::keyword, meta::label, label); +} + +// Get, by label, const +Handle2ConstKeyword +KeywordsKeywordGetByLabelConst( + ConstHandle2ConstKeywords self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"KeywordGetByLabelConst", + self, extract::keyword, meta::label, label); +} + +// Get, by label, non-const +Handle2Keyword +KeywordsKeywordGetByLabel( + ConstHandle2Keywords self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"KeywordGetByLabel", + self, extract::keyword, meta::label, label); +} + +// Set, by label +void +KeywordsKeywordSetByLabel( + ConstHandle2Keywords self, + const XMLName label, + ConstHandle2ConstKeyword keyword +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"KeywordSetByLabel", + self, extract::keyword, meta::label, label, keyword); +} + +// Has, by type +int +KeywordsKeywordHasByType( + ConstHandle2ConstKeywords self, + const XMLName type +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"KeywordHasByType", + self, extract::keyword, meta::type, type); +} + +// Get, by type, const +Handle2ConstKeyword +KeywordsKeywordGetByTypeConst( + ConstHandle2ConstKeywords self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"KeywordGetByTypeConst", + self, extract::keyword, meta::type, type); +} + +// Get, by type, non-const +Handle2Keyword +KeywordsKeywordGetByType( + ConstHandle2Keywords self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"KeywordGetByType", + self, extract::keyword, meta::type, type); +} + +// Set, by type +void +KeywordsKeywordSetByType( + ConstHandle2Keywords self, + const XMLName type, + ConstHandle2ConstKeyword keyword +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"KeywordSetByType", + self, extract::keyword, meta::type, type, keyword); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Keywords/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords.h new file mode 100644 index 000000000..8ff98e6f0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords.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. +// +// Keywords is the basic handle type in this file. Example: +// // Create a default Keywords object: +// Keywords handle = KeywordsDefault(); +// Functions involving Keywords are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_KEYWORDS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_KEYWORDS + +#include "GNDStk.h" +#include "v2.0/documentation/Keyword.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct KeywordsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Keywords +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct KeywordsClass *Keywords; + +// --- Const-aware handles. +typedef const struct KeywordsClass *const ConstHandle2ConstKeywords; +typedef struct KeywordsClass *const ConstHandle2Keywords; +typedef const struct KeywordsClass * Handle2ConstKeywords; +typedef struct KeywordsClass * Handle2Keywords; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstKeywords +KeywordsDefaultConst(); + +// +++ Create, default +extern_c Handle2Keywords +KeywordsDefault(); + +// --- Create, general, const +extern_c Handle2ConstKeywords +KeywordsCreateConst( + ConstHandle2Keyword *const keyword, const size_t keywordSize +); + +// +++ Create, general +extern_c Handle2Keywords +KeywordsCreate( + ConstHandle2Keyword *const keyword, const size_t keywordSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +KeywordsAssign(ConstHandle2Keywords self, ConstHandle2ConstKeywords from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +KeywordsDelete(ConstHandle2ConstKeywords self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +KeywordsRead(ConstHandle2Keywords self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +KeywordsWrite(ConstHandle2ConstKeywords self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +KeywordsPrint(ConstHandle2ConstKeywords self); + +// +++ Print to standard output, as XML +extern_c int +KeywordsPrintXML(ConstHandle2ConstKeywords self); + +// +++ Print to standard output, as JSON +extern_c int +KeywordsPrintJSON(ConstHandle2ConstKeywords self); + + +// ----------------------------------------------------------------------------- +// Child: keyword +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KeywordsKeywordHas(ConstHandle2ConstKeywords self); + +// +++ Clear +extern_c void +KeywordsKeywordClear(ConstHandle2Keywords self); + +// +++ Size +extern_c size_t +KeywordsKeywordSize(ConstHandle2ConstKeywords self); + +// +++ Add +extern_c void +KeywordsKeywordAdd(ConstHandle2Keywords self, ConstHandle2ConstKeyword keyword); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstKeyword +KeywordsKeywordGetConst(ConstHandle2ConstKeywords self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Keyword +KeywordsKeywordGet(ConstHandle2Keywords self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +KeywordsKeywordSet( + ConstHandle2Keywords self, + const size_t index_, + ConstHandle2ConstKeyword keyword +); + +// +++ Has, by encoding +extern_c int +KeywordsKeywordHasByEncoding( + ConstHandle2ConstKeywords self, + const XMLName encoding +); + +// --- Get, by encoding, const +extern_c Handle2ConstKeyword +KeywordsKeywordGetByEncodingConst( + ConstHandle2ConstKeywords self, + const XMLName encoding +); + +// +++ Get, by encoding, non-const +extern_c Handle2Keyword +KeywordsKeywordGetByEncoding( + ConstHandle2Keywords self, + const XMLName encoding +); + +// +++ Set, by encoding +extern_c void +KeywordsKeywordSetByEncoding( + ConstHandle2Keywords self, + const XMLName encoding, + ConstHandle2ConstKeyword keyword +); + +// +++ Has, by markup +extern_c int +KeywordsKeywordHasByMarkup( + ConstHandle2ConstKeywords self, + const char *const markup +); + +// --- Get, by markup, const +extern_c Handle2ConstKeyword +KeywordsKeywordGetByMarkupConst( + ConstHandle2ConstKeywords self, + const char *const markup +); + +// +++ Get, by markup, non-const +extern_c Handle2Keyword +KeywordsKeywordGetByMarkup( + ConstHandle2Keywords self, + const char *const markup +); + +// +++ Set, by markup +extern_c void +KeywordsKeywordSetByMarkup( + ConstHandle2Keywords self, + const char *const markup, + ConstHandle2ConstKeyword keyword +); + +// +++ Has, by label +extern_c int +KeywordsKeywordHasByLabel( + ConstHandle2ConstKeywords self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstKeyword +KeywordsKeywordGetByLabelConst( + ConstHandle2ConstKeywords self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Keyword +KeywordsKeywordGetByLabel( + ConstHandle2Keywords self, + const XMLName label +); + +// +++ Set, by label +extern_c void +KeywordsKeywordSetByLabel( + ConstHandle2Keywords self, + const XMLName label, + ConstHandle2ConstKeyword keyword +); + +// +++ Has, by type +extern_c int +KeywordsKeywordHasByType( + ConstHandle2ConstKeywords self, + const XMLName type +); + +// --- Get, by type, const +extern_c Handle2ConstKeyword +KeywordsKeywordGetByTypeConst( + ConstHandle2ConstKeywords self, + const XMLName type +); + +// +++ Get, by type, non-const +extern_c Handle2Keyword +KeywordsKeywordGetByType( + ConstHandle2Keywords self, + const XMLName type +); + +// +++ Set, by type +extern_c void +KeywordsKeywordSetByType( + ConstHandle2Keywords self, + const XMLName type, + ConstHandle2ConstKeyword keyword +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Keywords/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Keywords/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Note.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Note.cpp new file mode 100644 index 000000000..8832fdd8a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Note.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Note.hpp" +#include "Note.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = NoteClass; +using CPP = multigroup::Note; + +static const std::string CLASSNAME = "Note"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNote +NoteDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Note +NoteDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNote +NoteCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Note handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label + ); + return handle; +} + +// Create, general +Handle2Note +NoteCreate( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Note handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +NoteAssign(ConstHandle2Note self, ConstHandle2ConstNote from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NoteDelete(ConstHandle2ConstNote self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NoteRead(ConstHandle2Note self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NoteWrite(ConstHandle2ConstNote self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NotePrint(ConstHandle2ConstNote self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NotePrintXML(ConstHandle2ConstNote self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NotePrintJSON(ConstHandle2ConstNote self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +NoteIntsClear(ConstHandle2Note self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +NoteIntsSize(ConstHandle2ConstNote self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +NoteIntsGet(ConstHandle2ConstNote self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NoteIntsSet(ConstHandle2Note self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +NoteIntsGetArrayConst(ConstHandle2ConstNote self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +NoteIntsGetArray(ConstHandle2Note self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +NoteIntsSetArray(ConstHandle2Note self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +NoteUnsignedsClear(ConstHandle2Note self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +NoteUnsignedsSize(ConstHandle2ConstNote self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +NoteUnsignedsGet(ConstHandle2ConstNote self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NoteUnsignedsSet(ConstHandle2Note self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +NoteUnsignedsGetArrayConst(ConstHandle2ConstNote self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +NoteUnsignedsGetArray(ConstHandle2Note self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +NoteUnsignedsSetArray(ConstHandle2Note self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +NoteFloatsClear(ConstHandle2Note self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +NoteFloatsSize(ConstHandle2ConstNote self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +NoteFloatsGet(ConstHandle2ConstNote self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NoteFloatsSet(ConstHandle2Note self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +NoteFloatsGetArrayConst(ConstHandle2ConstNote self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +NoteFloatsGetArray(ConstHandle2Note self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +NoteFloatsSetArray(ConstHandle2Note self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +NoteDoublesClear(ConstHandle2Note self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +NoteDoublesSize(ConstHandle2ConstNote self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +NoteDoublesGet(ConstHandle2ConstNote self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NoteDoublesSet(ConstHandle2Note self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +NoteDoublesGetArrayConst(ConstHandle2ConstNote self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +NoteDoublesGetArray(ConstHandle2Note self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +NoteDoublesSetArray(ConstHandle2Note self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +NoteEncodingHas(ConstHandle2ConstNote self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +NoteEncodingGet(ConstHandle2ConstNote self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +NoteEncodingSet(ConstHandle2Note self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +NoteMarkupHas(ConstHandle2ConstNote self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +NoteMarkupGet(ConstHandle2ConstNote self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +NoteMarkupSet(ConstHandle2Note self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +NoteLabelHas(ConstHandle2ConstNote self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +NoteLabelGet(ConstHandle2ConstNote self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +NoteLabelSet(ConstHandle2Note self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Note/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Note.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Note.h new file mode 100644 index 000000000..bbd48f4ec --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Note.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. +// +// Note is the basic handle type in this file. Example: +// // Create a default Note object: +// Note handle = NoteDefault(); +// Functions involving Note are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_NOTE +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_NOTE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NoteClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Note +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NoteClass *Note; + +// --- Const-aware handles. +typedef const struct NoteClass *const ConstHandle2ConstNote; +typedef struct NoteClass *const ConstHandle2Note; +typedef const struct NoteClass * Handle2ConstNote; +typedef struct NoteClass * Handle2Note; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNote +NoteDefaultConst(); + +// +++ Create, default +extern_c Handle2Note +NoteDefault(); + +// --- Create, general, const +extern_c Handle2ConstNote +NoteCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +); + +// +++ Create, general +extern_c Handle2Note +NoteCreate( + const XMLName encoding, + const char *const markup, + const XMLName 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 +NoteAssign(ConstHandle2Note self, ConstHandle2ConstNote from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NoteDelete(ConstHandle2ConstNote self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NoteRead(ConstHandle2Note self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NoteWrite(ConstHandle2ConstNote self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NotePrint(ConstHandle2ConstNote self); + +// +++ Print to standard output, as XML +extern_c int +NotePrintXML(ConstHandle2ConstNote self); + +// +++ Print to standard output, as JSON +extern_c int +NotePrintJSON(ConstHandle2ConstNote self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +NoteIntsClear(ConstHandle2Note self); + +// +++ Get size +extern_c size_t +NoteIntsSize(ConstHandle2ConstNote self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +NoteIntsGet(ConstHandle2ConstNote self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NoteIntsSet(ConstHandle2Note self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +NoteIntsGetArrayConst(ConstHandle2ConstNote self); + +// +++ Get pointer to existing values, non-const +extern_c int * +NoteIntsGetArray(ConstHandle2Note self); + +// +++ Set completely new values and size +extern_c void +NoteIntsSetArray(ConstHandle2Note self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +NoteUnsignedsClear(ConstHandle2Note self); + +// +++ Get size +extern_c size_t +NoteUnsignedsSize(ConstHandle2ConstNote self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +NoteUnsignedsGet(ConstHandle2ConstNote self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NoteUnsignedsSet(ConstHandle2Note self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +NoteUnsignedsGetArrayConst(ConstHandle2ConstNote self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +NoteUnsignedsGetArray(ConstHandle2Note self); + +// +++ Set completely new values and size +extern_c void +NoteUnsignedsSetArray(ConstHandle2Note self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +NoteFloatsClear(ConstHandle2Note self); + +// +++ Get size +extern_c size_t +NoteFloatsSize(ConstHandle2ConstNote self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +NoteFloatsGet(ConstHandle2ConstNote self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NoteFloatsSet(ConstHandle2Note self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +NoteFloatsGetArrayConst(ConstHandle2ConstNote self); + +// +++ Get pointer to existing values, non-const +extern_c float * +NoteFloatsGetArray(ConstHandle2Note self); + +// +++ Set completely new values and size +extern_c void +NoteFloatsSetArray(ConstHandle2Note self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +NoteDoublesClear(ConstHandle2Note self); + +// +++ Get size +extern_c size_t +NoteDoublesSize(ConstHandle2ConstNote self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +NoteDoublesGet(ConstHandle2ConstNote self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NoteDoublesSet(ConstHandle2Note self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +NoteDoublesGetArrayConst(ConstHandle2ConstNote self); + +// +++ Get pointer to existing values, non-const +extern_c double * +NoteDoublesGetArray(ConstHandle2Note self); + +// +++ Set completely new values and size +extern_c void +NoteDoublesSetArray(ConstHandle2Note self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NoteEncodingHas(ConstHandle2ConstNote self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +NoteEncodingGet(ConstHandle2ConstNote self); + +// +++ Set +extern_c void +NoteEncodingSet(ConstHandle2Note self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NoteMarkupHas(ConstHandle2ConstNote self); + +// +++ Get +// +++ Returns by value +extern_c const char * +NoteMarkupGet(ConstHandle2ConstNote self); + +// +++ Set +extern_c void +NoteMarkupSet(ConstHandle2Note self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NoteLabelHas(ConstHandle2ConstNote self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +NoteLabelGet(ConstHandle2ConstNote self); + +// +++ Set +extern_c void +NoteLabelSet(ConstHandle2Note self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Note/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Note/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Note/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Note/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Note/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck.cpp new file mode 100644 index 000000000..91fe42863 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck.cpp @@ -0,0 +1,530 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/OutputDeck.hpp" +#include "OutputDeck.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = OutputDeckClass; +using CPP = multigroup::OutputDeck; + +static const std::string CLASSNAME = "OutputDeck"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto filename = [](auto &obj) { return &obj.filename; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstOutputDeck +OutputDeckDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2OutputDeck +OutputDeckDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstOutputDeck +OutputDeckCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName filename +) { + ConstHandle2OutputDeck handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label, + filename + ); + return handle; +} + +// Create, general +Handle2OutputDeck +OutputDeckCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName filename +) { + ConstHandle2OutputDeck handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + label, + filename + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +OutputDeckAssign(ConstHandle2OutputDeck self, ConstHandle2ConstOutputDeck from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +OutputDeckDelete(ConstHandle2ConstOutputDeck self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +OutputDeckRead(ConstHandle2OutputDeck self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +OutputDeckWrite(ConstHandle2ConstOutputDeck self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +OutputDeckPrint(ConstHandle2ConstOutputDeck self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +OutputDeckPrintXML(ConstHandle2ConstOutputDeck self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +OutputDeckPrintJSON(ConstHandle2ConstOutputDeck self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +OutputDeckIntsClear(ConstHandle2OutputDeck self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +OutputDeckIntsSize(ConstHandle2ConstOutputDeck self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +OutputDeckIntsGet(ConstHandle2ConstOutputDeck self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +OutputDeckIntsSet(ConstHandle2OutputDeck self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +OutputDeckIntsGetArrayConst(ConstHandle2ConstOutputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +OutputDeckIntsGetArray(ConstHandle2OutputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +OutputDeckIntsSetArray(ConstHandle2OutputDeck self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +OutputDeckUnsignedsClear(ConstHandle2OutputDeck self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +OutputDeckUnsignedsSize(ConstHandle2ConstOutputDeck self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +OutputDeckUnsignedsGet(ConstHandle2ConstOutputDeck self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +OutputDeckUnsignedsSet(ConstHandle2OutputDeck self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +OutputDeckUnsignedsGetArrayConst(ConstHandle2ConstOutputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +OutputDeckUnsignedsGetArray(ConstHandle2OutputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +OutputDeckUnsignedsSetArray(ConstHandle2OutputDeck self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +OutputDeckFloatsClear(ConstHandle2OutputDeck self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +OutputDeckFloatsSize(ConstHandle2ConstOutputDeck self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +OutputDeckFloatsGet(ConstHandle2ConstOutputDeck self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +OutputDeckFloatsSet(ConstHandle2OutputDeck self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +OutputDeckFloatsGetArrayConst(ConstHandle2ConstOutputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +OutputDeckFloatsGetArray(ConstHandle2OutputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +OutputDeckFloatsSetArray(ConstHandle2OutputDeck self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +OutputDeckDoublesClear(ConstHandle2OutputDeck self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +OutputDeckDoublesSize(ConstHandle2ConstOutputDeck self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +OutputDeckDoublesGet(ConstHandle2ConstOutputDeck self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +OutputDeckDoublesSet(ConstHandle2OutputDeck self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +OutputDeckDoublesGetArrayConst(ConstHandle2ConstOutputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +OutputDeckDoublesGetArray(ConstHandle2OutputDeck self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +OutputDeckDoublesSetArray(ConstHandle2OutputDeck self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +OutputDeckEncodingHas(ConstHandle2ConstOutputDeck self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +OutputDeckEncodingGet(ConstHandle2ConstOutputDeck self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +OutputDeckEncodingSet(ConstHandle2OutputDeck self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +OutputDeckMarkupHas(ConstHandle2ConstOutputDeck self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +OutputDeckMarkupGet(ConstHandle2ConstOutputDeck self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +OutputDeckMarkupSet(ConstHandle2OutputDeck self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +OutputDeckLabelHas(ConstHandle2ConstOutputDeck self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +OutputDeckLabelGet(ConstHandle2ConstOutputDeck self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +OutputDeckLabelSet(ConstHandle2OutputDeck self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: filename +// ----------------------------------------------------------------------------- + +// Has +int +OutputDeckFilenameHas(ConstHandle2ConstOutputDeck self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FilenameHas", self, extract::filename); +} + +// Get +// Returns by value +XMLName +OutputDeckFilenameGet(ConstHandle2ConstOutputDeck self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FilenameGet", self, extract::filename); +} + +// Set +void +OutputDeckFilenameSet(ConstHandle2OutputDeck self, const XMLName filename) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FilenameSet", self, extract::filename, filename); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/OutputDeck/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck.h new file mode 100644 index 000000000..4e6cd9bc8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck.h @@ -0,0 +1,358 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// OutputDeck is the basic handle type in this file. Example: +// // Create a default OutputDeck object: +// OutputDeck handle = OutputDeckDefault(); +// Functions involving OutputDeck are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_OUTPUTDECK +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_OUTPUTDECK + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct OutputDeckClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ OutputDeck +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct OutputDeckClass *OutputDeck; + +// --- Const-aware handles. +typedef const struct OutputDeckClass *const ConstHandle2ConstOutputDeck; +typedef struct OutputDeckClass *const ConstHandle2OutputDeck; +typedef const struct OutputDeckClass * Handle2ConstOutputDeck; +typedef struct OutputDeckClass * Handle2OutputDeck; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstOutputDeck +OutputDeckDefaultConst(); + +// +++ Create, default +extern_c Handle2OutputDeck +OutputDeckDefault(); + +// --- Create, general, const +extern_c Handle2ConstOutputDeck +OutputDeckCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName filename +); + +// +++ Create, general +extern_c Handle2OutputDeck +OutputDeckCreate( + const XMLName encoding, + const char *const markup, + const XMLName label, + const XMLName filename +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +OutputDeckAssign(ConstHandle2OutputDeck self, ConstHandle2ConstOutputDeck from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +OutputDeckDelete(ConstHandle2ConstOutputDeck self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +OutputDeckRead(ConstHandle2OutputDeck self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +OutputDeckWrite(ConstHandle2ConstOutputDeck self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +OutputDeckPrint(ConstHandle2ConstOutputDeck self); + +// +++ Print to standard output, as XML +extern_c int +OutputDeckPrintXML(ConstHandle2ConstOutputDeck self); + +// +++ Print to standard output, as JSON +extern_c int +OutputDeckPrintJSON(ConstHandle2ConstOutputDeck self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +OutputDeckIntsClear(ConstHandle2OutputDeck self); + +// +++ Get size +extern_c size_t +OutputDeckIntsSize(ConstHandle2ConstOutputDeck self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +OutputDeckIntsGet(ConstHandle2ConstOutputDeck self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +OutputDeckIntsSet(ConstHandle2OutputDeck self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +OutputDeckIntsGetArrayConst(ConstHandle2ConstOutputDeck self); + +// +++ Get pointer to existing values, non-const +extern_c int * +OutputDeckIntsGetArray(ConstHandle2OutputDeck self); + +// +++ Set completely new values and size +extern_c void +OutputDeckIntsSetArray(ConstHandle2OutputDeck self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +OutputDeckUnsignedsClear(ConstHandle2OutputDeck self); + +// +++ Get size +extern_c size_t +OutputDeckUnsignedsSize(ConstHandle2ConstOutputDeck self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +OutputDeckUnsignedsGet(ConstHandle2ConstOutputDeck self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +OutputDeckUnsignedsSet(ConstHandle2OutputDeck self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +OutputDeckUnsignedsGetArrayConst(ConstHandle2ConstOutputDeck self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +OutputDeckUnsignedsGetArray(ConstHandle2OutputDeck self); + +// +++ Set completely new values and size +extern_c void +OutputDeckUnsignedsSetArray(ConstHandle2OutputDeck self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +OutputDeckFloatsClear(ConstHandle2OutputDeck self); + +// +++ Get size +extern_c size_t +OutputDeckFloatsSize(ConstHandle2ConstOutputDeck self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +OutputDeckFloatsGet(ConstHandle2ConstOutputDeck self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +OutputDeckFloatsSet(ConstHandle2OutputDeck self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +OutputDeckFloatsGetArrayConst(ConstHandle2ConstOutputDeck self); + +// +++ Get pointer to existing values, non-const +extern_c float * +OutputDeckFloatsGetArray(ConstHandle2OutputDeck self); + +// +++ Set completely new values and size +extern_c void +OutputDeckFloatsSetArray(ConstHandle2OutputDeck self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +OutputDeckDoublesClear(ConstHandle2OutputDeck self); + +// +++ Get size +extern_c size_t +OutputDeckDoublesSize(ConstHandle2ConstOutputDeck self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +OutputDeckDoublesGet(ConstHandle2ConstOutputDeck self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +OutputDeckDoublesSet(ConstHandle2OutputDeck self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +OutputDeckDoublesGetArrayConst(ConstHandle2ConstOutputDeck self); + +// +++ Get pointer to existing values, non-const +extern_c double * +OutputDeckDoublesGetArray(ConstHandle2OutputDeck self); + +// +++ Set completely new values and size +extern_c void +OutputDeckDoublesSetArray(ConstHandle2OutputDeck self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputDeckEncodingHas(ConstHandle2ConstOutputDeck self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +OutputDeckEncodingGet(ConstHandle2ConstOutputDeck self); + +// +++ Set +extern_c void +OutputDeckEncodingSet(ConstHandle2OutputDeck self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputDeckMarkupHas(ConstHandle2ConstOutputDeck self); + +// +++ Get +// +++ Returns by value +extern_c const char * +OutputDeckMarkupGet(ConstHandle2ConstOutputDeck self); + +// +++ Set +extern_c void +OutputDeckMarkupSet(ConstHandle2OutputDeck self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputDeckLabelHas(ConstHandle2ConstOutputDeck self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +OutputDeckLabelGet(ConstHandle2ConstOutputDeck self); + +// +++ Set +extern_c void +OutputDeckLabelSet(ConstHandle2OutputDeck self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: filename +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputDeckFilenameHas(ConstHandle2ConstOutputDeck self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +OutputDeckFilenameGet(ConstHandle2ConstOutputDeck self); + +// +++ Set +extern_c void +OutputDeckFilenameSet(ConstHandle2OutputDeck self, const XMLName filename); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/OutputDeck/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDeck/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks.cpp new file mode 100644 index 000000000..84f0e59f5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/OutputDecks.hpp" +#include "OutputDecks.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = OutputDecksClass; +using CPP = multigroup::OutputDecks; + +static const std::string CLASSNAME = "OutputDecks"; + +namespace extract { + static auto outputDeck = [](auto &obj) { return &obj.outputDeck; }; +} + +using CPPOutputDeck = documentation::OutputDeck; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstOutputDecks +OutputDecksDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2OutputDecks +OutputDecksDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstOutputDecks +OutputDecksCreateConst( + ConstHandle2OutputDeck *const outputDeck, const size_t outputDeckSize +) { + ConstHandle2OutputDecks handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t OutputDeckN = 0; OutputDeckN < outputDeckSize; ++OutputDeckN) + OutputDecksOutputDeckAdd(handle, outputDeck[OutputDeckN]); + return handle; +} + +// Create, general +Handle2OutputDecks +OutputDecksCreate( + ConstHandle2OutputDeck *const outputDeck, const size_t outputDeckSize +) { + ConstHandle2OutputDecks handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t OutputDeckN = 0; OutputDeckN < outputDeckSize; ++OutputDeckN) + OutputDecksOutputDeckAdd(handle, outputDeck[OutputDeckN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +OutputDecksAssign(ConstHandle2OutputDecks self, ConstHandle2ConstOutputDecks from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +OutputDecksDelete(ConstHandle2ConstOutputDecks self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +OutputDecksRead(ConstHandle2OutputDecks self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +OutputDecksWrite(ConstHandle2ConstOutputDecks self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +OutputDecksPrint(ConstHandle2ConstOutputDecks self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +OutputDecksPrintXML(ConstHandle2ConstOutputDecks self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +OutputDecksPrintJSON(ConstHandle2ConstOutputDecks self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: outputDeck +// ----------------------------------------------------------------------------- + +// Has +int +OutputDecksOutputDeckHas(ConstHandle2ConstOutputDecks self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OutputDeckHas", self, extract::outputDeck); +} + +// Clear +void +OutputDecksOutputDeckClear(ConstHandle2OutputDecks self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"OutputDeckClear", self, extract::outputDeck); +} + +// Size +size_t +OutputDecksOutputDeckSize(ConstHandle2ConstOutputDecks self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"OutputDeckSize", self, extract::outputDeck); +} + +// Add +void +OutputDecksOutputDeckAdd(ConstHandle2OutputDecks self, ConstHandle2ConstOutputDeck outputDeck) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"OutputDeckAdd", self, extract::outputDeck, outputDeck); +} + +// Get, by index \in [0,size), const +Handle2ConstOutputDeck +OutputDecksOutputDeckGetConst(ConstHandle2ConstOutputDecks self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"OutputDeckGetConst", self, extract::outputDeck, index_); +} + +// Get, by index \in [0,size), non-const +Handle2OutputDeck +OutputDecksOutputDeckGet(ConstHandle2OutputDecks self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"OutputDeckGet", self, extract::outputDeck, index_); +} + +// Set, by index \in [0,size) +void +OutputDecksOutputDeckSet( + ConstHandle2OutputDecks self, + const size_t index_, + ConstHandle2ConstOutputDeck outputDeck +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"OutputDeckSet", self, extract::outputDeck, index_, outputDeck); +} + +// Has, by encoding +int +OutputDecksOutputDeckHasByEncoding( + ConstHandle2ConstOutputDecks self, + const XMLName encoding +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckHasByEncoding", + self, extract::outputDeck, meta::encoding, encoding); +} + +// Get, by encoding, const +Handle2ConstOutputDeck +OutputDecksOutputDeckGetByEncodingConst( + ConstHandle2ConstOutputDecks self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckGetByEncodingConst", + self, extract::outputDeck, meta::encoding, encoding); +} + +// Get, by encoding, non-const +Handle2OutputDeck +OutputDecksOutputDeckGetByEncoding( + ConstHandle2OutputDecks self, + const XMLName encoding +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckGetByEncoding", + self, extract::outputDeck, meta::encoding, encoding); +} + +// Set, by encoding +void +OutputDecksOutputDeckSetByEncoding( + ConstHandle2OutputDecks self, + const XMLName encoding, + ConstHandle2ConstOutputDeck outputDeck +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckSetByEncoding", + self, extract::outputDeck, meta::encoding, encoding, outputDeck); +} + +// Has, by markup +int +OutputDecksOutputDeckHasByMarkup( + ConstHandle2ConstOutputDecks self, + const char *const markup +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckHasByMarkup", + self, extract::outputDeck, meta::markup, markup); +} + +// Get, by markup, const +Handle2ConstOutputDeck +OutputDecksOutputDeckGetByMarkupConst( + ConstHandle2ConstOutputDecks self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckGetByMarkupConst", + self, extract::outputDeck, meta::markup, markup); +} + +// Get, by markup, non-const +Handle2OutputDeck +OutputDecksOutputDeckGetByMarkup( + ConstHandle2OutputDecks self, + const char *const markup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckGetByMarkup", + self, extract::outputDeck, meta::markup, markup); +} + +// Set, by markup +void +OutputDecksOutputDeckSetByMarkup( + ConstHandle2OutputDecks self, + const char *const markup, + ConstHandle2ConstOutputDeck outputDeck +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckSetByMarkup", + self, extract::outputDeck, meta::markup, markup, outputDeck); +} + +// Has, by label +int +OutputDecksOutputDeckHasByLabel( + ConstHandle2ConstOutputDecks self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckHasByLabel", + self, extract::outputDeck, meta::label, label); +} + +// Get, by label, const +Handle2ConstOutputDeck +OutputDecksOutputDeckGetByLabelConst( + ConstHandle2ConstOutputDecks self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckGetByLabelConst", + self, extract::outputDeck, meta::label, label); +} + +// Get, by label, non-const +Handle2OutputDeck +OutputDecksOutputDeckGetByLabel( + ConstHandle2OutputDecks self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckGetByLabel", + self, extract::outputDeck, meta::label, label); +} + +// Set, by label +void +OutputDecksOutputDeckSetByLabel( + ConstHandle2OutputDecks self, + const XMLName label, + ConstHandle2ConstOutputDeck outputDeck +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckSetByLabel", + self, extract::outputDeck, meta::label, label, outputDeck); +} + +// Has, by filename +int +OutputDecksOutputDeckHasByFilename( + ConstHandle2ConstOutputDecks self, + const XMLName filename +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckHasByFilename", + self, extract::outputDeck, meta::filename, filename); +} + +// Get, by filename, const +Handle2ConstOutputDeck +OutputDecksOutputDeckGetByFilenameConst( + ConstHandle2ConstOutputDecks self, + const XMLName filename +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckGetByFilenameConst", + self, extract::outputDeck, meta::filename, filename); +} + +// Get, by filename, non-const +Handle2OutputDeck +OutputDecksOutputDeckGetByFilename( + ConstHandle2OutputDecks self, + const XMLName filename +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckGetByFilename", + self, extract::outputDeck, meta::filename, filename); +} + +// Set, by filename +void +OutputDecksOutputDeckSetByFilename( + ConstHandle2OutputDecks self, + const XMLName filename, + ConstHandle2ConstOutputDeck outputDeck +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"OutputDeckSetByFilename", + self, extract::outputDeck, meta::filename, filename, outputDeck); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/OutputDecks/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks.h new file mode 100644 index 000000000..fb7973bf1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks.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. +// +// OutputDecks is the basic handle type in this file. Example: +// // Create a default OutputDecks object: +// OutputDecks handle = OutputDecksDefault(); +// Functions involving OutputDecks are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_OUTPUTDECKS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_OUTPUTDECKS + +#include "GNDStk.h" +#include "v2.0/documentation/OutputDeck.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct OutputDecksClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ OutputDecks +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct OutputDecksClass *OutputDecks; + +// --- Const-aware handles. +typedef const struct OutputDecksClass *const ConstHandle2ConstOutputDecks; +typedef struct OutputDecksClass *const ConstHandle2OutputDecks; +typedef const struct OutputDecksClass * Handle2ConstOutputDecks; +typedef struct OutputDecksClass * Handle2OutputDecks; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstOutputDecks +OutputDecksDefaultConst(); + +// +++ Create, default +extern_c Handle2OutputDecks +OutputDecksDefault(); + +// --- Create, general, const +extern_c Handle2ConstOutputDecks +OutputDecksCreateConst( + ConstHandle2OutputDeck *const outputDeck, const size_t outputDeckSize +); + +// +++ Create, general +extern_c Handle2OutputDecks +OutputDecksCreate( + ConstHandle2OutputDeck *const outputDeck, const size_t outputDeckSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +OutputDecksAssign(ConstHandle2OutputDecks self, ConstHandle2ConstOutputDecks from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +OutputDecksDelete(ConstHandle2ConstOutputDecks self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +OutputDecksRead(ConstHandle2OutputDecks self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +OutputDecksWrite(ConstHandle2ConstOutputDecks self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +OutputDecksPrint(ConstHandle2ConstOutputDecks self); + +// +++ Print to standard output, as XML +extern_c int +OutputDecksPrintXML(ConstHandle2ConstOutputDecks self); + +// +++ Print to standard output, as JSON +extern_c int +OutputDecksPrintJSON(ConstHandle2ConstOutputDecks self); + + +// ----------------------------------------------------------------------------- +// Child: outputDeck +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputDecksOutputDeckHas(ConstHandle2ConstOutputDecks self); + +// +++ Clear +extern_c void +OutputDecksOutputDeckClear(ConstHandle2OutputDecks self); + +// +++ Size +extern_c size_t +OutputDecksOutputDeckSize(ConstHandle2ConstOutputDecks self); + +// +++ Add +extern_c void +OutputDecksOutputDeckAdd(ConstHandle2OutputDecks self, ConstHandle2ConstOutputDeck outputDeck); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstOutputDeck +OutputDecksOutputDeckGetConst(ConstHandle2ConstOutputDecks self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2OutputDeck +OutputDecksOutputDeckGet(ConstHandle2OutputDecks self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +OutputDecksOutputDeckSet( + ConstHandle2OutputDecks self, + const size_t index_, + ConstHandle2ConstOutputDeck outputDeck +); + +// +++ Has, by encoding +extern_c int +OutputDecksOutputDeckHasByEncoding( + ConstHandle2ConstOutputDecks self, + const XMLName encoding +); + +// --- Get, by encoding, const +extern_c Handle2ConstOutputDeck +OutputDecksOutputDeckGetByEncodingConst( + ConstHandle2ConstOutputDecks self, + const XMLName encoding +); + +// +++ Get, by encoding, non-const +extern_c Handle2OutputDeck +OutputDecksOutputDeckGetByEncoding( + ConstHandle2OutputDecks self, + const XMLName encoding +); + +// +++ Set, by encoding +extern_c void +OutputDecksOutputDeckSetByEncoding( + ConstHandle2OutputDecks self, + const XMLName encoding, + ConstHandle2ConstOutputDeck outputDeck +); + +// +++ Has, by markup +extern_c int +OutputDecksOutputDeckHasByMarkup( + ConstHandle2ConstOutputDecks self, + const char *const markup +); + +// --- Get, by markup, const +extern_c Handle2ConstOutputDeck +OutputDecksOutputDeckGetByMarkupConst( + ConstHandle2ConstOutputDecks self, + const char *const markup +); + +// +++ Get, by markup, non-const +extern_c Handle2OutputDeck +OutputDecksOutputDeckGetByMarkup( + ConstHandle2OutputDecks self, + const char *const markup +); + +// +++ Set, by markup +extern_c void +OutputDecksOutputDeckSetByMarkup( + ConstHandle2OutputDecks self, + const char *const markup, + ConstHandle2ConstOutputDeck outputDeck +); + +// +++ Has, by label +extern_c int +OutputDecksOutputDeckHasByLabel( + ConstHandle2ConstOutputDecks self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstOutputDeck +OutputDecksOutputDeckGetByLabelConst( + ConstHandle2ConstOutputDecks self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2OutputDeck +OutputDecksOutputDeckGetByLabel( + ConstHandle2OutputDecks self, + const XMLName label +); + +// +++ Set, by label +extern_c void +OutputDecksOutputDeckSetByLabel( + ConstHandle2OutputDecks self, + const XMLName label, + ConstHandle2ConstOutputDeck outputDeck +); + +// +++ Has, by filename +extern_c int +OutputDecksOutputDeckHasByFilename( + ConstHandle2ConstOutputDecks self, + const XMLName filename +); + +// --- Get, by filename, const +extern_c Handle2ConstOutputDeck +OutputDecksOutputDeckGetByFilenameConst( + ConstHandle2ConstOutputDecks self, + const XMLName filename +); + +// +++ Get, by filename, non-const +extern_c Handle2OutputDeck +OutputDecksOutputDeckGetByFilename( + ConstHandle2OutputDecks self, + const XMLName filename +); + +// +++ Set, by filename +extern_c void +OutputDecksOutputDeckSetByFilename( + ConstHandle2OutputDecks self, + const XMLName filename, + ConstHandle2ConstOutputDeck outputDeck +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/OutputDecks/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/OutputDecks/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem.cpp new file mode 100644 index 000000000..df0955e9e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/RelatedItem.hpp" +#include "RelatedItem.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = RelatedItemClass; +using CPP = multigroup::RelatedItem; + +static const std::string CLASSNAME = "RelatedItem"; + +namespace extract { + static auto name = [](auto &obj) { return &obj.name; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto relationType = [](auto &obj) { return &obj.relationType; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRelatedItem +RelatedItemDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2RelatedItem +RelatedItemDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRelatedItem +RelatedItemCreateConst( + const UTF8Text name, + const UTF8Text href, + const enums::RelationType relationType +) { + ConstHandle2RelatedItem handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name, + href, + relationType + ); + return handle; +} + +// Create, general +Handle2RelatedItem +RelatedItemCreate( + const UTF8Text name, + const UTF8Text href, + const enums::RelationType relationType +) { + ConstHandle2RelatedItem handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name, + href, + relationType + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RelatedItemAssign(ConstHandle2RelatedItem self, ConstHandle2ConstRelatedItem from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RelatedItemDelete(ConstHandle2ConstRelatedItem self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RelatedItemRead(ConstHandle2RelatedItem self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RelatedItemWrite(ConstHandle2ConstRelatedItem self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RelatedItemPrint(ConstHandle2ConstRelatedItem self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RelatedItemPrintXML(ConstHandle2ConstRelatedItem self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RelatedItemPrintJSON(ConstHandle2ConstRelatedItem self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +RelatedItemNameHas(ConstHandle2ConstRelatedItem self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +UTF8Text +RelatedItemNameGet(ConstHandle2ConstRelatedItem self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +RelatedItemNameSet(ConstHandle2RelatedItem self, const UTF8Text name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +RelatedItemHrefHas(ConstHandle2ConstRelatedItem self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +UTF8Text +RelatedItemHrefGet(ConstHandle2ConstRelatedItem self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +RelatedItemHrefSet(ConstHandle2RelatedItem self, const UTF8Text href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: relationType +// ----------------------------------------------------------------------------- + +// Has +int +RelatedItemRelationTypeHas(ConstHandle2ConstRelatedItem self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RelationTypeHas", self, extract::relationType); +} + +// Get +// Returns by value +enums::RelationType +RelatedItemRelationTypeGet(ConstHandle2ConstRelatedItem self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RelationTypeGet", self, extract::relationType); +} + +// Set +void +RelatedItemRelationTypeSet(ConstHandle2RelatedItem self, const enums::RelationType relationType) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RelationTypeSet", self, extract::relationType, relationType); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/RelatedItem/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem.h new file mode 100644 index 000000000..b850d6ed9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem.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. +// +// RelatedItem is the basic handle type in this file. Example: +// // Create a default RelatedItem object: +// RelatedItem handle = RelatedItemDefault(); +// Functions involving RelatedItem are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_RELATEDITEM +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_RELATEDITEM + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RelatedItemClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ RelatedItem +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RelatedItemClass *RelatedItem; + +// --- Const-aware handles. +typedef const struct RelatedItemClass *const ConstHandle2ConstRelatedItem; +typedef struct RelatedItemClass *const ConstHandle2RelatedItem; +typedef const struct RelatedItemClass * Handle2ConstRelatedItem; +typedef struct RelatedItemClass * Handle2RelatedItem; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRelatedItem +RelatedItemDefaultConst(); + +// +++ Create, default +extern_c Handle2RelatedItem +RelatedItemDefault(); + +// --- Create, general, const +extern_c Handle2ConstRelatedItem +RelatedItemCreateConst( + const UTF8Text name, + const UTF8Text href, + const enums::RelationType relationType +); + +// +++ Create, general +extern_c Handle2RelatedItem +RelatedItemCreate( + const UTF8Text name, + const UTF8Text href, + const enums::RelationType relationType +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RelatedItemAssign(ConstHandle2RelatedItem self, ConstHandle2ConstRelatedItem from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RelatedItemDelete(ConstHandle2ConstRelatedItem self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RelatedItemRead(ConstHandle2RelatedItem self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RelatedItemWrite(ConstHandle2ConstRelatedItem self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RelatedItemPrint(ConstHandle2ConstRelatedItem self); + +// +++ Print to standard output, as XML +extern_c int +RelatedItemPrintXML(ConstHandle2ConstRelatedItem self); + +// +++ Print to standard output, as JSON +extern_c int +RelatedItemPrintJSON(ConstHandle2ConstRelatedItem self); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RelatedItemNameHas(ConstHandle2ConstRelatedItem self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +RelatedItemNameGet(ConstHandle2ConstRelatedItem self); + +// +++ Set +extern_c void +RelatedItemNameSet(ConstHandle2RelatedItem self, const UTF8Text name); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RelatedItemHrefHas(ConstHandle2ConstRelatedItem self); + +// +++ Get +// +++ Returns by value +extern_c UTF8Text +RelatedItemHrefGet(ConstHandle2ConstRelatedItem self); + +// +++ Set +extern_c void +RelatedItemHrefSet(ConstHandle2RelatedItem self, const UTF8Text href); + + +// ----------------------------------------------------------------------------- +// Metadatum: relationType +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RelatedItemRelationTypeHas(ConstHandle2ConstRelatedItem self); + +// +++ Get +// +++ Returns by value +extern_c enums::RelationType +RelatedItemRelationTypeGet(ConstHandle2ConstRelatedItem self); + +// +++ Set +extern_c void +RelatedItemRelationTypeSet(ConstHandle2RelatedItem self, const enums::RelationType relationType); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/RelatedItem/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItem/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems.cpp new file mode 100644 index 000000000..7720373ee --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/RelatedItems.hpp" +#include "RelatedItems.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = RelatedItemsClass; +using CPP = multigroup::RelatedItems; + +static const std::string CLASSNAME = "RelatedItems"; + +namespace extract { + static auto relatedItem = [](auto &obj) { return &obj.relatedItem; }; +} + +using CPPRelatedItem = documentation::RelatedItem; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRelatedItems +RelatedItemsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2RelatedItems +RelatedItemsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRelatedItems +RelatedItemsCreateConst( + ConstHandle2RelatedItem *const relatedItem, const size_t relatedItemSize +) { + ConstHandle2RelatedItems handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t RelatedItemN = 0; RelatedItemN < relatedItemSize; ++RelatedItemN) + RelatedItemsRelatedItemAdd(handle, relatedItem[RelatedItemN]); + return handle; +} + +// Create, general +Handle2RelatedItems +RelatedItemsCreate( + ConstHandle2RelatedItem *const relatedItem, const size_t relatedItemSize +) { + ConstHandle2RelatedItems handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t RelatedItemN = 0; RelatedItemN < relatedItemSize; ++RelatedItemN) + RelatedItemsRelatedItemAdd(handle, relatedItem[RelatedItemN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RelatedItemsAssign(ConstHandle2RelatedItems self, ConstHandle2ConstRelatedItems from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RelatedItemsDelete(ConstHandle2ConstRelatedItems self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RelatedItemsRead(ConstHandle2RelatedItems self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RelatedItemsWrite(ConstHandle2ConstRelatedItems self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RelatedItemsPrint(ConstHandle2ConstRelatedItems self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RelatedItemsPrintXML(ConstHandle2ConstRelatedItems self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RelatedItemsPrintJSON(ConstHandle2ConstRelatedItems self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: relatedItem +// ----------------------------------------------------------------------------- + +// Has +int +RelatedItemsRelatedItemHas(ConstHandle2ConstRelatedItems self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RelatedItemHas", self, extract::relatedItem); +} + +// Clear +void +RelatedItemsRelatedItemClear(ConstHandle2RelatedItems self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"RelatedItemClear", self, extract::relatedItem); +} + +// Size +size_t +RelatedItemsRelatedItemSize(ConstHandle2ConstRelatedItems self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"RelatedItemSize", self, extract::relatedItem); +} + +// Add +void +RelatedItemsRelatedItemAdd(ConstHandle2RelatedItems self, ConstHandle2ConstRelatedItem relatedItem) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"RelatedItemAdd", self, extract::relatedItem, relatedItem); +} + +// Get, by index \in [0,size), const +Handle2ConstRelatedItem +RelatedItemsRelatedItemGetConst(ConstHandle2ConstRelatedItems self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"RelatedItemGetConst", self, extract::relatedItem, index_); +} + +// Get, by index \in [0,size), non-const +Handle2RelatedItem +RelatedItemsRelatedItemGet(ConstHandle2RelatedItems self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"RelatedItemGet", self, extract::relatedItem, index_); +} + +// Set, by index \in [0,size) +void +RelatedItemsRelatedItemSet( + ConstHandle2RelatedItems self, + const size_t index_, + ConstHandle2ConstRelatedItem relatedItem +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"RelatedItemSet", self, extract::relatedItem, index_, relatedItem); +} + +// Has, by name +int +RelatedItemsRelatedItemHasByName( + ConstHandle2ConstRelatedItems self, + const UTF8Text name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemHasByName", + self, extract::relatedItem, meta::name, name); +} + +// Get, by name, const +Handle2ConstRelatedItem +RelatedItemsRelatedItemGetByNameConst( + ConstHandle2ConstRelatedItems self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemGetByNameConst", + self, extract::relatedItem, meta::name, name); +} + +// Get, by name, non-const +Handle2RelatedItem +RelatedItemsRelatedItemGetByName( + ConstHandle2RelatedItems self, + const UTF8Text name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemGetByName", + self, extract::relatedItem, meta::name, name); +} + +// Set, by name +void +RelatedItemsRelatedItemSetByName( + ConstHandle2RelatedItems self, + const UTF8Text name, + ConstHandle2ConstRelatedItem relatedItem +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemSetByName", + self, extract::relatedItem, meta::name, name, relatedItem); +} + +// Has, by href +int +RelatedItemsRelatedItemHasByHref( + ConstHandle2ConstRelatedItems self, + const UTF8Text href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemHasByHref", + self, extract::relatedItem, meta::href, href); +} + +// Get, by href, const +Handle2ConstRelatedItem +RelatedItemsRelatedItemGetByHrefConst( + ConstHandle2ConstRelatedItems self, + const UTF8Text href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemGetByHrefConst", + self, extract::relatedItem, meta::href, href); +} + +// Get, by href, non-const +Handle2RelatedItem +RelatedItemsRelatedItemGetByHref( + ConstHandle2RelatedItems self, + const UTF8Text href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemGetByHref", + self, extract::relatedItem, meta::href, href); +} + +// Set, by href +void +RelatedItemsRelatedItemSetByHref( + ConstHandle2RelatedItems self, + const UTF8Text href, + ConstHandle2ConstRelatedItem relatedItem +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemSetByHref", + self, extract::relatedItem, meta::href, href, relatedItem); +} + +// Has, by relationType +int +RelatedItemsRelatedItemHasByRelationType( + ConstHandle2ConstRelatedItems self, + const enums::RelationType relationType +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemHasByRelationType", + self, extract::relatedItem, meta::relationType, relationType); +} + +// Get, by relationType, const +Handle2ConstRelatedItem +RelatedItemsRelatedItemGetByRelationTypeConst( + ConstHandle2ConstRelatedItems self, + const enums::RelationType relationType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemGetByRelationTypeConst", + self, extract::relatedItem, meta::relationType, relationType); +} + +// Get, by relationType, non-const +Handle2RelatedItem +RelatedItemsRelatedItemGetByRelationType( + ConstHandle2RelatedItems self, + const enums::RelationType relationType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemGetByRelationType", + self, extract::relatedItem, meta::relationType, relationType); +} + +// Set, by relationType +void +RelatedItemsRelatedItemSetByRelationType( + ConstHandle2RelatedItems self, + const enums::RelationType relationType, + ConstHandle2ConstRelatedItem relatedItem +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"RelatedItemSetByRelationType", + self, extract::relatedItem, meta::relationType, relationType, relatedItem); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/RelatedItems/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems.h new file mode 100644 index 000000000..67fe0e405 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems.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. +// +// RelatedItems is the basic handle type in this file. Example: +// // Create a default RelatedItems object: +// RelatedItems handle = RelatedItemsDefault(); +// Functions involving RelatedItems are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_RELATEDITEMS +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_RELATEDITEMS + +#include "GNDStk.h" +#include "v2.0/documentation/RelatedItem.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RelatedItemsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ RelatedItems +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RelatedItemsClass *RelatedItems; + +// --- Const-aware handles. +typedef const struct RelatedItemsClass *const ConstHandle2ConstRelatedItems; +typedef struct RelatedItemsClass *const ConstHandle2RelatedItems; +typedef const struct RelatedItemsClass * Handle2ConstRelatedItems; +typedef struct RelatedItemsClass * Handle2RelatedItems; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRelatedItems +RelatedItemsDefaultConst(); + +// +++ Create, default +extern_c Handle2RelatedItems +RelatedItemsDefault(); + +// --- Create, general, const +extern_c Handle2ConstRelatedItems +RelatedItemsCreateConst( + ConstHandle2RelatedItem *const relatedItem, const size_t relatedItemSize +); + +// +++ Create, general +extern_c Handle2RelatedItems +RelatedItemsCreate( + ConstHandle2RelatedItem *const relatedItem, const size_t relatedItemSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RelatedItemsAssign(ConstHandle2RelatedItems self, ConstHandle2ConstRelatedItems from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RelatedItemsDelete(ConstHandle2ConstRelatedItems self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RelatedItemsRead(ConstHandle2RelatedItems self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RelatedItemsWrite(ConstHandle2ConstRelatedItems self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RelatedItemsPrint(ConstHandle2ConstRelatedItems self); + +// +++ Print to standard output, as XML +extern_c int +RelatedItemsPrintXML(ConstHandle2ConstRelatedItems self); + +// +++ Print to standard output, as JSON +extern_c int +RelatedItemsPrintJSON(ConstHandle2ConstRelatedItems self); + + +// ----------------------------------------------------------------------------- +// Child: relatedItem +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RelatedItemsRelatedItemHas(ConstHandle2ConstRelatedItems self); + +// +++ Clear +extern_c void +RelatedItemsRelatedItemClear(ConstHandle2RelatedItems self); + +// +++ Size +extern_c size_t +RelatedItemsRelatedItemSize(ConstHandle2ConstRelatedItems self); + +// +++ Add +extern_c void +RelatedItemsRelatedItemAdd(ConstHandle2RelatedItems self, ConstHandle2ConstRelatedItem relatedItem); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstRelatedItem +RelatedItemsRelatedItemGetConst(ConstHandle2ConstRelatedItems self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2RelatedItem +RelatedItemsRelatedItemGet(ConstHandle2RelatedItems self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +RelatedItemsRelatedItemSet( + ConstHandle2RelatedItems self, + const size_t index_, + ConstHandle2ConstRelatedItem relatedItem +); + +// +++ Has, by name +extern_c int +RelatedItemsRelatedItemHasByName( + ConstHandle2ConstRelatedItems self, + const UTF8Text name +); + +// --- Get, by name, const +extern_c Handle2ConstRelatedItem +RelatedItemsRelatedItemGetByNameConst( + ConstHandle2ConstRelatedItems self, + const UTF8Text name +); + +// +++ Get, by name, non-const +extern_c Handle2RelatedItem +RelatedItemsRelatedItemGetByName( + ConstHandle2RelatedItems self, + const UTF8Text name +); + +// +++ Set, by name +extern_c void +RelatedItemsRelatedItemSetByName( + ConstHandle2RelatedItems self, + const UTF8Text name, + ConstHandle2ConstRelatedItem relatedItem +); + +// +++ Has, by href +extern_c int +RelatedItemsRelatedItemHasByHref( + ConstHandle2ConstRelatedItems self, + const UTF8Text href +); + +// --- Get, by href, const +extern_c Handle2ConstRelatedItem +RelatedItemsRelatedItemGetByHrefConst( + ConstHandle2ConstRelatedItems self, + const UTF8Text href +); + +// +++ Get, by href, non-const +extern_c Handle2RelatedItem +RelatedItemsRelatedItemGetByHref( + ConstHandle2RelatedItems self, + const UTF8Text href +); + +// +++ Set, by href +extern_c void +RelatedItemsRelatedItemSetByHref( + ConstHandle2RelatedItems self, + const UTF8Text href, + ConstHandle2ConstRelatedItem relatedItem +); + +// +++ Has, by relationType +extern_c int +RelatedItemsRelatedItemHasByRelationType( + ConstHandle2ConstRelatedItems self, + const enums::RelationType relationType +); + +// --- Get, by relationType, const +extern_c Handle2ConstRelatedItem +RelatedItemsRelatedItemGetByRelationTypeConst( + ConstHandle2ConstRelatedItems self, + const enums::RelationType relationType +); + +// +++ Get, by relationType, non-const +extern_c Handle2RelatedItem +RelatedItemsRelatedItemGetByRelationType( + ConstHandle2RelatedItems self, + const enums::RelationType relationType +); + +// +++ Set, by relationType +extern_c void +RelatedItemsRelatedItemSetByRelationType( + ConstHandle2RelatedItems self, + const enums::RelationType relationType, + ConstHandle2ConstRelatedItem relatedItem +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/RelatedItems/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/RelatedItems/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Title.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Title.cpp new file mode 100644 index 000000000..a8a75b274 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Title.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Title.hpp" +#include "Title.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = TitleClass; +using CPP = multigroup::Title; + +static const std::string CLASSNAME = "Title"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTitle +TitleDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Title +TitleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTitle +TitleCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Title handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label + ); + return handle; +} + +// Create, general +Handle2Title +TitleCreate( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Title handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +TitleIntsClear(ConstHandle2Title self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +TitleIntsSize(ConstHandle2ConstTitle self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +TitleIntsGet(ConstHandle2ConstTitle self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +TitleIntsSet(ConstHandle2Title self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +TitleIntsGetArrayConst(ConstHandle2ConstTitle self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +TitleIntsGetArray(ConstHandle2Title self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +TitleIntsSetArray(ConstHandle2Title self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +TitleUnsignedsClear(ConstHandle2Title self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +TitleUnsignedsSize(ConstHandle2ConstTitle self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +TitleUnsignedsGet(ConstHandle2ConstTitle self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +TitleUnsignedsSet(ConstHandle2Title self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +TitleUnsignedsGetArrayConst(ConstHandle2ConstTitle self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +TitleUnsignedsGetArray(ConstHandle2Title self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +TitleUnsignedsSetArray(ConstHandle2Title self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +TitleFloatsClear(ConstHandle2Title self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +TitleFloatsSize(ConstHandle2ConstTitle self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +TitleFloatsGet(ConstHandle2ConstTitle self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +TitleFloatsSet(ConstHandle2Title self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +TitleFloatsGetArrayConst(ConstHandle2ConstTitle self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +TitleFloatsGetArray(ConstHandle2Title self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +TitleFloatsSetArray(ConstHandle2Title self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +TitleDoublesClear(ConstHandle2Title self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +TitleDoublesSize(ConstHandle2ConstTitle self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +TitleDoublesGet(ConstHandle2ConstTitle self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +TitleDoublesSet(ConstHandle2Title self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +TitleDoublesGetArrayConst(ConstHandle2ConstTitle self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +TitleDoublesGetArray(ConstHandle2Title self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +TitleDoublesSetArray(ConstHandle2Title self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +TitleEncodingHas(ConstHandle2ConstTitle self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +TitleEncodingGet(ConstHandle2ConstTitle self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +TitleEncodingSet(ConstHandle2Title self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +TitleMarkupHas(ConstHandle2ConstTitle self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +TitleMarkupGet(ConstHandle2ConstTitle self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +TitleMarkupSet(ConstHandle2Title self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +TitleLabelHas(ConstHandle2ConstTitle self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +TitleLabelGet(ConstHandle2ConstTitle self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +TitleLabelSet(ConstHandle2Title self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Title/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Title.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Title.h new file mode 100644 index 000000000..8a34c3e3b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Title.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. +// +// 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_TEST_V2_0_DOCUMENTATION_TITLE +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_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 +extern_c Handle2Title +TitleDefault(); + +// --- Create, general, const +extern_c Handle2ConstTitle +TitleCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +); + +// +++ Create, general +extern_c Handle2Title +TitleCreate( + const XMLName encoding, + const char *const markup, + const XMLName 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 +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); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +TitleIntsClear(ConstHandle2Title self); + +// +++ Get size +extern_c size_t +TitleIntsSize(ConstHandle2ConstTitle self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +TitleIntsGet(ConstHandle2ConstTitle self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +TitleIntsSet(ConstHandle2Title self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +TitleIntsGetArrayConst(ConstHandle2ConstTitle self); + +// +++ Get pointer to existing values, non-const +extern_c int * +TitleIntsGetArray(ConstHandle2Title self); + +// +++ Set completely new values and size +extern_c void +TitleIntsSetArray(ConstHandle2Title self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +TitleUnsignedsClear(ConstHandle2Title self); + +// +++ Get size +extern_c size_t +TitleUnsignedsSize(ConstHandle2ConstTitle self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +TitleUnsignedsGet(ConstHandle2ConstTitle self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +TitleUnsignedsSet(ConstHandle2Title self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +TitleUnsignedsGetArrayConst(ConstHandle2ConstTitle self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +TitleUnsignedsGetArray(ConstHandle2Title self); + +// +++ Set completely new values and size +extern_c void +TitleUnsignedsSetArray(ConstHandle2Title self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +TitleFloatsClear(ConstHandle2Title self); + +// +++ Get size +extern_c size_t +TitleFloatsSize(ConstHandle2ConstTitle self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +TitleFloatsGet(ConstHandle2ConstTitle self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +TitleFloatsSet(ConstHandle2Title self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +TitleFloatsGetArrayConst(ConstHandle2ConstTitle self); + +// +++ Get pointer to existing values, non-const +extern_c float * +TitleFloatsGetArray(ConstHandle2Title self); + +// +++ Set completely new values and size +extern_c void +TitleFloatsSetArray(ConstHandle2Title self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +TitleDoublesClear(ConstHandle2Title self); + +// +++ Get size +extern_c size_t +TitleDoublesSize(ConstHandle2ConstTitle self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +TitleDoublesGet(ConstHandle2ConstTitle self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +TitleDoublesSet(ConstHandle2Title self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +TitleDoublesGetArrayConst(ConstHandle2ConstTitle self); + +// +++ Get pointer to existing values, non-const +extern_c double * +TitleDoublesGetArray(ConstHandle2Title self); + +// +++ Set completely new values and size +extern_c void +TitleDoublesSetArray(ConstHandle2Title self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TitleEncodingHas(ConstHandle2ConstTitle self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TitleEncodingGet(ConstHandle2ConstTitle self); + +// +++ Set +extern_c void +TitleEncodingSet(ConstHandle2Title self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TitleMarkupHas(ConstHandle2ConstTitle self); + +// +++ Get +// +++ Returns by value +extern_c const char * +TitleMarkupGet(ConstHandle2ConstTitle self); + +// +++ Set +extern_c void +TitleMarkupSet(ConstHandle2Title self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TitleLabelHas(ConstHandle2ConstTitle self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TitleLabelGet(ConstHandle2ConstTitle self); + +// +++ Set +extern_c void +TitleLabelSet(ConstHandle2Title self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Title/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Title/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Title/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Title/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Title/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Version.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Version.cpp new file mode 100644 index 000000000..0c1b073d9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Version.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/documentation/Version.hpp" +#include "Version.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = VersionClass; +using CPP = multigroup::Version; + +static const std::string CLASSNAME = "Version"; + +namespace extract { + static auto encoding = [](auto &obj) { return &obj.encoding; }; + static auto markup = [](auto &obj) { return &obj.markup; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstVersion +VersionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Version +VersionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstVersion +VersionCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Version handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + encoding, + markup, + label + ); + return handle; +} + +// Create, general +Handle2Version +VersionCreate( + const XMLName encoding, + const char *const markup, + const XMLName label +) { + ConstHandle2Version handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + encoding, + markup, + 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 +VersionAssign(ConstHandle2Version self, ConstHandle2ConstVersion from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +VersionDelete(ConstHandle2ConstVersion self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +VersionRead(ConstHandle2Version self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +VersionWrite(ConstHandle2ConstVersion self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +VersionPrint(ConstHandle2ConstVersion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +VersionPrintXML(ConstHandle2ConstVersion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +VersionPrintJSON(ConstHandle2ConstVersion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +VersionIntsClear(ConstHandle2Version self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +VersionIntsSize(ConstHandle2ConstVersion self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +VersionIntsGet(ConstHandle2ConstVersion self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +VersionIntsSet(ConstHandle2Version self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +VersionIntsGetArrayConst(ConstHandle2ConstVersion self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +VersionIntsGetArray(ConstHandle2Version self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +VersionIntsSetArray(ConstHandle2Version self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +VersionUnsignedsClear(ConstHandle2Version self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +VersionUnsignedsSize(ConstHandle2ConstVersion self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +VersionUnsignedsGet(ConstHandle2ConstVersion self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +VersionUnsignedsSet(ConstHandle2Version self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +VersionUnsignedsGetArrayConst(ConstHandle2ConstVersion self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +VersionUnsignedsGetArray(ConstHandle2Version self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +VersionUnsignedsSetArray(ConstHandle2Version self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +VersionFloatsClear(ConstHandle2Version self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +VersionFloatsSize(ConstHandle2ConstVersion self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +VersionFloatsGet(ConstHandle2ConstVersion self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +VersionFloatsSet(ConstHandle2Version self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +VersionFloatsGetArrayConst(ConstHandle2ConstVersion self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +VersionFloatsGetArray(ConstHandle2Version self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +VersionFloatsSetArray(ConstHandle2Version self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +VersionDoublesClear(ConstHandle2Version self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +VersionDoublesSize(ConstHandle2ConstVersion self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +VersionDoublesGet(ConstHandle2ConstVersion self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +VersionDoublesSet(ConstHandle2Version self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +VersionDoublesGetArrayConst(ConstHandle2ConstVersion self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +VersionDoublesGetArray(ConstHandle2Version self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +VersionDoublesSetArray(ConstHandle2Version self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// Has +int +VersionEncodingHas(ConstHandle2ConstVersion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EncodingHas", self, extract::encoding); +} + +// Get +// Returns by value +XMLName +VersionEncodingGet(ConstHandle2ConstVersion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EncodingGet", self, extract::encoding); +} + +// Set +void +VersionEncodingSet(ConstHandle2Version self, const XMLName encoding) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EncodingSet", self, extract::encoding, encoding); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// Has +int +VersionMarkupHas(ConstHandle2ConstVersion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MarkupHas", self, extract::markup); +} + +// Get +// Returns by value +const char * +VersionMarkupGet(ConstHandle2ConstVersion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MarkupGet", self, extract::markup); +} + +// Set +void +VersionMarkupSet(ConstHandle2Version self, const char *const markup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MarkupSet", self, extract::markup, markup); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +VersionLabelHas(ConstHandle2ConstVersion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +VersionLabelGet(ConstHandle2ConstVersion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +VersionLabelSet(ConstHandle2Version self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Version/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Version.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Version.h new file mode 100644 index 000000000..25c7eab92 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/documentation/Version.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. +// +// Version is the basic handle type in this file. Example: +// // Create a default Version object: +// Version handle = VersionDefault(); +// Functions involving Version are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_DOCUMENTATION_VERSION +#define C_INTERFACE_TEST_V2_0_DOCUMENTATION_VERSION + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct VersionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Version +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct VersionClass *Version; + +// --- Const-aware handles. +typedef const struct VersionClass *const ConstHandle2ConstVersion; +typedef struct VersionClass *const ConstHandle2Version; +typedef const struct VersionClass * Handle2ConstVersion; +typedef struct VersionClass * Handle2Version; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstVersion +VersionDefaultConst(); + +// +++ Create, default +extern_c Handle2Version +VersionDefault(); + +// --- Create, general, const +extern_c Handle2ConstVersion +VersionCreateConst( + const XMLName encoding, + const char *const markup, + const XMLName label +); + +// +++ Create, general +extern_c Handle2Version +VersionCreate( + const XMLName encoding, + const char *const markup, + const XMLName 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 +VersionAssign(ConstHandle2Version self, ConstHandle2ConstVersion from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +VersionDelete(ConstHandle2ConstVersion self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +VersionRead(ConstHandle2Version self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +VersionWrite(ConstHandle2ConstVersion self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +VersionPrint(ConstHandle2ConstVersion self); + +// +++ Print to standard output, as XML +extern_c int +VersionPrintXML(ConstHandle2ConstVersion self); + +// +++ Print to standard output, as JSON +extern_c int +VersionPrintJSON(ConstHandle2ConstVersion self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +VersionIntsClear(ConstHandle2Version self); + +// +++ Get size +extern_c size_t +VersionIntsSize(ConstHandle2ConstVersion self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +VersionIntsGet(ConstHandle2ConstVersion self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +VersionIntsSet(ConstHandle2Version self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +VersionIntsGetArrayConst(ConstHandle2ConstVersion self); + +// +++ Get pointer to existing values, non-const +extern_c int * +VersionIntsGetArray(ConstHandle2Version self); + +// +++ Set completely new values and size +extern_c void +VersionIntsSetArray(ConstHandle2Version self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +VersionUnsignedsClear(ConstHandle2Version self); + +// +++ Get size +extern_c size_t +VersionUnsignedsSize(ConstHandle2ConstVersion self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +VersionUnsignedsGet(ConstHandle2ConstVersion self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +VersionUnsignedsSet(ConstHandle2Version self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +VersionUnsignedsGetArrayConst(ConstHandle2ConstVersion self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +VersionUnsignedsGetArray(ConstHandle2Version self); + +// +++ Set completely new values and size +extern_c void +VersionUnsignedsSetArray(ConstHandle2Version self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +VersionFloatsClear(ConstHandle2Version self); + +// +++ Get size +extern_c size_t +VersionFloatsSize(ConstHandle2ConstVersion self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +VersionFloatsGet(ConstHandle2ConstVersion self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +VersionFloatsSet(ConstHandle2Version self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +VersionFloatsGetArrayConst(ConstHandle2ConstVersion self); + +// +++ Get pointer to existing values, non-const +extern_c float * +VersionFloatsGetArray(ConstHandle2Version self); + +// +++ Set completely new values and size +extern_c void +VersionFloatsSetArray(ConstHandle2Version self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +VersionDoublesClear(ConstHandle2Version self); + +// +++ Get size +extern_c size_t +VersionDoublesSize(ConstHandle2ConstVersion self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +VersionDoublesGet(ConstHandle2ConstVersion self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +VersionDoublesSet(ConstHandle2Version self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +VersionDoublesGetArrayConst(ConstHandle2ConstVersion self); + +// +++ Get pointer to existing values, non-const +extern_c double * +VersionDoublesGetArray(ConstHandle2Version self); + +// +++ Set completely new values and size +extern_c void +VersionDoublesSetArray(ConstHandle2Version self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: encoding +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +VersionEncodingHas(ConstHandle2ConstVersion self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +VersionEncodingGet(ConstHandle2ConstVersion self); + +// +++ Set +extern_c void +VersionEncodingSet(ConstHandle2Version self, const XMLName encoding); + + +// ----------------------------------------------------------------------------- +// Metadatum: markup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +VersionMarkupHas(ConstHandle2ConstVersion self); + +// +++ Get +// +++ Returns by value +extern_c const char * +VersionMarkupGet(ConstHandle2ConstVersion self); + +// +++ Set +extern_c void +VersionMarkupSet(ConstHandle2Version self, const char *const markup); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +VersionLabelHas(ConstHandle2ConstVersion self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +VersionLabelGet(ConstHandle2ConstVersion self); + +// +++ Set +extern_c void +VersionLabelSet(ConstHandle2Version self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/documentation/Version/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Version/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/documentation/Version/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/documentation/Version/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/documentation/Version/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/extra/Double.cpp b/standards/gnds-2.0/test/c/src/v2.0/extra/Double.cpp new file mode 100644 index 000000000..16deee65f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/extra/Double.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/extra/Double.hpp" +#include "Double.h" + +using namespace njoy::GNDStk; +using namespace test::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 unit = [](auto &obj) { return &obj.unit; }; + 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 +Handle2Double +DoubleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDouble +DoubleCreateConst( + const XMLName label, + const XMLName unit, + const Float64 value +) { + ConstHandle2Double handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value + ); + return handle; +} + +// Create, general +Handle2Double +DoubleCreate( + const XMLName label, + const XMLName unit, + const Float64 value +) { + ConstHandle2Double handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + 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: label +// ----------------------------------------------------------------------------- + +// Has +int +DoubleLabelHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +DoubleLabelGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +DoubleLabelSet(ConstHandle2Double self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +DoubleUnitHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +DoubleUnitGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +DoubleUnitSet(ConstHandle2Double self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +DoubleValueHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +DoubleValueGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +DoubleValueSet(ConstHandle2Double self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/extra/Double/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/extra/Double.h b/standards/gnds-2.0/test/c/src/v2.0/extra/Double.h new file mode 100644 index 000000000..6a90306e7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/extra/Double.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. +// +// 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_TEST_V2_0_EXTRA_DOUBLE +#define C_INTERFACE_TEST_V2_0_EXTRA_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 +extern_c Handle2Double +DoubleDefault(); + +// --- Create, general, const +extern_c Handle2ConstDouble +DoubleCreateConst( + const XMLName label, + const XMLName unit, + const Float64 value +); + +// +++ Create, general +extern_c Handle2Double +DoubleCreate( + const XMLName label, + const XMLName unit, + const Float64 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleLabelHas(ConstHandle2ConstDouble self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +DoubleLabelGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleLabelSet(ConstHandle2Double self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleUnitHas(ConstHandle2ConstDouble self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +DoubleUnitGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleUnitSet(ConstHandle2Double self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleValueHas(ConstHandle2ConstDouble self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +DoubleValueGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleValueSet(ConstHandle2Double self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/extra/Double/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/extra/Double/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/extra/Double/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/extra/Double/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/extra/Double/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty.cpp b/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty.cpp new file mode 100644 index 000000000..631b66352 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty.cpp @@ -0,0 +1,353 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/extra/Uncertainty.hpp" +#include "Uncertainty.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = UncertaintyClass; +using CPP = multigroup::Uncertainty; + +static const std::string CLASSNAME = "Uncertainty"; + +namespace extract { + static auto standard = [](auto &obj) { return &obj.standard; }; + static auto logNormal = [](auto &obj) { return &obj.logNormal; }; + static auto confidenceIntervals = [](auto &obj) { return &obj.confidenceIntervals; }; + static auto covariance = [](auto &obj) { return &obj.covariance; }; + static auto listOfCovariances = [](auto &obj) { return &obj.listOfCovariances; }; +} + +using CPPStandard = containers::Standard; +using CPPLogNormal = containers::LogNormal; +using CPPConfidenceIntervals = containers::ConfidenceIntervals; +using CPPCovariance = containers::Covariance; +using CPPListOfCovariances = containers::ListOfCovariances; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUncertainty +UncertaintyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Uncertainty +UncertaintyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUncertainty +UncertaintyCreateConst( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstListOfCovariances listOfCovariances +) { + ConstHandle2Uncertainty handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(standard), + detail::tocpp(logNormal), + detail::tocpp(confidenceIntervals), + detail::tocpp(covariance), + detail::tocpp(listOfCovariances) + ); + return handle; +} + +// Create, general +Handle2Uncertainty +UncertaintyCreate( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstListOfCovariances listOfCovariances +) { + ConstHandle2Uncertainty handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(standard), + detail::tocpp(logNormal), + detail::tocpp(confidenceIntervals), + detail::tocpp(covariance), + detail::tocpp(listOfCovariances) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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: logNormal +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyLogNormalHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LogNormalHas", self, extract::logNormal); +} + +// Get, const +Handle2ConstLogNormal +UncertaintyLogNormalGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LogNormalGetConst", self, extract::logNormal); +} + +// Get, non-const +Handle2LogNormal +UncertaintyLogNormalGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LogNormalGet", self, extract::logNormal); +} + +// Set +void +UncertaintyLogNormalSet(ConstHandle2Uncertainty self, ConstHandle2ConstLogNormal logNormal) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LogNormalSet", self, extract::logNormal, logNormal); +} + + +// ----------------------------------------------------------------------------- +// Child: confidenceIntervals +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyConfidenceIntervalsHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsHas", self, extract::confidenceIntervals); +} + +// Get, const +Handle2ConstConfidenceIntervals +UncertaintyConfidenceIntervalsGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsGetConst", self, extract::confidenceIntervals); +} + +// Get, non-const +Handle2ConfidenceIntervals +UncertaintyConfidenceIntervalsGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsGet", self, extract::confidenceIntervals); +} + +// Set +void +UncertaintyConfidenceIntervalsSet(ConstHandle2Uncertainty self, ConstHandle2ConstConfidenceIntervals confidenceIntervals) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsSet", self, extract::confidenceIntervals, confidenceIntervals); +} + + +// ----------------------------------------------------------------------------- +// 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: 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/extra/Uncertainty/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty.h b/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty.h new file mode 100644 index 000000000..bc489687f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty.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. +// +// 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_TEST_V2_0_EXTRA_UNCERTAINTY +#define C_INTERFACE_TEST_V2_0_EXTRA_UNCERTAINTY + +#include "GNDStk.h" +#include "v2.0/containers/Standard.h" +#include "v2.0/containers/LogNormal.h" +#include "v2.0/containers/ConfidenceIntervals.h" +#include "v2.0/containers/Covariance.h" +#include "v2.0/containers/ListOfCovariances.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 +extern_c Handle2Uncertainty +UncertaintyDefault(); + +// --- Create, general, const +extern_c Handle2ConstUncertainty +UncertaintyCreateConst( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstListOfCovariances listOfCovariances +); + +// +++ Create, general +extern_c Handle2Uncertainty +UncertaintyCreate( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstListOfCovariances listOfCovariances +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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: logNormal +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyLogNormalHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstLogNormal +UncertaintyLogNormalGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2LogNormal +UncertaintyLogNormalGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyLogNormalSet(ConstHandle2Uncertainty self, ConstHandle2ConstLogNormal logNormal); + + +// ----------------------------------------------------------------------------- +// Child: confidenceIntervals +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyConfidenceIntervalsHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstConfidenceIntervals +UncertaintyConfidenceIntervalsGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2ConfidenceIntervals +UncertaintyConfidenceIntervalsGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyConfidenceIntervalsSet(ConstHandle2Uncertainty self, ConstHandle2ConstConfidenceIntervals confidenceIntervals); + + +// ----------------------------------------------------------------------------- +// 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: 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/extra/Uncertainty/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/extra/Uncertainty/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutron.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutron.cpp new file mode 100644 index 000000000..b06941dcc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutron.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionFragmentData/DelayedNeutron.hpp" +#include "DelayedNeutron.h" + +using namespace njoy::GNDStk; +using namespace test::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 = fissionFragmentData::Rate; +using CPPProduct = common::Product; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedNeutron +DelayedNeutronDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2DelayedNeutron +DelayedNeutronDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDelayedNeutron +DelayedNeutronCreateConst( + const XMLName label, + ConstHandle2ConstRate rate, + ConstHandle2ConstProduct product +) { + ConstHandle2DelayedNeutron handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(rate), + detail::tocpp(product) + ); + return handle; +} + +// Create, general +Handle2DelayedNeutron +DelayedNeutronCreate( + const XMLName 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 +XMLName +DelayedNeutronLabelGet(ConstHandle2ConstDelayedNeutron self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +DelayedNeutronLabelSet(ConstHandle2DelayedNeutron self, const XMLName 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/fissionFragmentData/DelayedNeutron/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutron.h b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutron.h new file mode 100644 index 000000000..b380a41b4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/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_TEST_V2_0_FISSIONFRAGMENTDATA_DELAYEDNEUTRON +#define C_INTERFACE_TEST_V2_0_FISSIONFRAGMENTDATA_DELAYEDNEUTRON + +#include "GNDStk.h" +#include "v2.0/fissionFragmentData/Rate.h" +#include "v2.0/common/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 +extern_c Handle2DelayedNeutron +DelayedNeutronDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedNeutron +DelayedNeutronCreateConst( + const XMLName label, + ConstHandle2ConstRate rate, + ConstHandle2ConstProduct product +); + +// +++ Create, general +extern_c Handle2DelayedNeutron +DelayedNeutronCreate( + const XMLName 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 XMLName +DelayedNeutronLabelGet(ConstHandle2ConstDelayedNeutron self); + +// +++ Set +extern_c void +DelayedNeutronLabelSet(ConstHandle2DelayedNeutron self, const XMLName 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/fissionFragmentData/DelayedNeutron/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutron/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutron/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutron/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutron/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons.cpp new file mode 100644 index 000000000..ec21fea8f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionFragmentData/DelayedNeutrons.hpp" +#include "DelayedNeutrons.h" + +using namespace njoy::GNDStk; +using namespace test::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 = fissionFragmentData::DelayedNeutron; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedNeutrons +DelayedNeutronsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +DelayedNeutronsDelayedNeutronHasByLabel( + ConstHandle2ConstDelayedNeutrons self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DelayedNeutronHasByLabel", + self, extract::delayedNeutron, meta::label, label); +} + +// Get, by label, const +Handle2ConstDelayedNeutron +DelayedNeutronsDelayedNeutronGetByLabelConst( + ConstHandle2ConstDelayedNeutrons self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DelayedNeutronGetByLabelConst", + self, extract::delayedNeutron, meta::label, label); +} + +// Get, by label, non-const +Handle2DelayedNeutron +DelayedNeutronsDelayedNeutronGetByLabel( + ConstHandle2DelayedNeutrons self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DelayedNeutronGetByLabel", + self, extract::delayedNeutron, meta::label, label); +} + +// Set, by label +void +DelayedNeutronsDelayedNeutronSetByLabel( + ConstHandle2DelayedNeutrons self, + const XMLName label, + ConstHandle2ConstDelayedNeutron delayedNeutron +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DelayedNeutronSetByLabel", + self, extract::delayedNeutron, meta::label, label, delayedNeutron); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionFragmentData/DelayedNeutrons/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons.h b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons.h new file mode 100644 index 000000000..75aa57751 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_FISSIONFRAGMENTDATA_DELAYEDNEUTRONS +#define C_INTERFACE_TEST_V2_0_FISSIONFRAGMENTDATA_DELAYEDNEUTRONS + +#include "GNDStk.h" +#include "v2.0/fissionFragmentData/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 +extern_c Handle2DelayedNeutrons +DelayedNeutronsDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedNeutrons +DelayedNeutronsCreateConst( + ConstHandle2DelayedNeutron *const delayedNeutron, const size_t delayedNeutronSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +DelayedNeutronsDelayedNeutronHasByLabel( + ConstHandle2ConstDelayedNeutrons self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstDelayedNeutron +DelayedNeutronsDelayedNeutronGetByLabelConst( + ConstHandle2ConstDelayedNeutrons self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2DelayedNeutron +DelayedNeutronsDelayedNeutronGetByLabel( + ConstHandle2DelayedNeutrons self, + const XMLName label +); + +// +++ Set, by label +extern_c void +DelayedNeutronsDelayedNeutronSetByLabel( + ConstHandle2DelayedNeutrons self, + const XMLName label, + ConstHandle2ConstDelayedNeutron delayedNeutron +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionFragmentData/DelayedNeutrons/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/DelayedNeutrons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/FissionFragmentData.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/FissionFragmentData.cpp new file mode 100644 index 000000000..66bbc733b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/FissionFragmentData.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionFragmentData/FissionFragmentData.hpp" +#include "FissionFragmentData.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = FissionFragmentDataClass; +using CPP = multigroup::FissionFragmentData; + +static const std::string CLASSNAME = "FissionFragmentData"; + +namespace extract { + static auto delayedNeutrons = [](auto &obj) { return &obj.delayedNeutrons; }; + static auto fissionEnergyReleased = [](auto &obj) { return &obj.fissionEnergyReleased; }; + static auto productYields = [](auto &obj) { return &obj.productYields; }; +} + +using CPPDelayedNeutrons = fissionFragmentData::DelayedNeutrons; +using CPPFissionEnergyReleased = fissionTransport::FissionEnergyReleased; +using CPPProductYields = fpy::ProductYields; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFissionFragmentData +FissionFragmentDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2FissionFragmentData +FissionFragmentDataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFissionFragmentData +FissionFragmentDataCreateConst( + ConstHandle2ConstDelayedNeutrons delayedNeutrons, + ConstHandle2ConstFissionEnergyReleased fissionEnergyReleased, + ConstHandle2ConstProductYields productYields +) { + ConstHandle2FissionFragmentData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(delayedNeutrons), + detail::tocpp(fissionEnergyReleased), + detail::tocpp(productYields) + ); + return handle; +} + +// Create, general +Handle2FissionFragmentData +FissionFragmentDataCreate( + ConstHandle2ConstDelayedNeutrons delayedNeutrons, + ConstHandle2ConstFissionEnergyReleased fissionEnergyReleased, + ConstHandle2ConstProductYields productYields +) { + ConstHandle2FissionFragmentData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(delayedNeutrons), + detail::tocpp(fissionEnergyReleased), + detail::tocpp(productYields) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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: fissionEnergyReleased +// ----------------------------------------------------------------------------- + +// Has +int +FissionFragmentDataFissionEnergyReleasedHas(ConstHandle2ConstFissionFragmentData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionEnergyReleasedHas", self, extract::fissionEnergyReleased); +} + +// Get, const +Handle2ConstFissionEnergyReleased +FissionFragmentDataFissionEnergyReleasedGetConst(ConstHandle2ConstFissionFragmentData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionEnergyReleasedGetConst", self, extract::fissionEnergyReleased); +} + +// Get, non-const +Handle2FissionEnergyReleased +FissionFragmentDataFissionEnergyReleasedGet(ConstHandle2FissionFragmentData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionEnergyReleasedGet", self, extract::fissionEnergyReleased); +} + +// Set +void +FissionFragmentDataFissionEnergyReleasedSet(ConstHandle2FissionFragmentData self, ConstHandle2ConstFissionEnergyReleased fissionEnergyReleased) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionEnergyReleasedSet", self, extract::fissionEnergyReleased, fissionEnergyReleased); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionFragmentData/FissionFragmentData/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/FissionFragmentData.h b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/FissionFragmentData.h new file mode 100644 index 000000000..988d34d55 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/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_TEST_V2_0_FISSIONFRAGMENTDATA_FISSIONFRAGMENTDATA +#define C_INTERFACE_TEST_V2_0_FISSIONFRAGMENTDATA_FISSIONFRAGMENTDATA + +#include "GNDStk.h" +#include "v2.0/fissionFragmentData/DelayedNeutrons.h" +#include "v2.0/fissionTransport/FissionEnergyReleased.h" +#include "v2.0/fpy/ProductYields.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 +extern_c Handle2FissionFragmentData +FissionFragmentDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionFragmentData +FissionFragmentDataCreateConst( + ConstHandle2ConstDelayedNeutrons delayedNeutrons, + ConstHandle2ConstFissionEnergyReleased fissionEnergyReleased, + ConstHandle2ConstProductYields productYields +); + +// +++ Create, general +extern_c Handle2FissionFragmentData +FissionFragmentDataCreate( + ConstHandle2ConstDelayedNeutrons delayedNeutrons, + ConstHandle2ConstFissionEnergyReleased fissionEnergyReleased, + ConstHandle2ConstProductYields productYields +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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: fissionEnergyReleased +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionFragmentDataFissionEnergyReleasedHas(ConstHandle2ConstFissionFragmentData self); + +// --- Get, const +extern_c Handle2ConstFissionEnergyReleased +FissionFragmentDataFissionEnergyReleasedGetConst(ConstHandle2ConstFissionFragmentData self); + +// +++ Get, non-const +extern_c Handle2FissionEnergyReleased +FissionFragmentDataFissionEnergyReleasedGet(ConstHandle2FissionFragmentData self); + +// +++ Set +extern_c void +FissionFragmentDataFissionEnergyReleasedSet(ConstHandle2FissionFragmentData self, ConstHandle2ConstFissionEnergyReleased fissionEnergyReleased); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionFragmentData/FissionFragmentData/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/FissionFragmentData/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/FissionFragmentData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/FissionFragmentData/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/FissionFragmentData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/Rate.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/Rate.cpp new file mode 100644 index 000000000..2b0f9918b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/Rate.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionFragmentData/Rate.hpp" +#include "Rate.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRate +RateDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/fissionFragmentData/Rate/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/Rate.h b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/Rate.h new file mode 100644 index 000000000..becebe366 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/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_TEST_V2_0_FISSIONFRAGMENTDATA_RATE +#define C_INTERFACE_TEST_V2_0_FISSIONFRAGMENTDATA_RATE + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2Rate +RateDefault(); + +// --- Create, general, const +extern_c Handle2ConstRate +RateCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/fissionFragmentData/Rate/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/Rate/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/Rate/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/Rate/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionFragmentData/Rate/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A.cpp new file mode 100644 index 000000000..94acff23f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/A.hpp" +#include "A.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AClass; +using CPP = multigroup::A; + +static const std::string CLASSNAME = "A"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstA +ADefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2A +ADefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstA +ACreateConst() +{ + ConstHandle2A handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2A +ACreate() +{ + ConstHandle2A 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 +AAssign(ConstHandle2A self, ConstHandle2ConstA from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ADelete(ConstHandle2ConstA self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ARead(ConstHandle2A self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AWrite(ConstHandle2ConstA self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +APrint(ConstHandle2ConstA self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +APrintXML(ConstHandle2ConstA self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +APrintJSON(ConstHandle2ConstA self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/A/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A.h new file mode 100644 index 000000000..8a46eb04b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A.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. +// +// A is the basic handle type in this file. Example: +// // Create a default A object: +// A handle = ADefault(); +// Functions involving A are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_A +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_A + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ A +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AClass *A; + +// --- Const-aware handles. +typedef const struct AClass *const ConstHandle2ConstA; +typedef struct AClass *const ConstHandle2A; +typedef const struct AClass * Handle2ConstA; +typedef struct AClass * Handle2A; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstA +ADefaultConst(); + +// +++ Create, default +extern_c Handle2A +ADefault(); + +// --- Create, general, const +extern_c Handle2ConstA +ACreateConst(); + +// +++ Create, general +extern_c Handle2A +ACreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AAssign(ConstHandle2A self, ConstHandle2ConstA from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ADelete(ConstHandle2ConstA self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ARead(ConstHandle2A self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AWrite(ConstHandle2ConstA self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +APrint(ConstHandle2ConstA self); + +// +++ Print to standard output, as XML +extern_c int +APrintXML(ConstHandle2ConstA self); + +// +++ Print to standard output, as JSON +extern_c int +APrintJSON(ConstHandle2ConstA self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/A/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/A/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B.cpp new file mode 100644 index 000000000..c4150893c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/B.hpp" +#include "B.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BClass; +using CPP = multigroup::B; + +static const std::string CLASSNAME = "B"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstB +BDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2B +BDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstB +BCreateConst() +{ + ConstHandle2B handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2B +BCreate() +{ + ConstHandle2B 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 +BAssign(ConstHandle2B self, ConstHandle2ConstB from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BDelete(ConstHandle2ConstB self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BRead(ConstHandle2B self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BWrite(ConstHandle2ConstB self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BPrint(ConstHandle2ConstB self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BPrintXML(ConstHandle2ConstB self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BPrintJSON(ConstHandle2ConstB self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/B/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B.h new file mode 100644 index 000000000..1abe7344f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B.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. +// +// B is the basic handle type in this file. Example: +// // Create a default B object: +// B handle = BDefault(); +// Functions involving B are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_B +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_B + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ B +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BClass *B; + +// --- Const-aware handles. +typedef const struct BClass *const ConstHandle2ConstB; +typedef struct BClass *const ConstHandle2B; +typedef const struct BClass * Handle2ConstB; +typedef struct BClass * Handle2B; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstB +BDefaultConst(); + +// +++ Create, default +extern_c Handle2B +BDefault(); + +// --- Create, general, const +extern_c Handle2ConstB +BCreateConst(); + +// +++ Create, general +extern_c Handle2B +BCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BAssign(ConstHandle2B self, ConstHandle2ConstB from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BDelete(ConstHandle2ConstB self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BRead(ConstHandle2B self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BWrite(ConstHandle2ConstB self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BPrint(ConstHandle2ConstB self); + +// +++ Print to standard output, as XML +extern_c int +BPrintXML(ConstHandle2ConstB self); + +// +++ Print to standard output, as JSON +extern_c int +BPrintJSON(ConstHandle2ConstB self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/B/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/B/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedBetaEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedBetaEnergy.cpp new file mode 100644 index 000000000..7b77398ba --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedBetaEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/DelayedBetaEnergy.hpp" +#include "DelayedBetaEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedBetaEnergy +DelayedBetaEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/fissionTransport/DelayedBetaEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedBetaEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedBetaEnergy.h new file mode 100644 index 000000000..6fa86faaa --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_DELAYEDBETAENERGY +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_DELAYEDBETAENERGY + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2DelayedBetaEnergy +DelayedBetaEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedBetaEnergy +DelayedBetaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/fissionTransport/DelayedBetaEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedBetaEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedBetaEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedBetaEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedBetaEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedGammaEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedGammaEnergy.cpp new file mode 100644 index 000000000..a062d74f0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedGammaEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/DelayedGammaEnergy.hpp" +#include "DelayedGammaEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedGammaEnergy +DelayedGammaEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/fissionTransport/DelayedGammaEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedGammaEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedGammaEnergy.h new file mode 100644 index 000000000..102615f7d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_DELAYEDGAMMAENERGY +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_DELAYEDGAMMAENERGY + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2DelayedGammaEnergy +DelayedGammaEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedGammaEnergy +DelayedGammaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/fissionTransport/DelayedGammaEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedGammaEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedGammaEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedGammaEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedGammaEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedNeutronKE.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedNeutronKE.cpp new file mode 100644 index 000000000..222f43914 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedNeutronKE.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/DelayedNeutronKE.hpp" +#include "DelayedNeutronKE.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = DelayedNeutronKEClass; +using CPP = multigroup::DelayedNeutronKE; + +static const std::string CLASSNAME = "DelayedNeutronKE"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPPolynomial1d = containers::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedNeutronKE +DelayedNeutronKEDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2DelayedNeutronKE +DelayedNeutronKEDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDelayedNeutronKE +DelayedNeutronKECreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2DelayedNeutronKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general +Handle2DelayedNeutronKE +DelayedNeutronKECreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2DelayedNeutronKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + 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 +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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/DelayedNeutronKE/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedNeutronKE.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedNeutronKE.h new file mode 100644 index 000000000..27a0026c8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_DELAYEDNEUTRONKE +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_DELAYEDNEUTRONKE + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Polynomial1d.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 +extern_c Handle2DelayedNeutronKE +DelayedNeutronKEDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedNeutronKE +DelayedNeutronKECreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +extern_c Handle2DelayedNeutronKE +DelayedNeutronKECreate( + ConstHandle2ConstXYs1d XYs1d, + 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 +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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/DelayedNeutronKE/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedNeutronKE/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedNeutronKE/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedNeutronKE/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/DelayedNeutronKE/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFH.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFH.cpp new file mode 100644 index 000000000..6dc4dd659 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFH.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/EFH.hpp" +#include "EFH.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EFHClass; +using CPP = multigroup::EFH; + +static const std::string CLASSNAME = "EFH"; + +namespace extract { + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEFH +EFHDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2EFH +EFHDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEFH +EFHCreateConst( + const XMLName unit, + const Float64 value +) { + ConstHandle2EFH handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + unit, + value + ); + return handle; +} + +// Create, general +Handle2EFH +EFHCreate( + const XMLName unit, + const Float64 value +) { + ConstHandle2EFH handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + unit, + 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 +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: unit +// ----------------------------------------------------------------------------- + +// Has +int +EFHUnitHas(ConstHandle2ConstEFH self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +EFHUnitGet(ConstHandle2ConstEFH self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +EFHUnitSet(ConstHandle2EFH self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +EFHValueHas(ConstHandle2ConstEFH self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +EFHValueGet(ConstHandle2ConstEFH self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +EFHValueSet(ConstHandle2EFH self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/EFH/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFH.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFH.h new file mode 100644 index 000000000..d4b6ce143 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_EFH +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_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 +extern_c Handle2EFH +EFHDefault(); + +// --- Create, general, const +extern_c Handle2ConstEFH +EFHCreateConst( + const XMLName unit, + const Float64 value +); + +// +++ Create, general +extern_c Handle2EFH +EFHCreate( + const XMLName unit, + const Float64 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 +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: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EFHUnitHas(ConstHandle2ConstEFH self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EFHUnitGet(ConstHandle2ConstEFH self); + +// +++ Set +extern_c void +EFHUnitSet(ConstHandle2EFH self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EFHValueHas(ConstHandle2ConstEFH self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +EFHValueGet(ConstHandle2ConstEFH self); + +// +++ Set +extern_c void +EFHValueSet(ConstHandle2EFH self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/EFH/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFH/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFH/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFH/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFH/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFL.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFL.cpp new file mode 100644 index 000000000..54b3e7a42 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFL.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/EFL.hpp" +#include "EFL.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EFLClass; +using CPP = multigroup::EFL; + +static const std::string CLASSNAME = "EFL"; + +namespace extract { + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEFL +EFLDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2EFL +EFLDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEFL +EFLCreateConst( + const XMLName unit, + const Float64 value +) { + ConstHandle2EFL handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + unit, + value + ); + return handle; +} + +// Create, general +Handle2EFL +EFLCreate( + const XMLName unit, + const Float64 value +) { + ConstHandle2EFL handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + unit, + 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 +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: unit +// ----------------------------------------------------------------------------- + +// Has +int +EFLUnitHas(ConstHandle2ConstEFL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +EFLUnitGet(ConstHandle2ConstEFL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +EFLUnitSet(ConstHandle2EFL self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +EFLValueHas(ConstHandle2ConstEFL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +EFLValueGet(ConstHandle2ConstEFL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +EFLValueSet(ConstHandle2EFL self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/EFL/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFL.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFL.h new file mode 100644 index 000000000..201308923 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_EFL +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_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 +extern_c Handle2EFL +EFLDefault(); + +// --- Create, general, const +extern_c Handle2ConstEFL +EFLCreateConst( + const XMLName unit, + const Float64 value +); + +// +++ Create, general +extern_c Handle2EFL +EFLCreate( + const XMLName unit, + const Float64 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 +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: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EFLUnitHas(ConstHandle2ConstEFL self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EFLUnitGet(ConstHandle2ConstEFL self); + +// +++ Set +extern_c void +EFLUnitSet(ConstHandle2EFL self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EFLValueHas(ConstHandle2ConstEFL self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +EFLValueGet(ConstHandle2ConstEFL self); + +// +++ Set +extern_c void +EFLValueSet(ConstHandle2EFL self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/EFL/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFL/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFL/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFL/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/EFL/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponent.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponent.cpp new file mode 100644 index 000000000..fa48fb424 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponent.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/FissionComponent.hpp" +#include "FissionComponent.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = FissionComponentClass; +using CPP = multigroup::FissionComponent; + +static const std::string CLASSNAME = "FissionComponent"; + +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; }; + static auto outputChannel = [](auto &obj) { return &obj.outputChannel; }; +} + +using CPPCrossSection = transport::CrossSection; +using CPPOutputChannel = transport::OutputChannel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFissionComponent +FissionComponentDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2FissionComponent +FissionComponentDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFissionComponent +FissionComponentCreateConst( + const Integer32 ENDF_MT, + const XMLName fissionGenre, + const XMLName label, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2FissionComponent handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MT, + fissionGenre, + label, + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Create, general +Handle2FissionComponent +FissionComponentCreate( + const Integer32 ENDF_MT, + const XMLName fissionGenre, + const XMLName label, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2FissionComponent handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MT, + fissionGenre, + label, + 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: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +FissionComponentENDFMTHas(ConstHandle2ConstFissionComponent self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +Integer32 +FissionComponentENDFMTGet(ConstHandle2ConstFissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +FissionComponentENDFMTSet(ConstHandle2FissionComponent self, const Integer32 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 +XMLName +FissionComponentFissionGenreGet(ConstHandle2ConstFissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionGenreGet", self, extract::fissionGenre); +} + +// Set +void +FissionComponentFissionGenreSet(ConstHandle2FissionComponent self, const XMLName fissionGenre) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionGenreSet", self, extract::fissionGenre, fissionGenre); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +FissionComponentLabelHas(ConstHandle2ConstFissionComponent self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +FissionComponentLabelGet(ConstHandle2ConstFissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +FissionComponentLabelSet(ConstHandle2FissionComponent self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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/fissionTransport/FissionComponent/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponent.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponent.h new file mode 100644 index 000000000..05ea33316 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_FISSIONCOMPONENT +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_FISSIONCOMPONENT + +#include "GNDStk.h" +#include "v2.0/transport/CrossSection.h" +#include "v2.0/transport/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 +extern_c Handle2FissionComponent +FissionComponentDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionComponent +FissionComponentCreateConst( + const Integer32 ENDF_MT, + const XMLName fissionGenre, + const XMLName label, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Create, general +extern_c Handle2FissionComponent +FissionComponentCreate( + const Integer32 ENDF_MT, + const XMLName fissionGenre, + const XMLName label, + 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: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionComponentENDFMTHas(ConstHandle2ConstFissionComponent self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +FissionComponentENDFMTGet(ConstHandle2ConstFissionComponent self); + +// +++ Set +extern_c void +FissionComponentENDFMTSet(ConstHandle2FissionComponent self, const Integer32 ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Metadatum: fissionGenre +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionComponentFissionGenreHas(ConstHandle2ConstFissionComponent self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +FissionComponentFissionGenreGet(ConstHandle2ConstFissionComponent self); + +// +++ Set +extern_c void +FissionComponentFissionGenreSet(ConstHandle2FissionComponent self, const XMLName fissionGenre); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionComponentLabelHas(ConstHandle2ConstFissionComponent self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +FissionComponentLabelGet(ConstHandle2ConstFissionComponent self); + +// +++ Set +extern_c void +FissionComponentLabelSet(ConstHandle2FissionComponent self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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/fissionTransport/FissionComponent/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponent/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponent/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponent/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponent/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents.cpp new file mode 100644 index 000000000..2688f2c14 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/FissionComponents.hpp" +#include "FissionComponents.h" + +using namespace njoy::GNDStk; +using namespace test::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 = fissionTransport::FissionComponent; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFissionComponents +FissionComponentsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by ENDF_MT +int +FissionComponentsFissionComponentHasByENDFMT( + ConstHandle2ConstFissionComponents self, + const Integer32 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 Integer32 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 Integer32 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 Integer32 ENDF_MT, + ConstHandle2ConstFissionComponent fissionComponent +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentSetByENDFMT", + self, extract::fissionComponent, meta::ENDF_MT, ENDF_MT, fissionComponent); +} + +// Has, by fissionGenre +int +FissionComponentsFissionComponentHasByFissionGenre( + ConstHandle2ConstFissionComponents self, + const XMLName fissionGenre +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentHasByFissionGenre", + self, extract::fissionComponent, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, const +Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByFissionGenreConst( + ConstHandle2ConstFissionComponents self, + const XMLName fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByFissionGenreConst", + self, extract::fissionComponent, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, non-const +Handle2FissionComponent +FissionComponentsFissionComponentGetByFissionGenre( + ConstHandle2FissionComponents self, + const XMLName fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByFissionGenre", + self, extract::fissionComponent, meta::fissionGenre, fissionGenre); +} + +// Set, by fissionGenre +void +FissionComponentsFissionComponentSetByFissionGenre( + ConstHandle2FissionComponents self, + const XMLName fissionGenre, + ConstHandle2ConstFissionComponent fissionComponent +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentSetByFissionGenre", + self, extract::fissionComponent, meta::fissionGenre, fissionGenre, fissionComponent); +} + +// Has, by label +int +FissionComponentsFissionComponentHasByLabel( + ConstHandle2ConstFissionComponents self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentHasByLabel", + self, extract::fissionComponent, meta::label, label); +} + +// Get, by label, const +Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByLabelConst( + ConstHandle2ConstFissionComponents self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByLabelConst", + self, extract::fissionComponent, meta::label, label); +} + +// Get, by label, non-const +Handle2FissionComponent +FissionComponentsFissionComponentGetByLabel( + ConstHandle2FissionComponents self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByLabel", + self, extract::fissionComponent, meta::label, label); +} + +// Set, by label +void +FissionComponentsFissionComponentSetByLabel( + ConstHandle2FissionComponents self, + const XMLName label, + ConstHandle2ConstFissionComponent fissionComponent +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentSetByLabel", + self, extract::fissionComponent, meta::label, label, fissionComponent); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/FissionComponents/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents.h new file mode 100644 index 000000000..9a497fac0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents.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. +// +// 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_TEST_V2_0_FISSIONTRANSPORT_FISSIONCOMPONENTS +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_FISSIONCOMPONENTS + +#include "GNDStk.h" +#include "v2.0/fissionTransport/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 +extern_c Handle2FissionComponents +FissionComponentsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionComponents +FissionComponentsCreateConst( + ConstHandle2FissionComponent *const fissionComponent, const size_t fissionComponentSize +); + +// +++ Create, general +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 +); + +// +++ Has, by ENDF_MT +extern_c int +FissionComponentsFissionComponentHasByENDFMT( + ConstHandle2ConstFissionComponents self, + const Integer32 ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByENDFMTConst( + ConstHandle2ConstFissionComponents self, + const Integer32 ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2FissionComponent +FissionComponentsFissionComponentGetByENDFMT( + ConstHandle2FissionComponents self, + const Integer32 ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +FissionComponentsFissionComponentSetByENDFMT( + ConstHandle2FissionComponents self, + const Integer32 ENDF_MT, + ConstHandle2ConstFissionComponent fissionComponent +); + +// +++ Has, by fissionGenre +extern_c int +FissionComponentsFissionComponentHasByFissionGenre( + ConstHandle2ConstFissionComponents self, + const XMLName fissionGenre +); + +// --- Get, by fissionGenre, const +extern_c Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByFissionGenreConst( + ConstHandle2ConstFissionComponents self, + const XMLName fissionGenre +); + +// +++ Get, by fissionGenre, non-const +extern_c Handle2FissionComponent +FissionComponentsFissionComponentGetByFissionGenre( + ConstHandle2FissionComponents self, + const XMLName fissionGenre +); + +// +++ Set, by fissionGenre +extern_c void +FissionComponentsFissionComponentSetByFissionGenre( + ConstHandle2FissionComponents self, + const XMLName fissionGenre, + ConstHandle2ConstFissionComponent fissionComponent +); + +// +++ Has, by label +extern_c int +FissionComponentsFissionComponentHasByLabel( + ConstHandle2ConstFissionComponents self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByLabelConst( + ConstHandle2ConstFissionComponents self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2FissionComponent +FissionComponentsFissionComponentGetByLabel( + ConstHandle2FissionComponents self, + const XMLName label +); + +// +++ Set, by label +extern_c void +FissionComponentsFissionComponentSetByLabel( + ConstHandle2FissionComponents self, + const XMLName label, + ConstHandle2ConstFissionComponent fissionComponent +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/FissionComponents/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionComponents/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased.cpp new file mode 100644 index 000000000..97881fdab --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased.cpp @@ -0,0 +1,560 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/FissionEnergyReleased.hpp" +#include "FissionEnergyReleased.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = FissionEnergyReleasedClass; +using CPP = multigroup::FissionEnergyReleased; + +static const std::string CLASSNAME = "FissionEnergyReleased"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto delayedBetaEnergy = [](auto &obj) { return &obj.delayedBetaEnergy; }; + static auto delayedGammaEnergy = [](auto &obj) { return &obj.delayedGammaEnergy; }; + static auto delayedNeutronKE = [](auto &obj) { return &obj.delayedNeutronKE; }; + static auto neutrinoEnergy = [](auto &obj) { return &obj.neutrinoEnergy; }; + static auto nonNeutrinoEnergy = [](auto &obj) { return &obj.nonNeutrinoEnergy; }; + static auto promptGammaEnergy = [](auto &obj) { return &obj.promptGammaEnergy; }; + static auto promptNeutronKE = [](auto &obj) { return &obj.promptNeutronKE; }; + static auto promptProductKE = [](auto &obj) { return &obj.promptProductKE; }; + static auto totalEnergy = [](auto &obj) { return &obj.totalEnergy; }; +} + +using CPPDelayedBetaEnergy = fissionTransport::DelayedBetaEnergy; +using CPPDelayedGammaEnergy = fissionTransport::DelayedGammaEnergy; +using CPPDelayedNeutronKE = fissionTransport::DelayedNeutronKE; +using CPPNeutrinoEnergy = fissionTransport::NeutrinoEnergy; +using CPPNonNeutrinoEnergy = fissionTransport::NonNeutrinoEnergy; +using CPPPromptGammaEnergy = fissionTransport::PromptGammaEnergy; +using CPPPromptNeutronKE = fissionTransport::PromptNeutronKE; +using CPPPromptProductKE = fissionTransport::PromptProductKE; +using CPPTotalEnergy = fissionTransport::TotalEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFissionEnergyReleased +FissionEnergyReleasedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2FissionEnergyReleased +FissionEnergyReleasedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFissionEnergyReleased +FissionEnergyReleasedCreateConst( + const XMLName label, + ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy, + ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy, + ConstHandle2ConstDelayedNeutronKE delayedNeutronKE, + ConstHandle2ConstNeutrinoEnergy neutrinoEnergy, + ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy, + ConstHandle2ConstPromptGammaEnergy promptGammaEnergy, + ConstHandle2ConstPromptNeutronKE promptNeutronKE, + ConstHandle2ConstPromptProductKE promptProductKE, + ConstHandle2ConstTotalEnergy totalEnergy +) { + ConstHandle2FissionEnergyReleased handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(delayedBetaEnergy), + detail::tocpp(delayedGammaEnergy), + detail::tocpp(delayedNeutronKE), + detail::tocpp(neutrinoEnergy), + detail::tocpp(nonNeutrinoEnergy), + detail::tocpp(promptGammaEnergy), + detail::tocpp(promptNeutronKE), + detail::tocpp(promptProductKE), + detail::tocpp(totalEnergy) + ); + return handle; +} + +// Create, general +Handle2FissionEnergyReleased +FissionEnergyReleasedCreate( + const XMLName label, + ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy, + ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy, + ConstHandle2ConstDelayedNeutronKE delayedNeutronKE, + ConstHandle2ConstNeutrinoEnergy neutrinoEnergy, + ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy, + ConstHandle2ConstPromptGammaEnergy promptGammaEnergy, + ConstHandle2ConstPromptNeutronKE promptNeutronKE, + ConstHandle2ConstPromptProductKE promptProductKE, + ConstHandle2ConstTotalEnergy totalEnergy +) { + ConstHandle2FissionEnergyReleased handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(delayedBetaEnergy), + detail::tocpp(delayedGammaEnergy), + detail::tocpp(delayedNeutronKE), + detail::tocpp(neutrinoEnergy), + detail::tocpp(nonNeutrinoEnergy), + detail::tocpp(promptGammaEnergy), + detail::tocpp(promptNeutronKE), + detail::tocpp(promptProductKE), + 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 +FissionEnergyReleasedAssign(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstFissionEnergyReleased from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FissionEnergyReleasedDelete(ConstHandle2ConstFissionEnergyReleased self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FissionEnergyReleasedRead(ConstHandle2FissionEnergyReleased self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FissionEnergyReleasedWrite(ConstHandle2ConstFissionEnergyReleased self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FissionEnergyReleasedPrint(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FissionEnergyReleasedPrintXML(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FissionEnergyReleasedPrintJSON(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedLabelHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +FissionEnergyReleasedLabelGet(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +FissionEnergyReleasedLabelSet(ConstHandle2FissionEnergyReleased self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: delayedBetaEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedDelayedBetaEnergyHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DelayedBetaEnergyHas", self, extract::delayedBetaEnergy); +} + +// Get, const +Handle2ConstDelayedBetaEnergy +FissionEnergyReleasedDelayedBetaEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedBetaEnergyGetConst", self, extract::delayedBetaEnergy); +} + +// Get, non-const +Handle2DelayedBetaEnergy +FissionEnergyReleasedDelayedBetaEnergyGet(ConstHandle2FissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedBetaEnergyGet", self, extract::delayedBetaEnergy); +} + +// Set +void +FissionEnergyReleasedDelayedBetaEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DelayedBetaEnergySet", self, extract::delayedBetaEnergy, delayedBetaEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: delayedGammaEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedDelayedGammaEnergyHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DelayedGammaEnergyHas", self, extract::delayedGammaEnergy); +} + +// Get, const +Handle2ConstDelayedGammaEnergy +FissionEnergyReleasedDelayedGammaEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedGammaEnergyGetConst", self, extract::delayedGammaEnergy); +} + +// Get, non-const +Handle2DelayedGammaEnergy +FissionEnergyReleasedDelayedGammaEnergyGet(ConstHandle2FissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedGammaEnergyGet", self, extract::delayedGammaEnergy); +} + +// Set +void +FissionEnergyReleasedDelayedGammaEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DelayedGammaEnergySet", self, extract::delayedGammaEnergy, delayedGammaEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: delayedNeutronKE +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedDelayedNeutronKEHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DelayedNeutronKEHas", self, extract::delayedNeutronKE); +} + +// Get, const +Handle2ConstDelayedNeutronKE +FissionEnergyReleasedDelayedNeutronKEGetConst(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedNeutronKEGetConst", self, extract::delayedNeutronKE); +} + +// Get, non-const +Handle2DelayedNeutronKE +FissionEnergyReleasedDelayedNeutronKEGet(ConstHandle2FissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedNeutronKEGet", self, extract::delayedNeutronKE); +} + +// Set +void +FissionEnergyReleasedDelayedNeutronKESet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstDelayedNeutronKE delayedNeutronKE) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DelayedNeutronKESet", self, extract::delayedNeutronKE, delayedNeutronKE); +} + + +// ----------------------------------------------------------------------------- +// Child: neutrinoEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedNeutrinoEnergyHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NeutrinoEnergyHas", self, extract::neutrinoEnergy); +} + +// Get, const +Handle2ConstNeutrinoEnergy +FissionEnergyReleasedNeutrinoEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NeutrinoEnergyGetConst", self, extract::neutrinoEnergy); +} + +// Get, non-const +Handle2NeutrinoEnergy +FissionEnergyReleasedNeutrinoEnergyGet(ConstHandle2FissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NeutrinoEnergyGet", self, extract::neutrinoEnergy); +} + +// Set +void +FissionEnergyReleasedNeutrinoEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstNeutrinoEnergy neutrinoEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NeutrinoEnergySet", self, extract::neutrinoEnergy, neutrinoEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: nonNeutrinoEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedNonNeutrinoEnergyHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NonNeutrinoEnergyHas", self, extract::nonNeutrinoEnergy); +} + +// Get, const +Handle2ConstNonNeutrinoEnergy +FissionEnergyReleasedNonNeutrinoEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NonNeutrinoEnergyGetConst", self, extract::nonNeutrinoEnergy); +} + +// Get, non-const +Handle2NonNeutrinoEnergy +FissionEnergyReleasedNonNeutrinoEnergyGet(ConstHandle2FissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NonNeutrinoEnergyGet", self, extract::nonNeutrinoEnergy); +} + +// Set +void +FissionEnergyReleasedNonNeutrinoEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NonNeutrinoEnergySet", self, extract::nonNeutrinoEnergy, nonNeutrinoEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: promptGammaEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedPromptGammaEnergyHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PromptGammaEnergyHas", self, extract::promptGammaEnergy); +} + +// Get, const +Handle2ConstPromptGammaEnergy +FissionEnergyReleasedPromptGammaEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptGammaEnergyGetConst", self, extract::promptGammaEnergy); +} + +// Get, non-const +Handle2PromptGammaEnergy +FissionEnergyReleasedPromptGammaEnergyGet(ConstHandle2FissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptGammaEnergyGet", self, extract::promptGammaEnergy); +} + +// Set +void +FissionEnergyReleasedPromptGammaEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstPromptGammaEnergy promptGammaEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PromptGammaEnergySet", self, extract::promptGammaEnergy, promptGammaEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: promptNeutronKE +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedPromptNeutronKEHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PromptNeutronKEHas", self, extract::promptNeutronKE); +} + +// Get, const +Handle2ConstPromptNeutronKE +FissionEnergyReleasedPromptNeutronKEGetConst(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptNeutronKEGetConst", self, extract::promptNeutronKE); +} + +// Get, non-const +Handle2PromptNeutronKE +FissionEnergyReleasedPromptNeutronKEGet(ConstHandle2FissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptNeutronKEGet", self, extract::promptNeutronKE); +} + +// Set +void +FissionEnergyReleasedPromptNeutronKESet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstPromptNeutronKE promptNeutronKE) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PromptNeutronKESet", self, extract::promptNeutronKE, promptNeutronKE); +} + + +// ----------------------------------------------------------------------------- +// Child: promptProductKE +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedPromptProductKEHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PromptProductKEHas", self, extract::promptProductKE); +} + +// Get, const +Handle2ConstPromptProductKE +FissionEnergyReleasedPromptProductKEGetConst(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptProductKEGetConst", self, extract::promptProductKE); +} + +// Get, non-const +Handle2PromptProductKE +FissionEnergyReleasedPromptProductKEGet(ConstHandle2FissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptProductKEGet", self, extract::promptProductKE); +} + +// Set +void +FissionEnergyReleasedPromptProductKESet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstPromptProductKE promptProductKE) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PromptProductKESet", self, extract::promptProductKE, promptProductKE); +} + + +// ----------------------------------------------------------------------------- +// Child: totalEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasedTotalEnergyHas(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TotalEnergyHas", self, extract::totalEnergy); +} + +// Get, const +Handle2ConstTotalEnergy +FissionEnergyReleasedTotalEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TotalEnergyGetConst", self, extract::totalEnergy); +} + +// Get, non-const +Handle2TotalEnergy +FissionEnergyReleasedTotalEnergyGet(ConstHandle2FissionEnergyReleased self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TotalEnergyGet", self, extract::totalEnergy); +} + +// Set +void +FissionEnergyReleasedTotalEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstTotalEnergy totalEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TotalEnergySet", self, extract::totalEnergy, totalEnergy); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/FissionEnergyReleased/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased.h new file mode 100644 index 000000000..16a87687b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased.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. +// +// FissionEnergyReleased is the basic handle type in this file. Example: +// // Create a default FissionEnergyReleased object: +// FissionEnergyReleased handle = FissionEnergyReleasedDefault(); +// Functions involving FissionEnergyReleased are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_FISSIONENERGYRELEASED +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_FISSIONENERGYRELEASED + +#include "GNDStk.h" +#include "v2.0/fissionTransport/DelayedBetaEnergy.h" +#include "v2.0/fissionTransport/DelayedGammaEnergy.h" +#include "v2.0/fissionTransport/DelayedNeutronKE.h" +#include "v2.0/fissionTransport/NeutrinoEnergy.h" +#include "v2.0/fissionTransport/NonNeutrinoEnergy.h" +#include "v2.0/fissionTransport/PromptGammaEnergy.h" +#include "v2.0/fissionTransport/PromptNeutronKE.h" +#include "v2.0/fissionTransport/PromptProductKE.h" +#include "v2.0/fissionTransport/TotalEnergy.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FissionEnergyReleasedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ FissionEnergyReleased +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FissionEnergyReleasedClass *FissionEnergyReleased; + +// --- Const-aware handles. +typedef const struct FissionEnergyReleasedClass *const ConstHandle2ConstFissionEnergyReleased; +typedef struct FissionEnergyReleasedClass *const ConstHandle2FissionEnergyReleased; +typedef const struct FissionEnergyReleasedClass * Handle2ConstFissionEnergyReleased; +typedef struct FissionEnergyReleasedClass * Handle2FissionEnergyReleased; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFissionEnergyReleased +FissionEnergyReleasedDefaultConst(); + +// +++ Create, default +extern_c Handle2FissionEnergyReleased +FissionEnergyReleasedDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionEnergyReleased +FissionEnergyReleasedCreateConst( + const XMLName label, + ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy, + ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy, + ConstHandle2ConstDelayedNeutronKE delayedNeutronKE, + ConstHandle2ConstNeutrinoEnergy neutrinoEnergy, + ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy, + ConstHandle2ConstPromptGammaEnergy promptGammaEnergy, + ConstHandle2ConstPromptNeutronKE promptNeutronKE, + ConstHandle2ConstPromptProductKE promptProductKE, + ConstHandle2ConstTotalEnergy totalEnergy +); + +// +++ Create, general +extern_c Handle2FissionEnergyReleased +FissionEnergyReleasedCreate( + const XMLName label, + ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy, + ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy, + ConstHandle2ConstDelayedNeutronKE delayedNeutronKE, + ConstHandle2ConstNeutrinoEnergy neutrinoEnergy, + ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy, + ConstHandle2ConstPromptGammaEnergy promptGammaEnergy, + ConstHandle2ConstPromptNeutronKE promptNeutronKE, + ConstHandle2ConstPromptProductKE promptProductKE, + 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 +FissionEnergyReleasedAssign(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstFissionEnergyReleased from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FissionEnergyReleasedDelete(ConstHandle2ConstFissionEnergyReleased self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FissionEnergyReleasedRead(ConstHandle2FissionEnergyReleased self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FissionEnergyReleasedWrite(ConstHandle2ConstFissionEnergyReleased self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FissionEnergyReleasedPrint(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Print to standard output, as XML +extern_c int +FissionEnergyReleasedPrintXML(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Print to standard output, as JSON +extern_c int +FissionEnergyReleasedPrintJSON(ConstHandle2ConstFissionEnergyReleased self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedLabelHas(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +FissionEnergyReleasedLabelGet(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedLabelSet(ConstHandle2FissionEnergyReleased self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: delayedBetaEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedDelayedBetaEnergyHas(ConstHandle2ConstFissionEnergyReleased self); + +// --- Get, const +extern_c Handle2ConstDelayedBetaEnergy +FissionEnergyReleasedDelayedBetaEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get, non-const +extern_c Handle2DelayedBetaEnergy +FissionEnergyReleasedDelayedBetaEnergyGet(ConstHandle2FissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedDelayedBetaEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy); + + +// ----------------------------------------------------------------------------- +// Child: delayedGammaEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedDelayedGammaEnergyHas(ConstHandle2ConstFissionEnergyReleased self); + +// --- Get, const +extern_c Handle2ConstDelayedGammaEnergy +FissionEnergyReleasedDelayedGammaEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get, non-const +extern_c Handle2DelayedGammaEnergy +FissionEnergyReleasedDelayedGammaEnergyGet(ConstHandle2FissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedDelayedGammaEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy); + + +// ----------------------------------------------------------------------------- +// Child: delayedNeutronKE +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedDelayedNeutronKEHas(ConstHandle2ConstFissionEnergyReleased self); + +// --- Get, const +extern_c Handle2ConstDelayedNeutronKE +FissionEnergyReleasedDelayedNeutronKEGetConst(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get, non-const +extern_c Handle2DelayedNeutronKE +FissionEnergyReleasedDelayedNeutronKEGet(ConstHandle2FissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedDelayedNeutronKESet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstDelayedNeutronKE delayedNeutronKE); + + +// ----------------------------------------------------------------------------- +// Child: neutrinoEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedNeutrinoEnergyHas(ConstHandle2ConstFissionEnergyReleased self); + +// --- Get, const +extern_c Handle2ConstNeutrinoEnergy +FissionEnergyReleasedNeutrinoEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get, non-const +extern_c Handle2NeutrinoEnergy +FissionEnergyReleasedNeutrinoEnergyGet(ConstHandle2FissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedNeutrinoEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstNeutrinoEnergy neutrinoEnergy); + + +// ----------------------------------------------------------------------------- +// Child: nonNeutrinoEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedNonNeutrinoEnergyHas(ConstHandle2ConstFissionEnergyReleased self); + +// --- Get, const +extern_c Handle2ConstNonNeutrinoEnergy +FissionEnergyReleasedNonNeutrinoEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get, non-const +extern_c Handle2NonNeutrinoEnergy +FissionEnergyReleasedNonNeutrinoEnergyGet(ConstHandle2FissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedNonNeutrinoEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy); + + +// ----------------------------------------------------------------------------- +// Child: promptGammaEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedPromptGammaEnergyHas(ConstHandle2ConstFissionEnergyReleased self); + +// --- Get, const +extern_c Handle2ConstPromptGammaEnergy +FissionEnergyReleasedPromptGammaEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get, non-const +extern_c Handle2PromptGammaEnergy +FissionEnergyReleasedPromptGammaEnergyGet(ConstHandle2FissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedPromptGammaEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstPromptGammaEnergy promptGammaEnergy); + + +// ----------------------------------------------------------------------------- +// Child: promptNeutronKE +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedPromptNeutronKEHas(ConstHandle2ConstFissionEnergyReleased self); + +// --- Get, const +extern_c Handle2ConstPromptNeutronKE +FissionEnergyReleasedPromptNeutronKEGetConst(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get, non-const +extern_c Handle2PromptNeutronKE +FissionEnergyReleasedPromptNeutronKEGet(ConstHandle2FissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedPromptNeutronKESet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstPromptNeutronKE promptNeutronKE); + + +// ----------------------------------------------------------------------------- +// Child: promptProductKE +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedPromptProductKEHas(ConstHandle2ConstFissionEnergyReleased self); + +// --- Get, const +extern_c Handle2ConstPromptProductKE +FissionEnergyReleasedPromptProductKEGetConst(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get, non-const +extern_c Handle2PromptProductKE +FissionEnergyReleasedPromptProductKEGet(ConstHandle2FissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedPromptProductKESet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstPromptProductKE promptProductKE); + + +// ----------------------------------------------------------------------------- +// Child: totalEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasedTotalEnergyHas(ConstHandle2ConstFissionEnergyReleased self); + +// --- Get, const +extern_c Handle2ConstTotalEnergy +FissionEnergyReleasedTotalEnergyGetConst(ConstHandle2ConstFissionEnergyReleased self); + +// +++ Get, non-const +extern_c Handle2TotalEnergy +FissionEnergyReleasedTotalEnergyGet(ConstHandle2FissionEnergyReleased self); + +// +++ Set +extern_c void +FissionEnergyReleasedTotalEnergySet(ConstHandle2FissionEnergyReleased self, ConstHandle2ConstTotalEnergy totalEnergy); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/FissionEnergyReleased/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/FissionEnergyReleased/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/MadlandNix.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/MadlandNix.cpp new file mode 100644 index 000000000..04766d536 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/MadlandNix.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/MadlandNix.hpp" +#include "MadlandNix.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MadlandNixClass; +using CPP = multigroup::MadlandNix; + +static const std::string CLASSNAME = "MadlandNix"; + +namespace extract { + static auto EFH = [](auto &obj) { return &obj.EFH; }; + static auto EFL = [](auto &obj) { return &obj.EFL; }; + static auto T_M = [](auto &obj) { return &obj.T_M; }; +} + +using CPPEFH = fissionTransport::EFH; +using CPPEFL = fissionTransport::EFL; +using CPPT_M = fissionTransport::T_M; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMadlandNix +MadlandNixDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2MadlandNix +MadlandNixDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMadlandNix +MadlandNixCreateConst( + ConstHandle2ConstEFH EFH, + ConstHandle2ConstEFL EFL, + ConstHandle2ConstT_M T_M +) { + ConstHandle2MadlandNix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(EFH), + detail::tocpp(EFL), + detail::tocpp(T_M) + ); + return handle; +} + +// Create, general +Handle2MadlandNix +MadlandNixCreate( + ConstHandle2ConstEFH EFH, + ConstHandle2ConstEFL EFL, + ConstHandle2ConstT_M T_M +) { + ConstHandle2MadlandNix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(EFH), + detail::tocpp(EFL), + 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: 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: 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: 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/fissionTransport/MadlandNix/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/MadlandNix.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/MadlandNix.h new file mode 100644 index 000000000..cd6f668ef --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_MADLANDNIX +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_MADLANDNIX + +#include "GNDStk.h" +#include "v2.0/fissionTransport/EFH.h" +#include "v2.0/fissionTransport/EFL.h" +#include "v2.0/fissionTransport/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 +extern_c Handle2MadlandNix +MadlandNixDefault(); + +// --- Create, general, const +extern_c Handle2ConstMadlandNix +MadlandNixCreateConst( + ConstHandle2ConstEFH EFH, + ConstHandle2ConstEFL EFL, + ConstHandle2ConstT_M T_M +); + +// +++ Create, general +extern_c Handle2MadlandNix +MadlandNixCreate( + ConstHandle2ConstEFH EFH, + ConstHandle2ConstEFL EFL, + 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: 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: 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: 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/fissionTransport/MadlandNix/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/MadlandNix/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/MadlandNix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/MadlandNix/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/MadlandNix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NeutrinoEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NeutrinoEnergy.cpp new file mode 100644 index 000000000..350c51cf2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NeutrinoEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/NeutrinoEnergy.hpp" +#include "NeutrinoEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNeutrinoEnergy +NeutrinoEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/fissionTransport/NeutrinoEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NeutrinoEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NeutrinoEnergy.h new file mode 100644 index 000000000..701fd1c97 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_NEUTRINOENERGY +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_NEUTRINOENERGY + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2NeutrinoEnergy +NeutrinoEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstNeutrinoEnergy +NeutrinoEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/fissionTransport/NeutrinoEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NeutrinoEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NeutrinoEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NeutrinoEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NeutrinoEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NonNeutrinoEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NonNeutrinoEnergy.cpp new file mode 100644 index 000000000..a5a943b09 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NonNeutrinoEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/NonNeutrinoEnergy.hpp" +#include "NonNeutrinoEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNonNeutrinoEnergy +NonNeutrinoEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/fissionTransport/NonNeutrinoEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NonNeutrinoEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NonNeutrinoEnergy.h new file mode 100644 index 000000000..c29df135d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_NONNEUTRINOENERGY +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_NONNEUTRINOENERGY + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2NonNeutrinoEnergy +NonNeutrinoEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstNonNeutrinoEnergy +NonNeutrinoEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/fissionTransport/NonNeutrinoEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NonNeutrinoEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NonNeutrinoEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NonNeutrinoEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/NonNeutrinoEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptGammaEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptGammaEnergy.cpp new file mode 100644 index 000000000..14c468446 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptGammaEnergy.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/PromptGammaEnergy.hpp" +#include "PromptGammaEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = PromptGammaEnergyClass; +using CPP = multigroup::PromptGammaEnergy; + +static const std::string CLASSNAME = "PromptGammaEnergy"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPPolynomial1d = containers::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPromptGammaEnergy +PromptGammaEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2PromptGammaEnergy +PromptGammaEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPromptGammaEnergy +PromptGammaEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2PromptGammaEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general +Handle2PromptGammaEnergy +PromptGammaEnergyCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2PromptGammaEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + 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 +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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/PromptGammaEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptGammaEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptGammaEnergy.h new file mode 100644 index 000000000..b5e66bb8c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_PROMPTGAMMAENERGY +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_PROMPTGAMMAENERGY + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Polynomial1d.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 +extern_c Handle2PromptGammaEnergy +PromptGammaEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstPromptGammaEnergy +PromptGammaEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +extern_c Handle2PromptGammaEnergy +PromptGammaEnergyCreate( + ConstHandle2ConstXYs1d XYs1d, + 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 +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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/PromptGammaEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptGammaEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptGammaEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptGammaEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptGammaEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptNeutronKE.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptNeutronKE.cpp new file mode 100644 index 000000000..0444791ff --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptNeutronKE.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/PromptNeutronKE.hpp" +#include "PromptNeutronKE.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = PromptNeutronKEClass; +using CPP = multigroup::PromptNeutronKE; + +static const std::string CLASSNAME = "PromptNeutronKE"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPPolynomial1d = containers::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPromptNeutronKE +PromptNeutronKEDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2PromptNeutronKE +PromptNeutronKEDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPromptNeutronKE +PromptNeutronKECreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2PromptNeutronKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general +Handle2PromptNeutronKE +PromptNeutronKECreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2PromptNeutronKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + 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 +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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/PromptNeutronKE/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptNeutronKE.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptNeutronKE.h new file mode 100644 index 000000000..bc1626e85 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_PROMPTNEUTRONKE +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_PROMPTNEUTRONKE + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Polynomial1d.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 +extern_c Handle2PromptNeutronKE +PromptNeutronKEDefault(); + +// --- Create, general, const +extern_c Handle2ConstPromptNeutronKE +PromptNeutronKECreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +extern_c Handle2PromptNeutronKE +PromptNeutronKECreate( + ConstHandle2ConstXYs1d XYs1d, + 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 +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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/PromptNeutronKE/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptNeutronKE/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptNeutronKE/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptNeutronKE/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptNeutronKE/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptProductKE.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptProductKE.cpp new file mode 100644 index 000000000..41188833a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptProductKE.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/PromptProductKE.hpp" +#include "PromptProductKE.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = PromptProductKEClass; +using CPP = multigroup::PromptProductKE; + +static const std::string CLASSNAME = "PromptProductKE"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPPolynomial1d = containers::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPromptProductKE +PromptProductKEDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2PromptProductKE +PromptProductKEDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPromptProductKE +PromptProductKECreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2PromptProductKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general +Handle2PromptProductKE +PromptProductKECreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2PromptProductKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + 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 +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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/PromptProductKE/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptProductKE.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptProductKE.h new file mode 100644 index 000000000..9871f595b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_PROMPTPRODUCTKE +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_PROMPTPRODUCTKE + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Polynomial1d.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 +extern_c Handle2PromptProductKE +PromptProductKEDefault(); + +// --- Create, general, const +extern_c Handle2ConstPromptProductKE +PromptProductKECreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +extern_c Handle2PromptProductKE +PromptProductKECreate( + ConstHandle2ConstXYs1d XYs1d, + 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 +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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/PromptProductKE/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptProductKE/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptProductKE/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptProductKE/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/PromptProductKE/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/SimpleMaxwellianFission.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/SimpleMaxwellianFission.cpp new file mode 100644 index 000000000..0d18e8f29 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/SimpleMaxwellianFission.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/SimpleMaxwellianFission.hpp" +#include "SimpleMaxwellianFission.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::U; +using CPPTheta = transport::Theta; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSimpleMaxwellianFission +SimpleMaxwellianFissionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/fissionTransport/SimpleMaxwellianFission/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/SimpleMaxwellianFission.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/SimpleMaxwellianFission.h new file mode 100644 index 000000000..ce176232f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_SIMPLEMAXWELLIANFISSION +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_SIMPLEMAXWELLIANFISSION + +#include "GNDStk.h" +#include "v2.0/transport/U.h" +#include "v2.0/transport/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 +extern_c Handle2SimpleMaxwellianFission +SimpleMaxwellianFissionDefault(); + +// --- Create, general, const +extern_c Handle2ConstSimpleMaxwellianFission +SimpleMaxwellianFissionCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +); + +// +++ Create, general +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/fissionTransport/SimpleMaxwellianFission/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/SimpleMaxwellianFission/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/SimpleMaxwellianFission/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/SimpleMaxwellianFission/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/SimpleMaxwellianFission/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/T_M.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/T_M.cpp new file mode 100644 index 000000000..33e66a092 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/T_M.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/T_M.hpp" +#include "T_M.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstT_M +T_MDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/fissionTransport/T_M/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/T_M.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/T_M.h new file mode 100644 index 000000000..41832786b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_T_M +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_T_M + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2T_M +T_MDefault(); + +// --- Create, general, const +extern_c Handle2ConstT_M +T_MCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/fissionTransport/T_M/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/T_M/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/T_M/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/T_M/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/T_M/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/TotalEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/TotalEnergy.cpp new file mode 100644 index 000000000..8b92d532d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/TotalEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/TotalEnergy.hpp" +#include "TotalEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTotalEnergy +TotalEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/fissionTransport/TotalEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/TotalEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/TotalEnergy.h new file mode 100644 index 000000000..56934d9c5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/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_TEST_V2_0_FISSIONTRANSPORT_TOTALENERGY +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_TOTALENERGY + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2TotalEnergy +TotalEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstTotalEnergy +TotalEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general +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/fissionTransport/TotalEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/TotalEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/TotalEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/TotalEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/TotalEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt.cpp new file mode 100644 index 000000000..2be065ef8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fissionTransport/Watt.hpp" +#include "Watt.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = WattClass; +using CPP = multigroup::Watt; + +static const std::string CLASSNAME = "Watt"; + +namespace extract { + static auto U = [](auto &obj) { return &obj.U; }; + static auto a = [](auto &obj) { return &obj.a; }; + static auto b = [](auto &obj) { return &obj.b; }; +} + +using CPPU = transport::U; +using CPPA = fissionTransport::A; +using CPPB = fissionTransport::B; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstWatt +WattDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Watt +WattDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstWatt +WattCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstA a, + ConstHandle2ConstB b +) { + ConstHandle2Watt handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(U), + detail::tocpp(a), + detail::tocpp(b) + ); + return handle; +} + +// Create, general +Handle2Watt +WattCreate( + ConstHandle2ConstU U, + ConstHandle2ConstA a, + ConstHandle2ConstB b +) { + ConstHandle2Watt handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(U), + detail::tocpp(a), + detail::tocpp(b) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +WattAssign(ConstHandle2Watt self, ConstHandle2ConstWatt from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +WattDelete(ConstHandle2ConstWatt self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +WattRead(ConstHandle2Watt self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +WattWrite(ConstHandle2ConstWatt self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +WattPrint(ConstHandle2ConstWatt self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +WattPrintXML(ConstHandle2ConstWatt self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +WattPrintJSON(ConstHandle2ConstWatt self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: U +// ----------------------------------------------------------------------------- + +// Has +int +WattUHas(ConstHandle2ConstWatt self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UHas", self, extract::U); +} + +// Get, const +Handle2ConstU +WattUGetConst(ConstHandle2ConstWatt self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UGetConst", self, extract::U); +} + +// Get, non-const +Handle2U +WattUGet(ConstHandle2Watt self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UGet", self, extract::U); +} + +// Set +void +WattUSet(ConstHandle2Watt self, ConstHandle2ConstU U) +{ + detail::setField + (CLASSNAME, CLASSNAME+"USet", self, extract::U, U); +} + + +// ----------------------------------------------------------------------------- +// Child: a +// ----------------------------------------------------------------------------- + +// Has +int +WattAHas(ConstHandle2ConstWatt self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AHas", self, extract::a); +} + +// Get, const +Handle2ConstA +WattAGetConst(ConstHandle2ConstWatt self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AGetConst", self, extract::a); +} + +// Get, non-const +Handle2A +WattAGet(ConstHandle2Watt self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AGet", self, extract::a); +} + +// Set +void +WattASet(ConstHandle2Watt self, ConstHandle2ConstA a) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ASet", self, extract::a, a); +} + + +// ----------------------------------------------------------------------------- +// Child: b +// ----------------------------------------------------------------------------- + +// Has +int +WattBHas(ConstHandle2ConstWatt self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BHas", self, extract::b); +} + +// Get, const +Handle2ConstB +WattBGetConst(ConstHandle2ConstWatt self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BGetConst", self, extract::b); +} + +// Get, non-const +Handle2B +WattBGet(ConstHandle2Watt self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BGet", self, extract::b); +} + +// Set +void +WattBSet(ConstHandle2Watt self, ConstHandle2ConstB b) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BSet", self, extract::b, b); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/Watt/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt.h new file mode 100644 index 000000000..5f505fb20 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt.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. +// +// Watt is the basic handle type in this file. Example: +// // Create a default Watt object: +// Watt handle = WattDefault(); +// Functions involving Watt are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_WATT +#define C_INTERFACE_TEST_V2_0_FISSIONTRANSPORT_WATT + +#include "GNDStk.h" +#include "v2.0/transport/U.h" +#include "v2.0/fissionTransport/A.h" +#include "v2.0/fissionTransport/B.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct WattClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Watt +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct WattClass *Watt; + +// --- Const-aware handles. +typedef const struct WattClass *const ConstHandle2ConstWatt; +typedef struct WattClass *const ConstHandle2Watt; +typedef const struct WattClass * Handle2ConstWatt; +typedef struct WattClass * Handle2Watt; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstWatt +WattDefaultConst(); + +// +++ Create, default +extern_c Handle2Watt +WattDefault(); + +// --- Create, general, const +extern_c Handle2ConstWatt +WattCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstA a, + ConstHandle2ConstB b +); + +// +++ Create, general +extern_c Handle2Watt +WattCreate( + ConstHandle2ConstU U, + ConstHandle2ConstA a, + ConstHandle2ConstB b +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +WattAssign(ConstHandle2Watt self, ConstHandle2ConstWatt from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +WattDelete(ConstHandle2ConstWatt self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +WattRead(ConstHandle2Watt self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +WattWrite(ConstHandle2ConstWatt self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +WattPrint(ConstHandle2ConstWatt self); + +// +++ Print to standard output, as XML +extern_c int +WattPrintXML(ConstHandle2ConstWatt self); + +// +++ Print to standard output, as JSON +extern_c int +WattPrintJSON(ConstHandle2ConstWatt self); + + +// ----------------------------------------------------------------------------- +// Child: U +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WattUHas(ConstHandle2ConstWatt self); + +// --- Get, const +extern_c Handle2ConstU +WattUGetConst(ConstHandle2ConstWatt self); + +// +++ Get, non-const +extern_c Handle2U +WattUGet(ConstHandle2Watt self); + +// +++ Set +extern_c void +WattUSet(ConstHandle2Watt self, ConstHandle2ConstU U); + + +// ----------------------------------------------------------------------------- +// Child: a +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WattAHas(ConstHandle2ConstWatt self); + +// --- Get, const +extern_c Handle2ConstA +WattAGetConst(ConstHandle2ConstWatt self); + +// +++ Get, non-const +extern_c Handle2A +WattAGet(ConstHandle2Watt self); + +// +++ Set +extern_c void +WattASet(ConstHandle2Watt self, ConstHandle2ConstA a); + + +// ----------------------------------------------------------------------------- +// Child: b +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WattBHas(ConstHandle2ConstWatt self); + +// --- Get, const +extern_c Handle2ConstB +WattBGetConst(ConstHandle2ConstWatt self); + +// +++ Get, non-const +extern_c Handle2B +WattBGet(ConstHandle2Watt self); + +// +++ Set +extern_c void +WattBSet(ConstHandle2Watt self, ConstHandle2ConstB b); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fissionTransport/Watt/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fissionTransport/Watt/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime.cpp new file mode 100644 index 000000000..98df4627d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime.cpp @@ -0,0 +1,218 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/ElapsedTime.hpp" +#include "ElapsedTime.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; +} + +using CPPTime = fpy::Time; +using CPPYields = fpy::Yields; +using CPPIncidentEnergies = fpy::IncidentEnergies; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstElapsedTime +ElapsedTimeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ElapsedTime +ElapsedTimeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstElapsedTime +ElapsedTimeCreateConst( + const XMLName label, + ConstHandle2ConstTime time, +) { + ConstHandle2ElapsedTime handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(time) + ); + return handle; +} + +// Create, general +Handle2ElapsedTime +ElapsedTimeCreate( + const XMLName label, + ConstHandle2ConstTime time, +) { + ConstHandle2ElapsedTime handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(time) + ); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +ElapsedTimeLabelGet(ConstHandle2ConstElapsedTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ElapsedTimeLabelSet(ConstHandle2ElapsedTime self, const XMLName 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/ElapsedTime/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime.h new file mode 100644 index 000000000..b2e2354c3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime.h @@ -0,0 +1,183 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_FPY_ELAPSEDTIME +#define C_INTERFACE_TEST_V2_0_FPY_ELAPSEDTIME + +#include "GNDStk.h" +#include "v2.0/fpy/Time.h" +#include "v2.0/fpy/Yields.h" +#include "v2.0/fpy/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 +extern_c Handle2ElapsedTime +ElapsedTimeDefault(); + +// --- Create, general, const +extern_c Handle2ConstElapsedTime +ElapsedTimeCreateConst( + const XMLName label, + ConstHandle2ConstTime time, +); + +// +++ Create, general +extern_c Handle2ElapsedTime +ElapsedTimeCreate( + const XMLName label, + ConstHandle2ConstTime time, +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +ElapsedTimeLabelGet(ConstHandle2ConstElapsedTime self); + +// +++ Set +extern_c void +ElapsedTimeLabelSet(ConstHandle2ElapsedTime self, const XMLName 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/ElapsedTime/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTime/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes.cpp new file mode 100644 index 000000000..e00e92f35 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/ElapsedTimes.hpp" +#include "ElapsedTimes.h" + +using namespace njoy::GNDStk; +using namespace test::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 = fpy::ElapsedTime; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstElapsedTimes +ElapsedTimesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +ElapsedTimesElapsedTimeHasByLabel( + ConstHandle2ConstElapsedTimes self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ElapsedTimeHasByLabel", + self, extract::elapsedTime, meta::label, label); +} + +// Get, by label, const +Handle2ConstElapsedTime +ElapsedTimesElapsedTimeGetByLabelConst( + ConstHandle2ConstElapsedTimes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ElapsedTimeGetByLabelConst", + self, extract::elapsedTime, meta::label, label); +} + +// Get, by label, non-const +Handle2ElapsedTime +ElapsedTimesElapsedTimeGetByLabel( + ConstHandle2ElapsedTimes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ElapsedTimeGetByLabel", + self, extract::elapsedTime, meta::label, label); +} + +// Set, by label +void +ElapsedTimesElapsedTimeSetByLabel( + ConstHandle2ElapsedTimes self, + const XMLName label, + ConstHandle2ConstElapsedTime elapsedTime +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ElapsedTimeSetByLabel", + self, extract::elapsedTime, meta::label, label, elapsedTime); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/ElapsedTimes/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes.h new file mode 100644 index 000000000..efdfd4cd1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_FPY_ELAPSEDTIMES +#define C_INTERFACE_TEST_V2_0_FPY_ELAPSEDTIMES + +#include "GNDStk.h" +#include "v2.0/fpy/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 +extern_c Handle2ElapsedTimes +ElapsedTimesDefault(); + +// --- Create, general, const +extern_c Handle2ConstElapsedTimes +ElapsedTimesCreateConst( + ConstHandle2ElapsedTime *const elapsedTime, const size_t elapsedTimeSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +ElapsedTimesElapsedTimeHasByLabel( + ConstHandle2ConstElapsedTimes self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstElapsedTime +ElapsedTimesElapsedTimeGetByLabelConst( + ConstHandle2ConstElapsedTimes self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2ElapsedTime +ElapsedTimesElapsedTimeGetByLabel( + ConstHandle2ElapsedTimes self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ElapsedTimesElapsedTimeSetByLabel( + ConstHandle2ElapsedTimes self, + const XMLName label, + ConstHandle2ConstElapsedTime elapsedTime +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/ElapsedTimes/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/ElapsedTimes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy.cpp new file mode 100644 index 000000000..5c49602e2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/Energy.hpp" +#include "Energy.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EnergyClass; +using CPP = multigroup::Energy; + +static const std::string CLASSNAME = "Energy"; + +namespace extract { + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDouble = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergy +EnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Energy +EnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergy +EnergyCreateConst( + ConstHandle2ConstDouble Double +) { + ConstHandle2Energy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(Double) + ); + return handle; +} + +// Create, general +Handle2Energy +EnergyCreate( + ConstHandle2ConstDouble Double +) { + ConstHandle2Energy 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/Energy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy.h new file mode 100644 index 000000000..2694f008e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy.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. +// +// 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_TEST_V2_0_FPY_ENERGY +#define C_INTERFACE_TEST_V2_0_FPY_ENERGY + +#include "GNDStk.h" +#include "v2.0/containers/Double.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 +extern_c Handle2Energy +EnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergy +EnergyCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +extern_c Handle2Energy +EnergyCreate( + 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 +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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/Energy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/Energy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies.cpp new file mode 100644 index 000000000..52b104835 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/IncidentEnergies.hpp" +#include "IncidentEnergies.h" + +using namespace njoy::GNDStk; +using namespace test::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 = fpy::IncidentEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIncidentEnergies +IncidentEnergiesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +IncidentEnergiesIncidentEnergyHasByLabel( + ConstHandle2ConstIncidentEnergies self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IncidentEnergyHasByLabel", + self, extract::incidentEnergy, meta::label, label); +} + +// Get, by label, const +Handle2ConstIncidentEnergy +IncidentEnergiesIncidentEnergyGetByLabelConst( + ConstHandle2ConstIncidentEnergies self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IncidentEnergyGetByLabelConst", + self, extract::incidentEnergy, meta::label, label); +} + +// Get, by label, non-const +Handle2IncidentEnergy +IncidentEnergiesIncidentEnergyGetByLabel( + ConstHandle2IncidentEnergies self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IncidentEnergyGetByLabel", + self, extract::incidentEnergy, meta::label, label); +} + +// Set, by label +void +IncidentEnergiesIncidentEnergySetByLabel( + ConstHandle2IncidentEnergies self, + const XMLName label, + ConstHandle2ConstIncidentEnergy incidentEnergy +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IncidentEnergySetByLabel", + self, extract::incidentEnergy, meta::label, label, incidentEnergy); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/IncidentEnergies/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies.h new file mode 100644 index 000000000..7dfc5f435 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_FPY_INCIDENTENERGIES +#define C_INTERFACE_TEST_V2_0_FPY_INCIDENTENERGIES + +#include "GNDStk.h" +#include "v2.0/fpy/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 +extern_c Handle2IncidentEnergies +IncidentEnergiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncidentEnergies +IncidentEnergiesCreateConst( + ConstHandle2IncidentEnergy *const incidentEnergy, const size_t incidentEnergySize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +IncidentEnergiesIncidentEnergyHasByLabel( + ConstHandle2ConstIncidentEnergies self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstIncidentEnergy +IncidentEnergiesIncidentEnergyGetByLabelConst( + ConstHandle2ConstIncidentEnergies self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2IncidentEnergy +IncidentEnergiesIncidentEnergyGetByLabel( + ConstHandle2IncidentEnergies self, + const XMLName label +); + +// +++ Set, by label +extern_c void +IncidentEnergiesIncidentEnergySetByLabel( + ConstHandle2IncidentEnergies self, + const XMLName label, + ConstHandle2ConstIncidentEnergy incidentEnergy +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/IncidentEnergies/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergies/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergy.cpp new file mode 100644 index 000000000..d1ee6d951 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergy.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/IncidentEnergy.hpp" +#include "IncidentEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::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 = fpy::Energy; +using CPPYields = fpy::Yields; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIncidentEnergy +IncidentEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2IncidentEnergy +IncidentEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIncidentEnergy +IncidentEnergyCreateConst( + const XMLName label, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstYields yields +) { + ConstHandle2IncidentEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(energy), + detail::tocpp(yields) + ); + return handle; +} + +// Create, general +Handle2IncidentEnergy +IncidentEnergyCreate( + const XMLName 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 +XMLName +IncidentEnergyLabelGet(ConstHandle2ConstIncidentEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +IncidentEnergyLabelSet(ConstHandle2IncidentEnergy self, const XMLName 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/fpy/IncidentEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergy.h new file mode 100644 index 000000000..4f068493d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/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_TEST_V2_0_FPY_INCIDENTENERGY +#define C_INTERFACE_TEST_V2_0_FPY_INCIDENTENERGY + +#include "GNDStk.h" +#include "v2.0/fpy/Energy.h" +#include "v2.0/fpy/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 +extern_c Handle2IncidentEnergy +IncidentEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncidentEnergy +IncidentEnergyCreateConst( + const XMLName label, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstYields yields +); + +// +++ Create, general +extern_c Handle2IncidentEnergy +IncidentEnergyCreate( + const XMLName 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 XMLName +IncidentEnergyLabelGet(ConstHandle2ConstIncidentEnergy self); + +// +++ Set +extern_c void +IncidentEnergyLabelSet(ConstHandle2IncidentEnergy self, const XMLName 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/fpy/IncidentEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/IncidentEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides.cpp new file mode 100644 index 000000000..256224569 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides.cpp @@ -0,0 +1,425 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/Nuclides.hpp" +#include "Nuclides.h" + +using namespace njoy::GNDStk; +using namespace test::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 +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 +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 +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +NuclidesIntsClear(ConstHandle2Nuclides self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +NuclidesIntsSize(ConstHandle2ConstNuclides self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +NuclidesIntsGet(ConstHandle2ConstNuclides self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NuclidesIntsSet(ConstHandle2Nuclides self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +NuclidesIntsGetArrayConst(ConstHandle2ConstNuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +NuclidesIntsGetArray(ConstHandle2Nuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +NuclidesIntsSetArray(ConstHandle2Nuclides self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +NuclidesUnsignedsClear(ConstHandle2Nuclides self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +NuclidesUnsignedsSize(ConstHandle2ConstNuclides self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +NuclidesUnsignedsGet(ConstHandle2ConstNuclides self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NuclidesUnsignedsSet(ConstHandle2Nuclides self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +NuclidesUnsignedsGetArrayConst(ConstHandle2ConstNuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +NuclidesUnsignedsGetArray(ConstHandle2Nuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +NuclidesUnsignedsSetArray(ConstHandle2Nuclides self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +NuclidesFloatsClear(ConstHandle2Nuclides self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +NuclidesFloatsSize(ConstHandle2ConstNuclides self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +NuclidesFloatsGet(ConstHandle2ConstNuclides self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NuclidesFloatsSet(ConstHandle2Nuclides self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +NuclidesFloatsGetArrayConst(ConstHandle2ConstNuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +NuclidesFloatsGetArray(ConstHandle2Nuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +NuclidesFloatsSetArray(ConstHandle2Nuclides self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +NuclidesDoublesClear(ConstHandle2Nuclides self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +NuclidesDoublesSize(ConstHandle2ConstNuclides self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +NuclidesDoublesGet(ConstHandle2ConstNuclides self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NuclidesDoublesSet(ConstHandle2Nuclides self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +NuclidesDoublesGetArrayConst(ConstHandle2ConstNuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +NuclidesDoublesGetArray(ConstHandle2Nuclides self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +NuclidesDoublesSetArray(ConstHandle2Nuclides self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// 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/fpy/Nuclides/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides.h new file mode 100644 index 000000000..7bd88bc19 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides.h @@ -0,0 +1,298 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_FPY_NUCLIDES +#define C_INTERFACE_TEST_V2_0_FPY_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 +extern_c Handle2Nuclides +NuclidesDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclides +NuclidesCreateConst( + const char *const href +); + +// +++ Create, general +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 +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +NuclidesIntsClear(ConstHandle2Nuclides self); + +// +++ Get size +extern_c size_t +NuclidesIntsSize(ConstHandle2ConstNuclides self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +NuclidesIntsGet(ConstHandle2ConstNuclides self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NuclidesIntsSet(ConstHandle2Nuclides self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +NuclidesIntsGetArrayConst(ConstHandle2ConstNuclides self); + +// +++ Get pointer to existing values, non-const +extern_c int * +NuclidesIntsGetArray(ConstHandle2Nuclides self); + +// +++ Set completely new values and size +extern_c void +NuclidesIntsSetArray(ConstHandle2Nuclides self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +NuclidesUnsignedsClear(ConstHandle2Nuclides self); + +// +++ Get size +extern_c size_t +NuclidesUnsignedsSize(ConstHandle2ConstNuclides self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +NuclidesUnsignedsGet(ConstHandle2ConstNuclides self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NuclidesUnsignedsSet(ConstHandle2Nuclides self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +NuclidesUnsignedsGetArrayConst(ConstHandle2ConstNuclides self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +NuclidesUnsignedsGetArray(ConstHandle2Nuclides self); + +// +++ Set completely new values and size +extern_c void +NuclidesUnsignedsSetArray(ConstHandle2Nuclides self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +NuclidesFloatsClear(ConstHandle2Nuclides self); + +// +++ Get size +extern_c size_t +NuclidesFloatsSize(ConstHandle2ConstNuclides self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +NuclidesFloatsGet(ConstHandle2ConstNuclides self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NuclidesFloatsSet(ConstHandle2Nuclides self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +NuclidesFloatsGetArrayConst(ConstHandle2ConstNuclides self); + +// +++ Get pointer to existing values, non-const +extern_c float * +NuclidesFloatsGetArray(ConstHandle2Nuclides self); + +// +++ Set completely new values and size +extern_c void +NuclidesFloatsSetArray(ConstHandle2Nuclides self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +NuclidesDoublesClear(ConstHandle2Nuclides self); + +// +++ Get size +extern_c size_t +NuclidesDoublesSize(ConstHandle2ConstNuclides self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +NuclidesDoublesGet(ConstHandle2ConstNuclides self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NuclidesDoublesSet(ConstHandle2Nuclides self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +NuclidesDoublesGetArrayConst(ConstHandle2ConstNuclides self); + +// +++ Get pointer to existing values, non-const +extern_c double * +NuclidesDoublesGetArray(ConstHandle2Nuclides self); + +// +++ Set completely new values and size +extern_c void +NuclidesDoublesSetArray(ConstHandle2Nuclides self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// 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/fpy/Nuclides/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/Nuclides/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYield.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYield.cpp new file mode 100644 index 000000000..d69b51f50 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYield.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/ProductYield.hpp" +#include "ProductYield.h" + +using namespace njoy::GNDStk; +using namespace test::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 = fpy::Nuclides; +using CPPElapsedTimes = fpy::ElapsedTimes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProductYield +ProductYieldDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ProductYield +ProductYieldDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProductYield +ProductYieldCreateConst( + const XMLName label, + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstElapsedTimes elapsedTimes +) { + ConstHandle2ProductYield handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(nuclides), + detail::tocpp(elapsedTimes) + ); + return handle; +} + +// Create, general +Handle2ProductYield +ProductYieldCreate( + const XMLName 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 +XMLName +ProductYieldLabelGet(ConstHandle2ConstProductYield self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ProductYieldLabelSet(ConstHandle2ProductYield self, const XMLName 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/fpy/ProductYield/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYield.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYield.h new file mode 100644 index 000000000..f8b16ca7c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/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_TEST_V2_0_FPY_PRODUCTYIELD +#define C_INTERFACE_TEST_V2_0_FPY_PRODUCTYIELD + +#include "GNDStk.h" +#include "v2.0/fpy/Nuclides.h" +#include "v2.0/fpy/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 +extern_c Handle2ProductYield +ProductYieldDefault(); + +// --- Create, general, const +extern_c Handle2ConstProductYield +ProductYieldCreateConst( + const XMLName label, + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstElapsedTimes elapsedTimes +); + +// +++ Create, general +extern_c Handle2ProductYield +ProductYieldCreate( + const XMLName 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 XMLName +ProductYieldLabelGet(ConstHandle2ConstProductYield self); + +// +++ Set +extern_c void +ProductYieldLabelSet(ConstHandle2ProductYield self, const XMLName 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/fpy/ProductYield/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYield/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYield/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYield/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYield/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields.cpp new file mode 100644 index 000000000..d1f9f2271 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/ProductYields.hpp" +#include "ProductYields.h" + +using namespace njoy::GNDStk; +using namespace test::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 = fpy::ProductYield; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProductYields +ProductYieldsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +ProductYieldsProductYieldHasByLabel( + ConstHandle2ConstProductYields self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductYieldHasByLabel", + self, extract::productYield, meta::label, label); +} + +// Get, by label, const +Handle2ConstProductYield +ProductYieldsProductYieldGetByLabelConst( + ConstHandle2ConstProductYields self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductYieldGetByLabelConst", + self, extract::productYield, meta::label, label); +} + +// Get, by label, non-const +Handle2ProductYield +ProductYieldsProductYieldGetByLabel( + ConstHandle2ProductYields self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductYieldGetByLabel", + self, extract::productYield, meta::label, label); +} + +// Set, by label +void +ProductYieldsProductYieldSetByLabel( + ConstHandle2ProductYields self, + const XMLName label, + ConstHandle2ConstProductYield productYield +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductYieldSetByLabel", + self, extract::productYield, meta::label, label, productYield); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/ProductYields/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields.h new file mode 100644 index 000000000..031d05077 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_FPY_PRODUCTYIELDS +#define C_INTERFACE_TEST_V2_0_FPY_PRODUCTYIELDS + +#include "GNDStk.h" +#include "v2.0/fpy/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 +extern_c Handle2ProductYields +ProductYieldsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProductYields +ProductYieldsCreateConst( + ConstHandle2ProductYield *const productYield, const size_t productYieldSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +ProductYieldsProductYieldHasByLabel( + ConstHandle2ConstProductYields self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstProductYield +ProductYieldsProductYieldGetByLabelConst( + ConstHandle2ConstProductYields self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2ProductYield +ProductYieldsProductYieldGetByLabel( + ConstHandle2ProductYields self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ProductYieldsProductYieldSetByLabel( + ConstHandle2ProductYields self, + const XMLName label, + ConstHandle2ConstProductYield productYield +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/ProductYields/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/ProductYields/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Time.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/Time.cpp new file mode 100644 index 000000000..e2e2df78f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/Time.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/Time.hpp" +#include "Time.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = TimeClass; +using CPP = multigroup::Time; + +static const std::string CLASSNAME = "Time"; + +namespace extract { +} + +using CPPDouble = containers::Double; +using CPPString = containers::String; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTime +TimeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Time +TimeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTime +TimeCreateConst( +) { + ConstHandle2Time handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2Time +TimeCreate( +) { + ConstHandle2Time 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/Time/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Time.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/Time.h new file mode 100644 index 000000000..d26567fb0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/Time.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. +// +// 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_TEST_V2_0_FPY_TIME +#define C_INTERFACE_TEST_V2_0_FPY_TIME + +#include "GNDStk.h" +#include "v2.0/containers/Double.h" +#include "v2.0/containers/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 +extern_c Handle2Time +TimeDefault(); + +// --- Create, general, const +extern_c Handle2ConstTime +TimeCreateConst( +); + +// +++ Create, general +extern_c Handle2Time +TimeCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/fpy/Time/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Time/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/Time/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Time/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/Time/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Yields.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/Yields.cpp new file mode 100644 index 000000000..683cb9c0d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/Yields.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/fpy/Yields.hpp" +#include "Yields.h" + +using namespace njoy::GNDStk; +using namespace test::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 = fpy::Nuclides; +using CPPValues = containers::Values; +using CPPUncertainty = containers::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstYields +YieldsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/fpy/Yields/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Yields.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/Yields.h new file mode 100644 index 000000000..82e2610bd --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/fpy/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_TEST_V2_0_FPY_YIELDS +#define C_INTERFACE_TEST_V2_0_FPY_YIELDS + +#include "GNDStk.h" +#include "v2.0/fpy/Nuclides.h" +#include "v2.0/containers/Values.h" +#include "v2.0/containers/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 +extern_c Handle2Yields +YieldsDefault(); + +// --- Create, general, const +extern_c Handle2ConstYields +YieldsCreateConst( + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +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/fpy/Yields/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Yields/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/fpy/Yields/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/fpy/Yields/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/fpy/Yields/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Import.cpp b/standards/gnds-2.0/test/c/src/v2.0/map/Import.cpp new file mode 100644 index 000000000..141434bb1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/map/Import.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/map/Import.hpp" +#include "Import.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ImportClass; +using CPP = multigroup::Import; + +static const std::string CLASSNAME = "Import"; + +namespace extract { + 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 +Handle2ConstImport +ImportDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Import +ImportDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstImport +ImportCreateConst( + const XMLName path, + const char *const checksum, + const enums::HashAlgorithm algorithm +) { + ConstHandle2Import handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + path, + checksum, + algorithm + ); + return handle; +} + +// Create, general +Handle2Import +ImportCreate( + const XMLName path, + const char *const checksum, + const enums::HashAlgorithm algorithm +) { + ConstHandle2Import handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + 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 +ImportAssign(ConstHandle2Import self, ConstHandle2ConstImport from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ImportDelete(ConstHandle2ConstImport self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ImportRead(ConstHandle2Import self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ImportWrite(ConstHandle2ConstImport self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ImportPrint(ConstHandle2ConstImport self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ImportPrintXML(ConstHandle2ConstImport self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ImportPrintJSON(ConstHandle2ConstImport self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: path +// ----------------------------------------------------------------------------- + +// Has +int +ImportPathHas(ConstHandle2ConstImport self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PathHas", self, extract::path); +} + +// Get +// Returns by value +XMLName +ImportPathGet(ConstHandle2ConstImport self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PathGet", self, extract::path); +} + +// Set +void +ImportPathSet(ConstHandle2Import self, const XMLName path) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PathSet", self, extract::path, path); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// Has +int +ImportChecksumHas(ConstHandle2ConstImport self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChecksumHas", self, extract::checksum); +} + +// Get +// Returns by value +const char * +ImportChecksumGet(ConstHandle2ConstImport self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChecksumGet", self, extract::checksum); +} + +// Set +void +ImportChecksumSet(ConstHandle2Import self, const char *const checksum) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChecksumSet", self, extract::checksum, checksum); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// Has +int +ImportAlgorithmHas(ConstHandle2ConstImport self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AlgorithmHas", self, extract::algorithm); +} + +// Get +// Returns by value +enums::HashAlgorithm +ImportAlgorithmGet(ConstHandle2ConstImport self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AlgorithmGet", self, extract::algorithm); +} + +// Set +void +ImportAlgorithmSet(ConstHandle2Import self, const enums::HashAlgorithm algorithm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AlgorithmSet", self, extract::algorithm, algorithm); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/map/Import/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Import.h b/standards/gnds-2.0/test/c/src/v2.0/map/Import.h new file mode 100644 index 000000000..b9f499ca3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/map/Import.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. +// +// Import is the basic handle type in this file. Example: +// // Create a default Import object: +// Import handle = ImportDefault(); +// Functions involving Import are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_MAP_IMPORT +#define C_INTERFACE_TEST_V2_0_MAP_IMPORT + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ImportClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Import +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ImportClass *Import; + +// --- Const-aware handles. +typedef const struct ImportClass *const ConstHandle2ConstImport; +typedef struct ImportClass *const ConstHandle2Import; +typedef const struct ImportClass * Handle2ConstImport; +typedef struct ImportClass * Handle2Import; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstImport +ImportDefaultConst(); + +// +++ Create, default +extern_c Handle2Import +ImportDefault(); + +// --- Create, general, const +extern_c Handle2ConstImport +ImportCreateConst( + const XMLName path, + const char *const checksum, + const enums::HashAlgorithm algorithm +); + +// +++ Create, general +extern_c Handle2Import +ImportCreate( + const XMLName path, + const char *const checksum, + const enums::HashAlgorithm 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 +ImportAssign(ConstHandle2Import self, ConstHandle2ConstImport from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ImportDelete(ConstHandle2ConstImport self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ImportRead(ConstHandle2Import self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ImportWrite(ConstHandle2ConstImport self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ImportPrint(ConstHandle2ConstImport self); + +// +++ Print to standard output, as XML +extern_c int +ImportPrintXML(ConstHandle2ConstImport self); + +// +++ Print to standard output, as JSON +extern_c int +ImportPrintJSON(ConstHandle2ConstImport self); + + +// ----------------------------------------------------------------------------- +// Metadatum: path +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ImportPathHas(ConstHandle2ConstImport self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ImportPathGet(ConstHandle2ConstImport self); + +// +++ Set +extern_c void +ImportPathSet(ConstHandle2Import self, const XMLName path); + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ImportChecksumHas(ConstHandle2ConstImport self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ImportChecksumGet(ConstHandle2ConstImport self); + +// +++ Set +extern_c void +ImportChecksumSet(ConstHandle2Import self, const char *const checksum); + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ImportAlgorithmHas(ConstHandle2ConstImport self); + +// +++ Get +// +++ Returns by value +extern_c enums::HashAlgorithm +ImportAlgorithmGet(ConstHandle2ConstImport self); + +// +++ Set +extern_c void +ImportAlgorithmSet(ConstHandle2Import self, const enums::HashAlgorithm algorithm); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/map/Import/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Import/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/map/Import/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Import/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/map/Import/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Map.cpp b/standards/gnds-2.0/test/c/src/v2.0/map/Map.cpp new file mode 100644 index 000000000..267f2683a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/map/Map.cpp @@ -0,0 +1,1355 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/map/Map.hpp" +#include "Map.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MapClass; +using CPP = multigroup::Map; + +static const std::string CLASSNAME = "Map"; + +namespace extract { + static auto library = [](auto &obj) { return &obj.library; }; + static auto format = [](auto &obj) { return &obj.format; }; + static auto checksum = [](auto &obj) { return &obj.checksum; }; + static auto algorithm = [](auto &obj) { return &obj.algorithm; }; + static auto import = [](auto &obj) { return &obj.import; }; + static auto protare = [](auto &obj) { return &obj.protare; }; + static auto TNSL = [](auto &obj) { return &obj.TNSL; }; +} + +using CPPImport = map::Import; +using CPPProtare = map::Protare; +using CPPTNSL = map::TNSL; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMap +MapDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Map +MapDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMap +MapCreateConst( + const XMLName library, + const XMLName format, + const char *const checksum, + const enums::HashAlgorithm algorithm, + ConstHandle2Import *const import, const size_t importSize, + ConstHandle2Protare *const protare, const size_t protareSize, + ConstHandle2TNSL *const TNSL, const size_t TNSLSize +) { + ConstHandle2Map handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + library, + format, + checksum, + algorithm, + std::vector{}, + std::vector{}, + std::vector{} + ); + for (size_t ImportN = 0; ImportN < importSize; ++ImportN) + MapImportAdd(handle, import[ImportN]); + for (size_t ProtareN = 0; ProtareN < protareSize; ++ProtareN) + MapProtareAdd(handle, protare[ProtareN]); + for (size_t TNSLN = 0; TNSLN < TNSLSize; ++TNSLN) + MapTNSLAdd(handle, TNSL[TNSLN]); + return handle; +} + +// Create, general +Handle2Map +MapCreate( + const XMLName library, + const XMLName format, + const char *const checksum, + const enums::HashAlgorithm algorithm, + ConstHandle2Import *const import, const size_t importSize, + ConstHandle2Protare *const protare, const size_t protareSize, + ConstHandle2TNSL *const TNSL, const size_t TNSLSize +) { + ConstHandle2Map handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + library, + format, + checksum, + algorithm, + std::vector{}, + std::vector{}, + std::vector{} + ); + for (size_t ImportN = 0; ImportN < importSize; ++ImportN) + MapImportAdd(handle, import[ImportN]); + for (size_t ProtareN = 0; ProtareN < protareSize; ++ProtareN) + MapProtareAdd(handle, protare[ProtareN]); + for (size_t TNSLN = 0; TNSLN < TNSLSize; ++TNSLN) + MapTNSLAdd(handle, TNSL[TNSLN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MapAssign(ConstHandle2Map self, ConstHandle2ConstMap from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MapDelete(ConstHandle2ConstMap self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MapRead(ConstHandle2Map self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MapWrite(ConstHandle2ConstMap self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MapPrint(ConstHandle2ConstMap self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MapPrintXML(ConstHandle2ConstMap self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MapPrintJSON(ConstHandle2ConstMap self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: library +// ----------------------------------------------------------------------------- + +// Has +int +MapLibraryHas(ConstHandle2ConstMap self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LibraryHas", self, extract::library); +} + +// Get +// Returns by value +XMLName +MapLibraryGet(ConstHandle2ConstMap self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LibraryGet", self, extract::library); +} + +// Set +void +MapLibrarySet(ConstHandle2Map self, const XMLName library) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LibrarySet", self, extract::library, library); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// Has +int +MapFormatHas(ConstHandle2ConstMap self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FormatHas", self, extract::format); +} + +// Get +// Returns by value +XMLName +MapFormatGet(ConstHandle2ConstMap self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormatGet", self, extract::format); +} + +// Set +void +MapFormatSet(ConstHandle2Map self, const XMLName format) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FormatSet", self, extract::format, format); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// Has +int +MapChecksumHas(ConstHandle2ConstMap self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChecksumHas", self, extract::checksum); +} + +// Get +// Returns by value +const char * +MapChecksumGet(ConstHandle2ConstMap self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChecksumGet", self, extract::checksum); +} + +// Set +void +MapChecksumSet(ConstHandle2Map self, const char *const checksum) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChecksumSet", self, extract::checksum, checksum); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// Has +int +MapAlgorithmHas(ConstHandle2ConstMap self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AlgorithmHas", self, extract::algorithm); +} + +// Get +// Returns by value +enums::HashAlgorithm +MapAlgorithmGet(ConstHandle2ConstMap self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AlgorithmGet", self, extract::algorithm); +} + +// Set +void +MapAlgorithmSet(ConstHandle2Map self, const enums::HashAlgorithm algorithm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AlgorithmSet", self, extract::algorithm, algorithm); +} + + +// ----------------------------------------------------------------------------- +// Child: import +// ----------------------------------------------------------------------------- + +// Has +int +MapImportHas(ConstHandle2ConstMap self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ImportHas", self, extract::import); +} + +// Clear +void +MapImportClear(ConstHandle2Map self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ImportClear", self, extract::import); +} + +// Size +size_t +MapImportSize(ConstHandle2ConstMap self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ImportSize", self, extract::import); +} + +// Add +void +MapImportAdd(ConstHandle2Map self, ConstHandle2ConstImport import) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ImportAdd", self, extract::import, import); +} + +// Get, by index \in [0,size), const +Handle2ConstImport +MapImportGetConst(ConstHandle2ConstMap self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ImportGetConst", self, extract::import, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Import +MapImportGet(ConstHandle2Map self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ImportGet", self, extract::import, index_); +} + +// Set, by index \in [0,size) +void +MapImportSet( + ConstHandle2Map self, + const size_t index_, + ConstHandle2ConstImport import +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ImportSet", self, extract::import, index_, import); +} + +// Has, by path +int +MapImportHasByPath( + ConstHandle2ConstMap self, + const XMLName path +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ImportHasByPath", + self, extract::import, meta::path, path); +} + +// Get, by path, const +Handle2ConstImport +MapImportGetByPathConst( + ConstHandle2ConstMap self, + const XMLName path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ImportGetByPathConst", + self, extract::import, meta::path, path); +} + +// Get, by path, non-const +Handle2Import +MapImportGetByPath( + ConstHandle2Map self, + const XMLName path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ImportGetByPath", + self, extract::import, meta::path, path); +} + +// Set, by path +void +MapImportSetByPath( + ConstHandle2Map self, + const XMLName path, + ConstHandle2ConstImport import +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ImportSetByPath", + self, extract::import, meta::path, path, import); +} + +// Has, by checksum +int +MapImportHasByChecksum( + ConstHandle2ConstMap self, + const char *const checksum +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ImportHasByChecksum", + self, extract::import, meta::checksum, checksum); +} + +// Get, by checksum, const +Handle2ConstImport +MapImportGetByChecksumConst( + ConstHandle2ConstMap self, + const char *const checksum +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ImportGetByChecksumConst", + self, extract::import, meta::checksum, checksum); +} + +// Get, by checksum, non-const +Handle2Import +MapImportGetByChecksum( + ConstHandle2Map self, + const char *const checksum +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ImportGetByChecksum", + self, extract::import, meta::checksum, checksum); +} + +// Set, by checksum +void +MapImportSetByChecksum( + ConstHandle2Map self, + const char *const checksum, + ConstHandle2ConstImport import +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ImportSetByChecksum", + self, extract::import, meta::checksum, checksum, import); +} + +// Has, by algorithm +int +MapImportHasByAlgorithm( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ImportHasByAlgorithm", + self, extract::import, meta::algorithm, algorithm); +} + +// Get, by algorithm, const +Handle2ConstImport +MapImportGetByAlgorithmConst( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ImportGetByAlgorithmConst", + self, extract::import, meta::algorithm, algorithm); +} + +// Get, by algorithm, non-const +Handle2Import +MapImportGetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ImportGetByAlgorithm", + self, extract::import, meta::algorithm, algorithm); +} + +// Set, by algorithm +void +MapImportSetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm, + ConstHandle2ConstImport import +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ImportSetByAlgorithm", + self, extract::import, meta::algorithm, algorithm, import); +} + + +// ----------------------------------------------------------------------------- +// Child: protare +// ----------------------------------------------------------------------------- + +// Has +int +MapProtareHas(ConstHandle2ConstMap self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProtareHas", self, extract::protare); +} + +// Clear +void +MapProtareClear(ConstHandle2Map self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ProtareClear", self, extract::protare); +} + +// Size +size_t +MapProtareSize(ConstHandle2ConstMap self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ProtareSize", self, extract::protare); +} + +// Add +void +MapProtareAdd(ConstHandle2Map self, ConstHandle2ConstProtare protare) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ProtareAdd", self, extract::protare, protare); +} + +// Get, by index \in [0,size), const +Handle2ConstProtare +MapProtareGetConst(ConstHandle2ConstMap self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProtareGetConst", self, extract::protare, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Protare +MapProtareGet(ConstHandle2Map self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProtareGet", self, extract::protare, index_); +} + +// Set, by index \in [0,size) +void +MapProtareSet( + ConstHandle2Map self, + const size_t index_, + ConstHandle2ConstProtare protare +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ProtareSet", self, extract::protare, index_, protare); +} + +// Has, by projectile +int +MapProtareHasByProjectile( + ConstHandle2ConstMap self, + const XMLName projectile +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProtareHasByProjectile", + self, extract::protare, meta::projectile, projectile); +} + +// Get, by projectile, const +Handle2ConstProtare +MapProtareGetByProjectileConst( + ConstHandle2ConstMap self, + const XMLName projectile +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByProjectileConst", + self, extract::protare, meta::projectile, projectile); +} + +// Get, by projectile, non-const +Handle2Protare +MapProtareGetByProjectile( + ConstHandle2Map self, + const XMLName projectile +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByProjectile", + self, extract::protare, meta::projectile, projectile); +} + +// Set, by projectile +void +MapProtareSetByProjectile( + ConstHandle2Map self, + const XMLName projectile, + ConstHandle2ConstProtare protare +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProtareSetByProjectile", + self, extract::protare, meta::projectile, projectile, protare); +} + +// Has, by target +int +MapProtareHasByTarget( + ConstHandle2ConstMap self, + const XMLName target +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProtareHasByTarget", + self, extract::protare, meta::target, target); +} + +// Get, by target, const +Handle2ConstProtare +MapProtareGetByTargetConst( + ConstHandle2ConstMap self, + const XMLName target +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByTargetConst", + self, extract::protare, meta::target, target); +} + +// Get, by target, non-const +Handle2Protare +MapProtareGetByTarget( + ConstHandle2Map self, + const XMLName target +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByTarget", + self, extract::protare, meta::target, target); +} + +// Set, by target +void +MapProtareSetByTarget( + ConstHandle2Map self, + const XMLName target, + ConstHandle2ConstProtare protare +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProtareSetByTarget", + self, extract::protare, meta::target, target, protare); +} + +// Has, by evaluation +int +MapProtareHasByEvaluation( + ConstHandle2ConstMap self, + const XMLName evaluation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProtareHasByEvaluation", + self, extract::protare, meta::evaluation, evaluation); +} + +// Get, by evaluation, const +Handle2ConstProtare +MapProtareGetByEvaluationConst( + ConstHandle2ConstMap self, + const XMLName evaluation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByEvaluationConst", + self, extract::protare, meta::evaluation, evaluation); +} + +// Get, by evaluation, non-const +Handle2Protare +MapProtareGetByEvaluation( + ConstHandle2Map self, + const XMLName evaluation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByEvaluation", + self, extract::protare, meta::evaluation, evaluation); +} + +// Set, by evaluation +void +MapProtareSetByEvaluation( + ConstHandle2Map self, + const XMLName evaluation, + ConstHandle2ConstProtare protare +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProtareSetByEvaluation", + self, extract::protare, meta::evaluation, evaluation, protare); +} + +// Has, by path +int +MapProtareHasByPath( + ConstHandle2ConstMap self, + const XMLName path +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProtareHasByPath", + self, extract::protare, meta::path, path); +} + +// Get, by path, const +Handle2ConstProtare +MapProtareGetByPathConst( + ConstHandle2ConstMap self, + const XMLName path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByPathConst", + self, extract::protare, meta::path, path); +} + +// Get, by path, non-const +Handle2Protare +MapProtareGetByPath( + ConstHandle2Map self, + const XMLName path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByPath", + self, extract::protare, meta::path, path); +} + +// Set, by path +void +MapProtareSetByPath( + ConstHandle2Map self, + const XMLName path, + ConstHandle2ConstProtare protare +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProtareSetByPath", + self, extract::protare, meta::path, path, protare); +} + +// Has, by interaction +int +MapProtareHasByInteraction( + ConstHandle2ConstMap self, + const XMLName interaction +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProtareHasByInteraction", + self, extract::protare, meta::interaction, interaction); +} + +// Get, by interaction, const +Handle2ConstProtare +MapProtareGetByInteractionConst( + ConstHandle2ConstMap self, + const XMLName interaction +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByInteractionConst", + self, extract::protare, meta::interaction, interaction); +} + +// Get, by interaction, non-const +Handle2Protare +MapProtareGetByInteraction( + ConstHandle2Map self, + const XMLName interaction +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByInteraction", + self, extract::protare, meta::interaction, interaction); +} + +// Set, by interaction +void +MapProtareSetByInteraction( + ConstHandle2Map self, + const XMLName interaction, + ConstHandle2ConstProtare protare +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProtareSetByInteraction", + self, extract::protare, meta::interaction, interaction, protare); +} + +// Has, by checksum +int +MapProtareHasByChecksum( + ConstHandle2ConstMap self, + const char *const checksum +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProtareHasByChecksum", + self, extract::protare, meta::checksum, checksum); +} + +// Get, by checksum, const +Handle2ConstProtare +MapProtareGetByChecksumConst( + ConstHandle2ConstMap self, + const char *const checksum +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByChecksumConst", + self, extract::protare, meta::checksum, checksum); +} + +// Get, by checksum, non-const +Handle2Protare +MapProtareGetByChecksum( + ConstHandle2Map self, + const char *const checksum +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByChecksum", + self, extract::protare, meta::checksum, checksum); +} + +// Set, by checksum +void +MapProtareSetByChecksum( + ConstHandle2Map self, + const char *const checksum, + ConstHandle2ConstProtare protare +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProtareSetByChecksum", + self, extract::protare, meta::checksum, checksum, protare); +} + +// Has, by algorithm +int +MapProtareHasByAlgorithm( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProtareHasByAlgorithm", + self, extract::protare, meta::algorithm, algorithm); +} + +// Get, by algorithm, const +Handle2ConstProtare +MapProtareGetByAlgorithmConst( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByAlgorithmConst", + self, extract::protare, meta::algorithm, algorithm); +} + +// Get, by algorithm, non-const +Handle2Protare +MapProtareGetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProtareGetByAlgorithm", + self, extract::protare, meta::algorithm, algorithm); +} + +// Set, by algorithm +void +MapProtareSetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm, + ConstHandle2ConstProtare protare +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProtareSetByAlgorithm", + self, extract::protare, meta::algorithm, algorithm, protare); +} + + +// ----------------------------------------------------------------------------- +// Child: TNSL +// ----------------------------------------------------------------------------- + +// Has +int +MapTNSLHas(ConstHandle2ConstMap self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TNSLHas", self, extract::TNSL); +} + +// Clear +void +MapTNSLClear(ConstHandle2Map self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"TNSLClear", self, extract::TNSL); +} + +// Size +size_t +MapTNSLSize(ConstHandle2ConstMap self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"TNSLSize", self, extract::TNSL); +} + +// Add +void +MapTNSLAdd(ConstHandle2Map self, ConstHandle2ConstTNSL TNSL) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"TNSLAdd", self, extract::TNSL, TNSL); +} + +// Get, by index \in [0,size), const +Handle2ConstTNSL +MapTNSLGetConst(ConstHandle2ConstMap self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"TNSLGetConst", self, extract::TNSL, index_); +} + +// Get, by index \in [0,size), non-const +Handle2TNSL +MapTNSLGet(ConstHandle2Map self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"TNSLGet", self, extract::TNSL, index_); +} + +// Set, by index \in [0,size) +void +MapTNSLSet( + ConstHandle2Map self, + const size_t index_, + ConstHandle2ConstTNSL TNSL +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"TNSLSet", self, extract::TNSL, index_, TNSL); +} + +// Has, by projectile +int +MapTNSLHasByProjectile( + ConstHandle2ConstMap self, + const XMLName projectile +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TNSLHasByProjectile", + self, extract::TNSL, meta::projectile, projectile); +} + +// Get, by projectile, const +Handle2ConstTNSL +MapTNSLGetByProjectileConst( + ConstHandle2ConstMap self, + const XMLName projectile +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByProjectileConst", + self, extract::TNSL, meta::projectile, projectile); +} + +// Get, by projectile, non-const +Handle2TNSL +MapTNSLGetByProjectile( + ConstHandle2Map self, + const XMLName projectile +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByProjectile", + self, extract::TNSL, meta::projectile, projectile); +} + +// Set, by projectile +void +MapTNSLSetByProjectile( + ConstHandle2Map self, + const XMLName projectile, + ConstHandle2ConstTNSL TNSL +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TNSLSetByProjectile", + self, extract::TNSL, meta::projectile, projectile, TNSL); +} + +// Has, by target +int +MapTNSLHasByTarget( + ConstHandle2ConstMap self, + const XMLName target +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TNSLHasByTarget", + self, extract::TNSL, meta::target, target); +} + +// Get, by target, const +Handle2ConstTNSL +MapTNSLGetByTargetConst( + ConstHandle2ConstMap self, + const XMLName target +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByTargetConst", + self, extract::TNSL, meta::target, target); +} + +// Get, by target, non-const +Handle2TNSL +MapTNSLGetByTarget( + ConstHandle2Map self, + const XMLName target +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByTarget", + self, extract::TNSL, meta::target, target); +} + +// Set, by target +void +MapTNSLSetByTarget( + ConstHandle2Map self, + const XMLName target, + ConstHandle2ConstTNSL TNSL +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TNSLSetByTarget", + self, extract::TNSL, meta::target, target, TNSL); +} + +// Has, by evaluation +int +MapTNSLHasByEvaluation( + ConstHandle2ConstMap self, + const XMLName evaluation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TNSLHasByEvaluation", + self, extract::TNSL, meta::evaluation, evaluation); +} + +// Get, by evaluation, const +Handle2ConstTNSL +MapTNSLGetByEvaluationConst( + ConstHandle2ConstMap self, + const XMLName evaluation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByEvaluationConst", + self, extract::TNSL, meta::evaluation, evaluation); +} + +// Get, by evaluation, non-const +Handle2TNSL +MapTNSLGetByEvaluation( + ConstHandle2Map self, + const XMLName evaluation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByEvaluation", + self, extract::TNSL, meta::evaluation, evaluation); +} + +// Set, by evaluation +void +MapTNSLSetByEvaluation( + ConstHandle2Map self, + const XMLName evaluation, + ConstHandle2ConstTNSL TNSL +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TNSLSetByEvaluation", + self, extract::TNSL, meta::evaluation, evaluation, TNSL); +} + +// Has, by path +int +MapTNSLHasByPath( + ConstHandle2ConstMap self, + const XMLName path +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TNSLHasByPath", + self, extract::TNSL, meta::path, path); +} + +// Get, by path, const +Handle2ConstTNSL +MapTNSLGetByPathConst( + ConstHandle2ConstMap self, + const XMLName path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByPathConst", + self, extract::TNSL, meta::path, path); +} + +// Get, by path, non-const +Handle2TNSL +MapTNSLGetByPath( + ConstHandle2Map self, + const XMLName path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByPath", + self, extract::TNSL, meta::path, path); +} + +// Set, by path +void +MapTNSLSetByPath( + ConstHandle2Map self, + const XMLName path, + ConstHandle2ConstTNSL TNSL +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TNSLSetByPath", + self, extract::TNSL, meta::path, path, TNSL); +} + +// Has, by interaction +int +MapTNSLHasByInteraction( + ConstHandle2ConstMap self, + const XMLName interaction +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TNSLHasByInteraction", + self, extract::TNSL, meta::interaction, interaction); +} + +// Get, by interaction, const +Handle2ConstTNSL +MapTNSLGetByInteractionConst( + ConstHandle2ConstMap self, + const XMLName interaction +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByInteractionConst", + self, extract::TNSL, meta::interaction, interaction); +} + +// Get, by interaction, non-const +Handle2TNSL +MapTNSLGetByInteraction( + ConstHandle2Map self, + const XMLName interaction +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByInteraction", + self, extract::TNSL, meta::interaction, interaction); +} + +// Set, by interaction +void +MapTNSLSetByInteraction( + ConstHandle2Map self, + const XMLName interaction, + ConstHandle2ConstTNSL TNSL +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TNSLSetByInteraction", + self, extract::TNSL, meta::interaction, interaction, TNSL); +} + +// Has, by checksum +int +MapTNSLHasByChecksum( + ConstHandle2ConstMap self, + const char *const checksum +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TNSLHasByChecksum", + self, extract::TNSL, meta::checksum, checksum); +} + +// Get, by checksum, const +Handle2ConstTNSL +MapTNSLGetByChecksumConst( + ConstHandle2ConstMap self, + const char *const checksum +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByChecksumConst", + self, extract::TNSL, meta::checksum, checksum); +} + +// Get, by checksum, non-const +Handle2TNSL +MapTNSLGetByChecksum( + ConstHandle2Map self, + const char *const checksum +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByChecksum", + self, extract::TNSL, meta::checksum, checksum); +} + +// Set, by checksum +void +MapTNSLSetByChecksum( + ConstHandle2Map self, + const char *const checksum, + ConstHandle2ConstTNSL TNSL +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TNSLSetByChecksum", + self, extract::TNSL, meta::checksum, checksum, TNSL); +} + +// Has, by algorithm +int +MapTNSLHasByAlgorithm( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TNSLHasByAlgorithm", + self, extract::TNSL, meta::algorithm, algorithm); +} + +// Get, by algorithm, const +Handle2ConstTNSL +MapTNSLGetByAlgorithmConst( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByAlgorithmConst", + self, extract::TNSL, meta::algorithm, algorithm); +} + +// Get, by algorithm, non-const +Handle2TNSL +MapTNSLGetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByAlgorithm", + self, extract::TNSL, meta::algorithm, algorithm); +} + +// Set, by algorithm +void +MapTNSLSetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm, + ConstHandle2ConstTNSL TNSL +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TNSLSetByAlgorithm", + self, extract::TNSL, meta::algorithm, algorithm, TNSL); +} + +// Has, by standardTarget +int +MapTNSLHasByStandardTarget( + ConstHandle2ConstMap self, + const XMLName standardTarget +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TNSLHasByStandardTarget", + self, extract::TNSL, meta::standardTarget, standardTarget); +} + +// Get, by standardTarget, const +Handle2ConstTNSL +MapTNSLGetByStandardTargetConst( + ConstHandle2ConstMap self, + const XMLName standardTarget +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByStandardTargetConst", + self, extract::TNSL, meta::standardTarget, standardTarget); +} + +// Get, by standardTarget, non-const +Handle2TNSL +MapTNSLGetByStandardTarget( + ConstHandle2Map self, + const XMLName standardTarget +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByStandardTarget", + self, extract::TNSL, meta::standardTarget, standardTarget); +} + +// Set, by standardTarget +void +MapTNSLSetByStandardTarget( + ConstHandle2Map self, + const XMLName standardTarget, + ConstHandle2ConstTNSL TNSL +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TNSLSetByStandardTarget", + self, extract::TNSL, meta::standardTarget, standardTarget, TNSL); +} + +// Has, by standardEvaluation +int +MapTNSLHasByStandardEvaluation( + ConstHandle2ConstMap self, + const XMLName standardEvaluation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TNSLHasByStandardEvaluation", + self, extract::TNSL, meta::standardEvaluation, standardEvaluation); +} + +// Get, by standardEvaluation, const +Handle2ConstTNSL +MapTNSLGetByStandardEvaluationConst( + ConstHandle2ConstMap self, + const XMLName standardEvaluation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByStandardEvaluationConst", + self, extract::TNSL, meta::standardEvaluation, standardEvaluation); +} + +// Get, by standardEvaluation, non-const +Handle2TNSL +MapTNSLGetByStandardEvaluation( + ConstHandle2Map self, + const XMLName standardEvaluation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TNSLGetByStandardEvaluation", + self, extract::TNSL, meta::standardEvaluation, standardEvaluation); +} + +// Set, by standardEvaluation +void +MapTNSLSetByStandardEvaluation( + ConstHandle2Map self, + const XMLName standardEvaluation, + ConstHandle2ConstTNSL TNSL +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TNSLSetByStandardEvaluation", + self, extract::TNSL, meta::standardEvaluation, standardEvaluation, TNSL); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/map/Map/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Map.h b/standards/gnds-2.0/test/c/src/v2.0/map/Map.h new file mode 100644 index 000000000..6a309ec27 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/map/Map.h @@ -0,0 +1,888 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Map is the basic handle type in this file. Example: +// // Create a default Map object: +// Map handle = MapDefault(); +// Functions involving Map are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_MAP_MAP +#define C_INTERFACE_TEST_V2_0_MAP_MAP + +#include "GNDStk.h" +#include "v2.0/map/Import.h" +#include "v2.0/map/Protare.h" +#include "v2.0/map/TNSL.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MapClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Map +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MapClass *Map; + +// --- Const-aware handles. +typedef const struct MapClass *const ConstHandle2ConstMap; +typedef struct MapClass *const ConstHandle2Map; +typedef const struct MapClass * Handle2ConstMap; +typedef struct MapClass * Handle2Map; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMap +MapDefaultConst(); + +// +++ Create, default +extern_c Handle2Map +MapDefault(); + +// --- Create, general, const +extern_c Handle2ConstMap +MapCreateConst( + const XMLName library, + const XMLName format, + const char *const checksum, + const enums::HashAlgorithm algorithm, + ConstHandle2Import *const import, const size_t importSize, + ConstHandle2Protare *const protare, const size_t protareSize, + ConstHandle2TNSL *const TNSL, const size_t TNSLSize +); + +// +++ Create, general +extern_c Handle2Map +MapCreate( + const XMLName library, + const XMLName format, + const char *const checksum, + const enums::HashAlgorithm algorithm, + ConstHandle2Import *const import, const size_t importSize, + ConstHandle2Protare *const protare, const size_t protareSize, + ConstHandle2TNSL *const TNSL, const size_t TNSLSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MapAssign(ConstHandle2Map self, ConstHandle2ConstMap from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MapDelete(ConstHandle2ConstMap self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MapRead(ConstHandle2Map self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MapWrite(ConstHandle2ConstMap self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MapPrint(ConstHandle2ConstMap self); + +// +++ Print to standard output, as XML +extern_c int +MapPrintXML(ConstHandle2ConstMap self); + +// +++ Print to standard output, as JSON +extern_c int +MapPrintJSON(ConstHandle2ConstMap self); + + +// ----------------------------------------------------------------------------- +// Metadatum: library +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MapLibraryHas(ConstHandle2ConstMap self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MapLibraryGet(ConstHandle2ConstMap self); + +// +++ Set +extern_c void +MapLibrarySet(ConstHandle2Map self, const XMLName library); + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MapFormatHas(ConstHandle2ConstMap self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MapFormatGet(ConstHandle2ConstMap self); + +// +++ Set +extern_c void +MapFormatSet(ConstHandle2Map self, const XMLName format); + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MapChecksumHas(ConstHandle2ConstMap self); + +// +++ Get +// +++ Returns by value +extern_c const char * +MapChecksumGet(ConstHandle2ConstMap self); + +// +++ Set +extern_c void +MapChecksumSet(ConstHandle2Map self, const char *const checksum); + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MapAlgorithmHas(ConstHandle2ConstMap self); + +// +++ Get +// +++ Returns by value +extern_c enums::HashAlgorithm +MapAlgorithmGet(ConstHandle2ConstMap self); + +// +++ Set +extern_c void +MapAlgorithmSet(ConstHandle2Map self, const enums::HashAlgorithm algorithm); + + +// ----------------------------------------------------------------------------- +// Child: import +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MapImportHas(ConstHandle2ConstMap self); + +// +++ Clear +extern_c void +MapImportClear(ConstHandle2Map self); + +// +++ Size +extern_c size_t +MapImportSize(ConstHandle2ConstMap self); + +// +++ Add +extern_c void +MapImportAdd(ConstHandle2Map self, ConstHandle2ConstImport import); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstImport +MapImportGetConst(ConstHandle2ConstMap self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Import +MapImportGet(ConstHandle2Map self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +MapImportSet( + ConstHandle2Map self, + const size_t index_, + ConstHandle2ConstImport import +); + +// +++ Has, by path +extern_c int +MapImportHasByPath( + ConstHandle2ConstMap self, + const XMLName path +); + +// --- Get, by path, const +extern_c Handle2ConstImport +MapImportGetByPathConst( + ConstHandle2ConstMap self, + const XMLName path +); + +// +++ Get, by path, non-const +extern_c Handle2Import +MapImportGetByPath( + ConstHandle2Map self, + const XMLName path +); + +// +++ Set, by path +extern_c void +MapImportSetByPath( + ConstHandle2Map self, + const XMLName path, + ConstHandle2ConstImport import +); + +// +++ Has, by checksum +extern_c int +MapImportHasByChecksum( + ConstHandle2ConstMap self, + const char *const checksum +); + +// --- Get, by checksum, const +extern_c Handle2ConstImport +MapImportGetByChecksumConst( + ConstHandle2ConstMap self, + const char *const checksum +); + +// +++ Get, by checksum, non-const +extern_c Handle2Import +MapImportGetByChecksum( + ConstHandle2Map self, + const char *const checksum +); + +// +++ Set, by checksum +extern_c void +MapImportSetByChecksum( + ConstHandle2Map self, + const char *const checksum, + ConstHandle2ConstImport import +); + +// +++ Has, by algorithm +extern_c int +MapImportHasByAlgorithm( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +); + +// --- Get, by algorithm, const +extern_c Handle2ConstImport +MapImportGetByAlgorithmConst( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +); + +// +++ Get, by algorithm, non-const +extern_c Handle2Import +MapImportGetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm +); + +// +++ Set, by algorithm +extern_c void +MapImportSetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm, + ConstHandle2ConstImport import +); + + +// ----------------------------------------------------------------------------- +// Child: protare +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MapProtareHas(ConstHandle2ConstMap self); + +// +++ Clear +extern_c void +MapProtareClear(ConstHandle2Map self); + +// +++ Size +extern_c size_t +MapProtareSize(ConstHandle2ConstMap self); + +// +++ Add +extern_c void +MapProtareAdd(ConstHandle2Map self, ConstHandle2ConstProtare protare); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstProtare +MapProtareGetConst(ConstHandle2ConstMap self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Protare +MapProtareGet(ConstHandle2Map self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +MapProtareSet( + ConstHandle2Map self, + const size_t index_, + ConstHandle2ConstProtare protare +); + +// +++ Has, by projectile +extern_c int +MapProtareHasByProjectile( + ConstHandle2ConstMap self, + const XMLName projectile +); + +// --- Get, by projectile, const +extern_c Handle2ConstProtare +MapProtareGetByProjectileConst( + ConstHandle2ConstMap self, + const XMLName projectile +); + +// +++ Get, by projectile, non-const +extern_c Handle2Protare +MapProtareGetByProjectile( + ConstHandle2Map self, + const XMLName projectile +); + +// +++ Set, by projectile +extern_c void +MapProtareSetByProjectile( + ConstHandle2Map self, + const XMLName projectile, + ConstHandle2ConstProtare protare +); + +// +++ Has, by target +extern_c int +MapProtareHasByTarget( + ConstHandle2ConstMap self, + const XMLName target +); + +// --- Get, by target, const +extern_c Handle2ConstProtare +MapProtareGetByTargetConst( + ConstHandle2ConstMap self, + const XMLName target +); + +// +++ Get, by target, non-const +extern_c Handle2Protare +MapProtareGetByTarget( + ConstHandle2Map self, + const XMLName target +); + +// +++ Set, by target +extern_c void +MapProtareSetByTarget( + ConstHandle2Map self, + const XMLName target, + ConstHandle2ConstProtare protare +); + +// +++ Has, by evaluation +extern_c int +MapProtareHasByEvaluation( + ConstHandle2ConstMap self, + const XMLName evaluation +); + +// --- Get, by evaluation, const +extern_c Handle2ConstProtare +MapProtareGetByEvaluationConst( + ConstHandle2ConstMap self, + const XMLName evaluation +); + +// +++ Get, by evaluation, non-const +extern_c Handle2Protare +MapProtareGetByEvaluation( + ConstHandle2Map self, + const XMLName evaluation +); + +// +++ Set, by evaluation +extern_c void +MapProtareSetByEvaluation( + ConstHandle2Map self, + const XMLName evaluation, + ConstHandle2ConstProtare protare +); + +// +++ Has, by path +extern_c int +MapProtareHasByPath( + ConstHandle2ConstMap self, + const XMLName path +); + +// --- Get, by path, const +extern_c Handle2ConstProtare +MapProtareGetByPathConst( + ConstHandle2ConstMap self, + const XMLName path +); + +// +++ Get, by path, non-const +extern_c Handle2Protare +MapProtareGetByPath( + ConstHandle2Map self, + const XMLName path +); + +// +++ Set, by path +extern_c void +MapProtareSetByPath( + ConstHandle2Map self, + const XMLName path, + ConstHandle2ConstProtare protare +); + +// +++ Has, by interaction +extern_c int +MapProtareHasByInteraction( + ConstHandle2ConstMap self, + const XMLName interaction +); + +// --- Get, by interaction, const +extern_c Handle2ConstProtare +MapProtareGetByInteractionConst( + ConstHandle2ConstMap self, + const XMLName interaction +); + +// +++ Get, by interaction, non-const +extern_c Handle2Protare +MapProtareGetByInteraction( + ConstHandle2Map self, + const XMLName interaction +); + +// +++ Set, by interaction +extern_c void +MapProtareSetByInteraction( + ConstHandle2Map self, + const XMLName interaction, + ConstHandle2ConstProtare protare +); + +// +++ Has, by checksum +extern_c int +MapProtareHasByChecksum( + ConstHandle2ConstMap self, + const char *const checksum +); + +// --- Get, by checksum, const +extern_c Handle2ConstProtare +MapProtareGetByChecksumConst( + ConstHandle2ConstMap self, + const char *const checksum +); + +// +++ Get, by checksum, non-const +extern_c Handle2Protare +MapProtareGetByChecksum( + ConstHandle2Map self, + const char *const checksum +); + +// +++ Set, by checksum +extern_c void +MapProtareSetByChecksum( + ConstHandle2Map self, + const char *const checksum, + ConstHandle2ConstProtare protare +); + +// +++ Has, by algorithm +extern_c int +MapProtareHasByAlgorithm( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +); + +// --- Get, by algorithm, const +extern_c Handle2ConstProtare +MapProtareGetByAlgorithmConst( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +); + +// +++ Get, by algorithm, non-const +extern_c Handle2Protare +MapProtareGetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm +); + +// +++ Set, by algorithm +extern_c void +MapProtareSetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm, + ConstHandle2ConstProtare protare +); + + +// ----------------------------------------------------------------------------- +// Child: TNSL +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MapTNSLHas(ConstHandle2ConstMap self); + +// +++ Clear +extern_c void +MapTNSLClear(ConstHandle2Map self); + +// +++ Size +extern_c size_t +MapTNSLSize(ConstHandle2ConstMap self); + +// +++ Add +extern_c void +MapTNSLAdd(ConstHandle2Map self, ConstHandle2ConstTNSL TNSL); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstTNSL +MapTNSLGetConst(ConstHandle2ConstMap self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2TNSL +MapTNSLGet(ConstHandle2Map self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +MapTNSLSet( + ConstHandle2Map self, + const size_t index_, + ConstHandle2ConstTNSL TNSL +); + +// +++ Has, by projectile +extern_c int +MapTNSLHasByProjectile( + ConstHandle2ConstMap self, + const XMLName projectile +); + +// --- Get, by projectile, const +extern_c Handle2ConstTNSL +MapTNSLGetByProjectileConst( + ConstHandle2ConstMap self, + const XMLName projectile +); + +// +++ Get, by projectile, non-const +extern_c Handle2TNSL +MapTNSLGetByProjectile( + ConstHandle2Map self, + const XMLName projectile +); + +// +++ Set, by projectile +extern_c void +MapTNSLSetByProjectile( + ConstHandle2Map self, + const XMLName projectile, + ConstHandle2ConstTNSL TNSL +); + +// +++ Has, by target +extern_c int +MapTNSLHasByTarget( + ConstHandle2ConstMap self, + const XMLName target +); + +// --- Get, by target, const +extern_c Handle2ConstTNSL +MapTNSLGetByTargetConst( + ConstHandle2ConstMap self, + const XMLName target +); + +// +++ Get, by target, non-const +extern_c Handle2TNSL +MapTNSLGetByTarget( + ConstHandle2Map self, + const XMLName target +); + +// +++ Set, by target +extern_c void +MapTNSLSetByTarget( + ConstHandle2Map self, + const XMLName target, + ConstHandle2ConstTNSL TNSL +); + +// +++ Has, by evaluation +extern_c int +MapTNSLHasByEvaluation( + ConstHandle2ConstMap self, + const XMLName evaluation +); + +// --- Get, by evaluation, const +extern_c Handle2ConstTNSL +MapTNSLGetByEvaluationConst( + ConstHandle2ConstMap self, + const XMLName evaluation +); + +// +++ Get, by evaluation, non-const +extern_c Handle2TNSL +MapTNSLGetByEvaluation( + ConstHandle2Map self, + const XMLName evaluation +); + +// +++ Set, by evaluation +extern_c void +MapTNSLSetByEvaluation( + ConstHandle2Map self, + const XMLName evaluation, + ConstHandle2ConstTNSL TNSL +); + +// +++ Has, by path +extern_c int +MapTNSLHasByPath( + ConstHandle2ConstMap self, + const XMLName path +); + +// --- Get, by path, const +extern_c Handle2ConstTNSL +MapTNSLGetByPathConst( + ConstHandle2ConstMap self, + const XMLName path +); + +// +++ Get, by path, non-const +extern_c Handle2TNSL +MapTNSLGetByPath( + ConstHandle2Map self, + const XMLName path +); + +// +++ Set, by path +extern_c void +MapTNSLSetByPath( + ConstHandle2Map self, + const XMLName path, + ConstHandle2ConstTNSL TNSL +); + +// +++ Has, by interaction +extern_c int +MapTNSLHasByInteraction( + ConstHandle2ConstMap self, + const XMLName interaction +); + +// --- Get, by interaction, const +extern_c Handle2ConstTNSL +MapTNSLGetByInteractionConst( + ConstHandle2ConstMap self, + const XMLName interaction +); + +// +++ Get, by interaction, non-const +extern_c Handle2TNSL +MapTNSLGetByInteraction( + ConstHandle2Map self, + const XMLName interaction +); + +// +++ Set, by interaction +extern_c void +MapTNSLSetByInteraction( + ConstHandle2Map self, + const XMLName interaction, + ConstHandle2ConstTNSL TNSL +); + +// +++ Has, by checksum +extern_c int +MapTNSLHasByChecksum( + ConstHandle2ConstMap self, + const char *const checksum +); + +// --- Get, by checksum, const +extern_c Handle2ConstTNSL +MapTNSLGetByChecksumConst( + ConstHandle2ConstMap self, + const char *const checksum +); + +// +++ Get, by checksum, non-const +extern_c Handle2TNSL +MapTNSLGetByChecksum( + ConstHandle2Map self, + const char *const checksum +); + +// +++ Set, by checksum +extern_c void +MapTNSLSetByChecksum( + ConstHandle2Map self, + const char *const checksum, + ConstHandle2ConstTNSL TNSL +); + +// +++ Has, by algorithm +extern_c int +MapTNSLHasByAlgorithm( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +); + +// --- Get, by algorithm, const +extern_c Handle2ConstTNSL +MapTNSLGetByAlgorithmConst( + ConstHandle2ConstMap self, + const enums::HashAlgorithm algorithm +); + +// +++ Get, by algorithm, non-const +extern_c Handle2TNSL +MapTNSLGetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm +); + +// +++ Set, by algorithm +extern_c void +MapTNSLSetByAlgorithm( + ConstHandle2Map self, + const enums::HashAlgorithm algorithm, + ConstHandle2ConstTNSL TNSL +); + +// +++ Has, by standardTarget +extern_c int +MapTNSLHasByStandardTarget( + ConstHandle2ConstMap self, + const XMLName standardTarget +); + +// --- Get, by standardTarget, const +extern_c Handle2ConstTNSL +MapTNSLGetByStandardTargetConst( + ConstHandle2ConstMap self, + const XMLName standardTarget +); + +// +++ Get, by standardTarget, non-const +extern_c Handle2TNSL +MapTNSLGetByStandardTarget( + ConstHandle2Map self, + const XMLName standardTarget +); + +// +++ Set, by standardTarget +extern_c void +MapTNSLSetByStandardTarget( + ConstHandle2Map self, + const XMLName standardTarget, + ConstHandle2ConstTNSL TNSL +); + +// +++ Has, by standardEvaluation +extern_c int +MapTNSLHasByStandardEvaluation( + ConstHandle2ConstMap self, + const XMLName standardEvaluation +); + +// --- Get, by standardEvaluation, const +extern_c Handle2ConstTNSL +MapTNSLGetByStandardEvaluationConst( + ConstHandle2ConstMap self, + const XMLName standardEvaluation +); + +// +++ Get, by standardEvaluation, non-const +extern_c Handle2TNSL +MapTNSLGetByStandardEvaluation( + ConstHandle2Map self, + const XMLName standardEvaluation +); + +// +++ Set, by standardEvaluation +extern_c void +MapTNSLSetByStandardEvaluation( + ConstHandle2Map self, + const XMLName standardEvaluation, + ConstHandle2ConstTNSL TNSL +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/map/Map/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Map/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/map/Map/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Map/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/map/Map/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Protare.cpp b/standards/gnds-2.0/test/c/src/v2.0/map/Protare.cpp new file mode 100644 index 000000000..5aa9aece7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/map/Protare.cpp @@ -0,0 +1,382 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/map/Protare.hpp" +#include "Protare.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ProtareClass; +using CPP = multigroup::Protare; + +static const std::string CLASSNAME = "Protare"; + +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 path = [](auto &obj) { return &obj.path; }; + static auto interaction = [](auto &obj) { return &obj.interaction; }; + static auto checksum = [](auto &obj) { return &obj.checksum; }; + static auto algorithm = [](auto &obj) { return &obj.algorithm; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProtare +ProtareDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Protare +ProtareDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProtare +ProtareCreateConst( + const XMLName projectile, + const XMLName target, + const XMLName evaluation, + const XMLName path, + const XMLName interaction, + const char *const checksum, + const enums::HashAlgorithm algorithm +) { + ConstHandle2Protare handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + projectile, + target, + evaluation, + path, + interaction, + checksum, + algorithm + ); + return handle; +} + +// Create, general +Handle2Protare +ProtareCreate( + const XMLName projectile, + const XMLName target, + const XMLName evaluation, + const XMLName path, + const XMLName interaction, + const char *const checksum, + const enums::HashAlgorithm algorithm +) { + ConstHandle2Protare handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + projectile, + target, + evaluation, + path, + interaction, + 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 +ProtareAssign(ConstHandle2Protare self, ConstHandle2ConstProtare from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProtareDelete(ConstHandle2ConstProtare self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProtareRead(ConstHandle2Protare self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProtareWrite(ConstHandle2ConstProtare self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProtarePrint(ConstHandle2ConstProtare self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProtarePrintXML(ConstHandle2ConstProtare self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProtarePrintJSON(ConstHandle2ConstProtare self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// Has +int +ProtareProjectileHas(ConstHandle2ConstProtare self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileHas", self, extract::projectile); +} + +// Get +// Returns by value +XMLName +ProtareProjectileGet(ConstHandle2ConstProtare self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileGet", self, extract::projectile); +} + +// Set +void +ProtareProjectileSet(ConstHandle2Protare self, const XMLName projectile) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProjectileSet", self, extract::projectile, projectile); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// Has +int +ProtareTargetHas(ConstHandle2ConstProtare self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TargetHas", self, extract::target); +} + +// Get +// Returns by value +XMLName +ProtareTargetGet(ConstHandle2ConstProtare self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TargetGet", self, extract::target); +} + +// Set +void +ProtareTargetSet(ConstHandle2Protare self, const XMLName target) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TargetSet", self, extract::target, target); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// Has +int +ProtareEvaluationHas(ConstHandle2ConstProtare self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaluationHas", self, extract::evaluation); +} + +// Get +// Returns by value +XMLName +ProtareEvaluationGet(ConstHandle2ConstProtare self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaluationGet", self, extract::evaluation); +} + +// Set +void +ProtareEvaluationSet(ConstHandle2Protare self, const XMLName evaluation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaluationSet", self, extract::evaluation, evaluation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: path +// ----------------------------------------------------------------------------- + +// Has +int +ProtarePathHas(ConstHandle2ConstProtare self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PathHas", self, extract::path); +} + +// Get +// Returns by value +XMLName +ProtarePathGet(ConstHandle2ConstProtare self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PathGet", self, extract::path); +} + +// Set +void +ProtarePathSet(ConstHandle2Protare self, const XMLName path) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PathSet", self, extract::path, path); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// Has +int +ProtareInteractionHas(ConstHandle2ConstProtare self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InteractionHas", self, extract::interaction); +} + +// Get +// Returns by value +XMLName +ProtareInteractionGet(ConstHandle2ConstProtare self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InteractionGet", self, extract::interaction); +} + +// Set +void +ProtareInteractionSet(ConstHandle2Protare self, const XMLName interaction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InteractionSet", self, extract::interaction, interaction); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// Has +int +ProtareChecksumHas(ConstHandle2ConstProtare self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChecksumHas", self, extract::checksum); +} + +// Get +// Returns by value +const char * +ProtareChecksumGet(ConstHandle2ConstProtare self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChecksumGet", self, extract::checksum); +} + +// Set +void +ProtareChecksumSet(ConstHandle2Protare self, const char *const checksum) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChecksumSet", self, extract::checksum, checksum); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// Has +int +ProtareAlgorithmHas(ConstHandle2ConstProtare self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AlgorithmHas", self, extract::algorithm); +} + +// Get +// Returns by value +enums::HashAlgorithm +ProtareAlgorithmGet(ConstHandle2ConstProtare self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AlgorithmGet", self, extract::algorithm); +} + +// Set +void +ProtareAlgorithmSet(ConstHandle2Protare self, const enums::HashAlgorithm algorithm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AlgorithmSet", self, extract::algorithm, algorithm); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/map/Protare/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Protare.h b/standards/gnds-2.0/test/c/src/v2.0/map/Protare.h new file mode 100644 index 000000000..1cd6cd585 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/map/Protare.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. +// +// Protare is the basic handle type in this file. Example: +// // Create a default Protare object: +// Protare handle = ProtareDefault(); +// Functions involving Protare are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_MAP_PROTARE +#define C_INTERFACE_TEST_V2_0_MAP_PROTARE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProtareClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Protare +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProtareClass *Protare; + +// --- Const-aware handles. +typedef const struct ProtareClass *const ConstHandle2ConstProtare; +typedef struct ProtareClass *const ConstHandle2Protare; +typedef const struct ProtareClass * Handle2ConstProtare; +typedef struct ProtareClass * Handle2Protare; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProtare +ProtareDefaultConst(); + +// +++ Create, default +extern_c Handle2Protare +ProtareDefault(); + +// --- Create, general, const +extern_c Handle2ConstProtare +ProtareCreateConst( + const XMLName projectile, + const XMLName target, + const XMLName evaluation, + const XMLName path, + const XMLName interaction, + const char *const checksum, + const enums::HashAlgorithm algorithm +); + +// +++ Create, general +extern_c Handle2Protare +ProtareCreate( + const XMLName projectile, + const XMLName target, + const XMLName evaluation, + const XMLName path, + const XMLName interaction, + const char *const checksum, + const enums::HashAlgorithm 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 +ProtareAssign(ConstHandle2Protare self, ConstHandle2ConstProtare from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProtareDelete(ConstHandle2ConstProtare self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProtareRead(ConstHandle2Protare self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProtareWrite(ConstHandle2ConstProtare self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProtarePrint(ConstHandle2ConstProtare self); + +// +++ Print to standard output, as XML +extern_c int +ProtarePrintXML(ConstHandle2ConstProtare self); + +// +++ Print to standard output, as JSON +extern_c int +ProtarePrintJSON(ConstHandle2ConstProtare self); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProtareProjectileHas(ConstHandle2ConstProtare self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProtareProjectileGet(ConstHandle2ConstProtare self); + +// +++ Set +extern_c void +ProtareProjectileSet(ConstHandle2Protare self, const XMLName projectile); + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProtareTargetHas(ConstHandle2ConstProtare self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProtareTargetGet(ConstHandle2ConstProtare self); + +// +++ Set +extern_c void +ProtareTargetSet(ConstHandle2Protare self, const XMLName target); + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProtareEvaluationHas(ConstHandle2ConstProtare self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProtareEvaluationGet(ConstHandle2ConstProtare self); + +// +++ Set +extern_c void +ProtareEvaluationSet(ConstHandle2Protare self, const XMLName evaluation); + + +// ----------------------------------------------------------------------------- +// Metadatum: path +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProtarePathHas(ConstHandle2ConstProtare self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProtarePathGet(ConstHandle2ConstProtare self); + +// +++ Set +extern_c void +ProtarePathSet(ConstHandle2Protare self, const XMLName path); + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProtareInteractionHas(ConstHandle2ConstProtare self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProtareInteractionGet(ConstHandle2ConstProtare self); + +// +++ Set +extern_c void +ProtareInteractionSet(ConstHandle2Protare self, const XMLName interaction); + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProtareChecksumHas(ConstHandle2ConstProtare self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ProtareChecksumGet(ConstHandle2ConstProtare self); + +// +++ Set +extern_c void +ProtareChecksumSet(ConstHandle2Protare self, const char *const checksum); + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProtareAlgorithmHas(ConstHandle2ConstProtare self); + +// +++ Get +// +++ Returns by value +extern_c enums::HashAlgorithm +ProtareAlgorithmGet(ConstHandle2ConstProtare self); + +// +++ Set +extern_c void +ProtareAlgorithmSet(ConstHandle2Protare self, const enums::HashAlgorithm algorithm); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/map/Protare/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Protare/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/map/Protare/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/Protare/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/map/Protare/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/TNSL.cpp b/standards/gnds-2.0/test/c/src/v2.0/map/TNSL.cpp new file mode 100644 index 000000000..bf33cd22c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/map/TNSL.cpp @@ -0,0 +1,452 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/map/TNSL.hpp" +#include "TNSL.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = TNSLClass; +using CPP = multigroup::TNSL; + +static const std::string CLASSNAME = "TNSL"; + +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 path = [](auto &obj) { return &obj.path; }; + static auto interaction = [](auto &obj) { return &obj.interaction; }; + static auto checksum = [](auto &obj) { return &obj.checksum; }; + static auto algorithm = [](auto &obj) { return &obj.algorithm; }; + static auto standardTarget = [](auto &obj) { return &obj.standardTarget; }; + static auto standardEvaluation = [](auto &obj) { return &obj.standardEvaluation; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTNSL +TNSLDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2TNSL +TNSLDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTNSL +TNSLCreateConst( + const XMLName projectile, + const XMLName target, + const XMLName evaluation, + const XMLName path, + const XMLName interaction, + const char *const checksum, + const enums::HashAlgorithm algorithm, + const XMLName standardTarget, + const XMLName standardEvaluation +) { + ConstHandle2TNSL handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + projectile, + target, + evaluation, + path, + interaction, + checksum, + algorithm, + standardTarget, + standardEvaluation + ); + return handle; +} + +// Create, general +Handle2TNSL +TNSLCreate( + const XMLName projectile, + const XMLName target, + const XMLName evaluation, + const XMLName path, + const XMLName interaction, + const char *const checksum, + const enums::HashAlgorithm algorithm, + const XMLName standardTarget, + const XMLName standardEvaluation +) { + ConstHandle2TNSL handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + projectile, + target, + evaluation, + path, + interaction, + checksum, + algorithm, + standardTarget, + standardEvaluation + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +TNSLAssign(ConstHandle2TNSL self, ConstHandle2ConstTNSL from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +TNSLDelete(ConstHandle2ConstTNSL self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +TNSLRead(ConstHandle2TNSL self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +TNSLWrite(ConstHandle2ConstTNSL self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +TNSLPrint(ConstHandle2ConstTNSL self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +TNSLPrintXML(ConstHandle2ConstTNSL self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +TNSLPrintJSON(ConstHandle2ConstTNSL self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// Has +int +TNSLProjectileHas(ConstHandle2ConstTNSL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileHas", self, extract::projectile); +} + +// Get +// Returns by value +XMLName +TNSLProjectileGet(ConstHandle2ConstTNSL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileGet", self, extract::projectile); +} + +// Set +void +TNSLProjectileSet(ConstHandle2TNSL self, const XMLName projectile) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProjectileSet", self, extract::projectile, projectile); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// Has +int +TNSLTargetHas(ConstHandle2ConstTNSL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TargetHas", self, extract::target); +} + +// Get +// Returns by value +XMLName +TNSLTargetGet(ConstHandle2ConstTNSL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TargetGet", self, extract::target); +} + +// Set +void +TNSLTargetSet(ConstHandle2TNSL self, const XMLName target) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TargetSet", self, extract::target, target); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// Has +int +TNSLEvaluationHas(ConstHandle2ConstTNSL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaluationHas", self, extract::evaluation); +} + +// Get +// Returns by value +XMLName +TNSLEvaluationGet(ConstHandle2ConstTNSL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaluationGet", self, extract::evaluation); +} + +// Set +void +TNSLEvaluationSet(ConstHandle2TNSL self, const XMLName evaluation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaluationSet", self, extract::evaluation, evaluation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: path +// ----------------------------------------------------------------------------- + +// Has +int +TNSLPathHas(ConstHandle2ConstTNSL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PathHas", self, extract::path); +} + +// Get +// Returns by value +XMLName +TNSLPathGet(ConstHandle2ConstTNSL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PathGet", self, extract::path); +} + +// Set +void +TNSLPathSet(ConstHandle2TNSL self, const XMLName path) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PathSet", self, extract::path, path); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// Has +int +TNSLInteractionHas(ConstHandle2ConstTNSL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InteractionHas", self, extract::interaction); +} + +// Get +// Returns by value +XMLName +TNSLInteractionGet(ConstHandle2ConstTNSL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InteractionGet", self, extract::interaction); +} + +// Set +void +TNSLInteractionSet(ConstHandle2TNSL self, const XMLName interaction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InteractionSet", self, extract::interaction, interaction); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// Has +int +TNSLChecksumHas(ConstHandle2ConstTNSL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChecksumHas", self, extract::checksum); +} + +// Get +// Returns by value +const char * +TNSLChecksumGet(ConstHandle2ConstTNSL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChecksumGet", self, extract::checksum); +} + +// Set +void +TNSLChecksumSet(ConstHandle2TNSL self, const char *const checksum) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChecksumSet", self, extract::checksum, checksum); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// Has +int +TNSLAlgorithmHas(ConstHandle2ConstTNSL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AlgorithmHas", self, extract::algorithm); +} + +// Get +// Returns by value +enums::HashAlgorithm +TNSLAlgorithmGet(ConstHandle2ConstTNSL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AlgorithmGet", self, extract::algorithm); +} + +// Set +void +TNSLAlgorithmSet(ConstHandle2TNSL self, const enums::HashAlgorithm algorithm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AlgorithmSet", self, extract::algorithm, algorithm); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: standardTarget +// ----------------------------------------------------------------------------- + +// Has +int +TNSLStandardTargetHas(ConstHandle2ConstTNSL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StandardTargetHas", self, extract::standardTarget); +} + +// Get +// Returns by value +XMLName +TNSLStandardTargetGet(ConstHandle2ConstTNSL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StandardTargetGet", self, extract::standardTarget); +} + +// Set +void +TNSLStandardTargetSet(ConstHandle2TNSL self, const XMLName standardTarget) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StandardTargetSet", self, extract::standardTarget, standardTarget); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: standardEvaluation +// ----------------------------------------------------------------------------- + +// Has +int +TNSLStandardEvaluationHas(ConstHandle2ConstTNSL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StandardEvaluationHas", self, extract::standardEvaluation); +} + +// Get +// Returns by value +XMLName +TNSLStandardEvaluationGet(ConstHandle2ConstTNSL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StandardEvaluationGet", self, extract::standardEvaluation); +} + +// Set +void +TNSLStandardEvaluationSet(ConstHandle2TNSL self, const XMLName standardEvaluation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StandardEvaluationSet", self, extract::standardEvaluation, standardEvaluation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/map/TNSL/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/TNSL.h b/standards/gnds-2.0/test/c/src/v2.0/map/TNSL.h new file mode 100644 index 000000000..1470a95d0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/map/TNSL.h @@ -0,0 +1,317 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// TNSL is the basic handle type in this file. Example: +// // Create a default TNSL object: +// TNSL handle = TNSLDefault(); +// Functions involving TNSL are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_MAP_TNSL +#define C_INTERFACE_TEST_V2_0_MAP_TNSL + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct TNSLClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ TNSL +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct TNSLClass *TNSL; + +// --- Const-aware handles. +typedef const struct TNSLClass *const ConstHandle2ConstTNSL; +typedef struct TNSLClass *const ConstHandle2TNSL; +typedef const struct TNSLClass * Handle2ConstTNSL; +typedef struct TNSLClass * Handle2TNSL; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTNSL +TNSLDefaultConst(); + +// +++ Create, default +extern_c Handle2TNSL +TNSLDefault(); + +// --- Create, general, const +extern_c Handle2ConstTNSL +TNSLCreateConst( + const XMLName projectile, + const XMLName target, + const XMLName evaluation, + const XMLName path, + const XMLName interaction, + const char *const checksum, + const enums::HashAlgorithm algorithm, + const XMLName standardTarget, + const XMLName standardEvaluation +); + +// +++ Create, general +extern_c Handle2TNSL +TNSLCreate( + const XMLName projectile, + const XMLName target, + const XMLName evaluation, + const XMLName path, + const XMLName interaction, + const char *const checksum, + const enums::HashAlgorithm algorithm, + const XMLName standardTarget, + const XMLName standardEvaluation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +TNSLAssign(ConstHandle2TNSL self, ConstHandle2ConstTNSL from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +TNSLDelete(ConstHandle2ConstTNSL self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +TNSLRead(ConstHandle2TNSL self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +TNSLWrite(ConstHandle2ConstTNSL self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +TNSLPrint(ConstHandle2ConstTNSL self); + +// +++ Print to standard output, as XML +extern_c int +TNSLPrintXML(ConstHandle2ConstTNSL self); + +// +++ Print to standard output, as JSON +extern_c int +TNSLPrintJSON(ConstHandle2ConstTNSL self); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TNSLProjectileHas(ConstHandle2ConstTNSL self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TNSLProjectileGet(ConstHandle2ConstTNSL self); + +// +++ Set +extern_c void +TNSLProjectileSet(ConstHandle2TNSL self, const XMLName projectile); + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TNSLTargetHas(ConstHandle2ConstTNSL self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TNSLTargetGet(ConstHandle2ConstTNSL self); + +// +++ Set +extern_c void +TNSLTargetSet(ConstHandle2TNSL self, const XMLName target); + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TNSLEvaluationHas(ConstHandle2ConstTNSL self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TNSLEvaluationGet(ConstHandle2ConstTNSL self); + +// +++ Set +extern_c void +TNSLEvaluationSet(ConstHandle2TNSL self, const XMLName evaluation); + + +// ----------------------------------------------------------------------------- +// Metadatum: path +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TNSLPathHas(ConstHandle2ConstTNSL self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TNSLPathGet(ConstHandle2ConstTNSL self); + +// +++ Set +extern_c void +TNSLPathSet(ConstHandle2TNSL self, const XMLName path); + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TNSLInteractionHas(ConstHandle2ConstTNSL self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TNSLInteractionGet(ConstHandle2ConstTNSL self); + +// +++ Set +extern_c void +TNSLInteractionSet(ConstHandle2TNSL self, const XMLName interaction); + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TNSLChecksumHas(ConstHandle2ConstTNSL self); + +// +++ Get +// +++ Returns by value +extern_c const char * +TNSLChecksumGet(ConstHandle2ConstTNSL self); + +// +++ Set +extern_c void +TNSLChecksumSet(ConstHandle2TNSL self, const char *const checksum); + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TNSLAlgorithmHas(ConstHandle2ConstTNSL self); + +// +++ Get +// +++ Returns by value +extern_c enums::HashAlgorithm +TNSLAlgorithmGet(ConstHandle2ConstTNSL self); + +// +++ Set +extern_c void +TNSLAlgorithmSet(ConstHandle2TNSL self, const enums::HashAlgorithm algorithm); + + +// ----------------------------------------------------------------------------- +// Metadatum: standardTarget +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TNSLStandardTargetHas(ConstHandle2ConstTNSL self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TNSLStandardTargetGet(ConstHandle2ConstTNSL self); + +// +++ Set +extern_c void +TNSLStandardTargetSet(ConstHandle2TNSL self, const XMLName standardTarget); + + +// ----------------------------------------------------------------------------- +// Metadatum: standardEvaluation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TNSLStandardEvaluationHas(ConstHandle2ConstTNSL self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TNSLStandardEvaluationGet(ConstHandle2ConstTNSL self); + +// +++ Set +extern_c void +TNSLStandardEvaluationSet(ConstHandle2TNSL self, const XMLName standardEvaluation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/map/TNSL/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/TNSL/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/map/TNSL/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/map/TNSL/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/map/TNSL/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Alias.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Alias.cpp new file mode 100644 index 000000000..8c5f26214 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Alias.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Alias.hpp" +#include "Alias.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2Alias +AliasDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAlias +AliasCreateConst( + const XMLName id, + const XMLName pid +) { + ConstHandle2Alias handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + pid + ); + return handle; +} + +// Create, general +Handle2Alias +AliasCreate( + const XMLName id, + const XMLName 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 +XMLName +AliasIdGet(ConstHandle2ConstAlias self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +AliasIdSet(ConstHandle2Alias self, const XMLName 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 +XMLName +AliasPidGet(ConstHandle2ConstAlias self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +AliasPidSet(ConstHandle2Alias self, const XMLName pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Alias/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Alias.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Alias.h new file mode 100644 index 000000000..d0f1ae250 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_ALIAS +#define C_INTERFACE_TEST_V2_0_POPS_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 +extern_c Handle2Alias +AliasDefault(); + +// --- Create, general, const +extern_c Handle2ConstAlias +AliasCreateConst( + const XMLName id, + const XMLName pid +); + +// +++ Create, general +extern_c Handle2Alias +AliasCreate( + const XMLName id, + const XMLName 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 XMLName +AliasIdGet(ConstHandle2ConstAlias self); + +// +++ Set +extern_c void +AliasIdSet(ConstHandle2Alias self, const XMLName id); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AliasPidHas(ConstHandle2ConstAlias self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AliasPidGet(ConstHandle2ConstAlias self); + +// +++ Set +extern_c void +AliasPidSet(ConstHandle2Alias self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Alias/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Alias/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Alias/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Alias/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Alias/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases.cpp new file mode 100644 index 000000000..ff8012919 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases.cpp @@ -0,0 +1,511 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Aliases.hpp" +#include "Aliases.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Alias; +using CPPMetaStable = pops::MetaStable; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAliases +AliasesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by id +int +AliasesAliasHasById( + ConstHandle2ConstAliases self, + const XMLName id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AliasHasById", + self, extract::alias, meta::id, id); +} + +// Get, by id, const +Handle2ConstAlias +AliasesAliasGetByIdConst( + ConstHandle2ConstAliases self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AliasGetByIdConst", + self, extract::alias, meta::id, id); +} + +// Get, by id, non-const +Handle2Alias +AliasesAliasGetById( + ConstHandle2Aliases self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AliasGetById", + self, extract::alias, meta::id, id); +} + +// Set, by id +void +AliasesAliasSetById( + ConstHandle2Aliases self, + const XMLName id, + ConstHandle2ConstAlias alias +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AliasSetById", + self, extract::alias, meta::id, id, alias); +} + +// Has, by pid +int +AliasesAliasHasByPid( + ConstHandle2ConstAliases self, + const XMLName pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AliasHasByPid", + self, extract::alias, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstAlias +AliasesAliasGetByPidConst( + ConstHandle2ConstAliases self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AliasGetByPidConst", + self, extract::alias, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2Alias +AliasesAliasGetByPid( + ConstHandle2Aliases self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AliasGetByPid", + self, extract::alias, meta::pid, pid); +} + +// Set, by pid +void +AliasesAliasSetByPid( + ConstHandle2Aliases self, + const XMLName 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); +} + +// Has, by id +int +AliasesMetaStableHasById( + ConstHandle2ConstAliases self, + const XMLName id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableHasById", + self, extract::metaStable, meta::id, id); +} + +// Get, by id, const +Handle2ConstMetaStable +AliasesMetaStableGetByIdConst( + ConstHandle2ConstAliases self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByIdConst", + self, extract::metaStable, meta::id, id); +} + +// Get, by id, non-const +Handle2MetaStable +AliasesMetaStableGetById( + ConstHandle2Aliases self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetById", + self, extract::metaStable, meta::id, id); +} + +// Set, by id +void +AliasesMetaStableSetById( + ConstHandle2Aliases self, + const XMLName id, + ConstHandle2ConstMetaStable metaStable +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableSetById", + self, extract::metaStable, meta::id, id, metaStable); +} + +// Has, by metaStableIndex +int +AliasesMetaStableHasByMetaStableIndex( + ConstHandle2ConstAliases self, + const Integer32 metaStableIndex +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableHasByMetaStableIndex", + self, extract::metaStable, meta::metaStableIndex, metaStableIndex); +} + +// Get, by metaStableIndex, const +Handle2ConstMetaStable +AliasesMetaStableGetByMetaStableIndexConst( + ConstHandle2ConstAliases self, + const Integer32 metaStableIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByMetaStableIndexConst", + self, extract::metaStable, meta::metaStableIndex, metaStableIndex); +} + +// Get, by metaStableIndex, non-const +Handle2MetaStable +AliasesMetaStableGetByMetaStableIndex( + ConstHandle2Aliases self, + const Integer32 metaStableIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByMetaStableIndex", + self, extract::metaStable, meta::metaStableIndex, metaStableIndex); +} + +// Set, by metaStableIndex +void +AliasesMetaStableSetByMetaStableIndex( + ConstHandle2Aliases self, + const Integer32 metaStableIndex, + ConstHandle2ConstMetaStable metaStable +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableSetByMetaStableIndex", + self, extract::metaStable, meta::metaStableIndex, metaStableIndex, metaStable); +} + +// Has, by pid +int +AliasesMetaStableHasByPid( + ConstHandle2ConstAliases self, + const XMLName pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableHasByPid", + self, extract::metaStable, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstMetaStable +AliasesMetaStableGetByPidConst( + ConstHandle2ConstAliases self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByPidConst", + self, extract::metaStable, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2MetaStable +AliasesMetaStableGetByPid( + ConstHandle2Aliases self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByPid", + self, extract::metaStable, meta::pid, pid); +} + +// Set, by pid +void +AliasesMetaStableSetByPid( + ConstHandle2Aliases self, + const XMLName pid, + ConstHandle2ConstMetaStable metaStable +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableSetByPid", + self, extract::metaStable, meta::pid, pid, metaStable); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Aliases/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases.h new file mode 100644 index 000000000..45538cb48 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases.h @@ -0,0 +1,362 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_ALIASES +#define C_INTERFACE_TEST_V2_0_POPS_ALIASES + +#include "GNDStk.h" +#include "v2.0/pops/Alias.h" +#include "v2.0/pops/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 +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 +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 +); + +// +++ Has, by id +extern_c int +AliasesAliasHasById( + ConstHandle2ConstAliases self, + const XMLName id +); + +// --- Get, by id, const +extern_c Handle2ConstAlias +AliasesAliasGetByIdConst( + ConstHandle2ConstAliases self, + const XMLName id +); + +// +++ Get, by id, non-const +extern_c Handle2Alias +AliasesAliasGetById( + ConstHandle2Aliases self, + const XMLName id +); + +// +++ Set, by id +extern_c void +AliasesAliasSetById( + ConstHandle2Aliases self, + const XMLName id, + ConstHandle2ConstAlias alias +); + +// +++ Has, by pid +extern_c int +AliasesAliasHasByPid( + ConstHandle2ConstAliases self, + const XMLName pid +); + +// --- Get, by pid, const +extern_c Handle2ConstAlias +AliasesAliasGetByPidConst( + ConstHandle2ConstAliases self, + const XMLName pid +); + +// +++ Get, by pid, non-const +extern_c Handle2Alias +AliasesAliasGetByPid( + ConstHandle2Aliases self, + const XMLName pid +); + +// +++ Set, by pid +extern_c void +AliasesAliasSetByPid( + ConstHandle2Aliases self, + const XMLName 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 +); + +// +++ Has, by id +extern_c int +AliasesMetaStableHasById( + ConstHandle2ConstAliases self, + const XMLName id +); + +// --- Get, by id, const +extern_c Handle2ConstMetaStable +AliasesMetaStableGetByIdConst( + ConstHandle2ConstAliases self, + const XMLName id +); + +// +++ Get, by id, non-const +extern_c Handle2MetaStable +AliasesMetaStableGetById( + ConstHandle2Aliases self, + const XMLName id +); + +// +++ Set, by id +extern_c void +AliasesMetaStableSetById( + ConstHandle2Aliases self, + const XMLName id, + ConstHandle2ConstMetaStable metaStable +); + +// +++ Has, by metaStableIndex +extern_c int +AliasesMetaStableHasByMetaStableIndex( + ConstHandle2ConstAliases self, + const Integer32 metaStableIndex +); + +// --- Get, by metaStableIndex, const +extern_c Handle2ConstMetaStable +AliasesMetaStableGetByMetaStableIndexConst( + ConstHandle2ConstAliases self, + const Integer32 metaStableIndex +); + +// +++ Get, by metaStableIndex, non-const +extern_c Handle2MetaStable +AliasesMetaStableGetByMetaStableIndex( + ConstHandle2Aliases self, + const Integer32 metaStableIndex +); + +// +++ Set, by metaStableIndex +extern_c void +AliasesMetaStableSetByMetaStableIndex( + ConstHandle2Aliases self, + const Integer32 metaStableIndex, + ConstHandle2ConstMetaStable metaStable +); + +// +++ Has, by pid +extern_c int +AliasesMetaStableHasByPid( + ConstHandle2ConstAliases self, + const XMLName pid +); + +// --- Get, by pid, const +extern_c Handle2ConstMetaStable +AliasesMetaStableGetByPidConst( + ConstHandle2ConstAliases self, + const XMLName pid +); + +// +++ Get, by pid, non-const +extern_c Handle2MetaStable +AliasesMetaStableGetByPid( + ConstHandle2Aliases self, + const XMLName pid +); + +// +++ Set, by pid +extern_c void +AliasesMetaStableSetByPid( + ConstHandle2Aliases self, + const XMLName pid, + ConstHandle2ConstMetaStable metaStable +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Aliases/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Aliases/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Atomic.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Atomic.cpp new file mode 100644 index 000000000..41d4c7f86 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Atomic.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Atomic.hpp" +#include "Atomic.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Configurations; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAtomic +AtomicDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/pops/Atomic/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Atomic.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Atomic.h new file mode 100644 index 000000000..e88a150dc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_ATOMIC +#define C_INTERFACE_TEST_V2_0_POPS_ATOMIC + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Atomic +AtomicDefault(); + +// --- Create, general, const +extern_c Handle2ConstAtomic +AtomicCreateConst( + ConstHandle2ConstConfigurations configurations +); + +// +++ Create, general +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/pops/Atomic/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Atomic/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Atomic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Atomic/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Atomic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies.cpp new file mode 100644 index 000000000..ac1071c4e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/AverageEnergies.hpp" +#include "AverageEnergies.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::AverageEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageEnergies +AverageEnergiesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +AverageEnergiesAverageEnergyHasByLabel( + ConstHandle2ConstAverageEnergies self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyHasByLabel", + self, extract::averageEnergy, meta::label, label); +} + +// Get, by label, const +Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByLabelConst( + ConstHandle2ConstAverageEnergies self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByLabelConst", + self, extract::averageEnergy, meta::label, label); +} + +// Get, by label, non-const +Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByLabel( + ConstHandle2AverageEnergies self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByLabel", + self, extract::averageEnergy, meta::label, label); +} + +// Set, by label +void +AverageEnergiesAverageEnergySetByLabel( + ConstHandle2AverageEnergies self, + const XMLName label, + ConstHandle2ConstAverageEnergy averageEnergy +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergySetByLabel", + self, extract::averageEnergy, meta::label, label, averageEnergy); +} + +// Has, by value +int +AverageEnergiesAverageEnergyHasByValue( + ConstHandle2ConstAverageEnergies self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyHasByValue", + self, extract::averageEnergy, meta::value, value); +} + +// Get, by value, const +Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByValueConst( + ConstHandle2ConstAverageEnergies self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByValueConst", + self, extract::averageEnergy, meta::value, value); +} + +// Get, by value, non-const +Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByValue( + ConstHandle2AverageEnergies self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByValue", + self, extract::averageEnergy, meta::value, value); +} + +// Set, by value +void +AverageEnergiesAverageEnergySetByValue( + ConstHandle2AverageEnergies self, + const Float64 value, + ConstHandle2ConstAverageEnergy averageEnergy +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergySetByValue", + self, extract::averageEnergy, meta::value, value, averageEnergy); +} + +// Has, by unit +int +AverageEnergiesAverageEnergyHasByUnit( + ConstHandle2ConstAverageEnergies self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyHasByUnit", + self, extract::averageEnergy, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByUnitConst( + ConstHandle2ConstAverageEnergies self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByUnitConst", + self, extract::averageEnergy, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByUnit( + ConstHandle2AverageEnergies self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByUnit", + self, extract::averageEnergy, meta::unit, unit); +} + +// Set, by unit +void +AverageEnergiesAverageEnergySetByUnit( + ConstHandle2AverageEnergies self, + const XMLName unit, + ConstHandle2ConstAverageEnergy averageEnergy +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergySetByUnit", + self, extract::averageEnergy, meta::unit, unit, averageEnergy); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/AverageEnergies/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies.h b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies.h new file mode 100644 index 000000000..7857daba1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies.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. +// +// 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_TEST_V2_0_POPS_AVERAGEENERGIES +#define C_INTERFACE_TEST_V2_0_POPS_AVERAGEENERGIES + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2AverageEnergies +AverageEnergiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageEnergies +AverageEnergiesCreateConst( + ConstHandle2AverageEnergy *const averageEnergy, const size_t averageEnergySize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +AverageEnergiesAverageEnergyHasByLabel( + ConstHandle2ConstAverageEnergies self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByLabelConst( + ConstHandle2ConstAverageEnergies self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByLabel( + ConstHandle2AverageEnergies self, + const XMLName label +); + +// +++ Set, by label +extern_c void +AverageEnergiesAverageEnergySetByLabel( + ConstHandle2AverageEnergies self, + const XMLName label, + ConstHandle2ConstAverageEnergy averageEnergy +); + +// +++ Has, by value +extern_c int +AverageEnergiesAverageEnergyHasByValue( + ConstHandle2ConstAverageEnergies self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByValueConst( + ConstHandle2ConstAverageEnergies self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByValue( + ConstHandle2AverageEnergies self, + const Float64 value +); + +// +++ Set, by value +extern_c void +AverageEnergiesAverageEnergySetByValue( + ConstHandle2AverageEnergies self, + const Float64 value, + ConstHandle2ConstAverageEnergy averageEnergy +); + +// +++ Has, by unit +extern_c int +AverageEnergiesAverageEnergyHasByUnit( + ConstHandle2ConstAverageEnergies self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByUnitConst( + ConstHandle2ConstAverageEnergies self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByUnit( + ConstHandle2AverageEnergies self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +AverageEnergiesAverageEnergySetByUnit( + ConstHandle2AverageEnergies self, + const XMLName unit, + ConstHandle2ConstAverageEnergy averageEnergy +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/AverageEnergies/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergies/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy.cpp new file mode 100644 index 000000000..86616d512 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/AverageEnergy.hpp" +#include "AverageEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::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 documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageEnergy +AverageEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AverageEnergy +AverageEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAverageEnergy +AverageEnergyCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2AverageEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit, + detail::tocpp(documentation), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2AverageEnergy +AverageEnergyCreate( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2AverageEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + unit, + detail::tocpp(documentation), + 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 +XMLName +AverageEnergyLabelGet(ConstHandle2ConstAverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AverageEnergyLabelSet(ConstHandle2AverageEnergy self, const XMLName 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 +Float64 +AverageEnergyValueGet(ConstHandle2ConstAverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +AverageEnergyValueSet(ConstHandle2AverageEnergy self, const Float64 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 +XMLName +AverageEnergyUnitGet(ConstHandle2ConstAverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +AverageEnergyUnitSet(ConstHandle2AverageEnergy self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +AverageEnergyDocumentationHas(ConstHandle2ConstAverageEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +AverageEnergyDocumentationGetConst(ConstHandle2ConstAverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +AverageEnergyDocumentationGet(ConstHandle2AverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +AverageEnergyDocumentationSet(ConstHandle2AverageEnergy self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// 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/pops/AverageEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy.h new file mode 100644 index 000000000..955140564 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy.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. +// +// 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_TEST_V2_0_POPS_AVERAGEENERGY +#define C_INTERFACE_TEST_V2_0_POPS_AVERAGEENERGY + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/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 +extern_c Handle2AverageEnergy +AverageEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageEnergy +AverageEnergyCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2AverageEnergy +AverageEnergyCreate( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + 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 XMLName +AverageEnergyLabelGet(ConstHandle2ConstAverageEnergy self); + +// +++ Set +extern_c void +AverageEnergyLabelSet(ConstHandle2AverageEnergy self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageEnergyValueHas(ConstHandle2ConstAverageEnergy self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +AverageEnergyValueGet(ConstHandle2ConstAverageEnergy self); + +// +++ Set +extern_c void +AverageEnergyValueSet(ConstHandle2AverageEnergy self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageEnergyUnitHas(ConstHandle2ConstAverageEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AverageEnergyUnitGet(ConstHandle2ConstAverageEnergy self); + +// +++ Set +extern_c void +AverageEnergyUnitSet(ConstHandle2AverageEnergy self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageEnergyDocumentationHas(ConstHandle2ConstAverageEnergy self); + +// --- Get, const +extern_c Handle2ConstDocumentation +AverageEnergyDocumentationGetConst(ConstHandle2ConstAverageEnergy self); + +// +++ Get, non-const +extern_c Handle2Documentation +AverageEnergyDocumentationGet(ConstHandle2AverageEnergy self); + +// +++ Set +extern_c void +AverageEnergyDocumentationSet(ConstHandle2AverageEnergy self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// 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/pops/AverageEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/AverageEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Baryon.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryon.cpp new file mode 100644 index 000000000..739c28f12 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryon.cpp @@ -0,0 +1,431 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Baryon.hpp" +#include "Baryon.h" + +using namespace njoy::GNDStk; +using namespace test::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 charge = [](auto &obj) { return &obj.charge; }; + static auto halflife = [](auto &obj) { return &obj.halflife; }; + 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 decayData = [](auto &obj) { return &obj.decayData; }; +} + +using CPPCharge = pops::Charge; +using CPPHalflife = pops::Halflife; +using CPPMass = pops::Mass; +using CPPSpin = pops::Spin; +using CPPParity = pops::Parity; +using CPPDecayData = pops::DecayData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBaryon +BaryonDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Baryon +BaryonDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBaryon +BaryonCreateConst( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Baryon handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(decayData) + ); + return handle; +} + +// Create, general +Handle2Baryon +BaryonCreate( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Baryon handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + 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 +XMLName +BaryonIdGet(ConstHandle2ConstBaryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +BaryonIdSet(ConstHandle2Baryon self, const XMLName id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// 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: 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: 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/pops/Baryon/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Baryon.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryon.h new file mode 100644 index 000000000..5b8345c5b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_BARYON +#define C_INTERFACE_TEST_V2_0_POPS_BARYON + +#include "GNDStk.h" +#include "v2.0/pops/Charge.h" +#include "v2.0/pops/Halflife.h" +#include "v2.0/pops/Mass.h" +#include "v2.0/pops/Spin.h" +#include "v2.0/pops/Parity.h" +#include "v2.0/pops/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 +extern_c Handle2Baryon +BaryonDefault(); + +// --- Create, general, const +extern_c Handle2ConstBaryon +BaryonCreateConst( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData +); + +// +++ Create, general +extern_c Handle2Baryon +BaryonCreate( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + 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 XMLName +BaryonIdGet(ConstHandle2ConstBaryon self); + +// +++ Set +extern_c void +BaryonIdSet(ConstHandle2Baryon self, const XMLName id); + + +// ----------------------------------------------------------------------------- +// 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: 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: 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/pops/Baryon/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Baryon/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryon/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Baryon/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryon/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons.cpp new file mode 100644 index 000000000..dd6530b4f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Baryons.hpp" +#include "Baryons.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Baryon; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBaryons +BaryonsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by id +int +BaryonsBaryonHasById( + ConstHandle2ConstBaryons self, + const XMLName id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"BaryonHasById", + self, extract::baryon, meta::id, id); +} + +// Get, by id, const +Handle2ConstBaryon +BaryonsBaryonGetByIdConst( + ConstHandle2ConstBaryons self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BaryonGetByIdConst", + self, extract::baryon, meta::id, id); +} + +// Get, by id, non-const +Handle2Baryon +BaryonsBaryonGetById( + ConstHandle2Baryons self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BaryonGetById", + self, extract::baryon, meta::id, id); +} + +// Set, by id +void +BaryonsBaryonSetById( + ConstHandle2Baryons self, + const XMLName id, + ConstHandle2ConstBaryon baryon +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"BaryonSetById", + self, extract::baryon, meta::id, id, baryon); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Baryons/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons.h new file mode 100644 index 000000000..d18d48114 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_BARYONS +#define C_INTERFACE_TEST_V2_0_POPS_BARYONS + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Baryons +BaryonsDefault(); + +// --- Create, general, const +extern_c Handle2ConstBaryons +BaryonsCreateConst( + ConstHandle2Baryon *const baryon, const size_t baryonSize +); + +// +++ Create, general +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 +); + +// +++ Has, by id +extern_c int +BaryonsBaryonHasById( + ConstHandle2ConstBaryons self, + const XMLName id +); + +// --- Get, by id, const +extern_c Handle2ConstBaryon +BaryonsBaryonGetByIdConst( + ConstHandle2ConstBaryons self, + const XMLName id +); + +// +++ Get, by id, non-const +extern_c Handle2Baryon +BaryonsBaryonGetById( + ConstHandle2Baryons self, + const XMLName id +); + +// +++ Set, by id +extern_c void +BaryonsBaryonSetById( + ConstHandle2Baryons self, + const XMLName id, + ConstHandle2ConstBaryon baryon +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Baryons/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Baryons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy.cpp new file mode 100644 index 000000000..5f899de61 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy.cpp @@ -0,0 +1,538 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/BindingEnergy.hpp" +#include "BindingEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BindingEnergyClass; +using CPP = multigroup::BindingEnergy; + +static const std::string CLASSNAME = "BindingEnergy"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; +using CPPDouble = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBindingEnergy +BindingEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2BindingEnergy +BindingEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBindingEnergy +BindingEnergyCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2BindingEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + BindingEnergyDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Create, general +Handle2BindingEnergy +BindingEnergyCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2BindingEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + BindingEnergyDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Assign +// Use this to assign 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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +BindingEnergyLabelHas(ConstHandle2ConstBindingEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +BindingEnergyLabelGet(ConstHandle2ConstBindingEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +BindingEnergyLabelSet(ConstHandle2BindingEnergy self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +BindingEnergyUnitHas(ConstHandle2ConstBindingEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +BindingEnergyUnitGet(ConstHandle2ConstBindingEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +BindingEnergyUnitSet(ConstHandle2BindingEnergy self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +BindingEnergyValueHas(ConstHandle2ConstBindingEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +BindingEnergyValueGet(ConstHandle2ConstBindingEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +BindingEnergyValueSet(ConstHandle2BindingEnergy self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +BindingEnergyDocumentationHas(ConstHandle2ConstBindingEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +BindingEnergyDocumentationGetConst(ConstHandle2ConstBindingEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +BindingEnergyDocumentationGet(ConstHandle2BindingEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +BindingEnergyDocumentationSet(ConstHandle2BindingEnergy self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +BindingEnergyUncertaintyHas(ConstHandle2ConstBindingEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +BindingEnergyUncertaintyGetConst(ConstHandle2ConstBindingEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +BindingEnergyUncertaintyGet(ConstHandle2BindingEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +BindingEnergyUncertaintySet(ConstHandle2BindingEnergy self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +BindingEnergyDoubleHas(ConstHandle2ConstBindingEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Clear +void +BindingEnergyDoubleClear(ConstHandle2BindingEnergy self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DoubleClear", self, extract::Double); +} + +// Size +size_t +BindingEnergyDoubleSize(ConstHandle2ConstBindingEnergy self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DoubleSize", self, extract::Double); +} + +// Add +void +BindingEnergyDoubleAdd(ConstHandle2BindingEnergy self, ConstHandle2ConstDouble Double) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DoubleAdd", self, extract::Double, Double); +} + +// Get, by index \in [0,size), const +Handle2ConstDouble +BindingEnergyDoubleGetConst(ConstHandle2ConstBindingEnergy self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Double +BindingEnergyDoubleGet(ConstHandle2BindingEnergy self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double, index_); +} + +// Set, by index \in [0,size) +void +BindingEnergyDoubleSet( + ConstHandle2BindingEnergy self, + const size_t index_, + ConstHandle2ConstDouble Double +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, index_, Double); +} + +// Has, by label +int +BindingEnergyDoubleHasByLabel( + ConstHandle2ConstBindingEnergy self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByLabel", + self, extract::Double, meta::label, label); +} + +// Get, by label, const +Handle2ConstDouble +BindingEnergyDoubleGetByLabelConst( + ConstHandle2ConstBindingEnergy self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabelConst", + self, extract::Double, meta::label, label); +} + +// Get, by label, non-const +Handle2Double +BindingEnergyDoubleGetByLabel( + ConstHandle2BindingEnergy self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabel", + self, extract::Double, meta::label, label); +} + +// Set, by label +void +BindingEnergyDoubleSetByLabel( + ConstHandle2BindingEnergy self, + const XMLName label, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByLabel", + self, extract::Double, meta::label, label, Double); +} + +// Has, by unit +int +BindingEnergyDoubleHasByUnit( + ConstHandle2ConstBindingEnergy self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByUnit", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstDouble +BindingEnergyDoubleGetByUnitConst( + ConstHandle2ConstBindingEnergy self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnitConst", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Double +BindingEnergyDoubleGetByUnit( + ConstHandle2BindingEnergy self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnit", + self, extract::Double, meta::unit, unit); +} + +// Set, by unit +void +BindingEnergyDoubleSetByUnit( + ConstHandle2BindingEnergy self, + const XMLName unit, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByUnit", + self, extract::Double, meta::unit, unit, Double); +} + +// Has, by value +int +BindingEnergyDoubleHasByValue( + ConstHandle2ConstBindingEnergy self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByValue", + self, extract::Double, meta::value, value); +} + +// Get, by value, const +Handle2ConstDouble +BindingEnergyDoubleGetByValueConst( + ConstHandle2ConstBindingEnergy self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValueConst", + self, extract::Double, meta::value, value); +} + +// Get, by value, non-const +Handle2Double +BindingEnergyDoubleGetByValue( + ConstHandle2BindingEnergy self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValue", + self, extract::Double, meta::value, value); +} + +// Set, by value +void +BindingEnergyDoubleSetByValue( + ConstHandle2BindingEnergy self, + const Float64 value, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByValue", + self, extract::Double, meta::value, value, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/BindingEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy.h new file mode 100644 index 000000000..2ddedd0eb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy.h @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_BINDINGENERGY +#define C_INTERFACE_TEST_V2_0_POPS_BINDINGENERGY + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" +#include "v2.0/containers/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 +extern_c Handle2BindingEnergy +BindingEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBindingEnergy +BindingEnergyCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Create, general +extern_c Handle2BindingEnergy +BindingEnergyCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BindingEnergyLabelHas(ConstHandle2ConstBindingEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BindingEnergyLabelGet(ConstHandle2ConstBindingEnergy self); + +// +++ Set +extern_c void +BindingEnergyLabelSet(ConstHandle2BindingEnergy self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BindingEnergyUnitHas(ConstHandle2ConstBindingEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BindingEnergyUnitGet(ConstHandle2ConstBindingEnergy self); + +// +++ Set +extern_c void +BindingEnergyUnitSet(ConstHandle2BindingEnergy self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BindingEnergyValueHas(ConstHandle2ConstBindingEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BindingEnergyValueGet(ConstHandle2ConstBindingEnergy self); + +// +++ Set +extern_c void +BindingEnergyValueSet(ConstHandle2BindingEnergy self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BindingEnergyDocumentationHas(ConstHandle2ConstBindingEnergy self); + +// --- Get, const +extern_c Handle2ConstDocumentation +BindingEnergyDocumentationGetConst(ConstHandle2ConstBindingEnergy self); + +// +++ Get, non-const +extern_c Handle2Documentation +BindingEnergyDocumentationGet(ConstHandle2BindingEnergy self); + +// +++ Set +extern_c void +BindingEnergyDocumentationSet(ConstHandle2BindingEnergy self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BindingEnergyUncertaintyHas(ConstHandle2ConstBindingEnergy self); + +// --- Get, const +extern_c Handle2ConstUncertainty +BindingEnergyUncertaintyGetConst(ConstHandle2ConstBindingEnergy self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +BindingEnergyUncertaintyGet(ConstHandle2BindingEnergy self); + +// +++ Set +extern_c void +BindingEnergyUncertaintySet(ConstHandle2BindingEnergy self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BindingEnergyDoubleHas(ConstHandle2ConstBindingEnergy self); + +// +++ Clear +extern_c void +BindingEnergyDoubleClear(ConstHandle2BindingEnergy self); + +// +++ Size +extern_c size_t +BindingEnergyDoubleSize(ConstHandle2ConstBindingEnergy self); + +// +++ Add +extern_c void +BindingEnergyDoubleAdd(ConstHandle2BindingEnergy self, ConstHandle2ConstDouble Double); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDouble +BindingEnergyDoubleGetConst(ConstHandle2ConstBindingEnergy self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Double +BindingEnergyDoubleGet(ConstHandle2BindingEnergy self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +BindingEnergyDoubleSet( + ConstHandle2BindingEnergy self, + const size_t index_, + ConstHandle2ConstDouble Double +); + +// +++ Has, by label +extern_c int +BindingEnergyDoubleHasByLabel( + ConstHandle2ConstBindingEnergy self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstDouble +BindingEnergyDoubleGetByLabelConst( + ConstHandle2ConstBindingEnergy self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Double +BindingEnergyDoubleGetByLabel( + ConstHandle2BindingEnergy self, + const XMLName label +); + +// +++ Set, by label +extern_c void +BindingEnergyDoubleSetByLabel( + ConstHandle2BindingEnergy self, + const XMLName label, + ConstHandle2ConstDouble Double +); + +// +++ Has, by unit +extern_c int +BindingEnergyDoubleHasByUnit( + ConstHandle2ConstBindingEnergy self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstDouble +BindingEnergyDoubleGetByUnitConst( + ConstHandle2ConstBindingEnergy self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Double +BindingEnergyDoubleGetByUnit( + ConstHandle2BindingEnergy self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +BindingEnergyDoubleSetByUnit( + ConstHandle2BindingEnergy self, + const XMLName unit, + ConstHandle2ConstDouble Double +); + +// +++ Has, by value +extern_c int +BindingEnergyDoubleHasByValue( + ConstHandle2ConstBindingEnergy self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstDouble +BindingEnergyDoubleGetByValueConst( + ConstHandle2ConstBindingEnergy self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2Double +BindingEnergyDoubleGetByValue( + ConstHandle2BindingEnergy self, + const Float64 value +); + +// +++ Set, by value +extern_c void +BindingEnergyDoubleSetByValue( + ConstHandle2BindingEnergy self, + const Float64 value, + ConstHandle2ConstDouble Double +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/BindingEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/BindingEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Charge.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Charge.cpp new file mode 100644 index 000000000..30911ca00 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Charge.cpp @@ -0,0 +1,331 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Charge.hpp" +#include "Charge.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ChargeClass; +using CPP = multigroup::Charge; + +static const std::string CLASSNAME = "Charge"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; +using CPPInteger = containers::Integer; +using CPPFraction = containers::Fraction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCharge +ChargeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Charge +ChargeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCharge +ChargeCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, +) { + ConstHandle2Charge handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Charge +ChargeCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, +) { + ConstHandle2Charge handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ChargeLabelHas(ConstHandle2ConstCharge self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ChargeLabelGet(ConstHandle2ConstCharge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ChargeLabelSet(ConstHandle2Charge self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +ChargeUnitHas(ConstHandle2ConstCharge self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +ChargeUnitGet(ConstHandle2ConstCharge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +ChargeUnitSet(ConstHandle2Charge self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +ChargeValueHas(ConstHandle2ConstCharge self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +ChargeValueGet(ConstHandle2ConstCharge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +ChargeValueSet(ConstHandle2Charge self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +ChargeDocumentationHas(ConstHandle2ConstCharge self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +ChargeDocumentationGetConst(ConstHandle2ConstCharge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +ChargeDocumentationGet(ConstHandle2Charge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +ChargeDocumentationSet(ConstHandle2Charge self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +ChargeUncertaintyHas(ConstHandle2ConstCharge self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +ChargeUncertaintyGetConst(ConstHandle2ConstCharge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +ChargeUncertaintyGet(ConstHandle2Charge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +ChargeUncertaintySet(ConstHandle2Charge self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Charge/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Charge.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Charge.h new file mode 100644 index 000000000..9f2d87a9c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Charge.h @@ -0,0 +1,247 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_CHARGE +#define C_INTERFACE_TEST_V2_0_POPS_CHARGE + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" +#include "v2.0/containers/Integer.h" +#include "v2.0/containers/Fraction.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 +extern_c Handle2Charge +ChargeDefault(); + +// --- Create, general, const +extern_c Handle2ConstCharge +ChargeCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, +); + +// +++ Create, general +extern_c Handle2Charge +ChargeCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + 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 +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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChargeLabelHas(ConstHandle2ConstCharge self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ChargeLabelGet(ConstHandle2ConstCharge self); + +// +++ Set +extern_c void +ChargeLabelSet(ConstHandle2Charge self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChargeUnitHas(ConstHandle2ConstCharge self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ChargeUnitGet(ConstHandle2ConstCharge self); + +// +++ Set +extern_c void +ChargeUnitSet(ConstHandle2Charge self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChargeValueHas(ConstHandle2ConstCharge self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ChargeValueGet(ConstHandle2ConstCharge self); + +// +++ Set +extern_c void +ChargeValueSet(ConstHandle2Charge self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChargeDocumentationHas(ConstHandle2ConstCharge self); + +// --- Get, const +extern_c Handle2ConstDocumentation +ChargeDocumentationGetConst(ConstHandle2ConstCharge self); + +// +++ Get, non-const +extern_c Handle2Documentation +ChargeDocumentationGet(ConstHandle2Charge self); + +// +++ Set +extern_c void +ChargeDocumentationSet(ConstHandle2Charge self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChargeUncertaintyHas(ConstHandle2ConstCharge self); + +// --- Get, const +extern_c Handle2ConstUncertainty +ChargeUncertaintyGetConst(ConstHandle2ConstCharge self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +ChargeUncertaintyGet(ConstHandle2Charge self); + +// +++ Set +extern_c void +ChargeUncertaintySet(ConstHandle2Charge self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Charge/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Charge/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Charge/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Charge/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Charge/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElement.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElement.cpp new file mode 100644 index 000000000..171938b3a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElement.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/ChemicalElement.hpp" +#include "ChemicalElement.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Atomic; +using CPPIsotopes = pops::Isotopes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChemicalElement +ChemicalElementDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ChemicalElement +ChemicalElementDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstChemicalElement +ChemicalElementCreateConst( + const XMLName symbol, + const Integer32 Z, + const XMLName 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 +Handle2ChemicalElement +ChemicalElementCreate( + const XMLName symbol, + const Integer32 Z, + const XMLName 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 +XMLName +ChemicalElementSymbolGet(ConstHandle2ConstChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SymbolGet", self, extract::symbol); +} + +// Set +void +ChemicalElementSymbolSet(ConstHandle2ChemicalElement self, const XMLName 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 +Integer32 +ChemicalElementZGet(ConstHandle2ConstChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ZGet", self, extract::Z); +} + +// Set +void +ChemicalElementZSet(ConstHandle2ChemicalElement self, const Integer32 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 +XMLName +ChemicalElementNameGet(ConstHandle2ConstChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +ChemicalElementNameSet(ConstHandle2ChemicalElement self, const XMLName 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/pops/ChemicalElement/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElement.h b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElement.h new file mode 100644 index 000000000..cdfe2a555 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_CHEMICALELEMENT +#define C_INTERFACE_TEST_V2_0_POPS_CHEMICALELEMENT + +#include "GNDStk.h" +#include "v2.0/pops/Atomic.h" +#include "v2.0/pops/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 +extern_c Handle2ChemicalElement +ChemicalElementDefault(); + +// --- Create, general, const +extern_c Handle2ConstChemicalElement +ChemicalElementCreateConst( + const XMLName symbol, + const Integer32 Z, + const XMLName name, + ConstHandle2ConstAtomic atomic, + ConstHandle2ConstIsotopes isotopes +); + +// +++ Create, general +extern_c Handle2ChemicalElement +ChemicalElementCreate( + const XMLName symbol, + const Integer32 Z, + const XMLName 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 XMLName +ChemicalElementSymbolGet(ConstHandle2ConstChemicalElement self); + +// +++ Set +extern_c void +ChemicalElementSymbolSet(ConstHandle2ChemicalElement self, const XMLName symbol); + + +// ----------------------------------------------------------------------------- +// Metadatum: Z +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChemicalElementZHas(ConstHandle2ConstChemicalElement self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ChemicalElementZGet(ConstHandle2ConstChemicalElement self); + +// +++ Set +extern_c void +ChemicalElementZSet(ConstHandle2ChemicalElement self, const Integer32 Z); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChemicalElementNameHas(ConstHandle2ConstChemicalElement self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ChemicalElementNameGet(ConstHandle2ConstChemicalElement self); + +// +++ Set +extern_c void +ChemicalElementNameSet(ConstHandle2ChemicalElement self, const XMLName 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/pops/ChemicalElement/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElement/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElement/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElement/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElement/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements.cpp new file mode 100644 index 000000000..ac7e6770d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/ChemicalElements.hpp" +#include "ChemicalElements.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::ChemicalElement; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChemicalElements +ChemicalElementsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by symbol +int +ChemicalElementsChemicalElementHasBySymbol( + ConstHandle2ConstChemicalElements self, + const XMLName symbol +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementHasBySymbol", + self, extract::chemicalElement, meta::symbol, symbol); +} + +// Get, by symbol, const +Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetBySymbolConst( + ConstHandle2ConstChemicalElements self, + const XMLName symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetBySymbolConst", + self, extract::chemicalElement, meta::symbol, symbol); +} + +// Get, by symbol, non-const +Handle2ChemicalElement +ChemicalElementsChemicalElementGetBySymbol( + ConstHandle2ChemicalElements self, + const XMLName symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetBySymbol", + self, extract::chemicalElement, meta::symbol, symbol); +} + +// Set, by symbol +void +ChemicalElementsChemicalElementSetBySymbol( + ConstHandle2ChemicalElements self, + const XMLName symbol, + ConstHandle2ConstChemicalElement chemicalElement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementSetBySymbol", + self, extract::chemicalElement, meta::symbol, symbol, chemicalElement); +} + +// Has, by Z +int +ChemicalElementsChemicalElementHasByZ( + ConstHandle2ConstChemicalElements self, + const Integer32 Z +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementHasByZ", + self, extract::chemicalElement, meta::Z, Z); +} + +// Get, by Z, const +Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetByZConst( + ConstHandle2ConstChemicalElements self, + const Integer32 Z +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetByZConst", + self, extract::chemicalElement, meta::Z, Z); +} + +// Get, by Z, non-const +Handle2ChemicalElement +ChemicalElementsChemicalElementGetByZ( + ConstHandle2ChemicalElements self, + const Integer32 Z +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetByZ", + self, extract::chemicalElement, meta::Z, Z); +} + +// Set, by Z +void +ChemicalElementsChemicalElementSetByZ( + ConstHandle2ChemicalElements self, + const Integer32 Z, + ConstHandle2ConstChemicalElement chemicalElement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementSetByZ", + self, extract::chemicalElement, meta::Z, Z, chemicalElement); +} + +// Has, by name +int +ChemicalElementsChemicalElementHasByName( + ConstHandle2ConstChemicalElements self, + const XMLName name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementHasByName", + self, extract::chemicalElement, meta::name, name); +} + +// Get, by name, const +Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetByNameConst( + ConstHandle2ConstChemicalElements self, + const XMLName name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetByNameConst", + self, extract::chemicalElement, meta::name, name); +} + +// Get, by name, non-const +Handle2ChemicalElement +ChemicalElementsChemicalElementGetByName( + ConstHandle2ChemicalElements self, + const XMLName name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetByName", + self, extract::chemicalElement, meta::name, name); +} + +// Set, by name +void +ChemicalElementsChemicalElementSetByName( + ConstHandle2ChemicalElements self, + const XMLName name, + ConstHandle2ConstChemicalElement chemicalElement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementSetByName", + self, extract::chemicalElement, meta::name, name, chemicalElement); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/ChemicalElements/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements.h b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements.h new file mode 100644 index 000000000..794cab9ef --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements.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. +// +// 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_TEST_V2_0_POPS_CHEMICALELEMENTS +#define C_INTERFACE_TEST_V2_0_POPS_CHEMICALELEMENTS + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2ChemicalElements +ChemicalElementsDefault(); + +// --- Create, general, const +extern_c Handle2ConstChemicalElements +ChemicalElementsCreateConst( + ConstHandle2ChemicalElement *const chemicalElement, const size_t chemicalElementSize +); + +// +++ Create, general +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 +); + +// +++ Has, by symbol +extern_c int +ChemicalElementsChemicalElementHasBySymbol( + ConstHandle2ConstChemicalElements self, + const XMLName symbol +); + +// --- Get, by symbol, const +extern_c Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetBySymbolConst( + ConstHandle2ConstChemicalElements self, + const XMLName symbol +); + +// +++ Get, by symbol, non-const +extern_c Handle2ChemicalElement +ChemicalElementsChemicalElementGetBySymbol( + ConstHandle2ChemicalElements self, + const XMLName symbol +); + +// +++ Set, by symbol +extern_c void +ChemicalElementsChemicalElementSetBySymbol( + ConstHandle2ChemicalElements self, + const XMLName symbol, + ConstHandle2ConstChemicalElement chemicalElement +); + +// +++ Has, by Z +extern_c int +ChemicalElementsChemicalElementHasByZ( + ConstHandle2ConstChemicalElements self, + const Integer32 Z +); + +// --- Get, by Z, const +extern_c Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetByZConst( + ConstHandle2ConstChemicalElements self, + const Integer32 Z +); + +// +++ Get, by Z, non-const +extern_c Handle2ChemicalElement +ChemicalElementsChemicalElementGetByZ( + ConstHandle2ChemicalElements self, + const Integer32 Z +); + +// +++ Set, by Z +extern_c void +ChemicalElementsChemicalElementSetByZ( + ConstHandle2ChemicalElements self, + const Integer32 Z, + ConstHandle2ConstChemicalElement chemicalElement +); + +// +++ Has, by name +extern_c int +ChemicalElementsChemicalElementHasByName( + ConstHandle2ConstChemicalElements self, + const XMLName name +); + +// --- Get, by name, const +extern_c Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetByNameConst( + ConstHandle2ConstChemicalElements self, + const XMLName name +); + +// +++ Get, by name, non-const +extern_c Handle2ChemicalElement +ChemicalElementsChemicalElementGetByName( + ConstHandle2ChemicalElements self, + const XMLName name +); + +// +++ Set, by name +extern_c void +ChemicalElementsChemicalElementSetByName( + ConstHandle2ChemicalElements self, + const XMLName name, + ConstHandle2ConstChemicalElement chemicalElement +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/ChemicalElements/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/ChemicalElements/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals.cpp new file mode 100644 index 000000000..2e311d028 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/ConfidenceIntervals.hpp" +#include "ConfidenceIntervals.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ConfidenceIntervalsClass; +using CPP = multigroup::ConfidenceIntervals; + +static const std::string CLASSNAME = "ConfidenceIntervals"; + +namespace extract { + static auto interval = [](auto &obj) { return &obj.interval; }; +} + +using CPPInterval = pops::Interval; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConfidenceIntervals +ConfidenceIntervalsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ConfidenceIntervals +ConfidenceIntervalsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConfidenceIntervals +ConfidenceIntervalsCreateConst( + ConstHandle2Interval *const interval, const size_t intervalSize +) { + ConstHandle2ConfidenceIntervals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t IntervalN = 0; IntervalN < intervalSize; ++IntervalN) + ConfidenceIntervalsIntervalAdd(handle, interval[IntervalN]); + return handle; +} + +// Create, general +Handle2ConfidenceIntervals +ConfidenceIntervalsCreate( + ConstHandle2Interval *const interval, const size_t intervalSize +) { + ConstHandle2ConfidenceIntervals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t IntervalN = 0; IntervalN < intervalSize; ++IntervalN) + ConfidenceIntervalsIntervalAdd(handle, interval[IntervalN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ConfidenceIntervalsAssign(ConstHandle2ConfidenceIntervals self, ConstHandle2ConstConfidenceIntervals from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ConfidenceIntervalsDelete(ConstHandle2ConstConfidenceIntervals self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ConfidenceIntervalsRead(ConstHandle2ConfidenceIntervals self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ConfidenceIntervalsWrite(ConstHandle2ConstConfidenceIntervals self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ConfidenceIntervalsPrint(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ConfidenceIntervalsPrintXML(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ConfidenceIntervalsPrintJSON(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: interval +// ----------------------------------------------------------------------------- + +// Has +int +ConfidenceIntervalsIntervalHas(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IntervalHas", self, extract::interval); +} + +// Clear +void +ConfidenceIntervalsIntervalClear(ConstHandle2ConfidenceIntervals self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"IntervalClear", self, extract::interval); +} + +// Size +size_t +ConfidenceIntervalsIntervalSize(ConstHandle2ConstConfidenceIntervals self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"IntervalSize", self, extract::interval); +} + +// Add +void +ConfidenceIntervalsIntervalAdd(ConstHandle2ConfidenceIntervals self, ConstHandle2ConstInterval interval) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"IntervalAdd", self, extract::interval, interval); +} + +// Get, by index \in [0,size), const +Handle2ConstInterval +ConfidenceIntervalsIntervalGetConst(ConstHandle2ConstConfidenceIntervals self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IntervalGetConst", self, extract::interval, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Interval +ConfidenceIntervalsIntervalGet(ConstHandle2ConfidenceIntervals self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IntervalGet", self, extract::interval, index_); +} + +// Set, by index \in [0,size) +void +ConfidenceIntervalsIntervalSet( + ConstHandle2ConfidenceIntervals self, + const size_t index_, + ConstHandle2ConstInterval interval +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"IntervalSet", self, extract::interval, index_, interval); +} + +// Has, by confidence +int +ConfidenceIntervalsIntervalHasByConfidence( + ConstHandle2ConstConfidenceIntervals self, + const Float64 confidence +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IntervalHasByConfidence", + self, extract::interval, meta::confidence, confidence); +} + +// Get, by confidence, const +Handle2ConstInterval +ConfidenceIntervalsIntervalGetByConfidenceConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 confidence +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByConfidenceConst", + self, extract::interval, meta::confidence, confidence); +} + +// Get, by confidence, non-const +Handle2Interval +ConfidenceIntervalsIntervalGetByConfidence( + ConstHandle2ConfidenceIntervals self, + const Float64 confidence +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByConfidence", + self, extract::interval, meta::confidence, confidence); +} + +// Set, by confidence +void +ConfidenceIntervalsIntervalSetByConfidence( + ConstHandle2ConfidenceIntervals self, + const Float64 confidence, + ConstHandle2ConstInterval interval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IntervalSetByConfidence", + self, extract::interval, meta::confidence, confidence, interval); +} + +// Has, by lower +int +ConfidenceIntervalsIntervalHasByLower( + ConstHandle2ConstConfidenceIntervals self, + const Float64 lower +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IntervalHasByLower", + self, extract::interval, meta::lower, lower); +} + +// Get, by lower, const +Handle2ConstInterval +ConfidenceIntervalsIntervalGetByLowerConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 lower +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByLowerConst", + self, extract::interval, meta::lower, lower); +} + +// Get, by lower, non-const +Handle2Interval +ConfidenceIntervalsIntervalGetByLower( + ConstHandle2ConfidenceIntervals self, + const Float64 lower +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByLower", + self, extract::interval, meta::lower, lower); +} + +// Set, by lower +void +ConfidenceIntervalsIntervalSetByLower( + ConstHandle2ConfidenceIntervals self, + const Float64 lower, + ConstHandle2ConstInterval interval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IntervalSetByLower", + self, extract::interval, meta::lower, lower, interval); +} + +// Has, by upper +int +ConfidenceIntervalsIntervalHasByUpper( + ConstHandle2ConstConfidenceIntervals self, + const Float64 upper +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IntervalHasByUpper", + self, extract::interval, meta::upper, upper); +} + +// Get, by upper, const +Handle2ConstInterval +ConfidenceIntervalsIntervalGetByUpperConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 upper +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByUpperConst", + self, extract::interval, meta::upper, upper); +} + +// Get, by upper, non-const +Handle2Interval +ConfidenceIntervalsIntervalGetByUpper( + ConstHandle2ConfidenceIntervals self, + const Float64 upper +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntervalGetByUpper", + self, extract::interval, meta::upper, upper); +} + +// Set, by upper +void +ConfidenceIntervalsIntervalSetByUpper( + ConstHandle2ConfidenceIntervals self, + const Float64 upper, + ConstHandle2ConstInterval interval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IntervalSetByUpper", + self, extract::interval, meta::upper, upper, interval); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/ConfidenceIntervals/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals.h b/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals.h new file mode 100644 index 000000000..f8b868945 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals.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. +// +// ConfidenceIntervals is the basic handle type in this file. Example: +// // Create a default ConfidenceIntervals object: +// ConfidenceIntervals handle = ConfidenceIntervalsDefault(); +// Functions involving ConfidenceIntervals are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_POPS_CONFIDENCEINTERVALS +#define C_INTERFACE_TEST_V2_0_POPS_CONFIDENCEINTERVALS + +#include "GNDStk.h" +#include "v2.0/pops/Interval.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ConfidenceIntervalsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ConfidenceIntervals +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ConfidenceIntervalsClass *ConfidenceIntervals; + +// --- Const-aware handles. +typedef const struct ConfidenceIntervalsClass *const ConstHandle2ConstConfidenceIntervals; +typedef struct ConfidenceIntervalsClass *const ConstHandle2ConfidenceIntervals; +typedef const struct ConfidenceIntervalsClass * Handle2ConstConfidenceIntervals; +typedef struct ConfidenceIntervalsClass * Handle2ConfidenceIntervals; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstConfidenceIntervals +ConfidenceIntervalsDefaultConst(); + +// +++ Create, default +extern_c Handle2ConfidenceIntervals +ConfidenceIntervalsDefault(); + +// --- Create, general, const +extern_c Handle2ConstConfidenceIntervals +ConfidenceIntervalsCreateConst( + ConstHandle2Interval *const interval, const size_t intervalSize +); + +// +++ Create, general +extern_c Handle2ConfidenceIntervals +ConfidenceIntervalsCreate( + ConstHandle2Interval *const interval, const size_t intervalSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ConfidenceIntervalsAssign(ConstHandle2ConfidenceIntervals self, ConstHandle2ConstConfidenceIntervals from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ConfidenceIntervalsDelete(ConstHandle2ConstConfidenceIntervals self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ConfidenceIntervalsRead(ConstHandle2ConfidenceIntervals self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ConfidenceIntervalsWrite(ConstHandle2ConstConfidenceIntervals self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ConfidenceIntervalsPrint(ConstHandle2ConstConfidenceIntervals self); + +// +++ Print to standard output, as XML +extern_c int +ConfidenceIntervalsPrintXML(ConstHandle2ConstConfidenceIntervals self); + +// +++ Print to standard output, as JSON +extern_c int +ConfidenceIntervalsPrintJSON(ConstHandle2ConstConfidenceIntervals self); + + +// ----------------------------------------------------------------------------- +// Child: interval +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ConfidenceIntervalsIntervalHas(ConstHandle2ConstConfidenceIntervals self); + +// +++ Clear +extern_c void +ConfidenceIntervalsIntervalClear(ConstHandle2ConfidenceIntervals self); + +// +++ Size +extern_c size_t +ConfidenceIntervalsIntervalSize(ConstHandle2ConstConfidenceIntervals self); + +// +++ Add +extern_c void +ConfidenceIntervalsIntervalAdd(ConstHandle2ConfidenceIntervals self, ConstHandle2ConstInterval interval); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstInterval +ConfidenceIntervalsIntervalGetConst(ConstHandle2ConstConfidenceIntervals self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Interval +ConfidenceIntervalsIntervalGet(ConstHandle2ConfidenceIntervals self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ConfidenceIntervalsIntervalSet( + ConstHandle2ConfidenceIntervals self, + const size_t index_, + ConstHandle2ConstInterval interval +); + +// +++ Has, by confidence +extern_c int +ConfidenceIntervalsIntervalHasByConfidence( + ConstHandle2ConstConfidenceIntervals self, + const Float64 confidence +); + +// --- Get, by confidence, const +extern_c Handle2ConstInterval +ConfidenceIntervalsIntervalGetByConfidenceConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 confidence +); + +// +++ Get, by confidence, non-const +extern_c Handle2Interval +ConfidenceIntervalsIntervalGetByConfidence( + ConstHandle2ConfidenceIntervals self, + const Float64 confidence +); + +// +++ Set, by confidence +extern_c void +ConfidenceIntervalsIntervalSetByConfidence( + ConstHandle2ConfidenceIntervals self, + const Float64 confidence, + ConstHandle2ConstInterval interval +); + +// +++ Has, by lower +extern_c int +ConfidenceIntervalsIntervalHasByLower( + ConstHandle2ConstConfidenceIntervals self, + const Float64 lower +); + +// --- Get, by lower, const +extern_c Handle2ConstInterval +ConfidenceIntervalsIntervalGetByLowerConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 lower +); + +// +++ Get, by lower, non-const +extern_c Handle2Interval +ConfidenceIntervalsIntervalGetByLower( + ConstHandle2ConfidenceIntervals self, + const Float64 lower +); + +// +++ Set, by lower +extern_c void +ConfidenceIntervalsIntervalSetByLower( + ConstHandle2ConfidenceIntervals self, + const Float64 lower, + ConstHandle2ConstInterval interval +); + +// +++ Has, by upper +extern_c int +ConfidenceIntervalsIntervalHasByUpper( + ConstHandle2ConstConfidenceIntervals self, + const Float64 upper +); + +// --- Get, by upper, const +extern_c Handle2ConstInterval +ConfidenceIntervalsIntervalGetByUpperConst( + ConstHandle2ConstConfidenceIntervals self, + const Float64 upper +); + +// +++ Get, by upper, non-const +extern_c Handle2Interval +ConfidenceIntervalsIntervalGetByUpper( + ConstHandle2ConfidenceIntervals self, + const Float64 upper +); + +// +++ Set, by upper +extern_c void +ConfidenceIntervalsIntervalSetByUpper( + ConstHandle2ConfidenceIntervals self, + const Float64 upper, + ConstHandle2ConstInterval interval +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/ConfidenceIntervals/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/ConfidenceIntervals/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration.cpp new file mode 100644 index 000000000..f4dfcf502 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Configuration.hpp" +#include "Configuration.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::BindingEnergy; +using CPPDecayData = pops::DecayData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConfiguration +ConfigurationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Configuration +ConfigurationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConfiguration +ConfigurationCreateConst( + const char *const subshell, + const Float64 electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Configuration handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + subshell, + electronNumber, + detail::tocpp(bindingEnergy), + detail::tocpp(decayData) + ); + return handle; +} + +// Create, general +Handle2Configuration +ConfigurationCreate( + const char *const subshell, + const Float64 electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Configuration handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + subshell, + electronNumber, + detail::tocpp(bindingEnergy), + 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 +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 +Float64 +ConfigurationElectronNumberGet(ConstHandle2ConstConfiguration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ElectronNumberGet", self, extract::electronNumber); +} + +// Set +void +ConfigurationElectronNumberSet(ConstHandle2Configuration self, const Float64 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); +} + +// Get, const +Handle2ConstDecayData +ConfigurationDecayDataGetConst(ConstHandle2ConstConfiguration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGetConst", self, extract::decayData); +} + +// Get, non-const +Handle2DecayData +ConfigurationDecayDataGet(ConstHandle2Configuration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGet", self, extract::decayData); +} + +// Set +void +ConfigurationDecayDataSet(ConstHandle2Configuration self, ConstHandle2ConstDecayData decayData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DecayDataSet", self, extract::decayData, decayData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Configuration/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration.h new file mode 100644 index 000000000..948395b9f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration.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. +// +// 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_TEST_V2_0_POPS_CONFIGURATION +#define C_INTERFACE_TEST_V2_0_POPS_CONFIGURATION + +#include "GNDStk.h" +#include "v2.0/pops/BindingEnergy.h" +#include "v2.0/pops/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 +extern_c Handle2Configuration +ConfigurationDefault(); + +// --- Create, general, const +extern_c Handle2ConstConfiguration +ConfigurationCreateConst( + const char *const subshell, + const Float64 electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy, + ConstHandle2ConstDecayData decayData +); + +// +++ Create, general +extern_c Handle2Configuration +ConfigurationCreate( + const char *const subshell, + const Float64 electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy, + 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 +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 Float64 +ConfigurationElectronNumberGet(ConstHandle2ConstConfiguration self); + +// +++ Set +extern_c void +ConfigurationElectronNumberSet(ConstHandle2Configuration self, const Float64 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); + +// --- Get, const +extern_c Handle2ConstDecayData +ConfigurationDecayDataGetConst(ConstHandle2ConstConfiguration self); + +// +++ Get, non-const +extern_c Handle2DecayData +ConfigurationDecayDataGet(ConstHandle2Configuration self); + +// +++ Set +extern_c void +ConfigurationDecayDataSet(ConstHandle2Configuration self, ConstHandle2ConstDecayData decayData); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Configuration/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Configuration/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations.cpp new file mode 100644 index 000000000..994add2da --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Configurations.hpp" +#include "Configurations.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Configuration; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConfigurations +ConfigurationsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// 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); +} + +// Has, by electronNumber +int +ConfigurationsConfigurationHasByElectronNumber( + ConstHandle2ConstConfigurations self, + const Float64 electronNumber +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationHasByElectronNumber", + self, extract::configuration, meta::electronNumber, electronNumber); +} + +// Get, by electronNumber, const +Handle2ConstConfiguration +ConfigurationsConfigurationGetByElectronNumberConst( + ConstHandle2ConstConfigurations self, + const Float64 electronNumber +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationGetByElectronNumberConst", + self, extract::configuration, meta::electronNumber, electronNumber); +} + +// Get, by electronNumber, non-const +Handle2Configuration +ConfigurationsConfigurationGetByElectronNumber( + ConstHandle2Configurations self, + const Float64 electronNumber +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationGetByElectronNumber", + self, extract::configuration, meta::electronNumber, electronNumber); +} + +// Set, by electronNumber +void +ConfigurationsConfigurationSetByElectronNumber( + ConstHandle2Configurations self, + const Float64 electronNumber, + ConstHandle2ConstConfiguration configuration +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationSetByElectronNumber", + self, extract::configuration, meta::electronNumber, electronNumber, configuration); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Configurations/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations.h new file mode 100644 index 000000000..9dac5fea7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_CONFIGURATIONS +#define C_INTERFACE_TEST_V2_0_POPS_CONFIGURATIONS + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Configurations +ConfigurationsDefault(); + +// --- Create, general, const +extern_c Handle2ConstConfigurations +ConfigurationsCreateConst( + ConstHandle2Configuration *const configuration, const size_t configurationSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ Has, by electronNumber +extern_c int +ConfigurationsConfigurationHasByElectronNumber( + ConstHandle2ConstConfigurations self, + const Float64 electronNumber +); + +// --- Get, by electronNumber, const +extern_c Handle2ConstConfiguration +ConfigurationsConfigurationGetByElectronNumberConst( + ConstHandle2ConstConfigurations self, + const Float64 electronNumber +); + +// +++ Get, by electronNumber, non-const +extern_c Handle2Configuration +ConfigurationsConfigurationGetByElectronNumber( + ConstHandle2Configurations self, + const Float64 electronNumber +); + +// +++ Set, by electronNumber +extern_c void +ConfigurationsConfigurationSetByElectronNumber( + ConstHandle2Configurations self, + const Float64 electronNumber, + ConstHandle2ConstConfiguration configuration +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Configurations/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Configurations/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Continuum.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Continuum.cpp new file mode 100644 index 000000000..89aa3f9d5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Continuum.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Continuum.hpp" +#include "Continuum.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstContinuum +ContinuumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/pops/Continuum/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Continuum.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Continuum.h new file mode 100644 index 000000000..0f4c52466 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_CONTINUUM +#define C_INTERFACE_TEST_V2_0_POPS_CONTINUUM + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2Continuum +ContinuumDefault(); + +// --- Create, general, const +extern_c Handle2ConstContinuum +ContinuumCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/pops/Continuum/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Continuum/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Continuum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Continuum/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Continuum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Decay.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Decay.cpp new file mode 100644 index 000000000..288915ff5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Decay.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Decay.hpp" +#include "Decay.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Products; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecay +DecayDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Decay +DecayDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDecay +DecayCreateConst( + const Integer32 index, + const enums::DecayType mode, + const bool complete, + ConstHandle2ConstProducts products +) { + ConstHandle2Decay handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + mode, + complete, + detail::tocpp(products) + ); + return handle; +} + +// Create, general +Handle2Decay +DecayCreate( + const Integer32 index, + const enums::DecayType 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 +Integer32 +DecayIndexGet(ConstHandle2ConstDecay self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +DecayIndexSet(ConstHandle2Decay self, const Integer32 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 +enums::DecayType +DecayModeGet(ConstHandle2ConstDecay self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ModeGet", self, extract::mode); +} + +// Set +void +DecayModeSet(ConstHandle2Decay self, const enums::DecayType 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/pops/Decay/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Decay.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Decay.h new file mode 100644 index 000000000..3f24a5039 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_DECAY +#define C_INTERFACE_TEST_V2_0_POPS_DECAY + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Decay +DecayDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecay +DecayCreateConst( + const Integer32 index, + const enums::DecayType mode, + const bool complete, + ConstHandle2ConstProducts products +); + +// +++ Create, general +extern_c Handle2Decay +DecayCreate( + const Integer32 index, + const enums::DecayType 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 Integer32 +DecayIndexGet(ConstHandle2ConstDecay self); + +// +++ Set +extern_c void +DecayIndexSet(ConstHandle2Decay self, const Integer32 index); + + +// ----------------------------------------------------------------------------- +// Metadatum: mode +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeHas(ConstHandle2ConstDecay self); + +// +++ Get +// +++ Returns by value +extern_c enums::DecayType +DecayModeGet(ConstHandle2ConstDecay self); + +// +++ Set +extern_c void +DecayModeSet(ConstHandle2Decay self, const enums::DecayType 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/pops/Decay/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Decay/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Decay/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Decay/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Decay/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayData.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayData.cpp new file mode 100644 index 000000000..89a488bf0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayData.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/DecayData.hpp" +#include "DecayData.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::DecayModes; +using CPPAverageEnergies = pops::AverageEnergies; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecayData +DecayDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/pops/DecayData/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayData.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayData.h new file mode 100644 index 000000000..7d974723a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_DECAYDATA +#define C_INTERFACE_TEST_V2_0_POPS_DECAYDATA + +#include "GNDStk.h" +#include "v2.0/pops/DecayModes.h" +#include "v2.0/pops/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 +extern_c Handle2DecayData +DecayDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayData +DecayDataCreateConst( + ConstHandle2ConstDecayModes decayModes, + ConstHandle2ConstAverageEnergies averageEnergies +); + +// +++ Create, general +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/pops/DecayData/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayData/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayData/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode.cpp new file mode 100644 index 000000000..f94587936 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode.cpp @@ -0,0 +1,466 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/DecayMode.hpp" +#include "DecayMode.h" + +using namespace njoy::GNDStk; +using namespace test::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 internalConversionCoefficients = [](auto &obj) { return &obj.internalConversionCoefficients; }; + static auto photonEmissionProbabilities = [](auto &obj) { return &obj.photonEmissionProbabilities; }; + static auto Q = [](auto &obj) { return &obj.Q; }; + static auto decayPath = [](auto &obj) { return &obj.decayPath; }; + static auto spectra = [](auto &obj) { return &obj.spectra; }; +} + +using CPPProbability = pops::Probability; +using CPPInternalConversionCoefficients = pops::InternalConversionCoefficients; +using CPPPhotonEmissionProbabilities = pops::PhotonEmissionProbabilities; +using CPPQ = pops::Q; +using CPPDecayPath = pops::DecayPath; +using CPPSpectra = pops::Spectra; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecayMode +DecayModeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2DecayMode +DecayModeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDecayMode +DecayModeCreateConst( + const XMLName label, + const enums::DecayType mode, + ConstHandle2ConstProbability probability, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstQ Q, + ConstHandle2ConstDecayPath decayPath, + ConstHandle2ConstSpectra spectra +) { + ConstHandle2DecayMode handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + mode, + detail::tocpp(probability), + detail::tocpp(internalConversionCoefficients), + detail::tocpp(photonEmissionProbabilities), + detail::tocpp(Q), + detail::tocpp(decayPath), + detail::tocpp(spectra) + ); + return handle; +} + +// Create, general +Handle2DecayMode +DecayModeCreate( + const XMLName label, + const enums::DecayType mode, + ConstHandle2ConstProbability probability, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstQ Q, + ConstHandle2ConstDecayPath decayPath, + ConstHandle2ConstSpectra spectra +) { + ConstHandle2DecayMode handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + mode, + detail::tocpp(probability), + detail::tocpp(internalConversionCoefficients), + detail::tocpp(photonEmissionProbabilities), + detail::tocpp(Q), + detail::tocpp(decayPath), + 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 +XMLName +DecayModeLabelGet(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +DecayModeLabelSet(ConstHandle2DecayMode self, const XMLName 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 +enums::DecayType +DecayModeModeGet(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ModeGet", self, extract::mode); +} + +// Set +void +DecayModeModeSet(ConstHandle2DecayMode self, const enums::DecayType 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: internalConversionCoefficients +// ----------------------------------------------------------------------------- + +// Has +int +DecayModeInternalConversionCoefficientsHas(ConstHandle2ConstDecayMode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InternalConversionCoefficientsHas", self, extract::internalConversionCoefficients); +} + +// Get, const +Handle2ConstInternalConversionCoefficients +DecayModeInternalConversionCoefficientsGetConst(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InternalConversionCoefficientsGetConst", self, extract::internalConversionCoefficients); +} + +// Get, non-const +Handle2InternalConversionCoefficients +DecayModeInternalConversionCoefficientsGet(ConstHandle2DecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InternalConversionCoefficientsGet", self, extract::internalConversionCoefficients); +} + +// Set +void +DecayModeInternalConversionCoefficientsSet(ConstHandle2DecayMode self, ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InternalConversionCoefficientsSet", self, extract::internalConversionCoefficients, internalConversionCoefficients); +} + + +// ----------------------------------------------------------------------------- +// 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: 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: 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/pops/DecayMode/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode.h new file mode 100644 index 000000000..8c314463f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode.h @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_DECAYMODE +#define C_INTERFACE_TEST_V2_0_POPS_DECAYMODE + +#include "GNDStk.h" +#include "v2.0/pops/Probability.h" +#include "v2.0/pops/InternalConversionCoefficients.h" +#include "v2.0/pops/PhotonEmissionProbabilities.h" +#include "v2.0/pops/Q.h" +#include "v2.0/pops/DecayPath.h" +#include "v2.0/pops/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 +extern_c Handle2DecayMode +DecayModeDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayMode +DecayModeCreateConst( + const XMLName label, + const enums::DecayType mode, + ConstHandle2ConstProbability probability, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstQ Q, + ConstHandle2ConstDecayPath decayPath, + ConstHandle2ConstSpectra spectra +); + +// +++ Create, general +extern_c Handle2DecayMode +DecayModeCreate( + const XMLName label, + const enums::DecayType mode, + ConstHandle2ConstProbability probability, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstQ Q, + ConstHandle2ConstDecayPath decayPath, + 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 XMLName +DecayModeLabelGet(ConstHandle2ConstDecayMode self); + +// +++ Set +extern_c void +DecayModeLabelSet(ConstHandle2DecayMode self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: mode +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeModeHas(ConstHandle2ConstDecayMode self); + +// +++ Get +// +++ Returns by value +extern_c enums::DecayType +DecayModeModeGet(ConstHandle2ConstDecayMode self); + +// +++ Set +extern_c void +DecayModeModeSet(ConstHandle2DecayMode self, const enums::DecayType 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: internalConversionCoefficients +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeInternalConversionCoefficientsHas(ConstHandle2ConstDecayMode self); + +// --- Get, const +extern_c Handle2ConstInternalConversionCoefficients +DecayModeInternalConversionCoefficientsGetConst(ConstHandle2ConstDecayMode self); + +// +++ Get, non-const +extern_c Handle2InternalConversionCoefficients +DecayModeInternalConversionCoefficientsGet(ConstHandle2DecayMode self); + +// +++ Set +extern_c void +DecayModeInternalConversionCoefficientsSet(ConstHandle2DecayMode self, ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients); + + +// ----------------------------------------------------------------------------- +// 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: 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: 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/pops/DecayMode/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayMode/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes.cpp new file mode 100644 index 000000000..2464991cb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/DecayModes.hpp" +#include "DecayModes.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::DecayMode; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecayModes +DecayModesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +DecayModesDecayModeHasByLabel( + ConstHandle2ConstDecayModes self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeHasByLabel", + self, extract::decayMode, meta::label, label); +} + +// Get, by label, const +Handle2ConstDecayMode +DecayModesDecayModeGetByLabelConst( + ConstHandle2ConstDecayModes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeGetByLabelConst", + self, extract::decayMode, meta::label, label); +} + +// Get, by label, non-const +Handle2DecayMode +DecayModesDecayModeGetByLabel( + ConstHandle2DecayModes self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeGetByLabel", + self, extract::decayMode, meta::label, label); +} + +// Set, by label +void +DecayModesDecayModeSetByLabel( + ConstHandle2DecayModes self, + const XMLName label, + ConstHandle2ConstDecayMode decayMode +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeSetByLabel", + self, extract::decayMode, meta::label, label, decayMode); +} + +// Has, by mode +int +DecayModesDecayModeHasByMode( + ConstHandle2ConstDecayModes self, + const enums::DecayType mode +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeHasByMode", + self, extract::decayMode, meta::mode, mode); +} + +// Get, by mode, const +Handle2ConstDecayMode +DecayModesDecayModeGetByModeConst( + ConstHandle2ConstDecayModes self, + const enums::DecayType mode +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeGetByModeConst", + self, extract::decayMode, meta::mode, mode); +} + +// Get, by mode, non-const +Handle2DecayMode +DecayModesDecayModeGetByMode( + ConstHandle2DecayModes self, + const enums::DecayType mode +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeGetByMode", + self, extract::decayMode, meta::mode, mode); +} + +// Set, by mode +void +DecayModesDecayModeSetByMode( + ConstHandle2DecayModes self, + const enums::DecayType mode, + ConstHandle2ConstDecayMode decayMode +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeSetByMode", + self, extract::decayMode, meta::mode, mode, decayMode); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/DecayModes/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes.h new file mode 100644 index 000000000..99efbd241 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_DECAYMODES +#define C_INTERFACE_TEST_V2_0_POPS_DECAYMODES + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2DecayModes +DecayModesDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayModes +DecayModesCreateConst( + ConstHandle2DecayMode *const decayMode, const size_t decayModeSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +DecayModesDecayModeHasByLabel( + ConstHandle2ConstDecayModes self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstDecayMode +DecayModesDecayModeGetByLabelConst( + ConstHandle2ConstDecayModes self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2DecayMode +DecayModesDecayModeGetByLabel( + ConstHandle2DecayModes self, + const XMLName label +); + +// +++ Set, by label +extern_c void +DecayModesDecayModeSetByLabel( + ConstHandle2DecayModes self, + const XMLName label, + ConstHandle2ConstDecayMode decayMode +); + +// +++ Has, by mode +extern_c int +DecayModesDecayModeHasByMode( + ConstHandle2ConstDecayModes self, + const enums::DecayType mode +); + +// --- Get, by mode, const +extern_c Handle2ConstDecayMode +DecayModesDecayModeGetByModeConst( + ConstHandle2ConstDecayModes self, + const enums::DecayType mode +); + +// +++ Get, by mode, non-const +extern_c Handle2DecayMode +DecayModesDecayModeGetByMode( + ConstHandle2DecayModes self, + const enums::DecayType mode +); + +// +++ Set, by mode +extern_c void +DecayModesDecayModeSetByMode( + ConstHandle2DecayModes self, + const enums::DecayType mode, + ConstHandle2ConstDecayMode decayMode +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/DecayModes/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayModes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath.cpp new file mode 100644 index 000000000..4ed109219 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/DecayPath.hpp" +#include "DecayPath.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Decay; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecayPath +DecayPathDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by index +int +DecayPathDecayHasByIndex( + ConstHandle2ConstDecayPath self, + const Integer32 index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DecayHasByIndex", + self, extract::decay, meta::index, index); +} + +// Get, by index, const +Handle2ConstDecay +DecayPathDecayGetByIndexConst( + ConstHandle2ConstDecayPath self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByIndexConst", + self, extract::decay, meta::index, index); +} + +// Get, by index, non-const +Handle2Decay +DecayPathDecayGetByIndex( + ConstHandle2DecayPath self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByIndex", + self, extract::decay, meta::index, index); +} + +// Set, by index +void +DecayPathDecaySetByIndex( + ConstHandle2DecayPath self, + const Integer32 index, + ConstHandle2ConstDecay decay +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DecaySetByIndex", + self, extract::decay, meta::index, index, decay); +} + +// Has, by mode +int +DecayPathDecayHasByMode( + ConstHandle2ConstDecayPath self, + const enums::DecayType mode +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DecayHasByMode", + self, extract::decay, meta::mode, mode); +} + +// Get, by mode, const +Handle2ConstDecay +DecayPathDecayGetByModeConst( + ConstHandle2ConstDecayPath self, + const enums::DecayType mode +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByModeConst", + self, extract::decay, meta::mode, mode); +} + +// Get, by mode, non-const +Handle2Decay +DecayPathDecayGetByMode( + ConstHandle2DecayPath self, + const enums::DecayType mode +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByMode", + self, extract::decay, meta::mode, mode); +} + +// Set, by mode +void +DecayPathDecaySetByMode( + ConstHandle2DecayPath self, + const enums::DecayType mode, + ConstHandle2ConstDecay decay +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DecaySetByMode", + self, extract::decay, meta::mode, mode, decay); +} + +// 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/pops/DecayPath/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath.h new file mode 100644 index 000000000..9ae385045 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath.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. +// +// 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_TEST_V2_0_POPS_DECAYPATH +#define C_INTERFACE_TEST_V2_0_POPS_DECAYPATH + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2DecayPath +DecayPathDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayPath +DecayPathCreateConst( + ConstHandle2Decay *const decay, const size_t decaySize +); + +// +++ Create, general +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 +); + +// +++ Has, by index +extern_c int +DecayPathDecayHasByIndex( + ConstHandle2ConstDecayPath self, + const Integer32 index +); + +// --- Get, by index, const +extern_c Handle2ConstDecay +DecayPathDecayGetByIndexConst( + ConstHandle2ConstDecayPath self, + const Integer32 index +); + +// +++ Get, by index, non-const +extern_c Handle2Decay +DecayPathDecayGetByIndex( + ConstHandle2DecayPath self, + const Integer32 index +); + +// +++ Set, by index +extern_c void +DecayPathDecaySetByIndex( + ConstHandle2DecayPath self, + const Integer32 index, + ConstHandle2ConstDecay decay +); + +// +++ Has, by mode +extern_c int +DecayPathDecayHasByMode( + ConstHandle2ConstDecayPath self, + const enums::DecayType mode +); + +// --- Get, by mode, const +extern_c Handle2ConstDecay +DecayPathDecayGetByModeConst( + ConstHandle2ConstDecayPath self, + const enums::DecayType mode +); + +// +++ Get, by mode, non-const +extern_c Handle2Decay +DecayPathDecayGetByMode( + ConstHandle2DecayPath self, + const enums::DecayType mode +); + +// +++ Set, by mode +extern_c void +DecayPathDecaySetByMode( + ConstHandle2DecayPath self, + const enums::DecayType mode, + ConstHandle2ConstDecay decay +); + +// +++ 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/pops/DecayPath/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DecayPath/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete.cpp new file mode 100644 index 000000000..d8908a927 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete.cpp @@ -0,0 +1,431 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Discrete.hpp" +#include "Discrete.h" + +using namespace njoy::GNDStk; +using namespace test::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 discreteEnergy = [](auto &obj) { return &obj.discreteEnergy; }; + static auto intensity = [](auto &obj) { return &obj.intensity; }; + static auto internalConversionCoefficients = [](auto &obj) { return &obj.internalConversionCoefficients; }; + static auto internalPairFormationCoefficient = [](auto &obj) { return &obj.internalPairFormationCoefficient; }; + static auto photonEmissionProbabilities = [](auto &obj) { return &obj.photonEmissionProbabilities; }; + static auto positronEmissionIntensity = [](auto &obj) { return &obj.positronEmissionIntensity; }; +} + +using CPPDiscreteEnergy = pops::DiscreteEnergy; +using CPPIntensity = pops::Intensity; +using CPPInternalConversionCoefficients = pops::InternalConversionCoefficients; +using CPPInternalPairFormationCoefficient = pops::InternalPairFormationCoefficient; +using CPPPhotonEmissionProbabilities = pops::PhotonEmissionProbabilities; +using CPPPositronEmissionIntensity = pops::PositronEmissionIntensity; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDiscrete +DiscreteDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Discrete +DiscreteDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDiscrete +DiscreteCreateConst( + const XMLName type, + ConstHandle2ConstDiscreteEnergy discreteEnergy, + ConstHandle2ConstIntensity intensity, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstInternalPairFormationCoefficient internalPairFormationCoefficient, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstPositronEmissionIntensity positronEmissionIntensity +) { + ConstHandle2Discrete handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + type, + detail::tocpp(discreteEnergy), + detail::tocpp(intensity), + detail::tocpp(internalConversionCoefficients), + detail::tocpp(internalPairFormationCoefficient), + detail::tocpp(photonEmissionProbabilities), + detail::tocpp(positronEmissionIntensity) + ); + return handle; +} + +// Create, general +Handle2Discrete +DiscreteCreate( + const XMLName type, + ConstHandle2ConstDiscreteEnergy discreteEnergy, + ConstHandle2ConstIntensity intensity, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstInternalPairFormationCoefficient internalPairFormationCoefficient, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstPositronEmissionIntensity positronEmissionIntensity +) { + ConstHandle2Discrete handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + type, + detail::tocpp(discreteEnergy), + detail::tocpp(intensity), + detail::tocpp(internalConversionCoefficients), + detail::tocpp(internalPairFormationCoefficient), + detail::tocpp(photonEmissionProbabilities), + 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 +XMLName +DiscreteTypeGet(ConstHandle2ConstDiscrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +DiscreteTypeSet(ConstHandle2Discrete self, const XMLName type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// Child: discreteEnergy +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteDiscreteEnergyHas(ConstHandle2ConstDiscrete self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DiscreteEnergyHas", self, extract::discreteEnergy); +} + +// Get, const +Handle2ConstDiscreteEnergy +DiscreteDiscreteEnergyGetConst(ConstHandle2ConstDiscrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DiscreteEnergyGetConst", self, extract::discreteEnergy); +} + +// Get, non-const +Handle2DiscreteEnergy +DiscreteDiscreteEnergyGet(ConstHandle2Discrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DiscreteEnergyGet", self, extract::discreteEnergy); +} + +// Set +void +DiscreteDiscreteEnergySet(ConstHandle2Discrete self, ConstHandle2ConstDiscreteEnergy discreteEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DiscreteEnergySet", self, extract::discreteEnergy, discreteEnergy); +} + + +// ----------------------------------------------------------------------------- +// 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: 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: internalPairFormationCoefficient +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteInternalPairFormationCoefficientHas(ConstHandle2ConstDiscrete self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InternalPairFormationCoefficientHas", self, extract::internalPairFormationCoefficient); +} + +// Get, const +Handle2ConstInternalPairFormationCoefficient +DiscreteInternalPairFormationCoefficientGetConst(ConstHandle2ConstDiscrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InternalPairFormationCoefficientGetConst", self, extract::internalPairFormationCoefficient); +} + +// Get, non-const +Handle2InternalPairFormationCoefficient +DiscreteInternalPairFormationCoefficientGet(ConstHandle2Discrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InternalPairFormationCoefficientGet", self, extract::internalPairFormationCoefficient); +} + +// Set +void +DiscreteInternalPairFormationCoefficientSet(ConstHandle2Discrete self, ConstHandle2ConstInternalPairFormationCoefficient internalPairFormationCoefficient) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InternalPairFormationCoefficientSet", self, extract::internalPairFormationCoefficient, internalPairFormationCoefficient); +} + + +// ----------------------------------------------------------------------------- +// Child: photonEmissionProbabilities +// ----------------------------------------------------------------------------- + +// Has +int +DiscretePhotonEmissionProbabilitiesHas(ConstHandle2ConstDiscrete self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PhotonEmissionProbabilitiesHas", self, extract::photonEmissionProbabilities); +} + +// Get, const +Handle2ConstPhotonEmissionProbabilities +DiscretePhotonEmissionProbabilitiesGetConst(ConstHandle2ConstDiscrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PhotonEmissionProbabilitiesGetConst", self, extract::photonEmissionProbabilities); +} + +// Get, non-const +Handle2PhotonEmissionProbabilities +DiscretePhotonEmissionProbabilitiesGet(ConstHandle2Discrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PhotonEmissionProbabilitiesGet", self, extract::photonEmissionProbabilities); +} + +// Set +void +DiscretePhotonEmissionProbabilitiesSet(ConstHandle2Discrete self, ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PhotonEmissionProbabilitiesSet", self, extract::photonEmissionProbabilities, photonEmissionProbabilities); +} + + +// ----------------------------------------------------------------------------- +// 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/pops/Discrete/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete.h new file mode 100644 index 000000000..12f72230e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete.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. +// +// 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_TEST_V2_0_POPS_DISCRETE +#define C_INTERFACE_TEST_V2_0_POPS_DISCRETE + +#include "GNDStk.h" +#include "v2.0/pops/DiscreteEnergy.h" +#include "v2.0/pops/Intensity.h" +#include "v2.0/pops/InternalConversionCoefficients.h" +#include "v2.0/pops/InternalPairFormationCoefficient.h" +#include "v2.0/pops/PhotonEmissionProbabilities.h" +#include "v2.0/pops/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 +extern_c Handle2Discrete +DiscreteDefault(); + +// --- Create, general, const +extern_c Handle2ConstDiscrete +DiscreteCreateConst( + const XMLName type, + ConstHandle2ConstDiscreteEnergy discreteEnergy, + ConstHandle2ConstIntensity intensity, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstInternalPairFormationCoefficient internalPairFormationCoefficient, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstPositronEmissionIntensity positronEmissionIntensity +); + +// +++ Create, general +extern_c Handle2Discrete +DiscreteCreate( + const XMLName type, + ConstHandle2ConstDiscreteEnergy discreteEnergy, + ConstHandle2ConstIntensity intensity, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstInternalPairFormationCoefficient internalPairFormationCoefficient, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + 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 XMLName +DiscreteTypeGet(ConstHandle2ConstDiscrete self); + +// +++ Set +extern_c void +DiscreteTypeSet(ConstHandle2Discrete self, const XMLName type); + + +// ----------------------------------------------------------------------------- +// Child: discreteEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteDiscreteEnergyHas(ConstHandle2ConstDiscrete self); + +// --- Get, const +extern_c Handle2ConstDiscreteEnergy +DiscreteDiscreteEnergyGetConst(ConstHandle2ConstDiscrete self); + +// +++ Get, non-const +extern_c Handle2DiscreteEnergy +DiscreteDiscreteEnergyGet(ConstHandle2Discrete self); + +// +++ Set +extern_c void +DiscreteDiscreteEnergySet(ConstHandle2Discrete self, ConstHandle2ConstDiscreteEnergy discreteEnergy); + + +// ----------------------------------------------------------------------------- +// 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: 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: internalPairFormationCoefficient +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteInternalPairFormationCoefficientHas(ConstHandle2ConstDiscrete self); + +// --- Get, const +extern_c Handle2ConstInternalPairFormationCoefficient +DiscreteInternalPairFormationCoefficientGetConst(ConstHandle2ConstDiscrete self); + +// +++ Get, non-const +extern_c Handle2InternalPairFormationCoefficient +DiscreteInternalPairFormationCoefficientGet(ConstHandle2Discrete self); + +// +++ Set +extern_c void +DiscreteInternalPairFormationCoefficientSet(ConstHandle2Discrete self, ConstHandle2ConstInternalPairFormationCoefficient internalPairFormationCoefficient); + + +// ----------------------------------------------------------------------------- +// Child: photonEmissionProbabilities +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscretePhotonEmissionProbabilitiesHas(ConstHandle2ConstDiscrete self); + +// --- Get, const +extern_c Handle2ConstPhotonEmissionProbabilities +DiscretePhotonEmissionProbabilitiesGetConst(ConstHandle2ConstDiscrete self); + +// +++ Get, non-const +extern_c Handle2PhotonEmissionProbabilities +DiscretePhotonEmissionProbabilitiesGet(ConstHandle2Discrete self); + +// +++ Set +extern_c void +DiscretePhotonEmissionProbabilitiesSet(ConstHandle2Discrete self, ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities); + + +// ----------------------------------------------------------------------------- +// 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/pops/Discrete/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Discrete/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy.cpp new file mode 100644 index 000000000..952a120c3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/DiscreteEnergy.hpp" +#include "DiscreteEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = DiscreteEnergyClass; +using CPP = multigroup::DiscreteEnergy; + +static const std::string CLASSNAME = "DiscreteEnergy"; + +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 documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDiscreteEnergy +DiscreteEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2DiscreteEnergy +DiscreteEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDiscreteEnergy +DiscreteEnergyCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2DiscreteEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit, + detail::tocpp(documentation), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2DiscreteEnergy +DiscreteEnergyCreate( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2DiscreteEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + unit, + detail::tocpp(documentation), + 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 +DiscreteEnergyAssign(ConstHandle2DiscreteEnergy self, ConstHandle2ConstDiscreteEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DiscreteEnergyDelete(ConstHandle2ConstDiscreteEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DiscreteEnergyRead(ConstHandle2DiscreteEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DiscreteEnergyWrite(ConstHandle2ConstDiscreteEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DiscreteEnergyPrint(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DiscreteEnergyPrintXML(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DiscreteEnergyPrintJSON(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteEnergyLabelHas(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +DiscreteEnergyLabelGet(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +DiscreteEnergyLabelSet(ConstHandle2DiscreteEnergy self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteEnergyValueHas(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +DiscreteEnergyValueGet(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +DiscreteEnergyValueSet(ConstHandle2DiscreteEnergy self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteEnergyUnitHas(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +DiscreteEnergyUnitGet(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +DiscreteEnergyUnitSet(ConstHandle2DiscreteEnergy self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteEnergyDocumentationHas(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +DiscreteEnergyDocumentationGetConst(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +DiscreteEnergyDocumentationGet(ConstHandle2DiscreteEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +DiscreteEnergyDocumentationSet(ConstHandle2DiscreteEnergy self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteEnergyUncertaintyHas(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +DiscreteEnergyUncertaintyGetConst(ConstHandle2ConstDiscreteEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +DiscreteEnergyUncertaintyGet(ConstHandle2DiscreteEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +DiscreteEnergyUncertaintySet(ConstHandle2DiscreteEnergy self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/DiscreteEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy.h new file mode 100644 index 000000000..5478f4d68 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy.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. +// +// DiscreteEnergy is the basic handle type in this file. Example: +// // Create a default DiscreteEnergy object: +// DiscreteEnergy handle = DiscreteEnergyDefault(); +// Functions involving DiscreteEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_POPS_DISCRETEENERGY +#define C_INTERFACE_TEST_V2_0_POPS_DISCRETEENERGY + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DiscreteEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DiscreteEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DiscreteEnergyClass *DiscreteEnergy; + +// --- Const-aware handles. +typedef const struct DiscreteEnergyClass *const ConstHandle2ConstDiscreteEnergy; +typedef struct DiscreteEnergyClass *const ConstHandle2DiscreteEnergy; +typedef const struct DiscreteEnergyClass * Handle2ConstDiscreteEnergy; +typedef struct DiscreteEnergyClass * Handle2DiscreteEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDiscreteEnergy +DiscreteEnergyDefaultConst(); + +// +++ Create, default +extern_c Handle2DiscreteEnergy +DiscreteEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstDiscreteEnergy +DiscreteEnergyCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2DiscreteEnergy +DiscreteEnergyCreate( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + 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 +DiscreteEnergyAssign(ConstHandle2DiscreteEnergy self, ConstHandle2ConstDiscreteEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DiscreteEnergyDelete(ConstHandle2ConstDiscreteEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DiscreteEnergyRead(ConstHandle2DiscreteEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DiscreteEnergyWrite(ConstHandle2ConstDiscreteEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DiscreteEnergyPrint(ConstHandle2ConstDiscreteEnergy self); + +// +++ Print to standard output, as XML +extern_c int +DiscreteEnergyPrintXML(ConstHandle2ConstDiscreteEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +DiscreteEnergyPrintJSON(ConstHandle2ConstDiscreteEnergy self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteEnergyLabelHas(ConstHandle2ConstDiscreteEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +DiscreteEnergyLabelGet(ConstHandle2ConstDiscreteEnergy self); + +// +++ Set +extern_c void +DiscreteEnergyLabelSet(ConstHandle2DiscreteEnergy self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteEnergyValueHas(ConstHandle2ConstDiscreteEnergy self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +DiscreteEnergyValueGet(ConstHandle2ConstDiscreteEnergy self); + +// +++ Set +extern_c void +DiscreteEnergyValueSet(ConstHandle2DiscreteEnergy self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteEnergyUnitHas(ConstHandle2ConstDiscreteEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +DiscreteEnergyUnitGet(ConstHandle2ConstDiscreteEnergy self); + +// +++ Set +extern_c void +DiscreteEnergyUnitSet(ConstHandle2DiscreteEnergy self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteEnergyDocumentationHas(ConstHandle2ConstDiscreteEnergy self); + +// --- Get, const +extern_c Handle2ConstDocumentation +DiscreteEnergyDocumentationGetConst(ConstHandle2ConstDiscreteEnergy self); + +// +++ Get, non-const +extern_c Handle2Documentation +DiscreteEnergyDocumentationGet(ConstHandle2DiscreteEnergy self); + +// +++ Set +extern_c void +DiscreteEnergyDocumentationSet(ConstHandle2DiscreteEnergy self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteEnergyUncertaintyHas(ConstHandle2ConstDiscreteEnergy self); + +// --- Get, const +extern_c Handle2ConstUncertainty +DiscreteEnergyUncertaintyGetConst(ConstHandle2ConstDiscreteEnergy self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +DiscreteEnergyUncertaintyGet(ConstHandle2DiscreteEnergy self); + +// +++ Set +extern_c void +DiscreteEnergyUncertaintySet(ConstHandle2DiscreteEnergy self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/DiscreteEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/DiscreteEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Energy.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Energy.cpp new file mode 100644 index 000000000..431ad4343 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Energy.cpp @@ -0,0 +1,538 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Energy.hpp" +#include "Energy.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EnergyClass; +using CPP = multigroup::Energy; + +static const std::string CLASSNAME = "Energy"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; +using CPPDouble = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergy +EnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Energy +EnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergy +EnergyCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Energy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + EnergyDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Create, general +Handle2Energy +EnergyCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Energy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + EnergyDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Assign +// Use this to assign 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: label +// ----------------------------------------------------------------------------- + +// Has +int +EnergyLabelHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +EnergyLabelGet(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EnergyLabelSet(ConstHandle2Energy self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +EnergyUnitHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +EnergyUnitGet(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +EnergyUnitSet(ConstHandle2Energy self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +EnergyValueHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +EnergyValueGet(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +EnergyValueSet(ConstHandle2Energy self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +EnergyDocumentationHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +EnergyDocumentationGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +EnergyDocumentationGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +EnergyDocumentationSet(ConstHandle2Energy self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// 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: Double +// ----------------------------------------------------------------------------- + +// Has +int +EnergyDoubleHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Clear +void +EnergyDoubleClear(ConstHandle2Energy self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DoubleClear", self, extract::Double); +} + +// Size +size_t +EnergyDoubleSize(ConstHandle2ConstEnergy self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DoubleSize", self, extract::Double); +} + +// Add +void +EnergyDoubleAdd(ConstHandle2Energy self, ConstHandle2ConstDouble Double) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DoubleAdd", self, extract::Double, Double); +} + +// Get, by index \in [0,size), const +Handle2ConstDouble +EnergyDoubleGetConst(ConstHandle2ConstEnergy self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Double +EnergyDoubleGet(ConstHandle2Energy self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double, index_); +} + +// Set, by index \in [0,size) +void +EnergyDoubleSet( + ConstHandle2Energy self, + const size_t index_, + ConstHandle2ConstDouble Double +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, index_, Double); +} + +// Has, by label +int +EnergyDoubleHasByLabel( + ConstHandle2ConstEnergy self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByLabel", + self, extract::Double, meta::label, label); +} + +// Get, by label, const +Handle2ConstDouble +EnergyDoubleGetByLabelConst( + ConstHandle2ConstEnergy self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabelConst", + self, extract::Double, meta::label, label); +} + +// Get, by label, non-const +Handle2Double +EnergyDoubleGetByLabel( + ConstHandle2Energy self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabel", + self, extract::Double, meta::label, label); +} + +// Set, by label +void +EnergyDoubleSetByLabel( + ConstHandle2Energy self, + const XMLName label, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByLabel", + self, extract::Double, meta::label, label, Double); +} + +// Has, by unit +int +EnergyDoubleHasByUnit( + ConstHandle2ConstEnergy self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByUnit", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstDouble +EnergyDoubleGetByUnitConst( + ConstHandle2ConstEnergy self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnitConst", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Double +EnergyDoubleGetByUnit( + ConstHandle2Energy self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnit", + self, extract::Double, meta::unit, unit); +} + +// Set, by unit +void +EnergyDoubleSetByUnit( + ConstHandle2Energy self, + const XMLName unit, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByUnit", + self, extract::Double, meta::unit, unit, Double); +} + +// Has, by value +int +EnergyDoubleHasByValue( + ConstHandle2ConstEnergy self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByValue", + self, extract::Double, meta::value, value); +} + +// Get, by value, const +Handle2ConstDouble +EnergyDoubleGetByValueConst( + ConstHandle2ConstEnergy self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValueConst", + self, extract::Double, meta::value, value); +} + +// Get, by value, non-const +Handle2Double +EnergyDoubleGetByValue( + ConstHandle2Energy self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValue", + self, extract::Double, meta::value, value); +} + +// Set, by value +void +EnergyDoubleSetByValue( + ConstHandle2Energy self, + const Float64 value, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByValue", + self, extract::Double, meta::value, value, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Energy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Energy.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Energy.h new file mode 100644 index 000000000..a84937576 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Energy.h @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_ENERGY +#define C_INTERFACE_TEST_V2_0_POPS_ENERGY + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" +#include "v2.0/containers/Double.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 +extern_c Handle2Energy +EnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergy +EnergyCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Create, general +extern_c Handle2Energy +EnergyCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Assign +// +++ Use this to assign one handled 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyLabelHas(ConstHandle2ConstEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyLabelGet(ConstHandle2ConstEnergy self); + +// +++ Set +extern_c void +EnergyLabelSet(ConstHandle2Energy self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyUnitHas(ConstHandle2ConstEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyUnitGet(ConstHandle2ConstEnergy self); + +// +++ Set +extern_c void +EnergyUnitSet(ConstHandle2Energy self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyValueHas(ConstHandle2ConstEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyValueGet(ConstHandle2ConstEnergy self); + +// +++ Set +extern_c void +EnergyValueSet(ConstHandle2Energy self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyDocumentationHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstDocumentation +EnergyDocumentationGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2Documentation +EnergyDocumentationGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyDocumentationSet(ConstHandle2Energy self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// 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: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyDoubleHas(ConstHandle2ConstEnergy self); + +// +++ Clear +extern_c void +EnergyDoubleClear(ConstHandle2Energy self); + +// +++ Size +extern_c size_t +EnergyDoubleSize(ConstHandle2ConstEnergy self); + +// +++ Add +extern_c void +EnergyDoubleAdd(ConstHandle2Energy self, ConstHandle2ConstDouble Double); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDouble +EnergyDoubleGetConst(ConstHandle2ConstEnergy self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Double +EnergyDoubleGet(ConstHandle2Energy self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +EnergyDoubleSet( + ConstHandle2Energy self, + const size_t index_, + ConstHandle2ConstDouble Double +); + +// +++ Has, by label +extern_c int +EnergyDoubleHasByLabel( + ConstHandle2ConstEnergy self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstDouble +EnergyDoubleGetByLabelConst( + ConstHandle2ConstEnergy self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Double +EnergyDoubleGetByLabel( + ConstHandle2Energy self, + const XMLName label +); + +// +++ Set, by label +extern_c void +EnergyDoubleSetByLabel( + ConstHandle2Energy self, + const XMLName label, + ConstHandle2ConstDouble Double +); + +// +++ Has, by unit +extern_c int +EnergyDoubleHasByUnit( + ConstHandle2ConstEnergy self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstDouble +EnergyDoubleGetByUnitConst( + ConstHandle2ConstEnergy self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Double +EnergyDoubleGetByUnit( + ConstHandle2Energy self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +EnergyDoubleSetByUnit( + ConstHandle2Energy self, + const XMLName unit, + ConstHandle2ConstDouble Double +); + +// +++ Has, by value +extern_c int +EnergyDoubleHasByValue( + ConstHandle2ConstEnergy self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstDouble +EnergyDoubleGetByValueConst( + ConstHandle2ConstEnergy self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2Double +EnergyDoubleGetByValue( + ConstHandle2Energy self, + const Float64 value +); + +// +++ Set, by value +extern_c void +EnergyDoubleSetByValue( + ConstHandle2Energy self, + const Float64 value, + ConstHandle2ConstDouble Double +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Energy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Energy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Energy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Energy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Energy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson.cpp new file mode 100644 index 000000000..e1d862768 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson.cpp @@ -0,0 +1,431 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/GaugeBoson.hpp" +#include "GaugeBoson.h" + +using namespace njoy::GNDStk; +using namespace test::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 charge = [](auto &obj) { return &obj.charge; }; + static auto halflife = [](auto &obj) { return &obj.halflife; }; + 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 decayData = [](auto &obj) { return &obj.decayData; }; +} + +using CPPCharge = pops::Charge; +using CPPHalflife = pops::Halflife; +using CPPMass = pops::Mass; +using CPPSpin = pops::Spin; +using CPPParity = pops::Parity; +using CPPDecayData = pops::DecayData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGaugeBoson +GaugeBosonDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2GaugeBoson +GaugeBosonDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGaugeBoson +GaugeBosonCreateConst( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2GaugeBoson handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(decayData) + ); + return handle; +} + +// Create, general +Handle2GaugeBoson +GaugeBosonCreate( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2GaugeBoson handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + 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 +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 +XMLName +GaugeBosonIdGet(ConstHandle2ConstGaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +GaugeBosonIdSet(ConstHandle2GaugeBoson self, const XMLName id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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: decayData +// ----------------------------------------------------------------------------- + +// Has +int +GaugeBosonDecayDataHas(ConstHandle2ConstGaugeBoson self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayDataHas", self, extract::decayData); +} + +// Get, const +Handle2ConstDecayData +GaugeBosonDecayDataGetConst(ConstHandle2ConstGaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGetConst", self, extract::decayData); +} + +// Get, non-const +Handle2DecayData +GaugeBosonDecayDataGet(ConstHandle2GaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGet", self, extract::decayData); +} + +// Set +void +GaugeBosonDecayDataSet(ConstHandle2GaugeBoson self, ConstHandle2ConstDecayData decayData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DecayDataSet", self, extract::decayData, decayData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/GaugeBoson/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson.h b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson.h new file mode 100644 index 000000000..8d7ec4acd --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson.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. +// +// 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_TEST_V2_0_POPS_GAUGEBOSON +#define C_INTERFACE_TEST_V2_0_POPS_GAUGEBOSON + +#include "GNDStk.h" +#include "v2.0/pops/Charge.h" +#include "v2.0/pops/Halflife.h" +#include "v2.0/pops/Mass.h" +#include "v2.0/pops/Spin.h" +#include "v2.0/pops/Parity.h" +#include "v2.0/pops/DecayData.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 +extern_c Handle2GaugeBoson +GaugeBosonDefault(); + +// --- Create, general, const +extern_c Handle2ConstGaugeBoson +GaugeBosonCreateConst( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData +); + +// +++ Create, general +extern_c Handle2GaugeBoson +GaugeBosonCreate( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + 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 +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 XMLName +GaugeBosonIdGet(ConstHandle2ConstGaugeBoson self); + +// +++ Set +extern_c void +GaugeBosonIdSet(ConstHandle2GaugeBoson self, const XMLName id); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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: decayData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GaugeBosonDecayDataHas(ConstHandle2ConstGaugeBoson self); + +// --- Get, const +extern_c Handle2ConstDecayData +GaugeBosonDecayDataGetConst(ConstHandle2ConstGaugeBoson self); + +// +++ Get, non-const +extern_c Handle2DecayData +GaugeBosonDecayDataGet(ConstHandle2GaugeBoson self); + +// +++ Set +extern_c void +GaugeBosonDecayDataSet(ConstHandle2GaugeBoson self, ConstHandle2ConstDecayData decayData); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/GaugeBoson/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBoson/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons.cpp new file mode 100644 index 000000000..aa6a9763e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/GaugeBosons.hpp" +#include "GaugeBosons.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::GaugeBoson; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGaugeBosons +GaugeBosonsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by id +int +GaugeBosonsGaugeBosonHasById( + ConstHandle2ConstGaugeBosons self, + const XMLName id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GaugeBosonHasById", + self, extract::gaugeBoson, meta::id, id); +} + +// Get, by id, const +Handle2ConstGaugeBoson +GaugeBosonsGaugeBosonGetByIdConst( + ConstHandle2ConstGaugeBosons self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GaugeBosonGetByIdConst", + self, extract::gaugeBoson, meta::id, id); +} + +// Get, by id, non-const +Handle2GaugeBoson +GaugeBosonsGaugeBosonGetById( + ConstHandle2GaugeBosons self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GaugeBosonGetById", + self, extract::gaugeBoson, meta::id, id); +} + +// Set, by id +void +GaugeBosonsGaugeBosonSetById( + ConstHandle2GaugeBosons self, + const XMLName id, + ConstHandle2ConstGaugeBoson gaugeBoson +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GaugeBosonSetById", + self, extract::gaugeBoson, meta::id, id, gaugeBoson); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/GaugeBosons/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons.h b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons.h new file mode 100644 index 000000000..f6167f30e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_GAUGEBOSONS +#define C_INTERFACE_TEST_V2_0_POPS_GAUGEBOSONS + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2GaugeBosons +GaugeBosonsDefault(); + +// --- Create, general, const +extern_c Handle2ConstGaugeBosons +GaugeBosonsCreateConst( + ConstHandle2GaugeBoson *const gaugeBoson, const size_t gaugeBosonSize +); + +// +++ Create, general +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 +); + +// +++ Has, by id +extern_c int +GaugeBosonsGaugeBosonHasById( + ConstHandle2ConstGaugeBosons self, + const XMLName id +); + +// --- Get, by id, const +extern_c Handle2ConstGaugeBoson +GaugeBosonsGaugeBosonGetByIdConst( + ConstHandle2ConstGaugeBosons self, + const XMLName id +); + +// +++ Get, by id, non-const +extern_c Handle2GaugeBoson +GaugeBosonsGaugeBosonGetById( + ConstHandle2GaugeBosons self, + const XMLName id +); + +// +++ Set, by id +extern_c void +GaugeBosonsGaugeBosonSetById( + ConstHandle2GaugeBosons self, + const XMLName id, + ConstHandle2ConstGaugeBoson gaugeBoson +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/GaugeBosons/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/GaugeBosons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife.cpp new file mode 100644 index 000000000..c7d3f8524 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife.cpp @@ -0,0 +1,331 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Halflife.hpp" +#include "Halflife.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = HalflifeClass; +using CPP = multigroup::Halflife; + +static const std::string CLASSNAME = "Halflife"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; +using CPPString = containers::String; +using CPPDouble = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstHalflife +HalflifeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Halflife +HalflifeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstHalflife +HalflifeCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, +) { + ConstHandle2Halflife handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Halflife +HalflifeCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, +) { + ConstHandle2Halflife handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +HalflifeLabelHas(ConstHandle2ConstHalflife self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +HalflifeLabelGet(ConstHandle2ConstHalflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +HalflifeLabelSet(ConstHandle2Halflife self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +HalflifeUnitHas(ConstHandle2ConstHalflife self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +HalflifeUnitGet(ConstHandle2ConstHalflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +HalflifeUnitSet(ConstHandle2Halflife self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +HalflifeValueHas(ConstHandle2ConstHalflife self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +HalflifeValueGet(ConstHandle2ConstHalflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +HalflifeValueSet(ConstHandle2Halflife self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +HalflifeDocumentationHas(ConstHandle2ConstHalflife self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +HalflifeDocumentationGetConst(ConstHandle2ConstHalflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +HalflifeDocumentationGet(ConstHandle2Halflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +HalflifeDocumentationSet(ConstHandle2Halflife self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +HalflifeUncertaintyHas(ConstHandle2ConstHalflife self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +HalflifeUncertaintyGetConst(ConstHandle2ConstHalflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +HalflifeUncertaintyGet(ConstHandle2Halflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +HalflifeUncertaintySet(ConstHandle2Halflife self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Halflife/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife.h new file mode 100644 index 000000000..8cd7bfa50 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife.h @@ -0,0 +1,247 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_HALFLIFE +#define C_INTERFACE_TEST_V2_0_POPS_HALFLIFE + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" +#include "v2.0/containers/String.h" +#include "v2.0/containers/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 +extern_c Handle2Halflife +HalflifeDefault(); + +// --- Create, general, const +extern_c Handle2ConstHalflife +HalflifeCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, +); + +// +++ Create, general +extern_c Handle2Halflife +HalflifeCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + 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 +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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HalflifeLabelHas(ConstHandle2ConstHalflife self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +HalflifeLabelGet(ConstHandle2ConstHalflife self); + +// +++ Set +extern_c void +HalflifeLabelSet(ConstHandle2Halflife self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HalflifeUnitHas(ConstHandle2ConstHalflife self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +HalflifeUnitGet(ConstHandle2ConstHalflife self); + +// +++ Set +extern_c void +HalflifeUnitSet(ConstHandle2Halflife self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HalflifeValueHas(ConstHandle2ConstHalflife self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +HalflifeValueGet(ConstHandle2ConstHalflife self); + +// +++ Set +extern_c void +HalflifeValueSet(ConstHandle2Halflife self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HalflifeDocumentationHas(ConstHandle2ConstHalflife self); + +// --- Get, const +extern_c Handle2ConstDocumentation +HalflifeDocumentationGetConst(ConstHandle2ConstHalflife self); + +// +++ Get, non-const +extern_c Handle2Documentation +HalflifeDocumentationGet(ConstHandle2Halflife self); + +// +++ Set +extern_c void +HalflifeDocumentationSet(ConstHandle2Halflife self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HalflifeUncertaintyHas(ConstHandle2ConstHalflife self); + +// --- Get, const +extern_c Handle2ConstUncertainty +HalflifeUncertaintyGetConst(ConstHandle2ConstHalflife self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +HalflifeUncertaintyGet(ConstHandle2Halflife self); + +// +++ Set +extern_c void +HalflifeUncertaintySet(ConstHandle2Halflife self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Halflife/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Halflife/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity.cpp new file mode 100644 index 000000000..e52d6be0c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Intensity.hpp" +#include "Intensity.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = IntensityClass; +using CPP = multigroup::Intensity; + +static const std::string CLASSNAME = "Intensity"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIntensity +IntensityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Intensity +IntensityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIntensity +IntensityCreateConst( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Intensity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Intensity +IntensityCreate( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Intensity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + 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: label +// ----------------------------------------------------------------------------- + +// Has +int +IntensityLabelHas(ConstHandle2ConstIntensity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +IntensityLabelGet(ConstHandle2ConstIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +IntensityLabelSet(ConstHandle2Intensity self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +IntensityUnitHas(ConstHandle2ConstIntensity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +IntensityUnitGet(ConstHandle2ConstIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +IntensityUnitSet(ConstHandle2Intensity self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +IntensityValueHas(ConstHandle2ConstIntensity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +IntensityValueGet(ConstHandle2ConstIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +IntensityValueSet(ConstHandle2Intensity self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +IntensityDocumentationHas(ConstHandle2ConstIntensity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +IntensityDocumentationGetConst(ConstHandle2ConstIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +IntensityDocumentationGet(ConstHandle2Intensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +IntensityDocumentationSet(ConstHandle2Intensity self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// 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/pops/Intensity/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity.h new file mode 100644 index 000000000..a4ec38d3e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity.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. +// +// 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_TEST_V2_0_POPS_INTENSITY +#define C_INTERFACE_TEST_V2_0_POPS_INTENSITY + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/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 +extern_c Handle2Intensity +IntensityDefault(); + +// --- Create, general, const +extern_c Handle2ConstIntensity +IntensityCreateConst( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2Intensity +IntensityCreate( + const XMLName label, + const XMLName unit, + const Float64 value, + ConstHandle2ConstDocumentation documentation, + 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntensityLabelHas(ConstHandle2ConstIntensity self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +IntensityLabelGet(ConstHandle2ConstIntensity self); + +// +++ Set +extern_c void +IntensityLabelSet(ConstHandle2Intensity self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntensityUnitHas(ConstHandle2ConstIntensity self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +IntensityUnitGet(ConstHandle2ConstIntensity self); + +// +++ Set +extern_c void +IntensityUnitSet(ConstHandle2Intensity self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntensityValueHas(ConstHandle2ConstIntensity self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +IntensityValueGet(ConstHandle2ConstIntensity self); + +// +++ Set +extern_c void +IntensityValueSet(ConstHandle2Intensity self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntensityDocumentationHas(ConstHandle2ConstIntensity self); + +// --- Get, const +extern_c Handle2ConstDocumentation +IntensityDocumentationGetConst(ConstHandle2ConstIntensity self); + +// +++ Get, non-const +extern_c Handle2Documentation +IntensityDocumentationGet(ConstHandle2Intensity self); + +// +++ Set +extern_c void +IntensityDocumentationSet(ConstHandle2Intensity self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// 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/pops/Intensity/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Intensity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients.cpp new file mode 100644 index 000000000..f5489915c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/InternalConversionCoefficients.hpp" +#include "InternalConversionCoefficients.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Shell; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInternalConversionCoefficients +InternalConversionCoefficientsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +InternalConversionCoefficientsShellHasByLabel( + ConstHandle2ConstInternalConversionCoefficients self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShellHasByLabel", + self, extract::shell, meta::label, label); +} + +// Get, by label, const +Handle2ConstShell +InternalConversionCoefficientsShellGetByLabelConst( + ConstHandle2ConstInternalConversionCoefficients self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByLabelConst", + self, extract::shell, meta::label, label); +} + +// Get, by label, non-const +Handle2Shell +InternalConversionCoefficientsShellGetByLabel( + ConstHandle2InternalConversionCoefficients self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByLabel", + self, extract::shell, meta::label, label); +} + +// Set, by label +void +InternalConversionCoefficientsShellSetByLabel( + ConstHandle2InternalConversionCoefficients self, + const XMLName label, + ConstHandle2ConstShell shell +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShellSetByLabel", + self, extract::shell, meta::label, label, shell); +} + +// Has, by value +int +InternalConversionCoefficientsShellHasByValue( + ConstHandle2ConstInternalConversionCoefficients self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShellHasByValue", + self, extract::shell, meta::value, value); +} + +// Get, by value, const +Handle2ConstShell +InternalConversionCoefficientsShellGetByValueConst( + ConstHandle2ConstInternalConversionCoefficients self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByValueConst", + self, extract::shell, meta::value, value); +} + +// Get, by value, non-const +Handle2Shell +InternalConversionCoefficientsShellGetByValue( + ConstHandle2InternalConversionCoefficients self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByValue", + self, extract::shell, meta::value, value); +} + +// Set, by value +void +InternalConversionCoefficientsShellSetByValue( + ConstHandle2InternalConversionCoefficients self, + const Float64 value, + ConstHandle2ConstShell shell +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShellSetByValue", + self, extract::shell, meta::value, value, shell); +} + +// Has, by unit +int +InternalConversionCoefficientsShellHasByUnit( + ConstHandle2ConstInternalConversionCoefficients self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShellHasByUnit", + self, extract::shell, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstShell +InternalConversionCoefficientsShellGetByUnitConst( + ConstHandle2ConstInternalConversionCoefficients self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByUnitConst", + self, extract::shell, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Shell +InternalConversionCoefficientsShellGetByUnit( + ConstHandle2InternalConversionCoefficients self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByUnit", + self, extract::shell, meta::unit, unit); +} + +// Set, by unit +void +InternalConversionCoefficientsShellSetByUnit( + ConstHandle2InternalConversionCoefficients self, + const XMLName unit, + ConstHandle2ConstShell shell +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShellSetByUnit", + self, extract::shell, meta::unit, unit, shell); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/InternalConversionCoefficients/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients.h b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients.h new file mode 100644 index 000000000..c8eaf491d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients.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. +// +// 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_TEST_V2_0_POPS_INTERNALCONVERSIONCOEFFICIENTS +#define C_INTERFACE_TEST_V2_0_POPS_INTERNALCONVERSIONCOEFFICIENTS + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2InternalConversionCoefficients +InternalConversionCoefficientsDefault(); + +// --- Create, general, const +extern_c Handle2ConstInternalConversionCoefficients +InternalConversionCoefficientsCreateConst( + ConstHandle2Shell *const shell, const size_t shellSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +InternalConversionCoefficientsShellHasByLabel( + ConstHandle2ConstInternalConversionCoefficients self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstShell +InternalConversionCoefficientsShellGetByLabelConst( + ConstHandle2ConstInternalConversionCoefficients self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Shell +InternalConversionCoefficientsShellGetByLabel( + ConstHandle2InternalConversionCoefficients self, + const XMLName label +); + +// +++ Set, by label +extern_c void +InternalConversionCoefficientsShellSetByLabel( + ConstHandle2InternalConversionCoefficients self, + const XMLName label, + ConstHandle2ConstShell shell +); + +// +++ Has, by value +extern_c int +InternalConversionCoefficientsShellHasByValue( + ConstHandle2ConstInternalConversionCoefficients self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstShell +InternalConversionCoefficientsShellGetByValueConst( + ConstHandle2ConstInternalConversionCoefficients self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2Shell +InternalConversionCoefficientsShellGetByValue( + ConstHandle2InternalConversionCoefficients self, + const Float64 value +); + +// +++ Set, by value +extern_c void +InternalConversionCoefficientsShellSetByValue( + ConstHandle2InternalConversionCoefficients self, + const Float64 value, + ConstHandle2ConstShell shell +); + +// +++ Has, by unit +extern_c int +InternalConversionCoefficientsShellHasByUnit( + ConstHandle2ConstInternalConversionCoefficients self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstShell +InternalConversionCoefficientsShellGetByUnitConst( + ConstHandle2ConstInternalConversionCoefficients self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Shell +InternalConversionCoefficientsShellGetByUnit( + ConstHandle2InternalConversionCoefficients self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +InternalConversionCoefficientsShellSetByUnit( + ConstHandle2InternalConversionCoefficients self, + const XMLName unit, + ConstHandle2ConstShell shell +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/InternalConversionCoefficients/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalConversionCoefficients/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient.cpp new file mode 100644 index 000000000..003c360d8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/InternalPairFormationCoefficient.hpp" +#include "InternalPairFormationCoefficient.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = InternalPairFormationCoefficientClass; +using CPP = multigroup::InternalPairFormationCoefficient; + +static const std::string CLASSNAME = "InternalPairFormationCoefficient"; + +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 documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInternalPairFormationCoefficient +InternalPairFormationCoefficientDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2InternalPairFormationCoefficient +InternalPairFormationCoefficientDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInternalPairFormationCoefficient +InternalPairFormationCoefficientCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2InternalPairFormationCoefficient handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit, + detail::tocpp(documentation), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2InternalPairFormationCoefficient +InternalPairFormationCoefficientCreate( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2InternalPairFormationCoefficient handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + unit, + detail::tocpp(documentation), + 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 +InternalPairFormationCoefficientAssign(ConstHandle2InternalPairFormationCoefficient self, ConstHandle2ConstInternalPairFormationCoefficient from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +InternalPairFormationCoefficientDelete(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +InternalPairFormationCoefficientRead(ConstHandle2InternalPairFormationCoefficient self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +InternalPairFormationCoefficientWrite(ConstHandle2ConstInternalPairFormationCoefficient self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +InternalPairFormationCoefficientPrint(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +InternalPairFormationCoefficientPrintXML(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +InternalPairFormationCoefficientPrintJSON(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +InternalPairFormationCoefficientLabelHas(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +InternalPairFormationCoefficientLabelGet(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +InternalPairFormationCoefficientLabelSet(ConstHandle2InternalPairFormationCoefficient self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +InternalPairFormationCoefficientValueHas(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +InternalPairFormationCoefficientValueGet(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +InternalPairFormationCoefficientValueSet(ConstHandle2InternalPairFormationCoefficient self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +InternalPairFormationCoefficientUnitHas(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +InternalPairFormationCoefficientUnitGet(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +InternalPairFormationCoefficientUnitSet(ConstHandle2InternalPairFormationCoefficient self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +InternalPairFormationCoefficientDocumentationHas(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +InternalPairFormationCoefficientDocumentationGetConst(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +InternalPairFormationCoefficientDocumentationGet(ConstHandle2InternalPairFormationCoefficient self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +InternalPairFormationCoefficientDocumentationSet(ConstHandle2InternalPairFormationCoefficient self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +InternalPairFormationCoefficientUncertaintyHas(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +InternalPairFormationCoefficientUncertaintyGetConst(ConstHandle2ConstInternalPairFormationCoefficient self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +InternalPairFormationCoefficientUncertaintyGet(ConstHandle2InternalPairFormationCoefficient self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +InternalPairFormationCoefficientUncertaintySet(ConstHandle2InternalPairFormationCoefficient self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/InternalPairFormationCoefficient/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient.h b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient.h new file mode 100644 index 000000000..9ecdef40e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient.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. +// +// InternalPairFormationCoefficient is the basic handle type in this file. Example: +// // Create a default InternalPairFormationCoefficient object: +// InternalPairFormationCoefficient handle = InternalPairFormationCoefficientDefault(); +// Functions involving InternalPairFormationCoefficient are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_POPS_INTERNALPAIRFORMATIONCOEFFICIENT +#define C_INTERFACE_TEST_V2_0_POPS_INTERNALPAIRFORMATIONCOEFFICIENT + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct InternalPairFormationCoefficientClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ InternalPairFormationCoefficient +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct InternalPairFormationCoefficientClass *InternalPairFormationCoefficient; + +// --- Const-aware handles. +typedef const struct InternalPairFormationCoefficientClass *const ConstHandle2ConstInternalPairFormationCoefficient; +typedef struct InternalPairFormationCoefficientClass *const ConstHandle2InternalPairFormationCoefficient; +typedef const struct InternalPairFormationCoefficientClass * Handle2ConstInternalPairFormationCoefficient; +typedef struct InternalPairFormationCoefficientClass * Handle2InternalPairFormationCoefficient; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstInternalPairFormationCoefficient +InternalPairFormationCoefficientDefaultConst(); + +// +++ Create, default +extern_c Handle2InternalPairFormationCoefficient +InternalPairFormationCoefficientDefault(); + +// --- Create, general, const +extern_c Handle2ConstInternalPairFormationCoefficient +InternalPairFormationCoefficientCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2InternalPairFormationCoefficient +InternalPairFormationCoefficientCreate( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + 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 +InternalPairFormationCoefficientAssign(ConstHandle2InternalPairFormationCoefficient self, ConstHandle2ConstInternalPairFormationCoefficient from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +InternalPairFormationCoefficientDelete(ConstHandle2ConstInternalPairFormationCoefficient self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +InternalPairFormationCoefficientRead(ConstHandle2InternalPairFormationCoefficient self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +InternalPairFormationCoefficientWrite(ConstHandle2ConstInternalPairFormationCoefficient self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +InternalPairFormationCoefficientPrint(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Print to standard output, as XML +extern_c int +InternalPairFormationCoefficientPrintXML(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Print to standard output, as JSON +extern_c int +InternalPairFormationCoefficientPrintJSON(ConstHandle2ConstInternalPairFormationCoefficient self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InternalPairFormationCoefficientLabelHas(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +InternalPairFormationCoefficientLabelGet(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Set +extern_c void +InternalPairFormationCoefficientLabelSet(ConstHandle2InternalPairFormationCoefficient self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InternalPairFormationCoefficientValueHas(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +InternalPairFormationCoefficientValueGet(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Set +extern_c void +InternalPairFormationCoefficientValueSet(ConstHandle2InternalPairFormationCoefficient self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InternalPairFormationCoefficientUnitHas(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +InternalPairFormationCoefficientUnitGet(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Set +extern_c void +InternalPairFormationCoefficientUnitSet(ConstHandle2InternalPairFormationCoefficient self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InternalPairFormationCoefficientDocumentationHas(ConstHandle2ConstInternalPairFormationCoefficient self); + +// --- Get, const +extern_c Handle2ConstDocumentation +InternalPairFormationCoefficientDocumentationGetConst(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Get, non-const +extern_c Handle2Documentation +InternalPairFormationCoefficientDocumentationGet(ConstHandle2InternalPairFormationCoefficient self); + +// +++ Set +extern_c void +InternalPairFormationCoefficientDocumentationSet(ConstHandle2InternalPairFormationCoefficient self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InternalPairFormationCoefficientUncertaintyHas(ConstHandle2ConstInternalPairFormationCoefficient self); + +// --- Get, const +extern_c Handle2ConstUncertainty +InternalPairFormationCoefficientUncertaintyGetConst(ConstHandle2ConstInternalPairFormationCoefficient self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +InternalPairFormationCoefficientUncertaintyGet(ConstHandle2InternalPairFormationCoefficient self); + +// +++ Set +extern_c void +InternalPairFormationCoefficientUncertaintySet(ConstHandle2InternalPairFormationCoefficient self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/InternalPairFormationCoefficient/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/InternalPairFormationCoefficient/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Interval.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Interval.cpp new file mode 100644 index 000000000..15159034d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Interval.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Interval.hpp" +#include "Interval.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = IntervalClass; +using CPP = multigroup::Interval; + +static const std::string CLASSNAME = "Interval"; + +namespace extract { + static auto confidence = [](auto &obj) { return &obj.confidence; }; + static auto lower = [](auto &obj) { return &obj.lower; }; + static auto upper = [](auto &obj) { return &obj.upper; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInterval +IntervalDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Interval +IntervalDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInterval +IntervalCreateConst( + const Float64 confidence, + const Float64 lower, + const Float64 upper +) { + ConstHandle2Interval handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + confidence, + lower, + upper + ); + return handle; +} + +// Create, general +Handle2Interval +IntervalCreate( + const Float64 confidence, + const Float64 lower, + const Float64 upper +) { + ConstHandle2Interval handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + confidence, + lower, + upper + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IntervalAssign(ConstHandle2Interval self, ConstHandle2ConstInterval from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IntervalDelete(ConstHandle2ConstInterval self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IntervalRead(ConstHandle2Interval self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IntervalWrite(ConstHandle2ConstInterval self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IntervalPrint(ConstHandle2ConstInterval self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IntervalPrintXML(ConstHandle2ConstInterval self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IntervalPrintJSON(ConstHandle2ConstInterval self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: confidence +// ----------------------------------------------------------------------------- + +// Has +int +IntervalConfidenceHas(ConstHandle2ConstInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConfidenceHas", self, extract::confidence); +} + +// Get +// Returns by value +Float64 +IntervalConfidenceGet(ConstHandle2ConstInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfidenceGet", self, extract::confidence); +} + +// Set +void +IntervalConfidenceSet(ConstHandle2Interval self, const Float64 confidence) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ConfidenceSet", self, extract::confidence, confidence); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: lower +// ----------------------------------------------------------------------------- + +// Has +int +IntervalLowerHas(ConstHandle2ConstInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LowerHas", self, extract::lower); +} + +// Get +// Returns by value +Float64 +IntervalLowerGet(ConstHandle2ConstInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LowerGet", self, extract::lower); +} + +// Set +void +IntervalLowerSet(ConstHandle2Interval self, const Float64 lower) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LowerSet", self, extract::lower, lower); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: upper +// ----------------------------------------------------------------------------- + +// Has +int +IntervalUpperHas(ConstHandle2ConstInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UpperHas", self, extract::upper); +} + +// Get +// Returns by value +Float64 +IntervalUpperGet(ConstHandle2ConstInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UpperGet", self, extract::upper); +} + +// Set +void +IntervalUpperSet(ConstHandle2Interval self, const Float64 upper) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UpperSet", self, extract::upper, upper); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Interval/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Interval.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Interval.h new file mode 100644 index 000000000..f0e6fbd88 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Interval.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. +// +// Interval is the basic handle type in this file. Example: +// // Create a default Interval object: +// Interval handle = IntervalDefault(); +// Functions involving Interval are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_POPS_INTERVAL +#define C_INTERFACE_TEST_V2_0_POPS_INTERVAL + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IntervalClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Interval +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IntervalClass *Interval; + +// --- Const-aware handles. +typedef const struct IntervalClass *const ConstHandle2ConstInterval; +typedef struct IntervalClass *const ConstHandle2Interval; +typedef const struct IntervalClass * Handle2ConstInterval; +typedef struct IntervalClass * Handle2Interval; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstInterval +IntervalDefaultConst(); + +// +++ Create, default +extern_c Handle2Interval +IntervalDefault(); + +// --- Create, general, const +extern_c Handle2ConstInterval +IntervalCreateConst( + const Float64 confidence, + const Float64 lower, + const Float64 upper +); + +// +++ Create, general +extern_c Handle2Interval +IntervalCreate( + const Float64 confidence, + const Float64 lower, + const Float64 upper +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IntervalAssign(ConstHandle2Interval self, ConstHandle2ConstInterval from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IntervalDelete(ConstHandle2ConstInterval self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IntervalRead(ConstHandle2Interval self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IntervalWrite(ConstHandle2ConstInterval self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IntervalPrint(ConstHandle2ConstInterval self); + +// +++ Print to standard output, as XML +extern_c int +IntervalPrintXML(ConstHandle2ConstInterval self); + +// +++ Print to standard output, as JSON +extern_c int +IntervalPrintJSON(ConstHandle2ConstInterval self); + + +// ----------------------------------------------------------------------------- +// Metadatum: confidence +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntervalConfidenceHas(ConstHandle2ConstInterval self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +IntervalConfidenceGet(ConstHandle2ConstInterval self); + +// +++ Set +extern_c void +IntervalConfidenceSet(ConstHandle2Interval self, const Float64 confidence); + + +// ----------------------------------------------------------------------------- +// Metadatum: lower +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntervalLowerHas(ConstHandle2ConstInterval self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +IntervalLowerGet(ConstHandle2ConstInterval self); + +// +++ Set +extern_c void +IntervalLowerSet(ConstHandle2Interval self, const Float64 lower); + + +// ----------------------------------------------------------------------------- +// Metadatum: upper +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntervalUpperHas(ConstHandle2ConstInterval self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +IntervalUpperGet(ConstHandle2ConstInterval self); + +// +++ Set +extern_c void +IntervalUpperSet(ConstHandle2Interval self, const Float64 upper); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Interval/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Interval/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Interval/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Interval/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Interval/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Isotope.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotope.cpp new file mode 100644 index 000000000..254b2f97c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotope.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Isotope.hpp" +#include "Isotope.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = IsotopeClass; +using CPP = multigroup::Isotope; + +static const std::string CLASSNAME = "Isotope"; + +namespace extract { + static auto A = [](auto &obj) { return &obj.A; }; + static auto symbol = [](auto &obj) { return &obj.symbol; }; + static auto nuclides = [](auto &obj) { return &obj.nuclides; }; +} + +using CPPNuclides = pops::Nuclides; + + +// ----------------------------------------------------------------------------- +// 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 Integer32 A, + const XMLName symbol, + ConstHandle2ConstNuclides nuclides +) { + ConstHandle2Isotope handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + A, + symbol, + detail::tocpp(nuclides) + ); + return handle; +} + +// Create, general +Handle2Isotope +IsotopeCreate( + const Integer32 A, + const XMLName symbol, + ConstHandle2ConstNuclides nuclides +) { + ConstHandle2Isotope handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + A, + symbol, + 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: A +// ----------------------------------------------------------------------------- + +// Has +int +IsotopeAHas(ConstHandle2ConstIsotope self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AHas", self, extract::A); +} + +// Get +// Returns by value +Integer32 +IsotopeAGet(ConstHandle2ConstIsotope self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AGet", self, extract::A); +} + +// Set +void +IsotopeASet(ConstHandle2Isotope self, const Integer32 A) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ASet", self, extract::A, A); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: symbol +// ----------------------------------------------------------------------------- + +// Has +int +IsotopeSymbolHas(ConstHandle2ConstIsotope self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SymbolHas", self, extract::symbol); +} + +// Get +// Returns by value +XMLName +IsotopeSymbolGet(ConstHandle2ConstIsotope self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SymbolGet", self, extract::symbol); +} + +// Set +void +IsotopeSymbolSet(ConstHandle2Isotope self, const XMLName symbol) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SymbolSet", self, extract::symbol, symbol); +} + + +// ----------------------------------------------------------------------------- +// 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/pops/Isotope/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Isotope.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotope.h new file mode 100644 index 000000000..60c1ec3f8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_ISOTOPE +#define C_INTERFACE_TEST_V2_0_POPS_ISOTOPE + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Isotope +IsotopeDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotope +IsotopeCreateConst( + const Integer32 A, + const XMLName symbol, + ConstHandle2ConstNuclides nuclides +); + +// +++ Create, general +extern_c Handle2Isotope +IsotopeCreate( + const Integer32 A, + const XMLName symbol, + 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: A +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IsotopeAHas(ConstHandle2ConstIsotope self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +IsotopeAGet(ConstHandle2ConstIsotope self); + +// +++ Set +extern_c void +IsotopeASet(ConstHandle2Isotope self, const Integer32 A); + + +// ----------------------------------------------------------------------------- +// Metadatum: symbol +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IsotopeSymbolHas(ConstHandle2ConstIsotope self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +IsotopeSymbolGet(ConstHandle2ConstIsotope self); + +// +++ Set +extern_c void +IsotopeSymbolSet(ConstHandle2Isotope self, const XMLName symbol); + + +// ----------------------------------------------------------------------------- +// 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/pops/Isotope/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Isotope/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotope/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Isotope/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotope/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes.cpp new file mode 100644 index 000000000..76a9d4d48 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Isotopes.hpp" +#include "Isotopes.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Isotope; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIsotopes +IsotopesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by A +int +IsotopesIsotopeHasByA( + ConstHandle2ConstIsotopes self, + const Integer32 A +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeHasByA", + self, extract::isotope, meta::A, A); +} + +// Get, by A, const +Handle2ConstIsotope +IsotopesIsotopeGetByAConst( + ConstHandle2ConstIsotopes self, + const Integer32 A +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetByAConst", + self, extract::isotope, meta::A, A); +} + +// Get, by A, non-const +Handle2Isotope +IsotopesIsotopeGetByA( + ConstHandle2Isotopes self, + const Integer32 A +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetByA", + self, extract::isotope, meta::A, A); +} + +// Set, by A +void +IsotopesIsotopeSetByA( + ConstHandle2Isotopes self, + const Integer32 A, + ConstHandle2ConstIsotope isotope +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeSetByA", + self, extract::isotope, meta::A, A, isotope); +} + +// Has, by symbol +int +IsotopesIsotopeHasBySymbol( + ConstHandle2ConstIsotopes self, + const XMLName symbol +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeHasBySymbol", + self, extract::isotope, meta::symbol, symbol); +} + +// Get, by symbol, const +Handle2ConstIsotope +IsotopesIsotopeGetBySymbolConst( + ConstHandle2ConstIsotopes self, + const XMLName symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetBySymbolConst", + self, extract::isotope, meta::symbol, symbol); +} + +// Get, by symbol, non-const +Handle2Isotope +IsotopesIsotopeGetBySymbol( + ConstHandle2Isotopes self, + const XMLName symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetBySymbol", + self, extract::isotope, meta::symbol, symbol); +} + +// Set, by symbol +void +IsotopesIsotopeSetBySymbol( + ConstHandle2Isotopes self, + const XMLName symbol, + ConstHandle2ConstIsotope isotope +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeSetBySymbol", + self, extract::isotope, meta::symbol, symbol, isotope); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Isotopes/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes.h new file mode 100644 index 000000000..f42a77658 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_ISOTOPES +#define C_INTERFACE_TEST_V2_0_POPS_ISOTOPES + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Isotopes +IsotopesDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotopes +IsotopesCreateConst( + ConstHandle2Isotope *const isotope, const size_t isotopeSize +); + +// +++ Create, general +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 +); + +// +++ Has, by A +extern_c int +IsotopesIsotopeHasByA( + ConstHandle2ConstIsotopes self, + const Integer32 A +); + +// --- Get, by A, const +extern_c Handle2ConstIsotope +IsotopesIsotopeGetByAConst( + ConstHandle2ConstIsotopes self, + const Integer32 A +); + +// +++ Get, by A, non-const +extern_c Handle2Isotope +IsotopesIsotopeGetByA( + ConstHandle2Isotopes self, + const Integer32 A +); + +// +++ Set, by A +extern_c void +IsotopesIsotopeSetByA( + ConstHandle2Isotopes self, + const Integer32 A, + ConstHandle2ConstIsotope isotope +); + +// +++ Has, by symbol +extern_c int +IsotopesIsotopeHasBySymbol( + ConstHandle2ConstIsotopes self, + const XMLName symbol +); + +// --- Get, by symbol, const +extern_c Handle2ConstIsotope +IsotopesIsotopeGetBySymbolConst( + ConstHandle2ConstIsotopes self, + const XMLName symbol +); + +// +++ Get, by symbol, non-const +extern_c Handle2Isotope +IsotopesIsotopeGetBySymbol( + ConstHandle2Isotopes self, + const XMLName symbol +); + +// +++ Set, by symbol +extern_c void +IsotopesIsotopeSetBySymbol( + ConstHandle2Isotopes self, + const XMLName symbol, + ConstHandle2ConstIsotope isotope +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Isotopes/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Isotopes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton.cpp new file mode 100644 index 000000000..d09be8158 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton.cpp @@ -0,0 +1,466 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Lepton.hpp" +#include "Lepton.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = LeptonClass; +using CPP = multigroup::Lepton; + +static const std::string CLASSNAME = "Lepton"; + +namespace extract { + static auto generation = [](auto &obj) { return &obj.generation; }; + static auto id = [](auto &obj) { return &obj.id; }; + static auto charge = [](auto &obj) { return &obj.charge; }; + static auto halflife = [](auto &obj) { return &obj.halflife; }; + 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 decayData = [](auto &obj) { return &obj.decayData; }; +} + +using CPPCharge = pops::Charge; +using CPPHalflife = pops::Halflife; +using CPPMass = pops::Mass; +using CPPSpin = pops::Spin; +using CPPParity = pops::Parity; +using CPPDecayData = pops::DecayData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLepton +LeptonDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Lepton +LeptonDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLepton +LeptonCreateConst( + const XMLName generation, + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Lepton handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + generation, + id, + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(decayData) + ); + return handle; +} + +// Create, general +Handle2Lepton +LeptonCreate( + const XMLName generation, + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Lepton handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + generation, + id, + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + 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 +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: generation +// ----------------------------------------------------------------------------- + +// Has +int +LeptonGenerationHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GenerationHas", self, extract::generation); +} + +// Get +// Returns by value +XMLName +LeptonGenerationGet(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GenerationGet", self, extract::generation); +} + +// Set +void +LeptonGenerationSet(ConstHandle2Lepton self, const XMLName generation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GenerationSet", self, extract::generation, generation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// Has +int +LeptonIdHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdHas", self, extract::id); +} + +// Get +// Returns by value +XMLName +LeptonIdGet(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +LeptonIdSet(ConstHandle2Lepton self, const XMLName id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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: decayData +// ----------------------------------------------------------------------------- + +// Has +int +LeptonDecayDataHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayDataHas", self, extract::decayData); +} + +// Get, const +Handle2ConstDecayData +LeptonDecayDataGetConst(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGetConst", self, extract::decayData); +} + +// Get, non-const +Handle2DecayData +LeptonDecayDataGet(ConstHandle2Lepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGet", self, extract::decayData); +} + +// Set +void +LeptonDecayDataSet(ConstHandle2Lepton self, ConstHandle2ConstDecayData decayData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DecayDataSet", self, extract::decayData, decayData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Lepton/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton.h new file mode 100644 index 000000000..ffb2d8a02 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton.h @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_LEPTON +#define C_INTERFACE_TEST_V2_0_POPS_LEPTON + +#include "GNDStk.h" +#include "v2.0/pops/Charge.h" +#include "v2.0/pops/Halflife.h" +#include "v2.0/pops/Mass.h" +#include "v2.0/pops/Spin.h" +#include "v2.0/pops/Parity.h" +#include "v2.0/pops/DecayData.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 +extern_c Handle2Lepton +LeptonDefault(); + +// --- Create, general, const +extern_c Handle2ConstLepton +LeptonCreateConst( + const XMLName generation, + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData +); + +// +++ Create, general +extern_c Handle2Lepton +LeptonCreate( + const XMLName generation, + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + 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 +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: generation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonGenerationHas(ConstHandle2ConstLepton self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +LeptonGenerationGet(ConstHandle2ConstLepton self); + +// +++ Set +extern_c void +LeptonGenerationSet(ConstHandle2Lepton self, const XMLName generation); + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonIdHas(ConstHandle2ConstLepton self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +LeptonIdGet(ConstHandle2ConstLepton self); + +// +++ Set +extern_c void +LeptonIdSet(ConstHandle2Lepton self, const XMLName id); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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: decayData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonDecayDataHas(ConstHandle2ConstLepton self); + +// --- Get, const +extern_c Handle2ConstDecayData +LeptonDecayDataGetConst(ConstHandle2ConstLepton self); + +// +++ Get, non-const +extern_c Handle2DecayData +LeptonDecayDataGet(ConstHandle2Lepton self); + +// +++ Set +extern_c void +LeptonDecayDataSet(ConstHandle2Lepton self, ConstHandle2ConstDecayData decayData); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Lepton/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Lepton/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons.cpp new file mode 100644 index 000000000..1996eaa10 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Leptons.hpp" +#include "Leptons.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Lepton; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLeptons +LeptonsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by generation +int +LeptonsLeptonHasByGeneration( + ConstHandle2ConstLeptons self, + const XMLName generation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LeptonHasByGeneration", + self, extract::lepton, meta::generation, generation); +} + +// Get, by generation, const +Handle2ConstLepton +LeptonsLeptonGetByGenerationConst( + ConstHandle2ConstLeptons self, + const XMLName generation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LeptonGetByGenerationConst", + self, extract::lepton, meta::generation, generation); +} + +// Get, by generation, non-const +Handle2Lepton +LeptonsLeptonGetByGeneration( + ConstHandle2Leptons self, + const XMLName generation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LeptonGetByGeneration", + self, extract::lepton, meta::generation, generation); +} + +// Set, by generation +void +LeptonsLeptonSetByGeneration( + ConstHandle2Leptons self, + const XMLName generation, + ConstHandle2ConstLepton lepton +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LeptonSetByGeneration", + self, extract::lepton, meta::generation, generation, lepton); +} + +// Has, by id +int +LeptonsLeptonHasById( + ConstHandle2ConstLeptons self, + const XMLName id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LeptonHasById", + self, extract::lepton, meta::id, id); +} + +// Get, by id, const +Handle2ConstLepton +LeptonsLeptonGetByIdConst( + ConstHandle2ConstLeptons self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LeptonGetByIdConst", + self, extract::lepton, meta::id, id); +} + +// Get, by id, non-const +Handle2Lepton +LeptonsLeptonGetById( + ConstHandle2Leptons self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LeptonGetById", + self, extract::lepton, meta::id, id); +} + +// Set, by id +void +LeptonsLeptonSetById( + ConstHandle2Leptons self, + const XMLName id, + ConstHandle2ConstLepton lepton +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LeptonSetById", + self, extract::lepton, meta::id, id, lepton); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Leptons/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons.h new file mode 100644 index 000000000..6b613a74a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_LEPTONS +#define C_INTERFACE_TEST_V2_0_POPS_LEPTONS + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Leptons +LeptonsDefault(); + +// --- Create, general, const +extern_c Handle2ConstLeptons +LeptonsCreateConst( + ConstHandle2Lepton *const lepton, const size_t leptonSize +); + +// +++ Create, general +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 +); + +// +++ Has, by generation +extern_c int +LeptonsLeptonHasByGeneration( + ConstHandle2ConstLeptons self, + const XMLName generation +); + +// --- Get, by generation, const +extern_c Handle2ConstLepton +LeptonsLeptonGetByGenerationConst( + ConstHandle2ConstLeptons self, + const XMLName generation +); + +// +++ Get, by generation, non-const +extern_c Handle2Lepton +LeptonsLeptonGetByGeneration( + ConstHandle2Leptons self, + const XMLName generation +); + +// +++ Set, by generation +extern_c void +LeptonsLeptonSetByGeneration( + ConstHandle2Leptons self, + const XMLName generation, + ConstHandle2ConstLepton lepton +); + +// +++ Has, by id +extern_c int +LeptonsLeptonHasById( + ConstHandle2ConstLeptons self, + const XMLName id +); + +// --- Get, by id, const +extern_c Handle2ConstLepton +LeptonsLeptonGetByIdConst( + ConstHandle2ConstLeptons self, + const XMLName id +); + +// +++ Get, by id, non-const +extern_c Handle2Lepton +LeptonsLeptonGetById( + ConstHandle2Leptons self, + const XMLName id +); + +// +++ Set, by id +extern_c void +LeptonsLeptonSetById( + ConstHandle2Leptons self, + const XMLName id, + ConstHandle2ConstLepton lepton +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Leptons/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Leptons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal.cpp new file mode 100644 index 000000000..901b6d1fb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/LogNormal.hpp" +#include "LogNormal.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = LogNormalClass; +using CPP = multigroup::LogNormal; + +static const std::string CLASSNAME = "LogNormal"; + +namespace extract { + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDouble = extra::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLogNormal +LogNormalDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2LogNormal +LogNormalDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLogNormal +LogNormalCreateConst( + ConstHandle2ConstDouble Double +) { + ConstHandle2LogNormal handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(Double) + ); + return handle; +} + +// Create, general +Handle2LogNormal +LogNormalCreate( + ConstHandle2ConstDouble Double +) { + ConstHandle2LogNormal 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 +LogNormalAssign(ConstHandle2LogNormal self, ConstHandle2ConstLogNormal from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LogNormalDelete(ConstHandle2ConstLogNormal self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LogNormalRead(ConstHandle2LogNormal self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LogNormalWrite(ConstHandle2ConstLogNormal self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LogNormalPrint(ConstHandle2ConstLogNormal self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LogNormalPrintXML(ConstHandle2ConstLogNormal self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LogNormalPrintJSON(ConstHandle2ConstLogNormal self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +LogNormalDoubleHas(ConstHandle2ConstLogNormal self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +LogNormalDoubleGetConst(ConstHandle2ConstLogNormal self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +LogNormalDoubleGet(ConstHandle2LogNormal self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +LogNormalDoubleSet(ConstHandle2LogNormal self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/LogNormal/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal.h b/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal.h new file mode 100644 index 000000000..8fc6663b6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal.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. +// +// LogNormal is the basic handle type in this file. Example: +// // Create a default LogNormal object: +// LogNormal handle = LogNormalDefault(); +// Functions involving LogNormal are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_POPS_LOGNORMAL +#define C_INTERFACE_TEST_V2_0_POPS_LOGNORMAL + +#include "GNDStk.h" +#include "v2.0/extra/Double.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LogNormalClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ LogNormal +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LogNormalClass *LogNormal; + +// --- Const-aware handles. +typedef const struct LogNormalClass *const ConstHandle2ConstLogNormal; +typedef struct LogNormalClass *const ConstHandle2LogNormal; +typedef const struct LogNormalClass * Handle2ConstLogNormal; +typedef struct LogNormalClass * Handle2LogNormal; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLogNormal +LogNormalDefaultConst(); + +// +++ Create, default +extern_c Handle2LogNormal +LogNormalDefault(); + +// --- Create, general, const +extern_c Handle2ConstLogNormal +LogNormalCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +extern_c Handle2LogNormal +LogNormalCreate( + 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 +LogNormalAssign(ConstHandle2LogNormal self, ConstHandle2ConstLogNormal from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LogNormalDelete(ConstHandle2ConstLogNormal self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LogNormalRead(ConstHandle2LogNormal self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LogNormalWrite(ConstHandle2ConstLogNormal self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LogNormalPrint(ConstHandle2ConstLogNormal self); + +// +++ Print to standard output, as XML +extern_c int +LogNormalPrintXML(ConstHandle2ConstLogNormal self); + +// +++ Print to standard output, as JSON +extern_c int +LogNormalPrintJSON(ConstHandle2ConstLogNormal self); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LogNormalDoubleHas(ConstHandle2ConstLogNormal self); + +// --- Get, const +extern_c Handle2ConstDouble +LogNormalDoubleGetConst(ConstHandle2ConstLogNormal self); + +// +++ Get, non-const +extern_c Handle2Double +LogNormalDoubleGet(ConstHandle2LogNormal self); + +// +++ Set +extern_c void +LogNormalDoubleSet(ConstHandle2LogNormal self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/LogNormal/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/LogNormal/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Mass.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Mass.cpp new file mode 100644 index 000000000..19797ba0f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Mass.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Mass.hpp" +#include "Mass.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MassClass; +using CPP = multigroup::Mass; + +static const std::string CLASSNAME = "Mass"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; +using CPPDouble = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMass +MassDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Mass +MassDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMass +MassCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstDouble Double +) { + ConstHandle2Mass handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + detail::tocpp(Double) + ); + return handle; +} + +// Create, general +Handle2Mass +MassCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstDouble Double +) { + ConstHandle2Mass handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + 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: label +// ----------------------------------------------------------------------------- + +// Has +int +MassLabelHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +MassLabelGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MassLabelSet(ConstHandle2Mass self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +MassUnitHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +MassUnitGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +MassUnitSet(ConstHandle2Mass self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +MassValueHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +MassValueGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +MassValueSet(ConstHandle2Mass self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +MassDocumentationHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +MassDocumentationGetConst(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +MassDocumentationGet(ConstHandle2Mass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +MassDocumentationSet(ConstHandle2Mass self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +MassUncertaintyHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +MassUncertaintyGetConst(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +MassUncertaintyGet(ConstHandle2Mass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +MassUncertaintySet(ConstHandle2Mass self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// 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/pops/Mass/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Mass.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Mass.h new file mode 100644 index 000000000..3f3f1b5ac --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Mass.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. +// +// 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_TEST_V2_0_POPS_MASS +#define C_INTERFACE_TEST_V2_0_POPS_MASS + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" +#include "v2.0/containers/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 +extern_c Handle2Mass +MassDefault(); + +// --- Create, general, const +extern_c Handle2ConstMass +MassCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstDouble Double +); + +// +++ Create, general +extern_c Handle2Mass +MassCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassLabelHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MassLabelGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassLabelSet(ConstHandle2Mass self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassUnitHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MassUnitGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassUnitSet(ConstHandle2Mass self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassValueHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MassValueGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassValueSet(ConstHandle2Mass self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassDocumentationHas(ConstHandle2ConstMass self); + +// --- Get, const +extern_c Handle2ConstDocumentation +MassDocumentationGetConst(ConstHandle2ConstMass self); + +// +++ Get, non-const +extern_c Handle2Documentation +MassDocumentationGet(ConstHandle2Mass self); + +// +++ Set +extern_c void +MassDocumentationSet(ConstHandle2Mass self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassUncertaintyHas(ConstHandle2ConstMass self); + +// --- Get, const +extern_c Handle2ConstUncertainty +MassUncertaintyGetConst(ConstHandle2ConstMass self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +MassUncertaintyGet(ConstHandle2Mass self); + +// +++ Set +extern_c void +MassUncertaintySet(ConstHandle2Mass self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// 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/pops/Mass/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Mass/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Mass/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Mass/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Mass/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/MetaStable.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/MetaStable.cpp new file mode 100644 index 000000000..6d439f2c8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/MetaStable.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/MetaStable.hpp" +#include "MetaStable.h" + +using namespace njoy::GNDStk; +using namespace test::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 metaStableIndex = [](auto &obj) { return &obj.metaStableIndex; }; + static auto pid = [](auto &obj) { return &obj.pid; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMetaStable +MetaStableDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2MetaStable +MetaStableDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMetaStable +MetaStableCreateConst( + const XMLName id, + const Integer32 metaStableIndex, + const XMLName pid +) { + ConstHandle2MetaStable handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + metaStableIndex, + pid + ); + return handle; +} + +// Create, general +Handle2MetaStable +MetaStableCreate( + const XMLName id, + const Integer32 metaStableIndex, + const XMLName pid +) { + ConstHandle2MetaStable handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + metaStableIndex, + 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 +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 +XMLName +MetaStableIdGet(ConstHandle2ConstMetaStable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +MetaStableIdSet(ConstHandle2MetaStable self, const XMLName id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: metaStableIndex +// ----------------------------------------------------------------------------- + +// Has +int +MetaStableMetaStableIndexHas(ConstHandle2ConstMetaStable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MetaStableIndexHas", self, extract::metaStableIndex); +} + +// Get +// Returns by value +Integer32 +MetaStableMetaStableIndexGet(ConstHandle2ConstMetaStable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MetaStableIndexGet", self, extract::metaStableIndex); +} + +// Set +void +MetaStableMetaStableIndexSet(ConstHandle2MetaStable self, const Integer32 metaStableIndex) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MetaStableIndexSet", self, extract::metaStableIndex, metaStableIndex); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +MetaStablePidHas(ConstHandle2ConstMetaStable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +XMLName +MetaStablePidGet(ConstHandle2ConstMetaStable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +MetaStablePidSet(ConstHandle2MetaStable self, const XMLName pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/MetaStable/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/MetaStable.h b/standards/gnds-2.0/test/c/src/v2.0/pops/MetaStable.h new file mode 100644 index 000000000..3452338fe --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_METASTABLE +#define C_INTERFACE_TEST_V2_0_POPS_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 +extern_c Handle2MetaStable +MetaStableDefault(); + +// --- Create, general, const +extern_c Handle2ConstMetaStable +MetaStableCreateConst( + const XMLName id, + const Integer32 metaStableIndex, + const XMLName pid +); + +// +++ Create, general +extern_c Handle2MetaStable +MetaStableCreate( + const XMLName id, + const Integer32 metaStableIndex, + const XMLName 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 +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 XMLName +MetaStableIdGet(ConstHandle2ConstMetaStable self); + +// +++ Set +extern_c void +MetaStableIdSet(ConstHandle2MetaStable self, const XMLName id); + + +// ----------------------------------------------------------------------------- +// Metadatum: metaStableIndex +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MetaStableMetaStableIndexHas(ConstHandle2ConstMetaStable self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +MetaStableMetaStableIndexGet(ConstHandle2ConstMetaStable self); + +// +++ Set +extern_c void +MetaStableMetaStableIndexSet(ConstHandle2MetaStable self, const Integer32 metaStableIndex); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MetaStablePidHas(ConstHandle2ConstMetaStable self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MetaStablePidGet(ConstHandle2ConstMetaStable self); + +// +++ Set +extern_c void +MetaStablePidSet(ConstHandle2MetaStable self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/MetaStable/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/MetaStable/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/MetaStable/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/MetaStable/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/MetaStable/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nucleus.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Nucleus.cpp new file mode 100644 index 000000000..f389ebd22 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Nucleus.cpp @@ -0,0 +1,509 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Nucleus.hpp" +#include "Nucleus.h" + +using namespace njoy::GNDStk; +using namespace test::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 charge = [](auto &obj) { return &obj.charge; }; + static auto energy = [](auto &obj) { return &obj.energy; }; + static auto halflife = [](auto &obj) { return &obj.halflife; }; + static auto spin = [](auto &obj) { return &obj.spin; }; + static auto parity = [](auto &obj) { return &obj.parity; }; + static auto decayData = [](auto &obj) { return &obj.decayData; }; + static auto fissionFragmentData = [](auto &obj) { return &obj.fissionFragmentData; }; +} + +using CPPCharge = pops::Charge; +using CPPEnergy = pops::Energy; +using CPPHalflife = pops::Halflife; +using CPPSpin = pops::Spin; +using CPPParity = pops::Parity; +using CPPDecayData = pops::DecayData; +using CPPFissionFragmentData = fissionFragmentData::FissionFragmentData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNucleus +NucleusDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Nucleus +NucleusDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNucleus +NucleusCreateConst( + const XMLName id, + const Integer32 index, + ConstHandle2ConstCharge charge, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +) { + ConstHandle2Nucleus handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + index, + detail::tocpp(charge), + detail::tocpp(energy), + detail::tocpp(halflife), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(decayData), + detail::tocpp(fissionFragmentData) + ); + return handle; +} + +// Create, general +Handle2Nucleus +NucleusCreate( + const XMLName id, + const Integer32 index, + ConstHandle2ConstCharge charge, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +) { + ConstHandle2Nucleus handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + index, + detail::tocpp(charge), + detail::tocpp(energy), + detail::tocpp(halflife), + detail::tocpp(spin), + detail::tocpp(parity), + 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 +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 +XMLName +NucleusIdGet(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +NucleusIdSet(ConstHandle2Nucleus self, const XMLName 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 +Integer32 +NucleusIndexGet(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +NucleusIndexSet(ConstHandle2Nucleus self, const Integer32 index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// 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: 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: 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: 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: 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); +} + + +// ----------------------------------------------------------------------------- +// Child: fissionFragmentData +// ----------------------------------------------------------------------------- + +// Has +int +NucleusFissionFragmentDataHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionFragmentDataHas", self, extract::fissionFragmentData); +} + +// Get, const +Handle2ConstFissionFragmentData +NucleusFissionFragmentDataGetConst(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionFragmentDataGetConst", self, extract::fissionFragmentData); +} + +// Get, non-const +Handle2FissionFragmentData +NucleusFissionFragmentDataGet(ConstHandle2Nucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionFragmentDataGet", self, extract::fissionFragmentData); +} + +// Set +void +NucleusFissionFragmentDataSet(ConstHandle2Nucleus self, ConstHandle2ConstFissionFragmentData fissionFragmentData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionFragmentDataSet", self, extract::fissionFragmentData, fissionFragmentData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Nucleus/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nucleus.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Nucleus.h new file mode 100644 index 000000000..cc9f7f660 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_NUCLEUS +#define C_INTERFACE_TEST_V2_0_POPS_NUCLEUS + +#include "GNDStk.h" +#include "v2.0/pops/Charge.h" +#include "v2.0/pops/Energy.h" +#include "v2.0/pops/Halflife.h" +#include "v2.0/pops/Spin.h" +#include "v2.0/pops/Parity.h" +#include "v2.0/pops/DecayData.h" +#include "v2.0/fissionFragmentData/FissionFragmentData.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 +extern_c Handle2Nucleus +NucleusDefault(); + +// --- Create, general, const +extern_c Handle2ConstNucleus +NucleusCreateConst( + const XMLName id, + const Integer32 index, + ConstHandle2ConstCharge charge, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +); + +// +++ Create, general +extern_c Handle2Nucleus +NucleusCreate( + const XMLName id, + const Integer32 index, + ConstHandle2ConstCharge charge, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + 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 +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 XMLName +NucleusIdGet(ConstHandle2ConstNucleus self); + +// +++ Set +extern_c void +NucleusIdSet(ConstHandle2Nucleus self, const XMLName id); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusIndexHas(ConstHandle2ConstNucleus self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +NucleusIndexGet(ConstHandle2ConstNucleus self); + +// +++ Set +extern_c void +NucleusIndexSet(ConstHandle2Nucleus self, const Integer32 index); + + +// ----------------------------------------------------------------------------- +// 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: 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: 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: 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: 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); + + +// ----------------------------------------------------------------------------- +// Child: fissionFragmentData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusFissionFragmentDataHas(ConstHandle2ConstNucleus self); + +// --- Get, const +extern_c Handle2ConstFissionFragmentData +NucleusFissionFragmentDataGetConst(ConstHandle2ConstNucleus self); + +// +++ Get, non-const +extern_c Handle2FissionFragmentData +NucleusFissionFragmentDataGet(ConstHandle2Nucleus self); + +// +++ Set +extern_c void +NucleusFissionFragmentDataSet(ConstHandle2Nucleus self, ConstHandle2ConstFissionFragmentData fissionFragmentData); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Nucleus/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nucleus/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Nucleus/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nucleus/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Nucleus/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide.cpp new file mode 100644 index 000000000..85cfb0daa --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide.cpp @@ -0,0 +1,474 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Nuclide.hpp" +#include "Nuclide.h" + +using namespace njoy::GNDStk; +using namespace test::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 charge = [](auto &obj) { return &obj.charge; }; + 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 nucleus = [](auto &obj) { return &obj.nucleus; }; + static auto decayData = [](auto &obj) { return &obj.decayData; }; + static auto fissionFragmentData = [](auto &obj) { return &obj.fissionFragmentData; }; +} + +using CPPCharge = pops::Charge; +using CPPMass = pops::Mass; +using CPPSpin = pops::Spin; +using CPPParity = pops::Parity; +using CPPNucleus = pops::Nucleus; +using CPPDecayData = pops::DecayData; +using CPPFissionFragmentData = fissionFragmentData::FissionFragmentData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclide +NuclideDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Nuclide +NuclideDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNuclide +NuclideCreateConst( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstNucleus nucleus, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +) { + ConstHandle2Nuclide handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + detail::tocpp(charge), + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(nucleus), + detail::tocpp(decayData), + detail::tocpp(fissionFragmentData) + ); + return handle; +} + +// Create, general +Handle2Nuclide +NuclideCreate( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstNucleus nucleus, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +) { + ConstHandle2Nuclide handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + detail::tocpp(charge), + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + 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 +XMLName +NuclideIdGet(ConstHandle2ConstNuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +NuclideIdSet(ConstHandle2Nuclide self, const XMLName id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// 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: 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: spin +// ----------------------------------------------------------------------------- + +// Has +int +NuclideSpinHas(ConstHandle2ConstNuclide self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpinHas", self, extract::spin); +} + +// Get, const +Handle2ConstSpin +NuclideSpinGetConst(ConstHandle2ConstNuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGetConst", self, extract::spin); +} + +// Get, non-const +Handle2Spin +NuclideSpinGet(ConstHandle2Nuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGet", self, extract::spin); +} + +// Set +void +NuclideSpinSet(ConstHandle2Nuclide self, ConstHandle2ConstSpin spin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SpinSet", self, extract::spin, spin); +} + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// Has +int +NuclideParityHas(ConstHandle2ConstNuclide self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParityHas", self, extract::parity); +} + +// Get, const +Handle2ConstParity +NuclideParityGetConst(ConstHandle2ConstNuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGetConst", self, extract::parity); +} + +// Get, non-const +Handle2Parity +NuclideParityGet(ConstHandle2Nuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGet", self, extract::parity); +} + +// Set +void +NuclideParitySet(ConstHandle2Nuclide self, ConstHandle2ConstParity parity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ParitySet", self, extract::parity, parity); +} + + +// ----------------------------------------------------------------------------- +// 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/pops/Nuclide/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide.h new file mode 100644 index 000000000..5eed45446 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide.h @@ -0,0 +1,325 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_NUCLIDE +#define C_INTERFACE_TEST_V2_0_POPS_NUCLIDE + +#include "GNDStk.h" +#include "v2.0/pops/Charge.h" +#include "v2.0/pops/Mass.h" +#include "v2.0/pops/Spin.h" +#include "v2.0/pops/Parity.h" +#include "v2.0/pops/Nucleus.h" +#include "v2.0/pops/DecayData.h" +#include "v2.0/fissionFragmentData/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 +extern_c Handle2Nuclide +NuclideDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclide +NuclideCreateConst( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstNucleus nucleus, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +); + +// +++ Create, general +extern_c Handle2Nuclide +NuclideCreate( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + 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 XMLName +NuclideIdGet(ConstHandle2ConstNuclide self); + +// +++ Set +extern_c void +NuclideIdSet(ConstHandle2Nuclide self, const XMLName id); + + +// ----------------------------------------------------------------------------- +// 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: 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: spin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclideSpinHas(ConstHandle2ConstNuclide self); + +// --- Get, const +extern_c Handle2ConstSpin +NuclideSpinGetConst(ConstHandle2ConstNuclide self); + +// +++ Get, non-const +extern_c Handle2Spin +NuclideSpinGet(ConstHandle2Nuclide self); + +// +++ Set +extern_c void +NuclideSpinSet(ConstHandle2Nuclide self, ConstHandle2ConstSpin spin); + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclideParityHas(ConstHandle2ConstNuclide self); + +// --- Get, const +extern_c Handle2ConstParity +NuclideParityGetConst(ConstHandle2ConstNuclide self); + +// +++ Get, non-const +extern_c Handle2Parity +NuclideParityGet(ConstHandle2Nuclide self); + +// +++ Set +extern_c void +NuclideParitySet(ConstHandle2Nuclide self, ConstHandle2ConstParity parity); + + +// ----------------------------------------------------------------------------- +// 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/pops/Nuclide/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclide/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides.cpp new file mode 100644 index 000000000..2129376fe --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Nuclides.hpp" +#include "Nuclides.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Nuclide; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclides +NuclidesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by id +int +NuclidesNuclideHasById( + ConstHandle2ConstNuclides self, + const XMLName id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"NuclideHasById", + self, extract::nuclide, meta::id, id); +} + +// Get, by id, const +Handle2ConstNuclide +NuclidesNuclideGetByIdConst( + ConstHandle2ConstNuclides self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"NuclideGetByIdConst", + self, extract::nuclide, meta::id, id); +} + +// Get, by id, non-const +Handle2Nuclide +NuclidesNuclideGetById( + ConstHandle2Nuclides self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"NuclideGetById", + self, extract::nuclide, meta::id, id); +} + +// Set, by id +void +NuclidesNuclideSetById( + ConstHandle2Nuclides self, + const XMLName id, + ConstHandle2ConstNuclide nuclide +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"NuclideSetById", + self, extract::nuclide, meta::id, id, nuclide); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Nuclides/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides.h new file mode 100644 index 000000000..eff0456b0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_NUCLIDES +#define C_INTERFACE_TEST_V2_0_POPS_NUCLIDES + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Nuclides +NuclidesDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclides +NuclidesCreateConst( + ConstHandle2Nuclide *const nuclide, const size_t nuclideSize +); + +// +++ Create, general +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 +); + +// +++ Has, by id +extern_c int +NuclidesNuclideHasById( + ConstHandle2ConstNuclides self, + const XMLName id +); + +// --- Get, by id, const +extern_c Handle2ConstNuclide +NuclidesNuclideGetByIdConst( + ConstHandle2ConstNuclides self, + const XMLName id +); + +// +++ Get, by id, non-const +extern_c Handle2Nuclide +NuclidesNuclideGetById( + ConstHandle2Nuclides self, + const XMLName id +); + +// +++ Set, by id +extern_c void +NuclidesNuclideSetById( + ConstHandle2Nuclides self, + const XMLName id, + ConstHandle2ConstNuclide nuclide +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Nuclides/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Nuclides/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Parity.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Parity.cpp new file mode 100644 index 000000000..ec2cd1b33 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Parity.cpp @@ -0,0 +1,538 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Parity.hpp" +#include "Parity.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ParityClass; +using CPP = multigroup::Parity; + +static const std::string CLASSNAME = "Parity"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto integer = [](auto &obj) { return &obj.integer; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; +using CPPInteger = containers::Integer; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParity +ParityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Parity +ParityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParity +ParityCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Integer *const integer, const size_t integerSize +) { + ConstHandle2Parity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t IntegerN = 0; IntegerN < integerSize; ++IntegerN) + ParityIntegerAdd(handle, integer[IntegerN]); + return handle; +} + +// Create, general +Handle2Parity +ParityCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Integer *const integer, const size_t integerSize +) { + ConstHandle2Parity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t IntegerN = 0; IntegerN < integerSize; ++IntegerN) + ParityIntegerAdd(handle, integer[IntegerN]); + return handle; +} + +// Assign +// Use this to assign 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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ParityLabelHas(ConstHandle2ConstParity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ParityLabelGet(ConstHandle2ConstParity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ParityLabelSet(ConstHandle2Parity self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +ParityUnitHas(ConstHandle2ConstParity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +ParityUnitGet(ConstHandle2ConstParity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +ParityUnitSet(ConstHandle2Parity self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +ParityValueHas(ConstHandle2ConstParity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +ParityValueGet(ConstHandle2ConstParity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +ParityValueSet(ConstHandle2Parity self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +ParityDocumentationHas(ConstHandle2ConstParity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +ParityDocumentationGetConst(ConstHandle2ConstParity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +ParityDocumentationGet(ConstHandle2Parity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +ParityDocumentationSet(ConstHandle2Parity self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +ParityUncertaintyHas(ConstHandle2ConstParity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +ParityUncertaintyGetConst(ConstHandle2ConstParity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +ParityUncertaintyGet(ConstHandle2Parity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +ParityUncertaintySet(ConstHandle2Parity self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Child: integer +// ----------------------------------------------------------------------------- + +// Has +int +ParityIntegerHas(ConstHandle2ConstParity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IntegerHas", self, extract::integer); +} + +// Clear +void +ParityIntegerClear(ConstHandle2Parity self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"IntegerClear", self, extract::integer); +} + +// Size +size_t +ParityIntegerSize(ConstHandle2ConstParity self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"IntegerSize", self, extract::integer); +} + +// Add +void +ParityIntegerAdd(ConstHandle2Parity self, ConstHandle2ConstInteger integer) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"IntegerAdd", self, extract::integer, integer); +} + +// Get, by index \in [0,size), const +Handle2ConstInteger +ParityIntegerGetConst(ConstHandle2ConstParity self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IntegerGetConst", self, extract::integer, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Integer +ParityIntegerGet(ConstHandle2Parity self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IntegerGet", self, extract::integer, index_); +} + +// Set, by index \in [0,size) +void +ParityIntegerSet( + ConstHandle2Parity self, + const size_t index_, + ConstHandle2ConstInteger integer +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"IntegerSet", self, extract::integer, index_, integer); +} + +// Has, by label +int +ParityIntegerHasByLabel( + ConstHandle2ConstParity self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IntegerHasByLabel", + self, extract::integer, meta::label, label); +} + +// Get, by label, const +Handle2ConstInteger +ParityIntegerGetByLabelConst( + ConstHandle2ConstParity self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntegerGetByLabelConst", + self, extract::integer, meta::label, label); +} + +// Get, by label, non-const +Handle2Integer +ParityIntegerGetByLabel( + ConstHandle2Parity self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntegerGetByLabel", + self, extract::integer, meta::label, label); +} + +// Set, by label +void +ParityIntegerSetByLabel( + ConstHandle2Parity self, + const XMLName label, + ConstHandle2ConstInteger integer +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IntegerSetByLabel", + self, extract::integer, meta::label, label, integer); +} + +// Has, by unit +int +ParityIntegerHasByUnit( + ConstHandle2ConstParity self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IntegerHasByUnit", + self, extract::integer, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstInteger +ParityIntegerGetByUnitConst( + ConstHandle2ConstParity self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntegerGetByUnitConst", + self, extract::integer, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Integer +ParityIntegerGetByUnit( + ConstHandle2Parity self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntegerGetByUnit", + self, extract::integer, meta::unit, unit); +} + +// Set, by unit +void +ParityIntegerSetByUnit( + ConstHandle2Parity self, + const XMLName unit, + ConstHandle2ConstInteger integer +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IntegerSetByUnit", + self, extract::integer, meta::unit, unit, integer); +} + +// Has, by value +int +ParityIntegerHasByValue( + ConstHandle2ConstParity self, + const Integer32 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IntegerHasByValue", + self, extract::integer, meta::value, value); +} + +// Get, by value, const +Handle2ConstInteger +ParityIntegerGetByValueConst( + ConstHandle2ConstParity self, + const Integer32 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntegerGetByValueConst", + self, extract::integer, meta::value, value); +} + +// Get, by value, non-const +Handle2Integer +ParityIntegerGetByValue( + ConstHandle2Parity self, + const Integer32 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IntegerGetByValue", + self, extract::integer, meta::value, value); +} + +// Set, by value +void +ParityIntegerSetByValue( + ConstHandle2Parity self, + const Integer32 value, + ConstHandle2ConstInteger integer +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IntegerSetByValue", + self, extract::integer, meta::value, value, integer); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Parity/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Parity.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Parity.h new file mode 100644 index 000000000..2104f3373 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Parity.h @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_PARITY +#define C_INTERFACE_TEST_V2_0_POPS_PARITY + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" +#include "v2.0/containers/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 +extern_c Handle2Parity +ParityDefault(); + +// --- Create, general, const +extern_c Handle2ConstParity +ParityCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Integer *const integer, const size_t integerSize +); + +// +++ Create, general +extern_c Handle2Parity +ParityCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Integer *const integer, const size_t integerSize +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParityLabelHas(ConstHandle2ConstParity self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ParityLabelGet(ConstHandle2ConstParity self); + +// +++ Set +extern_c void +ParityLabelSet(ConstHandle2Parity self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParityUnitHas(ConstHandle2ConstParity self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ParityUnitGet(ConstHandle2ConstParity self); + +// +++ Set +extern_c void +ParityUnitSet(ConstHandle2Parity self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParityValueHas(ConstHandle2ConstParity self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ParityValueGet(ConstHandle2ConstParity self); + +// +++ Set +extern_c void +ParityValueSet(ConstHandle2Parity self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParityDocumentationHas(ConstHandle2ConstParity self); + +// --- Get, const +extern_c Handle2ConstDocumentation +ParityDocumentationGetConst(ConstHandle2ConstParity self); + +// +++ Get, non-const +extern_c Handle2Documentation +ParityDocumentationGet(ConstHandle2Parity self); + +// +++ Set +extern_c void +ParityDocumentationSet(ConstHandle2Parity self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParityUncertaintyHas(ConstHandle2ConstParity self); + +// --- Get, const +extern_c Handle2ConstUncertainty +ParityUncertaintyGetConst(ConstHandle2ConstParity self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +ParityUncertaintyGet(ConstHandle2Parity self); + +// +++ Set +extern_c void +ParityUncertaintySet(ConstHandle2Parity self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Child: integer +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParityIntegerHas(ConstHandle2ConstParity self); + +// +++ Clear +extern_c void +ParityIntegerClear(ConstHandle2Parity self); + +// +++ Size +extern_c size_t +ParityIntegerSize(ConstHandle2ConstParity self); + +// +++ Add +extern_c void +ParityIntegerAdd(ConstHandle2Parity self, ConstHandle2ConstInteger integer); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstInteger +ParityIntegerGetConst(ConstHandle2ConstParity self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Integer +ParityIntegerGet(ConstHandle2Parity self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ParityIntegerSet( + ConstHandle2Parity self, + const size_t index_, + ConstHandle2ConstInteger integer +); + +// +++ Has, by label +extern_c int +ParityIntegerHasByLabel( + ConstHandle2ConstParity self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstInteger +ParityIntegerGetByLabelConst( + ConstHandle2ConstParity self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Integer +ParityIntegerGetByLabel( + ConstHandle2Parity self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ParityIntegerSetByLabel( + ConstHandle2Parity self, + const XMLName label, + ConstHandle2ConstInteger integer +); + +// +++ Has, by unit +extern_c int +ParityIntegerHasByUnit( + ConstHandle2ConstParity self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstInteger +ParityIntegerGetByUnitConst( + ConstHandle2ConstParity self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Integer +ParityIntegerGetByUnit( + ConstHandle2Parity self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +ParityIntegerSetByUnit( + ConstHandle2Parity self, + const XMLName unit, + ConstHandle2ConstInteger integer +); + +// +++ Has, by value +extern_c int +ParityIntegerHasByValue( + ConstHandle2ConstParity self, + const Integer32 value +); + +// --- Get, by value, const +extern_c Handle2ConstInteger +ParityIntegerGetByValueConst( + ConstHandle2ConstParity self, + const Integer32 value +); + +// +++ Get, by value, non-const +extern_c Handle2Integer +ParityIntegerGetByValue( + ConstHandle2Parity self, + const Integer32 value +); + +// +++ Set, by value +extern_c void +ParityIntegerSetByValue( + ConstHandle2Parity self, + const Integer32 value, + ConstHandle2ConstInteger integer +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Parity/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Parity/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Parity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Parity/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Parity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf.cpp new file mode 100644 index 000000000..b003860e5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Pdf.hpp" +#include "Pdf.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = PdfClass; +using CPP = multigroup::Pdf; + +static const std::string CLASSNAME = "Pdf"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPdf +PdfDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Pdf +PdfDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPdf +PdfCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Pdf handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2Pdf +PdfCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Pdf 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 +PdfAssign(ConstHandle2Pdf self, ConstHandle2ConstPdf from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PdfDelete(ConstHandle2ConstPdf self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PdfRead(ConstHandle2Pdf self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PdfWrite(ConstHandle2ConstPdf self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PdfPrint(ConstHandle2ConstPdf self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PdfPrintXML(ConstHandle2ConstPdf self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PdfPrintJSON(ConstHandle2ConstPdf self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +PdfXYs1dHas(ConstHandle2ConstPdf self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +PdfXYs1dGetConst(ConstHandle2ConstPdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +PdfXYs1dGet(ConstHandle2Pdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +PdfXYs1dSet(ConstHandle2Pdf self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +PdfRegions1dHas(ConstHandle2ConstPdf self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +PdfRegions1dGetConst(ConstHandle2ConstPdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +PdfRegions1dGet(ConstHandle2Pdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +PdfRegions1dSet(ConstHandle2Pdf self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Pdf/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf.h new file mode 100644 index 000000000..759920681 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf.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. +// +// Pdf is the basic handle type in this file. Example: +// // Create a default Pdf object: +// Pdf handle = PdfDefault(); +// Functions involving Pdf are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_POPS_PDF +#define C_INTERFACE_TEST_V2_0_POPS_PDF + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PdfClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Pdf +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PdfClass *Pdf; + +// --- Const-aware handles. +typedef const struct PdfClass *const ConstHandle2ConstPdf; +typedef struct PdfClass *const ConstHandle2Pdf; +typedef const struct PdfClass * Handle2ConstPdf; +typedef struct PdfClass * Handle2Pdf; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPdf +PdfDefaultConst(); + +// +++ Create, default +extern_c Handle2Pdf +PdfDefault(); + +// --- Create, general, const +extern_c Handle2ConstPdf +PdfCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2Pdf +PdfCreate( + 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 +PdfAssign(ConstHandle2Pdf self, ConstHandle2ConstPdf from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PdfDelete(ConstHandle2ConstPdf self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PdfRead(ConstHandle2Pdf self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PdfWrite(ConstHandle2ConstPdf self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PdfPrint(ConstHandle2ConstPdf self); + +// +++ Print to standard output, as XML +extern_c int +PdfPrintXML(ConstHandle2ConstPdf self); + +// +++ Print to standard output, as JSON +extern_c int +PdfPrintJSON(ConstHandle2ConstPdf self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PdfXYs1dHas(ConstHandle2ConstPdf self); + +// --- Get, const +extern_c Handle2ConstXYs1d +PdfXYs1dGetConst(ConstHandle2ConstPdf self); + +// +++ Get, non-const +extern_c Handle2XYs1d +PdfXYs1dGet(ConstHandle2Pdf self); + +// +++ Set +extern_c void +PdfXYs1dSet(ConstHandle2Pdf self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PdfRegions1dHas(ConstHandle2ConstPdf self); + +// --- Get, const +extern_c Handle2ConstRegions1d +PdfRegions1dGetConst(ConstHandle2ConstPdf self); + +// +++ Get, non-const +extern_c Handle2Regions1d +PdfRegions1dGet(ConstHandle2Pdf self); + +// +++ Set +extern_c void +PdfRegions1dSet(ConstHandle2Pdf self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Pdf/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Pdf/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities.cpp new file mode 100644 index 000000000..7cdf6bf24 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/PhotonEmissionProbabilities.hpp" +#include "PhotonEmissionProbabilities.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Shell; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreateConst( + ConstHandle2Shell *const shell, const size_t shellSize +) { + ConstHandle2PhotonEmissionProbabilities handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ShellN = 0; ShellN < shellSize; ++ShellN) + PhotonEmissionProbabilitiesShellAdd(handle, shell[ShellN]); + return handle; +} + +// Create, general +Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreate( + ConstHandle2Shell *const shell, const size_t shellSize +) { + ConstHandle2PhotonEmissionProbabilities handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ShellN = 0; ShellN < shellSize; ++ShellN) + PhotonEmissionProbabilitiesShellAdd(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 +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); +} + +// Clear +void +PhotonEmissionProbabilitiesShellClear(ConstHandle2PhotonEmissionProbabilities self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ShellClear", self, extract::shell); +} + +// Size +size_t +PhotonEmissionProbabilitiesShellSize(ConstHandle2ConstPhotonEmissionProbabilities self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ShellSize", self, extract::shell); +} + +// Add +void +PhotonEmissionProbabilitiesShellAdd(ConstHandle2PhotonEmissionProbabilities self, ConstHandle2ConstShell shell) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ShellAdd", self, extract::shell, shell); +} + +// Get, by index \in [0,size), const +Handle2ConstShell +PhotonEmissionProbabilitiesShellGetConst(ConstHandle2ConstPhotonEmissionProbabilities self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ShellGetConst", self, extract::shell, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Shell +PhotonEmissionProbabilitiesShellGet(ConstHandle2PhotonEmissionProbabilities self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ShellGet", self, extract::shell, index_); +} + +// Set, by index \in [0,size) +void +PhotonEmissionProbabilitiesShellSet( + ConstHandle2PhotonEmissionProbabilities self, + const size_t index_, + ConstHandle2ConstShell shell +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ShellSet", self, extract::shell, index_, shell); +} + +// Has, by label +int +PhotonEmissionProbabilitiesShellHasByLabel( + ConstHandle2ConstPhotonEmissionProbabilities self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShellHasByLabel", + self, extract::shell, meta::label, label); +} + +// Get, by label, const +Handle2ConstShell +PhotonEmissionProbabilitiesShellGetByLabelConst( + ConstHandle2ConstPhotonEmissionProbabilities self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByLabelConst", + self, extract::shell, meta::label, label); +} + +// Get, by label, non-const +Handle2Shell +PhotonEmissionProbabilitiesShellGetByLabel( + ConstHandle2PhotonEmissionProbabilities self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByLabel", + self, extract::shell, meta::label, label); +} + +// Set, by label +void +PhotonEmissionProbabilitiesShellSetByLabel( + ConstHandle2PhotonEmissionProbabilities self, + const XMLName label, + ConstHandle2ConstShell shell +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShellSetByLabel", + self, extract::shell, meta::label, label, shell); +} + +// Has, by value +int +PhotonEmissionProbabilitiesShellHasByValue( + ConstHandle2ConstPhotonEmissionProbabilities self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShellHasByValue", + self, extract::shell, meta::value, value); +} + +// Get, by value, const +Handle2ConstShell +PhotonEmissionProbabilitiesShellGetByValueConst( + ConstHandle2ConstPhotonEmissionProbabilities self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByValueConst", + self, extract::shell, meta::value, value); +} + +// Get, by value, non-const +Handle2Shell +PhotonEmissionProbabilitiesShellGetByValue( + ConstHandle2PhotonEmissionProbabilities self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByValue", + self, extract::shell, meta::value, value); +} + +// Set, by value +void +PhotonEmissionProbabilitiesShellSetByValue( + ConstHandle2PhotonEmissionProbabilities self, + const Float64 value, + ConstHandle2ConstShell shell +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShellSetByValue", + self, extract::shell, meta::value, value, shell); +} + +// Has, by unit +int +PhotonEmissionProbabilitiesShellHasByUnit( + ConstHandle2ConstPhotonEmissionProbabilities self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShellHasByUnit", + self, extract::shell, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstShell +PhotonEmissionProbabilitiesShellGetByUnitConst( + ConstHandle2ConstPhotonEmissionProbabilities self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByUnitConst", + self, extract::shell, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Shell +PhotonEmissionProbabilitiesShellGetByUnit( + ConstHandle2PhotonEmissionProbabilities self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByUnit", + self, extract::shell, meta::unit, unit); +} + +// Set, by unit +void +PhotonEmissionProbabilitiesShellSetByUnit( + ConstHandle2PhotonEmissionProbabilities self, + const XMLName unit, + ConstHandle2ConstShell shell +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShellSetByUnit", + self, extract::shell, meta::unit, unit, shell); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/PhotonEmissionProbabilities/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities.h b/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities.h new file mode 100644 index 000000000..16b44996e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities.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. +// +// 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_TEST_V2_0_POPS_PHOTONEMISSIONPROBABILITIES +#define C_INTERFACE_TEST_V2_0_POPS_PHOTONEMISSIONPROBABILITIES + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreateConst( + ConstHandle2Shell *const shell, const size_t shellSize +); + +// +++ Create, general +extern_c Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreate( + 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 +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); + +// +++ Clear +extern_c void +PhotonEmissionProbabilitiesShellClear(ConstHandle2PhotonEmissionProbabilities self); + +// +++ Size +extern_c size_t +PhotonEmissionProbabilitiesShellSize(ConstHandle2ConstPhotonEmissionProbabilities self); + +// +++ Add +extern_c void +PhotonEmissionProbabilitiesShellAdd(ConstHandle2PhotonEmissionProbabilities self, ConstHandle2ConstShell shell); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstShell +PhotonEmissionProbabilitiesShellGetConst(ConstHandle2ConstPhotonEmissionProbabilities self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Shell +PhotonEmissionProbabilitiesShellGet(ConstHandle2PhotonEmissionProbabilities self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +PhotonEmissionProbabilitiesShellSet( + ConstHandle2PhotonEmissionProbabilities self, + const size_t index_, + ConstHandle2ConstShell shell +); + +// +++ Has, by label +extern_c int +PhotonEmissionProbabilitiesShellHasByLabel( + ConstHandle2ConstPhotonEmissionProbabilities self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstShell +PhotonEmissionProbabilitiesShellGetByLabelConst( + ConstHandle2ConstPhotonEmissionProbabilities self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Shell +PhotonEmissionProbabilitiesShellGetByLabel( + ConstHandle2PhotonEmissionProbabilities self, + const XMLName label +); + +// +++ Set, by label +extern_c void +PhotonEmissionProbabilitiesShellSetByLabel( + ConstHandle2PhotonEmissionProbabilities self, + const XMLName label, + ConstHandle2ConstShell shell +); + +// +++ Has, by value +extern_c int +PhotonEmissionProbabilitiesShellHasByValue( + ConstHandle2ConstPhotonEmissionProbabilities self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstShell +PhotonEmissionProbabilitiesShellGetByValueConst( + ConstHandle2ConstPhotonEmissionProbabilities self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2Shell +PhotonEmissionProbabilitiesShellGetByValue( + ConstHandle2PhotonEmissionProbabilities self, + const Float64 value +); + +// +++ Set, by value +extern_c void +PhotonEmissionProbabilitiesShellSetByValue( + ConstHandle2PhotonEmissionProbabilities self, + const Float64 value, + ConstHandle2ConstShell shell +); + +// +++ Has, by unit +extern_c int +PhotonEmissionProbabilitiesShellHasByUnit( + ConstHandle2ConstPhotonEmissionProbabilities self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstShell +PhotonEmissionProbabilitiesShellGetByUnitConst( + ConstHandle2ConstPhotonEmissionProbabilities self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Shell +PhotonEmissionProbabilitiesShellGetByUnit( + ConstHandle2PhotonEmissionProbabilities self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +PhotonEmissionProbabilitiesShellSetByUnit( + ConstHandle2PhotonEmissionProbabilities self, + const XMLName unit, + ConstHandle2ConstShell shell +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/PhotonEmissionProbabilities/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/PhotonEmissionProbabilities/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database.cpp new file mode 100644 index 000000000..0ed5dfd57 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database.cpp @@ -0,0 +1,587 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/PoPs_database.hpp" +#include "PoPs_database.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = PoPs_databaseClass; +using CPP = multigroup::PoPs_database; + +static const std::string CLASSNAME = "PoPs_database"; + +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 styles = [](auto &obj) { return &obj.styles; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto aliases = [](auto &obj) { return &obj.aliases; }; + static auto gaugeBosons = [](auto &obj) { return &obj.gaugeBosons; }; + static auto leptons = [](auto &obj) { return &obj.leptons; }; + static auto baryons = [](auto &obj) { return &obj.baryons; }; + static auto chemicalElements = [](auto &obj) { return &obj.chemicalElements; }; + static auto unorthodoxes = [](auto &obj) { return &obj.unorthodoxes; }; +} + +using CPPStyles = styles::Styles; +using CPPDocumentation = documentation::Documentation; +using CPPAliases = pops::Aliases; +using CPPGaugeBosons = pops::GaugeBosons; +using CPPLeptons = pops::Leptons; +using CPPBaryons = pops::Baryons; +using CPPChemicalElements = pops::ChemicalElements; +using CPPUnorthodoxes = pops::Unorthodoxes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPoPs_database +PoPs_databaseDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2PoPs_database +PoPs_databaseDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPoPs_database +PoPs_databaseCreateConst( + const XMLName name, + const XMLName version, + const XMLName format, + ConstHandle2ConstStyles styles, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstAliases aliases, + ConstHandle2ConstGaugeBosons gaugeBosons, + ConstHandle2ConstLeptons leptons, + ConstHandle2ConstBaryons baryons, + ConstHandle2ConstChemicalElements chemicalElements, + ConstHandle2ConstUnorthodoxes unorthodoxes +) { + ConstHandle2PoPs_database handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name, + version, + format, + detail::tocpp(styles), + detail::tocpp(documentation), + detail::tocpp(aliases), + detail::tocpp(gaugeBosons), + detail::tocpp(leptons), + detail::tocpp(baryons), + detail::tocpp(chemicalElements), + detail::tocpp(unorthodoxes) + ); + return handle; +} + +// Create, general +Handle2PoPs_database +PoPs_databaseCreate( + const XMLName name, + const XMLName version, + const XMLName format, + ConstHandle2ConstStyles styles, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstAliases aliases, + ConstHandle2ConstGaugeBosons gaugeBosons, + ConstHandle2ConstLeptons leptons, + ConstHandle2ConstBaryons baryons, + ConstHandle2ConstChemicalElements chemicalElements, + ConstHandle2ConstUnorthodoxes unorthodoxes +) { + ConstHandle2PoPs_database handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name, + version, + format, + detail::tocpp(styles), + detail::tocpp(documentation), + detail::tocpp(aliases), + detail::tocpp(gaugeBosons), + detail::tocpp(leptons), + detail::tocpp(baryons), + detail::tocpp(chemicalElements), + detail::tocpp(unorthodoxes) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +PoPs_databaseAssign(ConstHandle2PoPs_database self, ConstHandle2ConstPoPs_database from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PoPs_databaseDelete(ConstHandle2ConstPoPs_database self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PoPs_databaseRead(ConstHandle2PoPs_database self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PoPs_databaseWrite(ConstHandle2ConstPoPs_database self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PoPs_databasePrint(ConstHandle2ConstPoPs_database self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PoPs_databasePrintXML(ConstHandle2ConstPoPs_database self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PoPs_databasePrintJSON(ConstHandle2ConstPoPs_database self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseNameHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +XMLName +PoPs_databaseNameGet(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +PoPs_databaseNameSet(ConstHandle2PoPs_database self, const XMLName name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseVersionHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"VersionHas", self, extract::version); +} + +// Get +// Returns by value +XMLName +PoPs_databaseVersionGet(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"VersionGet", self, extract::version); +} + +// Set +void +PoPs_databaseVersionSet(ConstHandle2PoPs_database self, const XMLName version) +{ + detail::setField + (CLASSNAME, CLASSNAME+"VersionSet", self, extract::version, version); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseFormatHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FormatHas", self, extract::format); +} + +// Get +// Returns by value +XMLName +PoPs_databaseFormatGet(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormatGet", self, extract::format); +} + +// Set +void +PoPs_databaseFormatSet(ConstHandle2PoPs_database self, const XMLName format) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FormatSet", self, extract::format, format); +} + + +// ----------------------------------------------------------------------------- +// Child: styles +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseStylesHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StylesHas", self, extract::styles); +} + +// Get, const +Handle2ConstStyles +PoPs_databaseStylesGetConst(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StylesGetConst", self, extract::styles); +} + +// Get, non-const +Handle2Styles +PoPs_databaseStylesGet(ConstHandle2PoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StylesGet", self, extract::styles); +} + +// Set +void +PoPs_databaseStylesSet(ConstHandle2PoPs_database self, ConstHandle2ConstStyles styles) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StylesSet", self, extract::styles, styles); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseDocumentationHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +PoPs_databaseDocumentationGetConst(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +PoPs_databaseDocumentationGet(ConstHandle2PoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +PoPs_databaseDocumentationSet(ConstHandle2PoPs_database self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: aliases +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseAliasesHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AliasesHas", self, extract::aliases); +} + +// Get, const +Handle2ConstAliases +PoPs_databaseAliasesGetConst(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AliasesGetConst", self, extract::aliases); +} + +// Get, non-const +Handle2Aliases +PoPs_databaseAliasesGet(ConstHandle2PoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AliasesGet", self, extract::aliases); +} + +// Set +void +PoPs_databaseAliasesSet(ConstHandle2PoPs_database self, ConstHandle2ConstAliases aliases) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AliasesSet", self, extract::aliases, aliases); +} + + +// ----------------------------------------------------------------------------- +// Child: gaugeBosons +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseGaugeBosonsHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GaugeBosonsHas", self, extract::gaugeBosons); +} + +// Get, const +Handle2ConstGaugeBosons +PoPs_databaseGaugeBosonsGetConst(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GaugeBosonsGetConst", self, extract::gaugeBosons); +} + +// Get, non-const +Handle2GaugeBosons +PoPs_databaseGaugeBosonsGet(ConstHandle2PoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GaugeBosonsGet", self, extract::gaugeBosons); +} + +// Set +void +PoPs_databaseGaugeBosonsSet(ConstHandle2PoPs_database self, ConstHandle2ConstGaugeBosons gaugeBosons) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GaugeBosonsSet", self, extract::gaugeBosons, gaugeBosons); +} + + +// ----------------------------------------------------------------------------- +// Child: leptons +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseLeptonsHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LeptonsHas", self, extract::leptons); +} + +// Get, const +Handle2ConstLeptons +PoPs_databaseLeptonsGetConst(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LeptonsGetConst", self, extract::leptons); +} + +// Get, non-const +Handle2Leptons +PoPs_databaseLeptonsGet(ConstHandle2PoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LeptonsGet", self, extract::leptons); +} + +// Set +void +PoPs_databaseLeptonsSet(ConstHandle2PoPs_database self, ConstHandle2ConstLeptons leptons) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LeptonsSet", self, extract::leptons, leptons); +} + + +// ----------------------------------------------------------------------------- +// Child: baryons +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseBaryonsHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BaryonsHas", self, extract::baryons); +} + +// Get, const +Handle2ConstBaryons +PoPs_databaseBaryonsGetConst(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BaryonsGetConst", self, extract::baryons); +} + +// Get, non-const +Handle2Baryons +PoPs_databaseBaryonsGet(ConstHandle2PoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BaryonsGet", self, extract::baryons); +} + +// Set +void +PoPs_databaseBaryonsSet(ConstHandle2PoPs_database self, ConstHandle2ConstBaryons baryons) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BaryonsSet", self, extract::baryons, baryons); +} + + +// ----------------------------------------------------------------------------- +// Child: chemicalElements +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseChemicalElementsHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChemicalElementsHas", self, extract::chemicalElements); +} + +// Get, const +Handle2ConstChemicalElements +PoPs_databaseChemicalElementsGetConst(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChemicalElementsGetConst", self, extract::chemicalElements); +} + +// Get, non-const +Handle2ChemicalElements +PoPs_databaseChemicalElementsGet(ConstHandle2PoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChemicalElementsGet", self, extract::chemicalElements); +} + +// Set +void +PoPs_databaseChemicalElementsSet(ConstHandle2PoPs_database self, ConstHandle2ConstChemicalElements chemicalElements) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChemicalElementsSet", self, extract::chemicalElements, chemicalElements); +} + + +// ----------------------------------------------------------------------------- +// Child: unorthodoxes +// ----------------------------------------------------------------------------- + +// Has +int +PoPs_databaseUnorthodoxesHas(ConstHandle2ConstPoPs_database self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnorthodoxesHas", self, extract::unorthodoxes); +} + +// Get, const +Handle2ConstUnorthodoxes +PoPs_databaseUnorthodoxesGetConst(ConstHandle2ConstPoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnorthodoxesGetConst", self, extract::unorthodoxes); +} + +// Get, non-const +Handle2Unorthodoxes +PoPs_databaseUnorthodoxesGet(ConstHandle2PoPs_database self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnorthodoxesGet", self, extract::unorthodoxes); +} + +// Set +void +PoPs_databaseUnorthodoxesSet(ConstHandle2PoPs_database self, ConstHandle2ConstUnorthodoxes unorthodoxes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnorthodoxesSet", self, extract::unorthodoxes, unorthodoxes); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/PoPs_database/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database.h b/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database.h new file mode 100644 index 000000000..814db07ff --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database.h @@ -0,0 +1,389 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_database is the basic handle type in this file. Example: +// // Create a default PoPs_database object: +// PoPs_database handle = PoPs_databaseDefault(); +// Functions involving PoPs_database are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_POPS_POPS_DATABASE +#define C_INTERFACE_TEST_V2_0_POPS_POPS_DATABASE + +#include "GNDStk.h" +#include "v2.0/styles/Styles.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Aliases.h" +#include "v2.0/pops/GaugeBosons.h" +#include "v2.0/pops/Leptons.h" +#include "v2.0/pops/Baryons.h" +#include "v2.0/pops/ChemicalElements.h" +#include "v2.0/pops/Unorthodoxes.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PoPs_databaseClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ PoPs_database +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PoPs_databaseClass *PoPs_database; + +// --- Const-aware handles. +typedef const struct PoPs_databaseClass *const ConstHandle2ConstPoPs_database; +typedef struct PoPs_databaseClass *const ConstHandle2PoPs_database; +typedef const struct PoPs_databaseClass * Handle2ConstPoPs_database; +typedef struct PoPs_databaseClass * Handle2PoPs_database; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPoPs_database +PoPs_databaseDefaultConst(); + +// +++ Create, default +extern_c Handle2PoPs_database +PoPs_databaseDefault(); + +// --- Create, general, const +extern_c Handle2ConstPoPs_database +PoPs_databaseCreateConst( + const XMLName name, + const XMLName version, + const XMLName format, + ConstHandle2ConstStyles styles, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstAliases aliases, + ConstHandle2ConstGaugeBosons gaugeBosons, + ConstHandle2ConstLeptons leptons, + ConstHandle2ConstBaryons baryons, + ConstHandle2ConstChemicalElements chemicalElements, + ConstHandle2ConstUnorthodoxes unorthodoxes +); + +// +++ Create, general +extern_c Handle2PoPs_database +PoPs_databaseCreate( + const XMLName name, + const XMLName version, + const XMLName format, + ConstHandle2ConstStyles styles, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstAliases aliases, + ConstHandle2ConstGaugeBosons gaugeBosons, + ConstHandle2ConstLeptons leptons, + ConstHandle2ConstBaryons baryons, + ConstHandle2ConstChemicalElements chemicalElements, + ConstHandle2ConstUnorthodoxes unorthodoxes +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +PoPs_databaseAssign(ConstHandle2PoPs_database self, ConstHandle2ConstPoPs_database from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PoPs_databaseDelete(ConstHandle2ConstPoPs_database self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PoPs_databaseRead(ConstHandle2PoPs_database self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PoPs_databaseWrite(ConstHandle2ConstPoPs_database self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PoPs_databasePrint(ConstHandle2ConstPoPs_database self); + +// +++ Print to standard output, as XML +extern_c int +PoPs_databasePrintXML(ConstHandle2ConstPoPs_database self); + +// +++ Print to standard output, as JSON +extern_c int +PoPs_databasePrintJSON(ConstHandle2ConstPoPs_database self); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseNameHas(ConstHandle2ConstPoPs_database self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +PoPs_databaseNameGet(ConstHandle2ConstPoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseNameSet(ConstHandle2PoPs_database self, const XMLName name); + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseVersionHas(ConstHandle2ConstPoPs_database self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +PoPs_databaseVersionGet(ConstHandle2ConstPoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseVersionSet(ConstHandle2PoPs_database self, const XMLName version); + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseFormatHas(ConstHandle2ConstPoPs_database self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +PoPs_databaseFormatGet(ConstHandle2ConstPoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseFormatSet(ConstHandle2PoPs_database self, const XMLName format); + + +// ----------------------------------------------------------------------------- +// Child: styles +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseStylesHas(ConstHandle2ConstPoPs_database self); + +// --- Get, const +extern_c Handle2ConstStyles +PoPs_databaseStylesGetConst(ConstHandle2ConstPoPs_database self); + +// +++ Get, non-const +extern_c Handle2Styles +PoPs_databaseStylesGet(ConstHandle2PoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseStylesSet(ConstHandle2PoPs_database self, ConstHandle2ConstStyles styles); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseDocumentationHas(ConstHandle2ConstPoPs_database self); + +// --- Get, const +extern_c Handle2ConstDocumentation +PoPs_databaseDocumentationGetConst(ConstHandle2ConstPoPs_database self); + +// +++ Get, non-const +extern_c Handle2Documentation +PoPs_databaseDocumentationGet(ConstHandle2PoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseDocumentationSet(ConstHandle2PoPs_database self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: aliases +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseAliasesHas(ConstHandle2ConstPoPs_database self); + +// --- Get, const +extern_c Handle2ConstAliases +PoPs_databaseAliasesGetConst(ConstHandle2ConstPoPs_database self); + +// +++ Get, non-const +extern_c Handle2Aliases +PoPs_databaseAliasesGet(ConstHandle2PoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseAliasesSet(ConstHandle2PoPs_database self, ConstHandle2ConstAliases aliases); + + +// ----------------------------------------------------------------------------- +// Child: gaugeBosons +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseGaugeBosonsHas(ConstHandle2ConstPoPs_database self); + +// --- Get, const +extern_c Handle2ConstGaugeBosons +PoPs_databaseGaugeBosonsGetConst(ConstHandle2ConstPoPs_database self); + +// +++ Get, non-const +extern_c Handle2GaugeBosons +PoPs_databaseGaugeBosonsGet(ConstHandle2PoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseGaugeBosonsSet(ConstHandle2PoPs_database self, ConstHandle2ConstGaugeBosons gaugeBosons); + + +// ----------------------------------------------------------------------------- +// Child: leptons +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseLeptonsHas(ConstHandle2ConstPoPs_database self); + +// --- Get, const +extern_c Handle2ConstLeptons +PoPs_databaseLeptonsGetConst(ConstHandle2ConstPoPs_database self); + +// +++ Get, non-const +extern_c Handle2Leptons +PoPs_databaseLeptonsGet(ConstHandle2PoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseLeptonsSet(ConstHandle2PoPs_database self, ConstHandle2ConstLeptons leptons); + + +// ----------------------------------------------------------------------------- +// Child: baryons +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseBaryonsHas(ConstHandle2ConstPoPs_database self); + +// --- Get, const +extern_c Handle2ConstBaryons +PoPs_databaseBaryonsGetConst(ConstHandle2ConstPoPs_database self); + +// +++ Get, non-const +extern_c Handle2Baryons +PoPs_databaseBaryonsGet(ConstHandle2PoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseBaryonsSet(ConstHandle2PoPs_database self, ConstHandle2ConstBaryons baryons); + + +// ----------------------------------------------------------------------------- +// Child: chemicalElements +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseChemicalElementsHas(ConstHandle2ConstPoPs_database self); + +// --- Get, const +extern_c Handle2ConstChemicalElements +PoPs_databaseChemicalElementsGetConst(ConstHandle2ConstPoPs_database self); + +// +++ Get, non-const +extern_c Handle2ChemicalElements +PoPs_databaseChemicalElementsGet(ConstHandle2PoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseChemicalElementsSet(ConstHandle2PoPs_database self, ConstHandle2ConstChemicalElements chemicalElements); + + +// ----------------------------------------------------------------------------- +// Child: unorthodoxes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPs_databaseUnorthodoxesHas(ConstHandle2ConstPoPs_database self); + +// --- Get, const +extern_c Handle2ConstUnorthodoxes +PoPs_databaseUnorthodoxesGetConst(ConstHandle2ConstPoPs_database self); + +// +++ Get, non-const +extern_c Handle2Unorthodoxes +PoPs_databaseUnorthodoxesGet(ConstHandle2PoPs_database self); + +// +++ Set +extern_c void +PoPs_databaseUnorthodoxesSet(ConstHandle2PoPs_database self, ConstHandle2ConstUnorthodoxes unorthodoxes); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/PoPs_database/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/PoPs_database/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PositronEmissionIntensity.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/PositronEmissionIntensity.cpp new file mode 100644 index 000000000..9dcb356e7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/PositronEmissionIntensity.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/PositronEmissionIntensity.hpp" +#include "PositronEmissionIntensity.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPositronEmissionIntensity +PositronEmissionIntensityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2PositronEmissionIntensity +PositronEmissionIntensityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPositronEmissionIntensity +PositronEmissionIntensityCreateConst( + const Float64 value, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2PositronEmissionIntensity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2PositronEmissionIntensity +PositronEmissionIntensityCreate( + const Float64 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 +Float64 +PositronEmissionIntensityValueGet(ConstHandle2ConstPositronEmissionIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +PositronEmissionIntensityValueSet(ConstHandle2PositronEmissionIntensity self, const Float64 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/pops/PositronEmissionIntensity/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PositronEmissionIntensity.h b/standards/gnds-2.0/test/c/src/v2.0/pops/PositronEmissionIntensity.h new file mode 100644 index 000000000..751f2a60c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_POSITRONEMISSIONINTENSITY +#define C_INTERFACE_TEST_V2_0_POPS_POSITRONEMISSIONINTENSITY + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2PositronEmissionIntensity +PositronEmissionIntensityDefault(); + +// --- Create, general, const +extern_c Handle2ConstPositronEmissionIntensity +PositronEmissionIntensityCreateConst( + const Float64 value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2PositronEmissionIntensity +PositronEmissionIntensityCreate( + const Float64 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 Float64 +PositronEmissionIntensityValueGet(ConstHandle2ConstPositronEmissionIntensity self); + +// +++ Set +extern_c void +PositronEmissionIntensityValueSet(ConstHandle2PositronEmissionIntensity self, const Float64 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/pops/PositronEmissionIntensity/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PositronEmissionIntensity/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/PositronEmissionIntensity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/PositronEmissionIntensity/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/PositronEmissionIntensity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Probability.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Probability.cpp new file mode 100644 index 000000000..2b98b1dd9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Probability.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Probability.hpp" +#include "Probability.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProbability +ProbabilityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Probability +ProbabilityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProbability +ProbabilityCreateConst( + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Probability handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + ProbabilityDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Create, general +Handle2Probability +ProbabilityCreate( + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Probability handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + ProbabilityDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Assign +// Use this to assign 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); +} + +// Clear +void +ProbabilityDoubleClear(ConstHandle2Probability self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DoubleClear", self, extract::Double); +} + +// Size +size_t +ProbabilityDoubleSize(ConstHandle2ConstProbability self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DoubleSize", self, extract::Double); +} + +// Add +void +ProbabilityDoubleAdd(ConstHandle2Probability self, ConstHandle2ConstDouble Double) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DoubleAdd", self, extract::Double, Double); +} + +// Get, by index \in [0,size), const +Handle2ConstDouble +ProbabilityDoubleGetConst(ConstHandle2ConstProbability self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Double +ProbabilityDoubleGet(ConstHandle2Probability self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double, index_); +} + +// Set, by index \in [0,size) +void +ProbabilityDoubleSet( + ConstHandle2Probability self, + const size_t index_, + ConstHandle2ConstDouble Double +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, index_, Double); +} + +// Has, by label +int +ProbabilityDoubleHasByLabel( + ConstHandle2ConstProbability self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByLabel", + self, extract::Double, meta::label, label); +} + +// Get, by label, const +Handle2ConstDouble +ProbabilityDoubleGetByLabelConst( + ConstHandle2ConstProbability self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabelConst", + self, extract::Double, meta::label, label); +} + +// Get, by label, non-const +Handle2Double +ProbabilityDoubleGetByLabel( + ConstHandle2Probability self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabel", + self, extract::Double, meta::label, label); +} + +// Set, by label +void +ProbabilityDoubleSetByLabel( + ConstHandle2Probability self, + const XMLName label, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByLabel", + self, extract::Double, meta::label, label, Double); +} + +// Has, by unit +int +ProbabilityDoubleHasByUnit( + ConstHandle2ConstProbability self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByUnit", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstDouble +ProbabilityDoubleGetByUnitConst( + ConstHandle2ConstProbability self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnitConst", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Double +ProbabilityDoubleGetByUnit( + ConstHandle2Probability self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnit", + self, extract::Double, meta::unit, unit); +} + +// Set, by unit +void +ProbabilityDoubleSetByUnit( + ConstHandle2Probability self, + const XMLName unit, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByUnit", + self, extract::Double, meta::unit, unit, Double); +} + +// Has, by value +int +ProbabilityDoubleHasByValue( + ConstHandle2ConstProbability self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByValue", + self, extract::Double, meta::value, value); +} + +// Get, by value, const +Handle2ConstDouble +ProbabilityDoubleGetByValueConst( + ConstHandle2ConstProbability self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValueConst", + self, extract::Double, meta::value, value); +} + +// Get, by value, non-const +Handle2Double +ProbabilityDoubleGetByValue( + ConstHandle2Probability self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValue", + self, extract::Double, meta::value, value); +} + +// Set, by value +void +ProbabilityDoubleSetByValue( + ConstHandle2Probability self, + const Float64 value, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByValue", + self, extract::Double, meta::value, value, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Probability/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Probability.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Probability.h new file mode 100644 index 000000000..e0e5eaf09 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Probability.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. +// +// 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_TEST_V2_0_POPS_PROBABILITY +#define C_INTERFACE_TEST_V2_0_POPS_PROBABILITY + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2Probability +ProbabilityDefault(); + +// --- Create, general, const +extern_c Handle2ConstProbability +ProbabilityCreateConst( + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Create, general +extern_c Handle2Probability +ProbabilityCreate( + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Assign +// +++ Use this to assign one handled 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); + +// +++ Clear +extern_c void +ProbabilityDoubleClear(ConstHandle2Probability self); + +// +++ Size +extern_c size_t +ProbabilityDoubleSize(ConstHandle2ConstProbability self); + +// +++ Add +extern_c void +ProbabilityDoubleAdd(ConstHandle2Probability self, ConstHandle2ConstDouble Double); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDouble +ProbabilityDoubleGetConst(ConstHandle2ConstProbability self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Double +ProbabilityDoubleGet(ConstHandle2Probability self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ProbabilityDoubleSet( + ConstHandle2Probability self, + const size_t index_, + ConstHandle2ConstDouble Double +); + +// +++ Has, by label +extern_c int +ProbabilityDoubleHasByLabel( + ConstHandle2ConstProbability self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstDouble +ProbabilityDoubleGetByLabelConst( + ConstHandle2ConstProbability self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Double +ProbabilityDoubleGetByLabel( + ConstHandle2Probability self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ProbabilityDoubleSetByLabel( + ConstHandle2Probability self, + const XMLName label, + ConstHandle2ConstDouble Double +); + +// +++ Has, by unit +extern_c int +ProbabilityDoubleHasByUnit( + ConstHandle2ConstProbability self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstDouble +ProbabilityDoubleGetByUnitConst( + ConstHandle2ConstProbability self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Double +ProbabilityDoubleGetByUnit( + ConstHandle2Probability self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +ProbabilityDoubleSetByUnit( + ConstHandle2Probability self, + const XMLName unit, + ConstHandle2ConstDouble Double +); + +// +++ Has, by value +extern_c int +ProbabilityDoubleHasByValue( + ConstHandle2ConstProbability self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstDouble +ProbabilityDoubleGetByValueConst( + ConstHandle2ConstProbability self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2Double +ProbabilityDoubleGetByValue( + ConstHandle2Probability self, + const Float64 value +); + +// +++ Set, by value +extern_c void +ProbabilityDoubleSetByValue( + ConstHandle2Probability self, + const Float64 value, + ConstHandle2ConstDouble Double +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Probability/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Probability/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Probability/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Probability/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Probability/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Product.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Product.cpp new file mode 100644 index 000000000..126eaff2d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Product.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Product.hpp" +#include "Product.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProduct +ProductDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Product +ProductDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProduct +ProductCreateConst( + const XMLName label, + const XMLName pid +) { + ConstHandle2Product handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid + ); + return handle; +} + +// Create, general +Handle2Product +ProductCreate( + const XMLName label, + const XMLName pid +) { + ConstHandle2Product handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + 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 +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 +XMLName +ProductLabelGet(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ProductLabelSet(ConstHandle2Product self, const XMLName 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 +XMLName +ProductPidGet(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ProductPidSet(ConstHandle2Product self, const XMLName pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Product/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Product.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Product.h new file mode 100644 index 000000000..129a817a8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Product.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. +// +// 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_TEST_V2_0_POPS_PRODUCT +#define C_INTERFACE_TEST_V2_0_POPS_PRODUCT + +#include "GNDStk.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 +extern_c Handle2Product +ProductDefault(); + +// --- Create, general, const +extern_c Handle2ConstProduct +ProductCreateConst( + const XMLName label, + const XMLName pid +); + +// +++ Create, general +extern_c Handle2Product +ProductCreate( + const XMLName label, + const XMLName 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 +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 XMLName +ProductLabelGet(ConstHandle2ConstProduct self); + +// +++ Set +extern_c void +ProductLabelSet(ConstHandle2Product self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductPidHas(ConstHandle2ConstProduct self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProductPidGet(ConstHandle2ConstProduct self); + +// +++ Set +extern_c void +ProductPidSet(ConstHandle2Product self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Product/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Product/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Product/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Product/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Product/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Products.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Products.cpp new file mode 100644 index 000000000..e5e7b4a32 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Products.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Products.hpp" +#include "Products.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Product; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProducts +ProductsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +ProductsProductHasByLabel( + ConstHandle2ConstProducts self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductHasByLabel", + self, extract::product, meta::label, label); +} + +// Get, by label, const +Handle2ConstProduct +ProductsProductGetByLabelConst( + ConstHandle2ConstProducts self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByLabelConst", + self, extract::product, meta::label, label); +} + +// Get, by label, non-const +Handle2Product +ProductsProductGetByLabel( + ConstHandle2Products self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByLabel", + self, extract::product, meta::label, label); +} + +// Set, by label +void +ProductsProductSetByLabel( + ConstHandle2Products self, + const XMLName label, + ConstHandle2ConstProduct product +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductSetByLabel", + self, extract::product, meta::label, label, product); +} + +// Has, by pid +int +ProductsProductHasByPid( + ConstHandle2ConstProducts self, + const XMLName pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductHasByPid", + self, extract::product, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstProduct +ProductsProductGetByPidConst( + ConstHandle2ConstProducts self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByPidConst", + self, extract::product, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2Product +ProductsProductGetByPid( + ConstHandle2Products self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByPid", + self, extract::product, meta::pid, pid); +} + +// Set, by pid +void +ProductsProductSetByPid( + ConstHandle2Products self, + const XMLName pid, + ConstHandle2ConstProduct product +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductSetByPid", + self, extract::product, meta::pid, pid, product); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Products/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Products.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Products.h new file mode 100644 index 000000000..1f984cb46 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Products.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_PRODUCTS +#define C_INTERFACE_TEST_V2_0_POPS_PRODUCTS + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Products +ProductsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProducts +ProductsCreateConst( + ConstHandle2Product *const product, const size_t productSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +ProductsProductHasByLabel( + ConstHandle2ConstProducts self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstProduct +ProductsProductGetByLabelConst( + ConstHandle2ConstProducts self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Product +ProductsProductGetByLabel( + ConstHandle2Products self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ProductsProductSetByLabel( + ConstHandle2Products self, + const XMLName label, + ConstHandle2ConstProduct product +); + +// +++ Has, by pid +extern_c int +ProductsProductHasByPid( + ConstHandle2ConstProducts self, + const XMLName pid +); + +// --- Get, by pid, const +extern_c Handle2ConstProduct +ProductsProductGetByPidConst( + ConstHandle2ConstProducts self, + const XMLName pid +); + +// +++ Get, by pid, non-const +extern_c Handle2Product +ProductsProductGetByPid( + ConstHandle2Products self, + const XMLName pid +); + +// +++ Set, by pid +extern_c void +ProductsProductSetByPid( + ConstHandle2Products self, + const XMLName pid, + ConstHandle2ConstProduct product +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Products/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Products/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Products/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Products/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Products/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Q.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Q.cpp new file mode 100644 index 000000000..1bcb4af82 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Q.cpp @@ -0,0 +1,538 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Q.hpp" +#include "Q.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = QClass; +using CPP = multigroup::Q; + +static const std::string CLASSNAME = "Q"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; +using CPPDouble = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstQ +QDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Q +QDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstQ +QCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Q handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + QDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Create, general +Handle2Q +QCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2Q handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + QDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Assign +// Use this to assign 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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +QLabelHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +QLabelGet(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +QLabelSet(ConstHandle2Q self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +QUnitHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +QUnitGet(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +QUnitSet(ConstHandle2Q self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +QValueHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +QValueGet(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +QValueSet(ConstHandle2Q self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +QDocumentationHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +QDocumentationGetConst(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +QDocumentationGet(ConstHandle2Q self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +QDocumentationSet(ConstHandle2Q self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +QUncertaintyHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +QUncertaintyGetConst(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +QUncertaintyGet(ConstHandle2Q self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +QUncertaintySet(ConstHandle2Q self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +QDoubleHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Clear +void +QDoubleClear(ConstHandle2Q self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DoubleClear", self, extract::Double); +} + +// Size +size_t +QDoubleSize(ConstHandle2ConstQ self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DoubleSize", self, extract::Double); +} + +// Add +void +QDoubleAdd(ConstHandle2Q self, ConstHandle2ConstDouble Double) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DoubleAdd", self, extract::Double, Double); +} + +// Get, by index \in [0,size), const +Handle2ConstDouble +QDoubleGetConst(ConstHandle2ConstQ self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Double +QDoubleGet(ConstHandle2Q self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double, index_); +} + +// Set, by index \in [0,size) +void +QDoubleSet( + ConstHandle2Q self, + const size_t index_, + ConstHandle2ConstDouble Double +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, index_, Double); +} + +// Has, by label +int +QDoubleHasByLabel( + ConstHandle2ConstQ self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByLabel", + self, extract::Double, meta::label, label); +} + +// Get, by label, const +Handle2ConstDouble +QDoubleGetByLabelConst( + ConstHandle2ConstQ self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabelConst", + self, extract::Double, meta::label, label); +} + +// Get, by label, non-const +Handle2Double +QDoubleGetByLabel( + ConstHandle2Q self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabel", + self, extract::Double, meta::label, label); +} + +// Set, by label +void +QDoubleSetByLabel( + ConstHandle2Q self, + const XMLName label, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByLabel", + self, extract::Double, meta::label, label, Double); +} + +// Has, by unit +int +QDoubleHasByUnit( + ConstHandle2ConstQ self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByUnit", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstDouble +QDoubleGetByUnitConst( + ConstHandle2ConstQ self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnitConst", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Double +QDoubleGetByUnit( + ConstHandle2Q self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnit", + self, extract::Double, meta::unit, unit); +} + +// Set, by unit +void +QDoubleSetByUnit( + ConstHandle2Q self, + const XMLName unit, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByUnit", + self, extract::Double, meta::unit, unit, Double); +} + +// Has, by value +int +QDoubleHasByValue( + ConstHandle2ConstQ self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByValue", + self, extract::Double, meta::value, value); +} + +// Get, by value, const +Handle2ConstDouble +QDoubleGetByValueConst( + ConstHandle2ConstQ self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValueConst", + self, extract::Double, meta::value, value); +} + +// Get, by value, non-const +Handle2Double +QDoubleGetByValue( + ConstHandle2Q self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValue", + self, extract::Double, meta::value, value); +} + +// Set, by value +void +QDoubleSetByValue( + ConstHandle2Q self, + const Float64 value, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByValue", + self, extract::Double, meta::value, value, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Q/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Q.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Q.h new file mode 100644 index 000000000..4826c13af --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Q.h @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_Q +#define C_INTERFACE_TEST_V2_0_POPS_Q + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" +#include "v2.0/containers/Double.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 +extern_c Handle2Q +QDefault(); + +// --- Create, general, const +extern_c Handle2ConstQ +QCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Create, general +extern_c Handle2Q +QCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QLabelHas(ConstHandle2ConstQ self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +QLabelGet(ConstHandle2ConstQ self); + +// +++ Set +extern_c void +QLabelSet(ConstHandle2Q self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QUnitHas(ConstHandle2ConstQ self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +QUnitGet(ConstHandle2ConstQ self); + +// +++ Set +extern_c void +QUnitSet(ConstHandle2Q self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QValueHas(ConstHandle2ConstQ self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +QValueGet(ConstHandle2ConstQ self); + +// +++ Set +extern_c void +QValueSet(ConstHandle2Q self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QDocumentationHas(ConstHandle2ConstQ self); + +// --- Get, const +extern_c Handle2ConstDocumentation +QDocumentationGetConst(ConstHandle2ConstQ self); + +// +++ Get, non-const +extern_c Handle2Documentation +QDocumentationGet(ConstHandle2Q self); + +// +++ Set +extern_c void +QDocumentationSet(ConstHandle2Q self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QUncertaintyHas(ConstHandle2ConstQ self); + +// --- Get, const +extern_c Handle2ConstUncertainty +QUncertaintyGetConst(ConstHandle2ConstQ self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +QUncertaintyGet(ConstHandle2Q self); + +// +++ Set +extern_c void +QUncertaintySet(ConstHandle2Q self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QDoubleHas(ConstHandle2ConstQ self); + +// +++ Clear +extern_c void +QDoubleClear(ConstHandle2Q self); + +// +++ Size +extern_c size_t +QDoubleSize(ConstHandle2ConstQ self); + +// +++ Add +extern_c void +QDoubleAdd(ConstHandle2Q self, ConstHandle2ConstDouble Double); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDouble +QDoubleGetConst(ConstHandle2ConstQ self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Double +QDoubleGet(ConstHandle2Q self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +QDoubleSet( + ConstHandle2Q self, + const size_t index_, + ConstHandle2ConstDouble Double +); + +// +++ Has, by label +extern_c int +QDoubleHasByLabel( + ConstHandle2ConstQ self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstDouble +QDoubleGetByLabelConst( + ConstHandle2ConstQ self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Double +QDoubleGetByLabel( + ConstHandle2Q self, + const XMLName label +); + +// +++ Set, by label +extern_c void +QDoubleSetByLabel( + ConstHandle2Q self, + const XMLName label, + ConstHandle2ConstDouble Double +); + +// +++ Has, by unit +extern_c int +QDoubleHasByUnit( + ConstHandle2ConstQ self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstDouble +QDoubleGetByUnitConst( + ConstHandle2ConstQ self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Double +QDoubleGetByUnit( + ConstHandle2Q self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +QDoubleSetByUnit( + ConstHandle2Q self, + const XMLName unit, + ConstHandle2ConstDouble Double +); + +// +++ Has, by value +extern_c int +QDoubleHasByValue( + ConstHandle2ConstQ self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstDouble +QDoubleGetByValueConst( + ConstHandle2ConstQ self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2Double +QDoubleGetByValue( + ConstHandle2Q self, + const Float64 value +); + +// +++ Set, by value +extern_c void +QDoubleSetByValue( + ConstHandle2Q self, + const Float64 value, + ConstHandle2ConstDouble Double +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Q/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Q/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Q/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Q/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Q/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Shell.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Shell.cpp new file mode 100644 index 000000000..877358703 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Shell.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Shell.hpp" +#include "Shell.h" + +using namespace njoy::GNDStk; +using namespace test::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 unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstShell +ShellDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Shell +ShellDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstShell +ShellCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit +) { + ConstHandle2Shell handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit + ); + return handle; +} + +// Create, general +Handle2Shell +ShellCreate( + const XMLName label, + const Float64 value, + const XMLName unit +) { + ConstHandle2Shell 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 +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 +XMLName +ShellLabelGet(ConstHandle2ConstShell self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ShellLabelSet(ConstHandle2Shell self, const XMLName 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 +Float64 +ShellValueGet(ConstHandle2ConstShell self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +ShellValueSet(ConstHandle2Shell self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +ShellUnitHas(ConstHandle2ConstShell self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +ShellUnitGet(ConstHandle2ConstShell self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +ShellUnitSet(ConstHandle2Shell self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Shell/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Shell.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Shell.h new file mode 100644 index 000000000..5878b2dd8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Shell.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. +// +// 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_TEST_V2_0_POPS_SHELL +#define C_INTERFACE_TEST_V2_0_POPS_SHELL + +#include "GNDStk.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 +extern_c Handle2Shell +ShellDefault(); + +// --- Create, general, const +extern_c Handle2ConstShell +ShellCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit +); + +// +++ Create, general +extern_c Handle2Shell +ShellCreate( + const XMLName label, + const Float64 value, + const XMLName 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 +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 XMLName +ShellLabelGet(ConstHandle2ConstShell self); + +// +++ Set +extern_c void +ShellLabelSet(ConstHandle2Shell self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShellValueHas(ConstHandle2ConstShell self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +ShellValueGet(ConstHandle2ConstShell self); + +// +++ Set +extern_c void +ShellValueSet(ConstHandle2Shell self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShellUnitHas(ConstHandle2ConstShell self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ShellUnitGet(ConstHandle2ConstShell self); + +// +++ Set +extern_c void +ShellUnitSet(ConstHandle2Shell self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Shell/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Shell/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Shell/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Shell/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Shell/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra.cpp new file mode 100644 index 000000000..2b385406e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Spectra.hpp" +#include "Spectra.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Spectrum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpectra +SpectraDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +SpectraSpectrumHasByLabel( + ConstHandle2ConstSpectra self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumHasByLabel", + self, extract::spectrum, meta::label, label); +} + +// Get, by label, const +Handle2ConstSpectrum +SpectraSpectrumGetByLabelConst( + ConstHandle2ConstSpectra self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumGetByLabelConst", + self, extract::spectrum, meta::label, label); +} + +// Get, by label, non-const +Handle2Spectrum +SpectraSpectrumGetByLabel( + ConstHandle2Spectra self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumGetByLabel", + self, extract::spectrum, meta::label, label); +} + +// Set, by label +void +SpectraSpectrumSetByLabel( + ConstHandle2Spectra self, + const XMLName label, + ConstHandle2ConstSpectrum spectrum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumSetByLabel", + self, extract::spectrum, meta::label, label, spectrum); +} + +// Has, by pid +int +SpectraSpectrumHasByPid( + ConstHandle2ConstSpectra self, + const XMLName pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumHasByPid", + self, extract::spectrum, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstSpectrum +SpectraSpectrumGetByPidConst( + ConstHandle2ConstSpectra self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumGetByPidConst", + self, extract::spectrum, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2Spectrum +SpectraSpectrumGetByPid( + ConstHandle2Spectra self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumGetByPid", + self, extract::spectrum, meta::pid, pid); +} + +// Set, by pid +void +SpectraSpectrumSetByPid( + ConstHandle2Spectra self, + const XMLName pid, + ConstHandle2ConstSpectrum spectrum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumSetByPid", + self, extract::spectrum, meta::pid, pid, spectrum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Spectra/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra.h new file mode 100644 index 000000000..d714ab077 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_SPECTRA +#define C_INTERFACE_TEST_V2_0_POPS_SPECTRA + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2Spectra +SpectraDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpectra +SpectraCreateConst( + ConstHandle2Spectrum *const spectrum, const size_t spectrumSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +SpectraSpectrumHasByLabel( + ConstHandle2ConstSpectra self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstSpectrum +SpectraSpectrumGetByLabelConst( + ConstHandle2ConstSpectra self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Spectrum +SpectraSpectrumGetByLabel( + ConstHandle2Spectra self, + const XMLName label +); + +// +++ Set, by label +extern_c void +SpectraSpectrumSetByLabel( + ConstHandle2Spectra self, + const XMLName label, + ConstHandle2ConstSpectrum spectrum +); + +// +++ Has, by pid +extern_c int +SpectraSpectrumHasByPid( + ConstHandle2ConstSpectra self, + const XMLName pid +); + +// --- Get, by pid, const +extern_c Handle2ConstSpectrum +SpectraSpectrumGetByPidConst( + ConstHandle2ConstSpectra self, + const XMLName pid +); + +// +++ Get, by pid, non-const +extern_c Handle2Spectrum +SpectraSpectrumGetByPid( + ConstHandle2Spectra self, + const XMLName pid +); + +// +++ Set, by pid +extern_c void +SpectraSpectrumSetByPid( + ConstHandle2Spectra self, + const XMLName pid, + ConstHandle2ConstSpectrum spectrum +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Spectra/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectra/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum.cpp new file mode 100644 index 000000000..ad7b974d9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum.cpp @@ -0,0 +1,370 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Spectrum.hpp" +#include "Spectrum.h" + +using namespace njoy::GNDStk; +using namespace test::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 continuum = [](auto &obj) { return &obj.continuum; }; + static auto discrete = [](auto &obj) { return &obj.discrete; }; +} + +using CPPContinuum = pops::Continuum; +using CPPDiscrete = pops::Discrete; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpectrum +SpectrumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Spectrum +SpectrumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSpectrum +SpectrumCreateConst( + const XMLName label, + const XMLName pid, + ConstHandle2ConstContinuum continuum, + ConstHandle2Discrete *const discrete, const size_t discreteSize +) { + ConstHandle2Spectrum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + detail::tocpp(continuum), + std::vector{} + ); + for (size_t DiscreteN = 0; DiscreteN < discreteSize; ++DiscreteN) + SpectrumDiscreteAdd(handle, discrete[DiscreteN]); + return handle; +} + +// Create, general +Handle2Spectrum +SpectrumCreate( + const XMLName label, + const XMLName pid, + ConstHandle2ConstContinuum continuum, + ConstHandle2Discrete *const discrete, const size_t discreteSize +) { + ConstHandle2Spectrum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + pid, + detail::tocpp(continuum), + std::vector{} + ); + 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 +XMLName +SpectrumLabelGet(ConstHandle2ConstSpectrum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +SpectrumLabelSet(ConstHandle2Spectrum self, const XMLName 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 +XMLName +SpectrumPidGet(ConstHandle2ConstSpectrum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +SpectrumPidSet(ConstHandle2Spectrum self, const XMLName pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + +// Has, by type +int +SpectrumDiscreteHasByType( + ConstHandle2ConstSpectrum self, + const XMLName type +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DiscreteHasByType", + self, extract::discrete, meta::type, type); +} + +// Get, by type, const +Handle2ConstDiscrete +SpectrumDiscreteGetByTypeConst( + ConstHandle2ConstSpectrum self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DiscreteGetByTypeConst", + self, extract::discrete, meta::type, type); +} + +// Get, by type, non-const +Handle2Discrete +SpectrumDiscreteGetByType( + ConstHandle2Spectrum self, + const XMLName type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DiscreteGetByType", + self, extract::discrete, meta::type, type); +} + +// Set, by type +void +SpectrumDiscreteSetByType( + ConstHandle2Spectrum self, + const XMLName type, + ConstHandle2ConstDiscrete discrete +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DiscreteSetByType", + self, extract::discrete, meta::type, type, discrete); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Spectrum/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum.h new file mode 100644 index 000000000..756f031a6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum.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. +// +// 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_TEST_V2_0_POPS_SPECTRUM +#define C_INTERFACE_TEST_V2_0_POPS_SPECTRUM + +#include "GNDStk.h" +#include "v2.0/pops/Continuum.h" +#include "v2.0/pops/Discrete.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 +extern_c Handle2Spectrum +SpectrumDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpectrum +SpectrumCreateConst( + const XMLName label, + const XMLName pid, + ConstHandle2ConstContinuum continuum, + ConstHandle2Discrete *const discrete, const size_t discreteSize +); + +// +++ Create, general +extern_c Handle2Spectrum +SpectrumCreate( + const XMLName label, + const XMLName pid, + ConstHandle2ConstContinuum continuum, + ConstHandle2Discrete *const discrete, const size_t discreteSize +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +SpectrumLabelGet(ConstHandle2ConstSpectrum self); + +// +++ Set +extern_c void +SpectrumLabelSet(ConstHandle2Spectrum self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpectrumPidHas(ConstHandle2ConstSpectrum self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SpectrumPidGet(ConstHandle2ConstSpectrum self); + +// +++ Set +extern_c void +SpectrumPidSet(ConstHandle2Spectrum self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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 +); + +// +++ Has, by type +extern_c int +SpectrumDiscreteHasByType( + ConstHandle2ConstSpectrum self, + const XMLName type +); + +// --- Get, by type, const +extern_c Handle2ConstDiscrete +SpectrumDiscreteGetByTypeConst( + ConstHandle2ConstSpectrum self, + const XMLName type +); + +// +++ Get, by type, non-const +extern_c Handle2Discrete +SpectrumDiscreteGetByType( + ConstHandle2Spectrum self, + const XMLName type +); + +// +++ Set, by type +extern_c void +SpectrumDiscreteSetByType( + ConstHandle2Spectrum self, + const XMLName type, + ConstHandle2ConstDiscrete discrete +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Spectrum/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Spectrum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spin.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Spin.cpp new file mode 100644 index 000000000..bc3bfe1ee --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Spin.cpp @@ -0,0 +1,538 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Spin.hpp" +#include "Spin.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = SpinClass; +using CPP = multigroup::Spin; + +static const std::string CLASSNAME = "Spin"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto fraction = [](auto &obj) { return &obj.fraction; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; +using CPPFraction = containers::Fraction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpin +SpinDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Spin +SpinDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSpin +SpinCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Fraction *const fraction, const size_t fractionSize +) { + ConstHandle2Spin handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t FractionN = 0; FractionN < fractionSize; ++FractionN) + SpinFractionAdd(handle, fraction[FractionN]); + return handle; +} + +// Create, general +Handle2Spin +SpinCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Fraction *const fraction, const size_t fractionSize +) { + ConstHandle2Spin handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + unit, + value, + detail::tocpp(documentation), + detail::tocpp(uncertainty), + std::vector{} + ); + for (size_t FractionN = 0; FractionN < fractionSize; ++FractionN) + SpinFractionAdd(handle, fraction[FractionN]); + return handle; +} + +// Assign +// Use this to assign 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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +SpinLabelHas(ConstHandle2ConstSpin self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +SpinLabelGet(ConstHandle2ConstSpin self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +SpinLabelSet(ConstHandle2Spin self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +SpinUnitHas(ConstHandle2ConstSpin self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +SpinUnitGet(ConstHandle2ConstSpin self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +SpinUnitSet(ConstHandle2Spin self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +SpinValueHas(ConstHandle2ConstSpin self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +XMLName +SpinValueGet(ConstHandle2ConstSpin self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +SpinValueSet(ConstHandle2Spin self, const XMLName value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +SpinDocumentationHas(ConstHandle2ConstSpin self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +SpinDocumentationGetConst(ConstHandle2ConstSpin self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +SpinDocumentationGet(ConstHandle2Spin self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +SpinDocumentationSet(ConstHandle2Spin self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +SpinUncertaintyHas(ConstHandle2ConstSpin self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +SpinUncertaintyGetConst(ConstHandle2ConstSpin self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +SpinUncertaintyGet(ConstHandle2Spin self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +SpinUncertaintySet(ConstHandle2Spin self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Child: fraction +// ----------------------------------------------------------------------------- + +// Has +int +SpinFractionHas(ConstHandle2ConstSpin self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FractionHas", self, extract::fraction); +} + +// Clear +void +SpinFractionClear(ConstHandle2Spin self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"FractionClear", self, extract::fraction); +} + +// Size +size_t +SpinFractionSize(ConstHandle2ConstSpin self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"FractionSize", self, extract::fraction); +} + +// Add +void +SpinFractionAdd(ConstHandle2Spin self, ConstHandle2ConstFraction fraction) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"FractionAdd", self, extract::fraction, fraction); +} + +// Get, by index \in [0,size), const +Handle2ConstFraction +SpinFractionGetConst(ConstHandle2ConstSpin self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"FractionGetConst", self, extract::fraction, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Fraction +SpinFractionGet(ConstHandle2Spin self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"FractionGet", self, extract::fraction, index_); +} + +// Set, by index \in [0,size) +void +SpinFractionSet( + ConstHandle2Spin self, + const size_t index_, + ConstHandle2ConstFraction fraction +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"FractionSet", self, extract::fraction, index_, fraction); +} + +// Has, by label +int +SpinFractionHasByLabel( + ConstHandle2ConstSpin self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"FractionHasByLabel", + self, extract::fraction, meta::label, label); +} + +// Get, by label, const +Handle2ConstFraction +SpinFractionGetByLabelConst( + ConstHandle2ConstSpin self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FractionGetByLabelConst", + self, extract::fraction, meta::label, label); +} + +// Get, by label, non-const +Handle2Fraction +SpinFractionGetByLabel( + ConstHandle2Spin self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FractionGetByLabel", + self, extract::fraction, meta::label, label); +} + +// Set, by label +void +SpinFractionSetByLabel( + ConstHandle2Spin self, + const XMLName label, + ConstHandle2ConstFraction fraction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FractionSetByLabel", + self, extract::fraction, meta::label, label, fraction); +} + +// Has, by unit +int +SpinFractionHasByUnit( + ConstHandle2ConstSpin self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"FractionHasByUnit", + self, extract::fraction, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstFraction +SpinFractionGetByUnitConst( + ConstHandle2ConstSpin self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FractionGetByUnitConst", + self, extract::fraction, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Fraction +SpinFractionGetByUnit( + ConstHandle2Spin self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FractionGetByUnit", + self, extract::fraction, meta::unit, unit); +} + +// Set, by unit +void +SpinFractionSetByUnit( + ConstHandle2Spin self, + const XMLName unit, + ConstHandle2ConstFraction fraction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FractionSetByUnit", + self, extract::fraction, meta::unit, unit, fraction); +} + +// Has, by value +int +SpinFractionHasByValue( + ConstHandle2ConstSpin self, + const Fraction32 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"FractionHasByValue", + self, extract::fraction, meta::value, value); +} + +// Get, by value, const +Handle2ConstFraction +SpinFractionGetByValueConst( + ConstHandle2ConstSpin self, + const Fraction32 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FractionGetByValueConst", + self, extract::fraction, meta::value, value); +} + +// Get, by value, non-const +Handle2Fraction +SpinFractionGetByValue( + ConstHandle2Spin self, + const Fraction32 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FractionGetByValue", + self, extract::fraction, meta::value, value); +} + +// Set, by value +void +SpinFractionSetByValue( + ConstHandle2Spin self, + const Fraction32 value, + ConstHandle2ConstFraction fraction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FractionSetByValue", + self, extract::fraction, meta::value, value, fraction); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Spin/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spin.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Spin.h new file mode 100644 index 000000000..2266e052e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Spin.h @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_SPIN +#define C_INTERFACE_TEST_V2_0_POPS_SPIN + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.h" +#include "v2.0/containers/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 +extern_c Handle2Spin +SpinDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpin +SpinCreateConst( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Fraction *const fraction, const size_t fractionSize +); + +// +++ Create, general +extern_c Handle2Spin +SpinCreate( + const XMLName label, + const XMLName unit, + const XMLName value, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2Fraction *const fraction, const size_t fractionSize +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinLabelHas(ConstHandle2ConstSpin self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SpinLabelGet(ConstHandle2ConstSpin self); + +// +++ Set +extern_c void +SpinLabelSet(ConstHandle2Spin self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinUnitHas(ConstHandle2ConstSpin self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SpinUnitGet(ConstHandle2ConstSpin self); + +// +++ Set +extern_c void +SpinUnitSet(ConstHandle2Spin self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinValueHas(ConstHandle2ConstSpin self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SpinValueGet(ConstHandle2ConstSpin self); + +// +++ Set +extern_c void +SpinValueSet(ConstHandle2Spin self, const XMLName value); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinDocumentationHas(ConstHandle2ConstSpin self); + +// --- Get, const +extern_c Handle2ConstDocumentation +SpinDocumentationGetConst(ConstHandle2ConstSpin self); + +// +++ Get, non-const +extern_c Handle2Documentation +SpinDocumentationGet(ConstHandle2Spin self); + +// +++ Set +extern_c void +SpinDocumentationSet(ConstHandle2Spin self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinUncertaintyHas(ConstHandle2ConstSpin self); + +// --- Get, const +extern_c Handle2ConstUncertainty +SpinUncertaintyGetConst(ConstHandle2ConstSpin self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +SpinUncertaintyGet(ConstHandle2Spin self); + +// +++ Set +extern_c void +SpinUncertaintySet(ConstHandle2Spin self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Child: fraction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinFractionHas(ConstHandle2ConstSpin self); + +// +++ Clear +extern_c void +SpinFractionClear(ConstHandle2Spin self); + +// +++ Size +extern_c size_t +SpinFractionSize(ConstHandle2ConstSpin self); + +// +++ Add +extern_c void +SpinFractionAdd(ConstHandle2Spin self, ConstHandle2ConstFraction fraction); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstFraction +SpinFractionGetConst(ConstHandle2ConstSpin self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Fraction +SpinFractionGet(ConstHandle2Spin self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +SpinFractionSet( + ConstHandle2Spin self, + const size_t index_, + ConstHandle2ConstFraction fraction +); + +// +++ Has, by label +extern_c int +SpinFractionHasByLabel( + ConstHandle2ConstSpin self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstFraction +SpinFractionGetByLabelConst( + ConstHandle2ConstSpin self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Fraction +SpinFractionGetByLabel( + ConstHandle2Spin self, + const XMLName label +); + +// +++ Set, by label +extern_c void +SpinFractionSetByLabel( + ConstHandle2Spin self, + const XMLName label, + ConstHandle2ConstFraction fraction +); + +// +++ Has, by unit +extern_c int +SpinFractionHasByUnit( + ConstHandle2ConstSpin self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstFraction +SpinFractionGetByUnitConst( + ConstHandle2ConstSpin self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Fraction +SpinFractionGetByUnit( + ConstHandle2Spin self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +SpinFractionSetByUnit( + ConstHandle2Spin self, + const XMLName unit, + ConstHandle2ConstFraction fraction +); + +// +++ Has, by value +extern_c int +SpinFractionHasByValue( + ConstHandle2ConstSpin self, + const Fraction32 value +); + +// --- Get, by value, const +extern_c Handle2ConstFraction +SpinFractionGetByValueConst( + ConstHandle2ConstSpin self, + const Fraction32 value +); + +// +++ Get, by value, non-const +extern_c Handle2Fraction +SpinFractionGetByValue( + ConstHandle2Spin self, + const Fraction32 value +); + +// +++ Set, by value +extern_c void +SpinFractionSetByValue( + ConstHandle2Spin self, + const Fraction32 value, + ConstHandle2ConstFraction fraction +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Spin/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spin/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Spin/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Spin/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Spin/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Standard.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Standard.cpp new file mode 100644 index 000000000..d4416d0d6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Standard.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Standard.hpp" +#include "Standard.h" + +using namespace njoy::GNDStk; +using namespace test::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 = extra::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstStandard +StandardDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/pops/Standard/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Standard.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Standard.h new file mode 100644 index 000000000..f931f27b7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_STANDARD +#define C_INTERFACE_TEST_V2_0_POPS_STANDARD + +#include "GNDStk.h" +#include "v2.0/extra/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 +extern_c Handle2Standard +StandardDefault(); + +// --- Create, general, const +extern_c Handle2ConstStandard +StandardCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/pops/Standard/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Standard/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Standard/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Standard/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Standard/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Uncertainty.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Uncertainty.cpp new file mode 100644 index 000000000..3b94d6896 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Uncertainty.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Uncertainty.hpp" +#include "Uncertainty.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = UncertaintyClass; +using CPP = multigroup::Uncertainty; + +static const std::string CLASSNAME = "Uncertainty"; + +namespace extract { + static auto standard = [](auto &obj) { return &obj.standard; }; + static auto logNormal = [](auto &obj) { return &obj.logNormal; }; + static auto confidenceIntervals = [](auto &obj) { return &obj.confidenceIntervals; }; + static auto pdf = [](auto &obj) { return &obj.pdf; }; +} + +using CPPStandard = pops::Standard; +using CPPLogNormal = pops::LogNormal; +using CPPConfidenceIntervals = pops::ConfidenceIntervals; +using CPPPdf = pops::Pdf; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUncertainty +UncertaintyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Uncertainty +UncertaintyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUncertainty +UncertaintyCreateConst( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstPdf pdf +) { + ConstHandle2Uncertainty handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(standard), + detail::tocpp(logNormal), + detail::tocpp(confidenceIntervals), + detail::tocpp(pdf) + ); + return handle; +} + +// Create, general +Handle2Uncertainty +UncertaintyCreate( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstPdf pdf +) { + ConstHandle2Uncertainty handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(standard), + detail::tocpp(logNormal), + detail::tocpp(confidenceIntervals), + detail::tocpp(pdf) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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: logNormal +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyLogNormalHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LogNormalHas", self, extract::logNormal); +} + +// Get, const +Handle2ConstLogNormal +UncertaintyLogNormalGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LogNormalGetConst", self, extract::logNormal); +} + +// Get, non-const +Handle2LogNormal +UncertaintyLogNormalGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LogNormalGet", self, extract::logNormal); +} + +// Set +void +UncertaintyLogNormalSet(ConstHandle2Uncertainty self, ConstHandle2ConstLogNormal logNormal) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LogNormalSet", self, extract::logNormal, logNormal); +} + + +// ----------------------------------------------------------------------------- +// Child: confidenceIntervals +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyConfidenceIntervalsHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsHas", self, extract::confidenceIntervals); +} + +// Get, const +Handle2ConstConfidenceIntervals +UncertaintyConfidenceIntervalsGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsGetConst", self, extract::confidenceIntervals); +} + +// Get, non-const +Handle2ConfidenceIntervals +UncertaintyConfidenceIntervalsGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsGet", self, extract::confidenceIntervals); +} + +// Set +void +UncertaintyConfidenceIntervalsSet(ConstHandle2Uncertainty self, ConstHandle2ConstConfidenceIntervals confidenceIntervals) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ConfidenceIntervalsSet", self, extract::confidenceIntervals, confidenceIntervals); +} + + +// ----------------------------------------------------------------------------- +// Child: pdf +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyPdfHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PdfHas", self, extract::pdf); +} + +// Get, const +Handle2ConstPdf +UncertaintyPdfGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PdfGetConst", self, extract::pdf); +} + +// Get, non-const +Handle2Pdf +UncertaintyPdfGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PdfGet", self, extract::pdf); +} + +// Set +void +UncertaintyPdfSet(ConstHandle2Uncertainty self, ConstHandle2ConstPdf pdf) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PdfSet", self, extract::pdf, pdf); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Uncertainty/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Uncertainty.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Uncertainty.h new file mode 100644 index 000000000..559eb07f8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/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_TEST_V2_0_POPS_UNCERTAINTY +#define C_INTERFACE_TEST_V2_0_POPS_UNCERTAINTY + +#include "GNDStk.h" +#include "v2.0/pops/Standard.h" +#include "v2.0/pops/LogNormal.h" +#include "v2.0/pops/ConfidenceIntervals.h" +#include "v2.0/pops/Pdf.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 +extern_c Handle2Uncertainty +UncertaintyDefault(); + +// --- Create, general, const +extern_c Handle2ConstUncertainty +UncertaintyCreateConst( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstPdf pdf +); + +// +++ Create, general +extern_c Handle2Uncertainty +UncertaintyCreate( + ConstHandle2ConstStandard standard, + ConstHandle2ConstLogNormal logNormal, + ConstHandle2ConstConfidenceIntervals confidenceIntervals, + ConstHandle2ConstPdf pdf +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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: logNormal +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyLogNormalHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstLogNormal +UncertaintyLogNormalGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2LogNormal +UncertaintyLogNormalGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyLogNormalSet(ConstHandle2Uncertainty self, ConstHandle2ConstLogNormal logNormal); + + +// ----------------------------------------------------------------------------- +// Child: confidenceIntervals +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyConfidenceIntervalsHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstConfidenceIntervals +UncertaintyConfidenceIntervalsGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2ConfidenceIntervals +UncertaintyConfidenceIntervalsGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyConfidenceIntervalsSet(ConstHandle2Uncertainty self, ConstHandle2ConstConfidenceIntervals confidenceIntervals); + + +// ----------------------------------------------------------------------------- +// Child: pdf +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyPdfHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstPdf +UncertaintyPdfGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2Pdf +UncertaintyPdfGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyPdfSet(ConstHandle2Uncertainty self, ConstHandle2ConstPdf pdf); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Uncertainty/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Uncertainty/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Uncertainty/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Uncertainty/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Uncertainty/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox.cpp new file mode 100644 index 000000000..94d7a2208 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Unorthodox.hpp" +#include "Unorthodox.h" + +using namespace njoy::GNDStk; +using namespace test::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 charge = [](auto &obj) { return &obj.charge; }; + static auto mass = [](auto &obj) { return &obj.mass; }; +} + +using CPPCharge = pops::Charge; +using CPPMass = pops::Mass; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUnorthodox +UnorthodoxDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Unorthodox +UnorthodoxDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnorthodox +UnorthodoxCreateConst( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstMass mass +) { + ConstHandle2Unorthodox handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + detail::tocpp(charge), + detail::tocpp(mass) + ); + return handle; +} + +// Create, general +Handle2Unorthodox +UnorthodoxCreate( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstMass mass +) { + ConstHandle2Unorthodox handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + detail::tocpp(charge), + 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 +XMLName +UnorthodoxIdGet(ConstHandle2ConstUnorthodox self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +UnorthodoxIdSet(ConstHandle2Unorthodox self, const XMLName id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// Has +int +UnorthodoxChargeHas(ConstHandle2ConstUnorthodox self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChargeHas", self, extract::charge); +} + +// Get, const +Handle2ConstCharge +UnorthodoxChargeGetConst(ConstHandle2ConstUnorthodox self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGetConst", self, extract::charge); +} + +// Get, non-const +Handle2Charge +UnorthodoxChargeGet(ConstHandle2Unorthodox self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGet", self, extract::charge); +} + +// Set +void +UnorthodoxChargeSet(ConstHandle2Unorthodox self, ConstHandle2ConstCharge charge) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChargeSet", self, extract::charge, charge); +} + + +// ----------------------------------------------------------------------------- +// 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/pops/Unorthodox/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox.h new file mode 100644 index 000000000..fd84350c3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox.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. +// +// 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_TEST_V2_0_POPS_UNORTHODOX +#define C_INTERFACE_TEST_V2_0_POPS_UNORTHODOX + +#include "GNDStk.h" +#include "v2.0/pops/Charge.h" +#include "v2.0/pops/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 +extern_c Handle2Unorthodox +UnorthodoxDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnorthodox +UnorthodoxCreateConst( + const XMLName id, + ConstHandle2ConstCharge charge, + ConstHandle2ConstMass mass +); + +// +++ Create, general +extern_c Handle2Unorthodox +UnorthodoxCreate( + const XMLName id, + ConstHandle2ConstCharge charge, + 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 XMLName +UnorthodoxIdGet(ConstHandle2ConstUnorthodox self); + +// +++ Set +extern_c void +UnorthodoxIdSet(ConstHandle2Unorthodox self, const XMLName id); + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnorthodoxChargeHas(ConstHandle2ConstUnorthodox self); + +// --- Get, const +extern_c Handle2ConstCharge +UnorthodoxChargeGetConst(ConstHandle2ConstUnorthodox self); + +// +++ Get, non-const +extern_c Handle2Charge +UnorthodoxChargeGet(ConstHandle2Unorthodox self); + +// +++ Set +extern_c void +UnorthodoxChargeSet(ConstHandle2Unorthodox self, ConstHandle2ConstCharge charge); + + +// ----------------------------------------------------------------------------- +// 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/pops/Unorthodox/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodox/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes.cpp new file mode 100644 index 000000000..031a364d5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/pops/Unorthodoxes.hpp" +#include "Unorthodoxes.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = UnorthodoxesClass; +using CPP = multigroup::Unorthodoxes; + +static const std::string CLASSNAME = "Unorthodoxes"; + +namespace extract { + static auto nuclide = [](auto &obj) { return &obj.nuclide; }; +} + +using CPPNuclide = pops::Nuclide; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUnorthodoxes +UnorthodoxesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Unorthodoxes +UnorthodoxesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnorthodoxes +UnorthodoxesCreateConst( + ConstHandle2Nuclide *const nuclide, const size_t nuclideSize +) { + ConstHandle2Unorthodoxes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t NuclideN = 0; NuclideN < nuclideSize; ++NuclideN) + UnorthodoxesNuclideAdd(handle, nuclide[NuclideN]); + return handle; +} + +// Create, general +Handle2Unorthodoxes +UnorthodoxesCreate( + ConstHandle2Nuclide *const nuclide, const size_t nuclideSize +) { + ConstHandle2Unorthodoxes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t NuclideN = 0; NuclideN < nuclideSize; ++NuclideN) + UnorthodoxesNuclideAdd(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 +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: nuclide +// ----------------------------------------------------------------------------- + +// Has +int +UnorthodoxesNuclideHas(ConstHandle2ConstUnorthodoxes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NuclideHas", self, extract::nuclide); +} + +// Clear +void +UnorthodoxesNuclideClear(ConstHandle2Unorthodoxes self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"NuclideClear", self, extract::nuclide); +} + +// Size +size_t +UnorthodoxesNuclideSize(ConstHandle2ConstUnorthodoxes self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"NuclideSize", self, extract::nuclide); +} + +// Add +void +UnorthodoxesNuclideAdd(ConstHandle2Unorthodoxes self, ConstHandle2ConstNuclide nuclide) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"NuclideAdd", self, extract::nuclide, nuclide); +} + +// Get, by index \in [0,size), const +Handle2ConstNuclide +UnorthodoxesNuclideGetConst(ConstHandle2ConstUnorthodoxes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"NuclideGetConst", self, extract::nuclide, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Nuclide +UnorthodoxesNuclideGet(ConstHandle2Unorthodoxes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"NuclideGet", self, extract::nuclide, index_); +} + +// Set, by index \in [0,size) +void +UnorthodoxesNuclideSet( + ConstHandle2Unorthodoxes self, + const size_t index_, + ConstHandle2ConstNuclide nuclide +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"NuclideSet", self, extract::nuclide, index_, nuclide); +} + +// Has, by id +int +UnorthodoxesNuclideHasById( + ConstHandle2ConstUnorthodoxes self, + const XMLName id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"NuclideHasById", + self, extract::nuclide, meta::id, id); +} + +// Get, by id, const +Handle2ConstNuclide +UnorthodoxesNuclideGetByIdConst( + ConstHandle2ConstUnorthodoxes self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"NuclideGetByIdConst", + self, extract::nuclide, meta::id, id); +} + +// Get, by id, non-const +Handle2Nuclide +UnorthodoxesNuclideGetById( + ConstHandle2Unorthodoxes self, + const XMLName id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"NuclideGetById", + self, extract::nuclide, meta::id, id); +} + +// Set, by id +void +UnorthodoxesNuclideSetById( + ConstHandle2Unorthodoxes self, + const XMLName id, + ConstHandle2ConstNuclide nuclide +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"NuclideSetById", + self, extract::nuclide, meta::id, id, nuclide); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Unorthodoxes/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes.h new file mode 100644 index 000000000..b14189751 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_POPS_UNORTHODOXES +#define C_INTERFACE_TEST_V2_0_POPS_UNORTHODOXES + +#include "GNDStk.h" +#include "v2.0/pops/Nuclide.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 +extern_c Handle2Unorthodoxes +UnorthodoxesDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnorthodoxes +UnorthodoxesCreateConst( + ConstHandle2Nuclide *const nuclide, const size_t nuclideSize +); + +// +++ Create, general +extern_c Handle2Unorthodoxes +UnorthodoxesCreate( + 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 +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: nuclide +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnorthodoxesNuclideHas(ConstHandle2ConstUnorthodoxes self); + +// +++ Clear +extern_c void +UnorthodoxesNuclideClear(ConstHandle2Unorthodoxes self); + +// +++ Size +extern_c size_t +UnorthodoxesNuclideSize(ConstHandle2ConstUnorthodoxes self); + +// +++ Add +extern_c void +UnorthodoxesNuclideAdd(ConstHandle2Unorthodoxes self, ConstHandle2ConstNuclide nuclide); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstNuclide +UnorthodoxesNuclideGetConst(ConstHandle2ConstUnorthodoxes self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Nuclide +UnorthodoxesNuclideGet(ConstHandle2Unorthodoxes self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +UnorthodoxesNuclideSet( + ConstHandle2Unorthodoxes self, + const size_t index_, + ConstHandle2ConstNuclide nuclide +); + +// +++ Has, by id +extern_c int +UnorthodoxesNuclideHasById( + ConstHandle2ConstUnorthodoxes self, + const XMLName id +); + +// --- Get, by id, const +extern_c Handle2ConstNuclide +UnorthodoxesNuclideGetByIdConst( + ConstHandle2ConstUnorthodoxes self, + const XMLName id +); + +// +++ Get, by id, non-const +extern_c Handle2Nuclide +UnorthodoxesNuclideGetById( + ConstHandle2Unorthodoxes self, + const XMLName id +); + +// +++ Set, by id +extern_c void +UnorthodoxesNuclideSetById( + ConstHandle2Unorthodoxes self, + const XMLName id, + ConstHandle2ConstNuclide nuclide +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/pops/Unorthodoxes/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/pops/Unorthodoxes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC.cpp new file mode 100644 index 000000000..d43f4e501 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/processed/AngularEnergyMC.hpp" +#include "AngularEnergyMC.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AngularEnergyMCClass; +using CPP = multigroup::AngularEnergyMC; + +static const std::string CLASSNAME = "AngularEnergyMC"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto angular_uncorrelated = [](auto &obj) { return &obj.angular_uncorrelated; }; + static auto angularEnergy = [](auto &obj) { return &obj.angularEnergy; }; +} + +using CPPAngular_uncorrelated = transport::Angular_uncorrelated; +using CPPAngularEnergy = transport::AngularEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAngularEnergyMC +AngularEnergyMCDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AngularEnergyMC +AngularEnergyMCDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAngularEnergyMC +AngularEnergyMCCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstAngular_uncorrelated angular_uncorrelated, + ConstHandle2ConstAngularEnergy angularEnergy +) { + ConstHandle2AngularEnergyMC handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(angular_uncorrelated), + detail::tocpp(angularEnergy) + ); + return handle; +} + +// Create, general +Handle2AngularEnergyMC +AngularEnergyMCCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstAngular_uncorrelated angular_uncorrelated, + ConstHandle2ConstAngularEnergy angularEnergy +) { + ConstHandle2AngularEnergyMC handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(angular_uncorrelated), + detail::tocpp(angularEnergy) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AngularEnergyMCAssign(ConstHandle2AngularEnergyMC self, ConstHandle2ConstAngularEnergyMC from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AngularEnergyMCDelete(ConstHandle2ConstAngularEnergyMC self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AngularEnergyMCRead(ConstHandle2AngularEnergyMC self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AngularEnergyMCWrite(ConstHandle2ConstAngularEnergyMC self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AngularEnergyMCPrint(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AngularEnergyMCPrintXML(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AngularEnergyMCPrintJSON(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AngularEnergyMCLabelHas(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +AngularEnergyMCLabelGet(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AngularEnergyMCLabelSet(ConstHandle2AngularEnergyMC self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +AngularEnergyMCProductFrameHas(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +XMLName +AngularEnergyMCProductFrameGet(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +AngularEnergyMCProductFrameSet(ConstHandle2AngularEnergyMC self, const XMLName productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: angular_uncorrelated +// ----------------------------------------------------------------------------- + +// Has +int +AngularEnergyMCAngular_uncorrelatedHas(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Angular_uncorrelatedHas", self, extract::angular_uncorrelated); +} + +// Get, const +Handle2ConstAngular_uncorrelated +AngularEnergyMCAngular_uncorrelatedGetConst(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Angular_uncorrelatedGetConst", self, extract::angular_uncorrelated); +} + +// Get, non-const +Handle2Angular_uncorrelated +AngularEnergyMCAngular_uncorrelatedGet(ConstHandle2AngularEnergyMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Angular_uncorrelatedGet", self, extract::angular_uncorrelated); +} + +// Set +void +AngularEnergyMCAngular_uncorrelatedSet(ConstHandle2AngularEnergyMC self, ConstHandle2ConstAngular_uncorrelated angular_uncorrelated) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Angular_uncorrelatedSet", self, extract::angular_uncorrelated, angular_uncorrelated); +} + + +// ----------------------------------------------------------------------------- +// Child: angularEnergy +// ----------------------------------------------------------------------------- + +// Has +int +AngularEnergyMCAngularEnergyHas(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AngularEnergyHas", self, extract::angularEnergy); +} + +// Get, const +Handle2ConstAngularEnergy +AngularEnergyMCAngularEnergyGetConst(ConstHandle2ConstAngularEnergyMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AngularEnergyGetConst", self, extract::angularEnergy); +} + +// Get, non-const +Handle2AngularEnergy +AngularEnergyMCAngularEnergyGet(ConstHandle2AngularEnergyMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AngularEnergyGet", self, extract::angularEnergy); +} + +// Set +void +AngularEnergyMCAngularEnergySet(ConstHandle2AngularEnergyMC self, ConstHandle2ConstAngularEnergy angularEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AngularEnergySet", self, extract::angularEnergy, angularEnergy); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AngularEnergyMC/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC.h new file mode 100644 index 000000000..8cac68871 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC.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. +// +// AngularEnergyMC is the basic handle type in this file. Example: +// // Create a default AngularEnergyMC object: +// AngularEnergyMC handle = AngularEnergyMCDefault(); +// Functions involving AngularEnergyMC are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_PROCESSED_ANGULARENERGYMC +#define C_INTERFACE_TEST_V2_0_PROCESSED_ANGULARENERGYMC + +#include "GNDStk.h" +#include "v2.0/transport/Angular_uncorrelated.h" +#include "v2.0/transport/AngularEnergy.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AngularEnergyMCClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AngularEnergyMC +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AngularEnergyMCClass *AngularEnergyMC; + +// --- Const-aware handles. +typedef const struct AngularEnergyMCClass *const ConstHandle2ConstAngularEnergyMC; +typedef struct AngularEnergyMCClass *const ConstHandle2AngularEnergyMC; +typedef const struct AngularEnergyMCClass * Handle2ConstAngularEnergyMC; +typedef struct AngularEnergyMCClass * Handle2AngularEnergyMC; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAngularEnergyMC +AngularEnergyMCDefaultConst(); + +// +++ Create, default +extern_c Handle2AngularEnergyMC +AngularEnergyMCDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngularEnergyMC +AngularEnergyMCCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstAngular_uncorrelated angular_uncorrelated, + ConstHandle2ConstAngularEnergy angularEnergy +); + +// +++ Create, general +extern_c Handle2AngularEnergyMC +AngularEnergyMCCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstAngular_uncorrelated angular_uncorrelated, + ConstHandle2ConstAngularEnergy angularEnergy +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AngularEnergyMCAssign(ConstHandle2AngularEnergyMC self, ConstHandle2ConstAngularEnergyMC from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AngularEnergyMCDelete(ConstHandle2ConstAngularEnergyMC self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AngularEnergyMCRead(ConstHandle2AngularEnergyMC self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AngularEnergyMCWrite(ConstHandle2ConstAngularEnergyMC self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AngularEnergyMCPrint(ConstHandle2ConstAngularEnergyMC self); + +// +++ Print to standard output, as XML +extern_c int +AngularEnergyMCPrintXML(ConstHandle2ConstAngularEnergyMC self); + +// +++ Print to standard output, as JSON +extern_c int +AngularEnergyMCPrintJSON(ConstHandle2ConstAngularEnergyMC self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularEnergyMCLabelHas(ConstHandle2ConstAngularEnergyMC self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AngularEnergyMCLabelGet(ConstHandle2ConstAngularEnergyMC self); + +// +++ Set +extern_c void +AngularEnergyMCLabelSet(ConstHandle2AngularEnergyMC self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularEnergyMCProductFrameHas(ConstHandle2ConstAngularEnergyMC self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AngularEnergyMCProductFrameGet(ConstHandle2ConstAngularEnergyMC self); + +// +++ Set +extern_c void +AngularEnergyMCProductFrameSet(ConstHandle2AngularEnergyMC self, const XMLName productFrame); + + +// ----------------------------------------------------------------------------- +// Child: angular_uncorrelated +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularEnergyMCAngular_uncorrelatedHas(ConstHandle2ConstAngularEnergyMC self); + +// --- Get, const +extern_c Handle2ConstAngular_uncorrelated +AngularEnergyMCAngular_uncorrelatedGetConst(ConstHandle2ConstAngularEnergyMC self); + +// +++ Get, non-const +extern_c Handle2Angular_uncorrelated +AngularEnergyMCAngular_uncorrelatedGet(ConstHandle2AngularEnergyMC self); + +// +++ Set +extern_c void +AngularEnergyMCAngular_uncorrelatedSet(ConstHandle2AngularEnergyMC self, ConstHandle2ConstAngular_uncorrelated angular_uncorrelated); + + +// ----------------------------------------------------------------------------- +// Child: angularEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularEnergyMCAngularEnergyHas(ConstHandle2ConstAngularEnergyMC self); + +// --- Get, const +extern_c Handle2ConstAngularEnergy +AngularEnergyMCAngularEnergyGetConst(ConstHandle2ConstAngularEnergyMC self); + +// +++ Get, non-const +extern_c Handle2AngularEnergy +AngularEnergyMCAngularEnergyGet(ConstHandle2AngularEnergyMC self); + +// +++ Set +extern_c void +AngularEnergyMCAngularEnergySet(ConstHandle2AngularEnergyMC self, ConstHandle2ConstAngularEnergy angularEnergy); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AngularEnergyMC/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AngularEnergyMC/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy.cpp new file mode 100644 index 000000000..32ae5e68b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/processed/AvailableEnergy.hpp" +#include "AvailableEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AvailableEnergyClass; +using CPP = multigroup::AvailableEnergy; + +static const std::string CLASSNAME = "AvailableEnergy"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto gridded1d = [](auto &obj) { return &obj.gridded1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPGridded1d = containers::Gridded1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAvailableEnergy +AvailableEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AvailableEnergy +AvailableEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAvailableEnergy +AvailableEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d +) { + ConstHandle2AvailableEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(gridded1d) + ); + return handle; +} + +// Create, general +Handle2AvailableEnergy +AvailableEnergyCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d +) { + ConstHandle2AvailableEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(gridded1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AvailableEnergyAssign(ConstHandle2AvailableEnergy self, ConstHandle2ConstAvailableEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AvailableEnergyDelete(ConstHandle2ConstAvailableEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AvailableEnergyRead(ConstHandle2AvailableEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AvailableEnergyWrite(ConstHandle2ConstAvailableEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AvailableEnergyPrint(ConstHandle2ConstAvailableEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AvailableEnergyPrintXML(ConstHandle2ConstAvailableEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AvailableEnergyPrintJSON(ConstHandle2ConstAvailableEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +AvailableEnergyXYs1dHas(ConstHandle2ConstAvailableEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +AvailableEnergyXYs1dGetConst(ConstHandle2ConstAvailableEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +AvailableEnergyXYs1dGet(ConstHandle2AvailableEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +AvailableEnergyXYs1dSet(ConstHandle2AvailableEnergy self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// Has +int +AvailableEnergyGridded1dHas(ConstHandle2ConstAvailableEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded1dHas", self, extract::gridded1d); +} + +// Get, const +Handle2ConstGridded1d +AvailableEnergyGridded1dGetConst(ConstHandle2ConstAvailableEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGetConst", self, extract::gridded1d); +} + +// Get, non-const +Handle2Gridded1d +AvailableEnergyGridded1dGet(ConstHandle2AvailableEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGet", self, extract::gridded1d); +} + +// Set +void +AvailableEnergyGridded1dSet(ConstHandle2AvailableEnergy self, ConstHandle2ConstGridded1d gridded1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded1dSet", self, extract::gridded1d, gridded1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AvailableEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy.h new file mode 100644 index 000000000..27b9f0528 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy.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. +// +// AvailableEnergy is the basic handle type in this file. Example: +// // Create a default AvailableEnergy object: +// AvailableEnergy handle = AvailableEnergyDefault(); +// Functions involving AvailableEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_PROCESSED_AVAILABLEENERGY +#define C_INTERFACE_TEST_V2_0_PROCESSED_AVAILABLEENERGY + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Gridded1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AvailableEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AvailableEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AvailableEnergyClass *AvailableEnergy; + +// --- Const-aware handles. +typedef const struct AvailableEnergyClass *const ConstHandle2ConstAvailableEnergy; +typedef struct AvailableEnergyClass *const ConstHandle2AvailableEnergy; +typedef const struct AvailableEnergyClass * Handle2ConstAvailableEnergy; +typedef struct AvailableEnergyClass * Handle2AvailableEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAvailableEnergy +AvailableEnergyDefaultConst(); + +// +++ Create, default +extern_c Handle2AvailableEnergy +AvailableEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAvailableEnergy +AvailableEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d +); + +// +++ Create, general +extern_c Handle2AvailableEnergy +AvailableEnergyCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AvailableEnergyAssign(ConstHandle2AvailableEnergy self, ConstHandle2ConstAvailableEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AvailableEnergyDelete(ConstHandle2ConstAvailableEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AvailableEnergyRead(ConstHandle2AvailableEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AvailableEnergyWrite(ConstHandle2ConstAvailableEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AvailableEnergyPrint(ConstHandle2ConstAvailableEnergy self); + +// +++ Print to standard output, as XML +extern_c int +AvailableEnergyPrintXML(ConstHandle2ConstAvailableEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +AvailableEnergyPrintJSON(ConstHandle2ConstAvailableEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AvailableEnergyXYs1dHas(ConstHandle2ConstAvailableEnergy self); + +// --- Get, const +extern_c Handle2ConstXYs1d +AvailableEnergyXYs1dGetConst(ConstHandle2ConstAvailableEnergy self); + +// +++ Get, non-const +extern_c Handle2XYs1d +AvailableEnergyXYs1dGet(ConstHandle2AvailableEnergy self); + +// +++ Set +extern_c void +AvailableEnergyXYs1dSet(ConstHandle2AvailableEnergy self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AvailableEnergyGridded1dHas(ConstHandle2ConstAvailableEnergy self); + +// --- Get, const +extern_c Handle2ConstGridded1d +AvailableEnergyGridded1dGetConst(ConstHandle2ConstAvailableEnergy self); + +// +++ Get, non-const +extern_c Handle2Gridded1d +AvailableEnergyGridded1dGet(ConstHandle2AvailableEnergy self); + +// +++ Set +extern_c void +AvailableEnergyGridded1dSet(ConstHandle2AvailableEnergy self, ConstHandle2ConstGridded1d gridded1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AvailableEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum.cpp new file mode 100644 index 000000000..a275f0843 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/processed/AvailableMomentum.hpp" +#include "AvailableMomentum.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AvailableMomentumClass; +using CPP = multigroup::AvailableMomentum; + +static const std::string CLASSNAME = "AvailableMomentum"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto gridded1d = [](auto &obj) { return &obj.gridded1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPGridded1d = containers::Gridded1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAvailableMomentum +AvailableMomentumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AvailableMomentum +AvailableMomentumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAvailableMomentum +AvailableMomentumCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d +) { + ConstHandle2AvailableMomentum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(gridded1d) + ); + return handle; +} + +// Create, general +Handle2AvailableMomentum +AvailableMomentumCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d +) { + ConstHandle2AvailableMomentum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(gridded1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AvailableMomentumAssign(ConstHandle2AvailableMomentum self, ConstHandle2ConstAvailableMomentum from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AvailableMomentumDelete(ConstHandle2ConstAvailableMomentum self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AvailableMomentumRead(ConstHandle2AvailableMomentum self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AvailableMomentumWrite(ConstHandle2ConstAvailableMomentum self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AvailableMomentumPrint(ConstHandle2ConstAvailableMomentum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AvailableMomentumPrintXML(ConstHandle2ConstAvailableMomentum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AvailableMomentumPrintJSON(ConstHandle2ConstAvailableMomentum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +AvailableMomentumXYs1dHas(ConstHandle2ConstAvailableMomentum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +AvailableMomentumXYs1dGetConst(ConstHandle2ConstAvailableMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +AvailableMomentumXYs1dGet(ConstHandle2AvailableMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +AvailableMomentumXYs1dSet(ConstHandle2AvailableMomentum self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// Has +int +AvailableMomentumGridded1dHas(ConstHandle2ConstAvailableMomentum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded1dHas", self, extract::gridded1d); +} + +// Get, const +Handle2ConstGridded1d +AvailableMomentumGridded1dGetConst(ConstHandle2ConstAvailableMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGetConst", self, extract::gridded1d); +} + +// Get, non-const +Handle2Gridded1d +AvailableMomentumGridded1dGet(ConstHandle2AvailableMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGet", self, extract::gridded1d); +} + +// Set +void +AvailableMomentumGridded1dSet(ConstHandle2AvailableMomentum self, ConstHandle2ConstGridded1d gridded1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded1dSet", self, extract::gridded1d, gridded1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AvailableMomentum/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum.h new file mode 100644 index 000000000..3617876a4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum.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. +// +// AvailableMomentum is the basic handle type in this file. Example: +// // Create a default AvailableMomentum object: +// AvailableMomentum handle = AvailableMomentumDefault(); +// Functions involving AvailableMomentum are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_PROCESSED_AVAILABLEMOMENTUM +#define C_INTERFACE_TEST_V2_0_PROCESSED_AVAILABLEMOMENTUM + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Gridded1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AvailableMomentumClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AvailableMomentum +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AvailableMomentumClass *AvailableMomentum; + +// --- Const-aware handles. +typedef const struct AvailableMomentumClass *const ConstHandle2ConstAvailableMomentum; +typedef struct AvailableMomentumClass *const ConstHandle2AvailableMomentum; +typedef const struct AvailableMomentumClass * Handle2ConstAvailableMomentum; +typedef struct AvailableMomentumClass * Handle2AvailableMomentum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAvailableMomentum +AvailableMomentumDefaultConst(); + +// +++ Create, default +extern_c Handle2AvailableMomentum +AvailableMomentumDefault(); + +// --- Create, general, const +extern_c Handle2ConstAvailableMomentum +AvailableMomentumCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d +); + +// +++ Create, general +extern_c Handle2AvailableMomentum +AvailableMomentumCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AvailableMomentumAssign(ConstHandle2AvailableMomentum self, ConstHandle2ConstAvailableMomentum from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AvailableMomentumDelete(ConstHandle2ConstAvailableMomentum self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AvailableMomentumRead(ConstHandle2AvailableMomentum self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AvailableMomentumWrite(ConstHandle2ConstAvailableMomentum self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AvailableMomentumPrint(ConstHandle2ConstAvailableMomentum self); + +// +++ Print to standard output, as XML +extern_c int +AvailableMomentumPrintXML(ConstHandle2ConstAvailableMomentum self); + +// +++ Print to standard output, as JSON +extern_c int +AvailableMomentumPrintJSON(ConstHandle2ConstAvailableMomentum self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AvailableMomentumXYs1dHas(ConstHandle2ConstAvailableMomentum self); + +// --- Get, const +extern_c Handle2ConstXYs1d +AvailableMomentumXYs1dGetConst(ConstHandle2ConstAvailableMomentum self); + +// +++ Get, non-const +extern_c Handle2XYs1d +AvailableMomentumXYs1dGet(ConstHandle2AvailableMomentum self); + +// +++ Set +extern_c void +AvailableMomentumXYs1dSet(ConstHandle2AvailableMomentum self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AvailableMomentumGridded1dHas(ConstHandle2ConstAvailableMomentum self); + +// --- Get, const +extern_c Handle2ConstGridded1d +AvailableMomentumGridded1dGetConst(ConstHandle2ConstAvailableMomentum self); + +// +++ Get, non-const +extern_c Handle2Gridded1d +AvailableMomentumGridded1dGet(ConstHandle2AvailableMomentum self); + +// +++ Set +extern_c void +AvailableMomentumGridded1dSet(ConstHandle2AvailableMomentum self, ConstHandle2ConstGridded1d gridded1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AvailableMomentum/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AvailableMomentum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy.cpp new file mode 100644 index 000000000..489d5368a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/processed/AverageProductEnergy.hpp" +#include "AverageProductEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto gridded1d = [](auto &obj) { return &obj.gridded1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPGridded1d = containers::Gridded1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageProductEnergy +AverageProductEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AverageProductEnergy +AverageProductEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAverageProductEnergy +AverageProductEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2AverageProductEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(gridded1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2AverageProductEnergy +AverageProductEnergyCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2AverageProductEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(gridded1d), + 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 +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); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductEnergyGridded1dHas(ConstHandle2ConstAverageProductEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded1dHas", self, extract::gridded1d); +} + +// Get, const +Handle2ConstGridded1d +AverageProductEnergyGridded1dGetConst(ConstHandle2ConstAverageProductEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGetConst", self, extract::gridded1d); +} + +// Get, non-const +Handle2Gridded1d +AverageProductEnergyGridded1dGet(ConstHandle2AverageProductEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGet", self, extract::gridded1d); +} + +// Set +void +AverageProductEnergyGridded1dSet(ConstHandle2AverageProductEnergy self, ConstHandle2ConstGridded1d gridded1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded1dSet", self, extract::gridded1d, gridded1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductEnergyRegions1dHas(ConstHandle2ConstAverageProductEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +AverageProductEnergyRegions1dGetConst(ConstHandle2ConstAverageProductEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +AverageProductEnergyRegions1dGet(ConstHandle2AverageProductEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +AverageProductEnergyRegions1dSet(ConstHandle2AverageProductEnergy self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AverageProductEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy.h new file mode 100644 index 000000000..07c90df51 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy.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. +// +// 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_TEST_V2_0_PROCESSED_AVERAGEPRODUCTENERGY +#define C_INTERFACE_TEST_V2_0_PROCESSED_AVERAGEPRODUCTENERGY + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Gridded1d.h" +#include "v2.0/containers/Regions1d.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 +extern_c Handle2AverageProductEnergy +AverageProductEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageProductEnergy +AverageProductEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2AverageProductEnergy +AverageProductEnergyCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d, + 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 +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); + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductEnergyGridded1dHas(ConstHandle2ConstAverageProductEnergy self); + +// --- Get, const +extern_c Handle2ConstGridded1d +AverageProductEnergyGridded1dGetConst(ConstHandle2ConstAverageProductEnergy self); + +// +++ Get, non-const +extern_c Handle2Gridded1d +AverageProductEnergyGridded1dGet(ConstHandle2AverageProductEnergy self); + +// +++ Set +extern_c void +AverageProductEnergyGridded1dSet(ConstHandle2AverageProductEnergy self, ConstHandle2ConstGridded1d gridded1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductEnergyRegions1dHas(ConstHandle2ConstAverageProductEnergy self); + +// --- Get, const +extern_c Handle2ConstRegions1d +AverageProductEnergyRegions1dGetConst(ConstHandle2ConstAverageProductEnergy self); + +// +++ Get, non-const +extern_c Handle2Regions1d +AverageProductEnergyRegions1dGet(ConstHandle2AverageProductEnergy self); + +// +++ Set +extern_c void +AverageProductEnergyRegions1dSet(ConstHandle2AverageProductEnergy self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AverageProductEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum.cpp new file mode 100644 index 000000000..33a6001b2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/processed/AverageProductMomentum.hpp" +#include "AverageProductMomentum.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AverageProductMomentumClass; +using CPP = multigroup::AverageProductMomentum; + +static const std::string CLASSNAME = "AverageProductMomentum"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto gridded1d = [](auto &obj) { return &obj.gridded1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPGridded1d = containers::Gridded1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageProductMomentum +AverageProductMomentumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AverageProductMomentum +AverageProductMomentumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAverageProductMomentum +AverageProductMomentumCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2AverageProductMomentum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(gridded1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2AverageProductMomentum +AverageProductMomentumCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2AverageProductMomentum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(gridded1d), + 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 +AverageProductMomentumAssign(ConstHandle2AverageProductMomentum self, ConstHandle2ConstAverageProductMomentum from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AverageProductMomentumDelete(ConstHandle2ConstAverageProductMomentum self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AverageProductMomentumRead(ConstHandle2AverageProductMomentum self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AverageProductMomentumWrite(ConstHandle2ConstAverageProductMomentum self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AverageProductMomentumPrint(ConstHandle2ConstAverageProductMomentum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AverageProductMomentumPrintXML(ConstHandle2ConstAverageProductMomentum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AverageProductMomentumPrintJSON(ConstHandle2ConstAverageProductMomentum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductMomentumXYs1dHas(ConstHandle2ConstAverageProductMomentum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +AverageProductMomentumXYs1dGetConst(ConstHandle2ConstAverageProductMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +AverageProductMomentumXYs1dGet(ConstHandle2AverageProductMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +AverageProductMomentumXYs1dSet(ConstHandle2AverageProductMomentum self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductMomentumGridded1dHas(ConstHandle2ConstAverageProductMomentum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded1dHas", self, extract::gridded1d); +} + +// Get, const +Handle2ConstGridded1d +AverageProductMomentumGridded1dGetConst(ConstHandle2ConstAverageProductMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGetConst", self, extract::gridded1d); +} + +// Get, non-const +Handle2Gridded1d +AverageProductMomentumGridded1dGet(ConstHandle2AverageProductMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGet", self, extract::gridded1d); +} + +// Set +void +AverageProductMomentumGridded1dSet(ConstHandle2AverageProductMomentum self, ConstHandle2ConstGridded1d gridded1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded1dSet", self, extract::gridded1d, gridded1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductMomentumRegions1dHas(ConstHandle2ConstAverageProductMomentum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +AverageProductMomentumRegions1dGetConst(ConstHandle2ConstAverageProductMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +AverageProductMomentumRegions1dGet(ConstHandle2AverageProductMomentum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +AverageProductMomentumRegions1dSet(ConstHandle2AverageProductMomentum self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AverageProductMomentum/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum.h new file mode 100644 index 000000000..62a0b1772 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum.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. +// +// AverageProductMomentum is the basic handle type in this file. Example: +// // Create a default AverageProductMomentum object: +// AverageProductMomentum handle = AverageProductMomentumDefault(); +// Functions involving AverageProductMomentum are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_PROCESSED_AVERAGEPRODUCTMOMENTUM +#define C_INTERFACE_TEST_V2_0_PROCESSED_AVERAGEPRODUCTMOMENTUM + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Gridded1d.h" +#include "v2.0/containers/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AverageProductMomentumClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AverageProductMomentum +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AverageProductMomentumClass *AverageProductMomentum; + +// --- Const-aware handles. +typedef const struct AverageProductMomentumClass *const ConstHandle2ConstAverageProductMomentum; +typedef struct AverageProductMomentumClass *const ConstHandle2AverageProductMomentum; +typedef const struct AverageProductMomentumClass * Handle2ConstAverageProductMomentum; +typedef struct AverageProductMomentumClass * Handle2AverageProductMomentum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAverageProductMomentum +AverageProductMomentumDefaultConst(); + +// +++ Create, default +extern_c Handle2AverageProductMomentum +AverageProductMomentumDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageProductMomentum +AverageProductMomentumCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2AverageProductMomentum +AverageProductMomentumCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstGridded1d gridded1d, + 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 +AverageProductMomentumAssign(ConstHandle2AverageProductMomentum self, ConstHandle2ConstAverageProductMomentum from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AverageProductMomentumDelete(ConstHandle2ConstAverageProductMomentum self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AverageProductMomentumRead(ConstHandle2AverageProductMomentum self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AverageProductMomentumWrite(ConstHandle2ConstAverageProductMomentum self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AverageProductMomentumPrint(ConstHandle2ConstAverageProductMomentum self); + +// +++ Print to standard output, as XML +extern_c int +AverageProductMomentumPrintXML(ConstHandle2ConstAverageProductMomentum self); + +// +++ Print to standard output, as JSON +extern_c int +AverageProductMomentumPrintJSON(ConstHandle2ConstAverageProductMomentum self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductMomentumXYs1dHas(ConstHandle2ConstAverageProductMomentum self); + +// --- Get, const +extern_c Handle2ConstXYs1d +AverageProductMomentumXYs1dGetConst(ConstHandle2ConstAverageProductMomentum self); + +// +++ Get, non-const +extern_c Handle2XYs1d +AverageProductMomentumXYs1dGet(ConstHandle2AverageProductMomentum self); + +// +++ Set +extern_c void +AverageProductMomentumXYs1dSet(ConstHandle2AverageProductMomentum self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductMomentumGridded1dHas(ConstHandle2ConstAverageProductMomentum self); + +// --- Get, const +extern_c Handle2ConstGridded1d +AverageProductMomentumGridded1dGetConst(ConstHandle2ConstAverageProductMomentum self); + +// +++ Get, non-const +extern_c Handle2Gridded1d +AverageProductMomentumGridded1dGet(ConstHandle2AverageProductMomentum self); + +// +++ Set +extern_c void +AverageProductMomentumGridded1dSet(ConstHandle2AverageProductMomentum self, ConstHandle2ConstGridded1d gridded1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductMomentumRegions1dHas(ConstHandle2ConstAverageProductMomentum self); + +// --- Get, const +extern_c Handle2ConstRegions1d +AverageProductMomentumRegions1dGetConst(ConstHandle2ConstAverageProductMomentum self); + +// +++ Get, non-const +extern_c Handle2Regions1d +AverageProductMomentumRegions1dGet(ConstHandle2AverageProductMomentum self); + +// +++ Set +extern_c void +AverageProductMomentumRegions1dSet(ConstHandle2AverageProductMomentum self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/AverageProductMomentum/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/processed/AverageProductMomentum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC.cpp new file mode 100644 index 000000000..46ecfff6f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/processed/EnergyAngularMC.hpp" +#include "EnergyAngularMC.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EnergyAngularMCClass; +using CPP = multigroup::EnergyAngularMC; + +static const std::string CLASSNAME = "EnergyAngularMC"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto energy = [](auto &obj) { return &obj.energy; }; + static auto energyAngular = [](auto &obj) { return &obj.energyAngular; }; +} + +using CPPEnergy = common::Energy; +using CPPEnergyAngular = transport::EnergyAngular; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergyAngularMC +EnergyAngularMCDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2EnergyAngularMC +EnergyAngularMCDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergyAngularMC +EnergyAngularMCCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstEnergyAngular energyAngular +) { + ConstHandle2EnergyAngularMC handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(energy), + detail::tocpp(energyAngular) + ); + return handle; +} + +// Create, general +Handle2EnergyAngularMC +EnergyAngularMCCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstEnergyAngular energyAngular +) { + ConstHandle2EnergyAngularMC handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(energy), + detail::tocpp(energyAngular) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EnergyAngularMCAssign(ConstHandle2EnergyAngularMC self, ConstHandle2ConstEnergyAngularMC from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EnergyAngularMCDelete(ConstHandle2ConstEnergyAngularMC self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EnergyAngularMCRead(ConstHandle2EnergyAngularMC self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EnergyAngularMCWrite(ConstHandle2ConstEnergyAngularMC self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EnergyAngularMCPrint(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EnergyAngularMCPrintXML(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EnergyAngularMCPrintJSON(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +EnergyAngularMCLabelHas(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +EnergyAngularMCLabelGet(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EnergyAngularMCLabelSet(ConstHandle2EnergyAngularMC self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +EnergyAngularMCProductFrameHas(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +XMLName +EnergyAngularMCProductFrameGet(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +EnergyAngularMCProductFrameSet(ConstHandle2EnergyAngularMC self, const XMLName productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// Has +int +EnergyAngularMCEnergyHas(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EnergyHas", self, extract::energy); +} + +// Get, const +Handle2ConstEnergy +EnergyAngularMCEnergyGetConst(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGetConst", self, extract::energy); +} + +// Get, non-const +Handle2Energy +EnergyAngularMCEnergyGet(ConstHandle2EnergyAngularMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGet", self, extract::energy); +} + +// Set +void +EnergyAngularMCEnergySet(ConstHandle2EnergyAngularMC self, ConstHandle2ConstEnergy energy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EnergySet", self, extract::energy, energy); +} + + +// ----------------------------------------------------------------------------- +// Child: energyAngular +// ----------------------------------------------------------------------------- + +// Has +int +EnergyAngularMCEnergyAngularHas(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EnergyAngularHas", self, extract::energyAngular); +} + +// Get, const +Handle2ConstEnergyAngular +EnergyAngularMCEnergyAngularGetConst(ConstHandle2ConstEnergyAngularMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyAngularGetConst", self, extract::energyAngular); +} + +// Get, non-const +Handle2EnergyAngular +EnergyAngularMCEnergyAngularGet(ConstHandle2EnergyAngularMC self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyAngularGet", self, extract::energyAngular); +} + +// Set +void +EnergyAngularMCEnergyAngularSet(ConstHandle2EnergyAngularMC self, ConstHandle2ConstEnergyAngular energyAngular) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EnergyAngularSet", self, extract::energyAngular, energyAngular); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/EnergyAngularMC/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC.h b/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC.h new file mode 100644 index 000000000..f8250a63e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC.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. +// +// EnergyAngularMC is the basic handle type in this file. Example: +// // Create a default EnergyAngularMC object: +// EnergyAngularMC handle = EnergyAngularMCDefault(); +// Functions involving EnergyAngularMC are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_PROCESSED_ENERGYANGULARMC +#define C_INTERFACE_TEST_V2_0_PROCESSED_ENERGYANGULARMC + +#include "GNDStk.h" +#include "v2.0/common/Energy.h" +#include "v2.0/transport/EnergyAngular.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EnergyAngularMCClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ EnergyAngularMC +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EnergyAngularMCClass *EnergyAngularMC; + +// --- Const-aware handles. +typedef const struct EnergyAngularMCClass *const ConstHandle2ConstEnergyAngularMC; +typedef struct EnergyAngularMCClass *const ConstHandle2EnergyAngularMC; +typedef const struct EnergyAngularMCClass * Handle2ConstEnergyAngularMC; +typedef struct EnergyAngularMCClass * Handle2EnergyAngularMC; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEnergyAngularMC +EnergyAngularMCDefaultConst(); + +// +++ Create, default +extern_c Handle2EnergyAngularMC +EnergyAngularMCDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergyAngularMC +EnergyAngularMCCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstEnergyAngular energyAngular +); + +// +++ Create, general +extern_c Handle2EnergyAngularMC +EnergyAngularMCCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstEnergyAngular energyAngular +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EnergyAngularMCAssign(ConstHandle2EnergyAngularMC self, ConstHandle2ConstEnergyAngularMC from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EnergyAngularMCDelete(ConstHandle2ConstEnergyAngularMC self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EnergyAngularMCRead(ConstHandle2EnergyAngularMC self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EnergyAngularMCWrite(ConstHandle2ConstEnergyAngularMC self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EnergyAngularMCPrint(ConstHandle2ConstEnergyAngularMC self); + +// +++ Print to standard output, as XML +extern_c int +EnergyAngularMCPrintXML(ConstHandle2ConstEnergyAngularMC self); + +// +++ Print to standard output, as JSON +extern_c int +EnergyAngularMCPrintJSON(ConstHandle2ConstEnergyAngularMC self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyAngularMCLabelHas(ConstHandle2ConstEnergyAngularMC self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyAngularMCLabelGet(ConstHandle2ConstEnergyAngularMC self); + +// +++ Set +extern_c void +EnergyAngularMCLabelSet(ConstHandle2EnergyAngularMC self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyAngularMCProductFrameHas(ConstHandle2ConstEnergyAngularMC self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyAngularMCProductFrameGet(ConstHandle2ConstEnergyAngularMC self); + +// +++ Set +extern_c void +EnergyAngularMCProductFrameSet(ConstHandle2EnergyAngularMC self, const XMLName productFrame); + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyAngularMCEnergyHas(ConstHandle2ConstEnergyAngularMC self); + +// --- Get, const +extern_c Handle2ConstEnergy +EnergyAngularMCEnergyGetConst(ConstHandle2ConstEnergyAngularMC self); + +// +++ Get, non-const +extern_c Handle2Energy +EnergyAngularMCEnergyGet(ConstHandle2EnergyAngularMC self); + +// +++ Set +extern_c void +EnergyAngularMCEnergySet(ConstHandle2EnergyAngularMC self, ConstHandle2ConstEnergy energy); + + +// ----------------------------------------------------------------------------- +// Child: energyAngular +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyAngularMCEnergyAngularHas(ConstHandle2ConstEnergyAngularMC self); + +// --- Get, const +extern_c Handle2ConstEnergyAngular +EnergyAngularMCEnergyAngularGetConst(ConstHandle2ConstEnergyAngularMC self); + +// +++ Get, non-const +extern_c Handle2EnergyAngular +EnergyAngularMCEnergyAngularGet(ConstHandle2EnergyAngularMC self); + +// +++ Set +extern_c void +EnergyAngularMCEnergyAngularSet(ConstHandle2EnergyAngularMC self, ConstHandle2ConstEnergyAngular energyAngular); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/EnergyAngularMC/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/processed/EnergyAngularMC/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d.cpp new file mode 100644 index 000000000..a7488d60a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/processed/MultiGroup3d.hpp" +#include "MultiGroup3d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MultiGroup3dClass; +using CPP = multigroup::MultiGroup3d; + +static const std::string CLASSNAME = "MultiGroup3d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto gridded3d = [](auto &obj) { return &obj.gridded3d; }; +} + +using CPPGridded3d = containers::Gridded3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultiGroup3d +MultiGroup3dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2MultiGroup3d +MultiGroup3dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMultiGroup3d +MultiGroup3dCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstGridded3d gridded3d +) { + ConstHandle2MultiGroup3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(gridded3d) + ); + return handle; +} + +// Create, general +Handle2MultiGroup3d +MultiGroup3dCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstGridded3d gridded3d +) { + ConstHandle2MultiGroup3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(gridded3d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MultiGroup3dAssign(ConstHandle2MultiGroup3d self, ConstHandle2ConstMultiGroup3d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MultiGroup3dDelete(ConstHandle2ConstMultiGroup3d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MultiGroup3dRead(ConstHandle2MultiGroup3d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MultiGroup3dWrite(ConstHandle2ConstMultiGroup3d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MultiGroup3dPrint(ConstHandle2ConstMultiGroup3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MultiGroup3dPrintXML(ConstHandle2ConstMultiGroup3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MultiGroup3dPrintJSON(ConstHandle2ConstMultiGroup3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +MultiGroup3dLabelHas(ConstHandle2ConstMultiGroup3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +MultiGroup3dLabelGet(ConstHandle2ConstMultiGroup3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MultiGroup3dLabelSet(ConstHandle2MultiGroup3d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +MultiGroup3dProductFrameHas(ConstHandle2ConstMultiGroup3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +XMLName +MultiGroup3dProductFrameGet(ConstHandle2ConstMultiGroup3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +MultiGroup3dProductFrameSet(ConstHandle2MultiGroup3d self, const XMLName productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded3d +// ----------------------------------------------------------------------------- + +// Has +int +MultiGroup3dGridded3dHas(ConstHandle2ConstMultiGroup3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded3dHas", self, extract::gridded3d); +} + +// Get, const +Handle2ConstGridded3d +MultiGroup3dGridded3dGetConst(ConstHandle2ConstMultiGroup3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded3dGetConst", self, extract::gridded3d); +} + +// Get, non-const +Handle2Gridded3d +MultiGroup3dGridded3dGet(ConstHandle2MultiGroup3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded3dGet", self, extract::gridded3d); +} + +// Set +void +MultiGroup3dGridded3dSet(ConstHandle2MultiGroup3d self, ConstHandle2ConstGridded3d gridded3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded3dSet", self, extract::gridded3d, gridded3d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/MultiGroup3d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d.h b/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d.h new file mode 100644 index 000000000..7af5cb022 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d.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. +// +// MultiGroup3d is the basic handle type in this file. Example: +// // Create a default MultiGroup3d object: +// MultiGroup3d handle = MultiGroup3dDefault(); +// Functions involving MultiGroup3d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_PROCESSED_MULTIGROUP3D +#define C_INTERFACE_TEST_V2_0_PROCESSED_MULTIGROUP3D + +#include "GNDStk.h" +#include "v2.0/containers/Gridded3d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MultiGroup3dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ MultiGroup3d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MultiGroup3dClass *MultiGroup3d; + +// --- Const-aware handles. +typedef const struct MultiGroup3dClass *const ConstHandle2ConstMultiGroup3d; +typedef struct MultiGroup3dClass *const ConstHandle2MultiGroup3d; +typedef const struct MultiGroup3dClass * Handle2ConstMultiGroup3d; +typedef struct MultiGroup3dClass * Handle2MultiGroup3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMultiGroup3d +MultiGroup3dDefaultConst(); + +// +++ Create, default +extern_c Handle2MultiGroup3d +MultiGroup3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiGroup3d +MultiGroup3dCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstGridded3d gridded3d +); + +// +++ Create, general +extern_c Handle2MultiGroup3d +MultiGroup3dCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstGridded3d gridded3d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MultiGroup3dAssign(ConstHandle2MultiGroup3d self, ConstHandle2ConstMultiGroup3d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MultiGroup3dDelete(ConstHandle2ConstMultiGroup3d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MultiGroup3dRead(ConstHandle2MultiGroup3d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MultiGroup3dWrite(ConstHandle2ConstMultiGroup3d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MultiGroup3dPrint(ConstHandle2ConstMultiGroup3d self); + +// +++ Print to standard output, as XML +extern_c int +MultiGroup3dPrintXML(ConstHandle2ConstMultiGroup3d self); + +// +++ Print to standard output, as JSON +extern_c int +MultiGroup3dPrintJSON(ConstHandle2ConstMultiGroup3d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiGroup3dLabelHas(ConstHandle2ConstMultiGroup3d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MultiGroup3dLabelGet(ConstHandle2ConstMultiGroup3d self); + +// +++ Set +extern_c void +MultiGroup3dLabelSet(ConstHandle2MultiGroup3d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiGroup3dProductFrameHas(ConstHandle2ConstMultiGroup3d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MultiGroup3dProductFrameGet(ConstHandle2ConstMultiGroup3d self); + +// +++ Set +extern_c void +MultiGroup3dProductFrameSet(ConstHandle2MultiGroup3d self, const XMLName productFrame); + + +// ----------------------------------------------------------------------------- +// Child: gridded3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiGroup3dGridded3dHas(ConstHandle2ConstMultiGroup3d self); + +// --- Get, const +extern_c Handle2ConstGridded3d +MultiGroup3dGridded3dGetConst(ConstHandle2ConstMultiGroup3d self); + +// +++ Get, non-const +extern_c Handle2Gridded3d +MultiGroup3dGridded3dGet(ConstHandle2MultiGroup3d self); + +// +++ Set +extern_c void +MultiGroup3dGridded3dSet(ConstHandle2MultiGroup3d self, ConstHandle2ConstGridded3d gridded3d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/processed/MultiGroup3d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/processed/MultiGroup3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner.cpp new file mode 100644 index 000000000..97d199015 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner.cpp @@ -0,0 +1,450 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/BreitWigner.hpp" +#include "BreitWigner.h" + +using namespace njoy::GNDStk; +using namespace test::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 useForSelfShieldingOnly = [](auto &obj) { return &obj.useForSelfShieldingOnly; }; + static auto PoPs_database = [](auto &obj) { return &obj.PoPs_database; }; + static auto scatteringRadius = [](auto &obj) { return &obj.scatteringRadius; }; + static auto hardSphereRadius = [](auto &obj) { return &obj.hardSphereRadius; }; + static auto resonanceParameters = [](auto &obj) { return &obj.resonanceParameters; }; +} + +using CPPPoPs_database = pops::PoPs_database; +using CPPScatteringRadius = resonances::ScatteringRadius; +using CPPHardSphereRadius = resonances::HardSphereRadius; +using CPPResonanceParameters = resonances::ResonanceParameters; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBreitWigner +BreitWignerDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2BreitWigner +BreitWignerDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBreitWigner +BreitWignerCreateConst( + const XMLName label, + const XMLName approximation, + const bool calculateChannelRadius, + const bool useForSelfShieldingOnly, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstResonanceParameters resonanceParameters +) { + ConstHandle2BreitWigner handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + approximation, + calculateChannelRadius, + useForSelfShieldingOnly, + detail::tocpp(PoPs_database), + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius), + detail::tocpp(resonanceParameters) + ); + return handle; +} + +// Create, general +Handle2BreitWigner +BreitWignerCreate( + const XMLName label, + const XMLName approximation, + const bool calculateChannelRadius, + const bool useForSelfShieldingOnly, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstResonanceParameters resonanceParameters +) { + ConstHandle2BreitWigner handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + approximation, + calculateChannelRadius, + useForSelfShieldingOnly, + detail::tocpp(PoPs_database), + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius), + 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 +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 +XMLName +BreitWignerLabelGet(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +BreitWignerLabelSet(ConstHandle2BreitWigner self, const XMLName 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 +XMLName +BreitWignerApproximationGet(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ApproximationGet", self, extract::approximation); +} + +// Set +void +BreitWignerApproximationSet(ConstHandle2BreitWigner self, const XMLName 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); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: useForSelfShieldingOnly +// ----------------------------------------------------------------------------- + +// Has +int +BreitWignerUseForSelfShieldingOnlyHas(ConstHandle2ConstBreitWigner self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UseForSelfShieldingOnlyHas", self, extract::useForSelfShieldingOnly); +} + +// Get +// Returns by value +bool +BreitWignerUseForSelfShieldingOnlyGet(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UseForSelfShieldingOnlyGet", self, extract::useForSelfShieldingOnly); +} + +// Set +void +BreitWignerUseForSelfShieldingOnlySet(ConstHandle2BreitWigner self, const bool useForSelfShieldingOnly) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UseForSelfShieldingOnlySet", self, extract::useForSelfShieldingOnly, useForSelfShieldingOnly); +} + + +// ----------------------------------------------------------------------------- +// Child: PoPs_database +// ----------------------------------------------------------------------------- + +// Has +int +BreitWignerPoPs_databaseHas(ConstHandle2ConstBreitWigner self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PoPs_databaseHas", self, extract::PoPs_database); +} + +// Get, const +Handle2ConstPoPs_database +BreitWignerPoPs_databaseGetConst(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPs_databaseGetConst", self, extract::PoPs_database); +} + +// Get, non-const +Handle2PoPs_database +BreitWignerPoPs_databaseGet(ConstHandle2BreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPs_databaseGet", self, extract::PoPs_database); +} + +// Set +void +BreitWignerPoPs_databaseSet(ConstHandle2BreitWigner self, ConstHandle2ConstPoPs_database PoPs_database) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PoPs_databaseSet", self, extract::PoPs_database, PoPs_database); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Child: hardSphereRadius +// ----------------------------------------------------------------------------- + +// Has +int +BreitWignerHardSphereRadiusHas(ConstHandle2ConstBreitWigner self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HardSphereRadiusHas", self, extract::hardSphereRadius); +} + +// Get, const +Handle2ConstHardSphereRadius +BreitWignerHardSphereRadiusGetConst(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGetConst", self, extract::hardSphereRadius); +} + +// Get, non-const +Handle2HardSphereRadius +BreitWignerHardSphereRadiusGet(ConstHandle2BreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGet", self, extract::hardSphereRadius); +} + +// Set +void +BreitWignerHardSphereRadiusSet(ConstHandle2BreitWigner self, ConstHandle2ConstHardSphereRadius hardSphereRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HardSphereRadiusSet", self, extract::hardSphereRadius, hardSphereRadius); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/BreitWigner/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner.h new file mode 100644 index 000000000..e4dd2b04a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner.h @@ -0,0 +1,313 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_BREITWIGNER +#define C_INTERFACE_TEST_V2_0_RESONANCES_BREITWIGNER + +#include "GNDStk.h" +#include "v2.0/pops/PoPs_database.h" +#include "v2.0/resonances/ScatteringRadius.h" +#include "v2.0/resonances/HardSphereRadius.h" +#include "v2.0/resonances/ResonanceParameters.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 +extern_c Handle2BreitWigner +BreitWignerDefault(); + +// --- Create, general, const +extern_c Handle2ConstBreitWigner +BreitWignerCreateConst( + const XMLName label, + const XMLName approximation, + const bool calculateChannelRadius, + const bool useForSelfShieldingOnly, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstResonanceParameters resonanceParameters +); + +// +++ Create, general +extern_c Handle2BreitWigner +BreitWignerCreate( + const XMLName label, + const XMLName approximation, + const bool calculateChannelRadius, + const bool useForSelfShieldingOnly, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + 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 +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 XMLName +BreitWignerLabelGet(ConstHandle2ConstBreitWigner self); + +// +++ Set +extern_c void +BreitWignerLabelSet(ConstHandle2BreitWigner self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: approximation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerApproximationHas(ConstHandle2ConstBreitWigner self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BreitWignerApproximationGet(ConstHandle2ConstBreitWigner self); + +// +++ Set +extern_c void +BreitWignerApproximationSet(ConstHandle2BreitWigner self, const XMLName 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: useForSelfShieldingOnly +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerUseForSelfShieldingOnlyHas(ConstHandle2ConstBreitWigner self); + +// +++ Get +// +++ Returns by value +extern_c bool +BreitWignerUseForSelfShieldingOnlyGet(ConstHandle2ConstBreitWigner self); + +// +++ Set +extern_c void +BreitWignerUseForSelfShieldingOnlySet(ConstHandle2BreitWigner self, const bool useForSelfShieldingOnly); + + +// ----------------------------------------------------------------------------- +// Child: PoPs_database +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerPoPs_databaseHas(ConstHandle2ConstBreitWigner self); + +// --- Get, const +extern_c Handle2ConstPoPs_database +BreitWignerPoPs_databaseGetConst(ConstHandle2ConstBreitWigner self); + +// +++ Get, non-const +extern_c Handle2PoPs_database +BreitWignerPoPs_databaseGet(ConstHandle2BreitWigner self); + +// +++ Set +extern_c void +BreitWignerPoPs_databaseSet(ConstHandle2BreitWigner self, ConstHandle2ConstPoPs_database PoPs_database); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Child: hardSphereRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerHardSphereRadiusHas(ConstHandle2ConstBreitWigner self); + +// --- Get, const +extern_c Handle2ConstHardSphereRadius +BreitWignerHardSphereRadiusGetConst(ConstHandle2ConstBreitWigner self); + +// +++ Get, non-const +extern_c Handle2HardSphereRadius +BreitWignerHardSphereRadiusGet(ConstHandle2BreitWigner self); + +// +++ Set +extern_c void +BreitWignerHardSphereRadiusSet(ConstHandle2BreitWigner self, ConstHandle2ConstHardSphereRadius hardSphereRadius); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/BreitWigner/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/BreitWigner/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel.cpp new file mode 100644 index 000000000..9fb715935 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel.cpp @@ -0,0 +1,477 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/Channel.hpp" +#include "Channel.h" + +using namespace njoy::GNDStk; +using namespace test::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 boundaryConditionValue = [](auto &obj) { return &obj.boundaryConditionValue; }; + static auto columnIndex = [](auto &obj) { return &obj.columnIndex; }; + static auto externalRMatrix = [](auto &obj) { return &obj.externalRMatrix; }; + static auto scatteringRadius = [](auto &obj) { return &obj.scatteringRadius; }; + static auto hardSphereRadius = [](auto &obj) { return &obj.hardSphereRadius; }; +} + +using CPPExternalRMatrix = resonances::ExternalRMatrix; +using CPPScatteringRadius = resonances::ScatteringRadius; +using CPPHardSphereRadius = resonances::HardSphereRadius; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChannel +ChannelDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Channel +ChannelDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstChannel +ChannelCreateConst( + const XMLName label, + const char *const resonanceReaction, + const Integer32 L, + const Fraction32 channelSpin, + const Float64 boundaryConditionValue, + const Integer32 columnIndex, + ConstHandle2ConstExternalRMatrix externalRMatrix, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius +) { + ConstHandle2Channel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + resonanceReaction, + L, + channelSpin, + boundaryConditionValue, + columnIndex, + detail::tocpp(externalRMatrix), + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius) + ); + return handle; +} + +// Create, general +Handle2Channel +ChannelCreate( + const XMLName label, + const char *const resonanceReaction, + const Integer32 L, + const Fraction32 channelSpin, + const Float64 boundaryConditionValue, + const Integer32 columnIndex, + ConstHandle2ConstExternalRMatrix externalRMatrix, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius +) { + ConstHandle2Channel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + resonanceReaction, + L, + channelSpin, + boundaryConditionValue, + columnIndex, + detail::tocpp(externalRMatrix), + 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 +XMLName +ChannelLabelGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ChannelLabelSet(ConstHandle2Channel self, const XMLName 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 +Integer32 +ChannelLGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LGet", self, extract::L); +} + +// Set +void +ChannelLSet(ConstHandle2Channel self, const Integer32 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 +Fraction32 +ChannelChannelSpinGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChannelSpinGet", self, extract::channelSpin); +} + +// Set +void +ChannelChannelSpinSet(ConstHandle2Channel self, const Fraction32 channelSpin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChannelSpinSet", self, extract::channelSpin, channelSpin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: boundaryConditionValue +// ----------------------------------------------------------------------------- + +// Has +int +ChannelBoundaryConditionValueHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BoundaryConditionValueHas", self, extract::boundaryConditionValue); +} + +// Get +// Returns by value +Float64 +ChannelBoundaryConditionValueGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BoundaryConditionValueGet", self, extract::boundaryConditionValue); +} + +// Set +void +ChannelBoundaryConditionValueSet(ConstHandle2Channel self, const Float64 boundaryConditionValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BoundaryConditionValueSet", self, extract::boundaryConditionValue, boundaryConditionValue); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: columnIndex +// ----------------------------------------------------------------------------- + +// Has +int +ChannelColumnIndexHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ColumnIndexHas", self, extract::columnIndex); +} + +// Get +// Returns by value +Integer32 +ChannelColumnIndexGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnIndexGet", self, extract::columnIndex); +} + +// Set +void +ChannelColumnIndexSet(ConstHandle2Channel self, const Integer32 columnIndex) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ColumnIndexSet", self, extract::columnIndex, columnIndex); +} + + +// ----------------------------------------------------------------------------- +// Child: externalRMatrix +// ----------------------------------------------------------------------------- + +// Has +int +ChannelExternalRMatrixHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ExternalRMatrixHas", self, extract::externalRMatrix); +} + +// Get, const +Handle2ConstExternalRMatrix +ChannelExternalRMatrixGetConst(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExternalRMatrixGetConst", self, extract::externalRMatrix); +} + +// Get, non-const +Handle2ExternalRMatrix +ChannelExternalRMatrixGet(ConstHandle2Channel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExternalRMatrixGet", self, extract::externalRMatrix); +} + +// Set +void +ChannelExternalRMatrixSet(ConstHandle2Channel self, ConstHandle2ConstExternalRMatrix externalRMatrix) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ExternalRMatrixSet", self, extract::externalRMatrix, externalRMatrix); +} + + +// ----------------------------------------------------------------------------- +// 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/resonances/Channel/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel.h new file mode 100644 index 000000000..7c9376af1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel.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. +// +// 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_TEST_V2_0_RESONANCES_CHANNEL +#define C_INTERFACE_TEST_V2_0_RESONANCES_CHANNEL + +#include "GNDStk.h" +#include "v2.0/resonances/ExternalRMatrix.h" +#include "v2.0/resonances/ScatteringRadius.h" +#include "v2.0/resonances/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 +extern_c Handle2Channel +ChannelDefault(); + +// --- Create, general, const +extern_c Handle2ConstChannel +ChannelCreateConst( + const XMLName label, + const char *const resonanceReaction, + const Integer32 L, + const Fraction32 channelSpin, + const Float64 boundaryConditionValue, + const Integer32 columnIndex, + ConstHandle2ConstExternalRMatrix externalRMatrix, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius +); + +// +++ Create, general +extern_c Handle2Channel +ChannelCreate( + const XMLName label, + const char *const resonanceReaction, + const Integer32 L, + const Fraction32 channelSpin, + const Float64 boundaryConditionValue, + const Integer32 columnIndex, + ConstHandle2ConstExternalRMatrix externalRMatrix, + 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 XMLName +ChannelLabelGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelLabelSet(ConstHandle2Channel self, const XMLName 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 Integer32 +ChannelLGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelLSet(ConstHandle2Channel self, const Integer32 L); + + +// ----------------------------------------------------------------------------- +// Metadatum: channelSpin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelChannelSpinHas(ConstHandle2ConstChannel self); + +// +++ Get +// +++ Returns by value +extern_c Fraction32 +ChannelChannelSpinGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelChannelSpinSet(ConstHandle2Channel self, const Fraction32 channelSpin); + + +// ----------------------------------------------------------------------------- +// Metadatum: boundaryConditionValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelBoundaryConditionValueHas(ConstHandle2ConstChannel self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +ChannelBoundaryConditionValueGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelBoundaryConditionValueSet(ConstHandle2Channel self, const Float64 boundaryConditionValue); + + +// ----------------------------------------------------------------------------- +// Metadatum: columnIndex +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelColumnIndexHas(ConstHandle2ConstChannel self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ChannelColumnIndexGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelColumnIndexSet(ConstHandle2Channel self, const Integer32 columnIndex); + + +// ----------------------------------------------------------------------------- +// Child: externalRMatrix +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelExternalRMatrixHas(ConstHandle2ConstChannel self); + +// --- Get, const +extern_c Handle2ConstExternalRMatrix +ChannelExternalRMatrixGetConst(ConstHandle2ConstChannel self); + +// +++ Get, non-const +extern_c Handle2ExternalRMatrix +ChannelExternalRMatrixGet(ConstHandle2Channel self); + +// +++ Set +extern_c void +ChannelExternalRMatrixSet(ConstHandle2Channel self, ConstHandle2ConstExternalRMatrix externalRMatrix); + + +// ----------------------------------------------------------------------------- +// 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/resonances/Channel/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels.cpp new file mode 100644 index 000000000..01451683f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels.cpp @@ -0,0 +1,482 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/Channels.hpp" +#include "Channels.h" + +using namespace njoy::GNDStk; +using namespace test::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 = resonances::Channel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChannels +ChannelsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +ChannelsChannelHasByLabel( + ConstHandle2ConstChannels self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByLabel", + self, extract::channel, meta::label, label); +} + +// Get, by label, const +Handle2ConstChannel +ChannelsChannelGetByLabelConst( + ConstHandle2ConstChannels self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByLabelConst", + self, extract::channel, meta::label, label); +} + +// Get, by label, non-const +Handle2Channel +ChannelsChannelGetByLabel( + ConstHandle2Channels self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByLabel", + self, extract::channel, meta::label, label); +} + +// Set, by label +void +ChannelsChannelSetByLabel( + ConstHandle2Channels self, + const XMLName label, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByLabel", + self, extract::channel, meta::label, label, channel); +} + +// 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); +} + +// Has, by L +int +ChannelsChannelHasByL( + ConstHandle2ConstChannels self, + const Integer32 L +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByL", + self, extract::channel, meta::L, L); +} + +// Get, by L, const +Handle2ConstChannel +ChannelsChannelGetByLConst( + ConstHandle2ConstChannels self, + const Integer32 L +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByLConst", + self, extract::channel, meta::L, L); +} + +// Get, by L, non-const +Handle2Channel +ChannelsChannelGetByL( + ConstHandle2Channels self, + const Integer32 L +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByL", + self, extract::channel, meta::L, L); +} + +// Set, by L +void +ChannelsChannelSetByL( + ConstHandle2Channels self, + const Integer32 L, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByL", + self, extract::channel, meta::L, L, channel); +} + +// Has, by channelSpin +int +ChannelsChannelHasByChannelSpin( + ConstHandle2ConstChannels self, + const Fraction32 channelSpin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByChannelSpin", + self, extract::channel, meta::channelSpin, channelSpin); +} + +// Get, by channelSpin, const +Handle2ConstChannel +ChannelsChannelGetByChannelSpinConst( + ConstHandle2ConstChannels self, + const Fraction32 channelSpin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByChannelSpinConst", + self, extract::channel, meta::channelSpin, channelSpin); +} + +// Get, by channelSpin, non-const +Handle2Channel +ChannelsChannelGetByChannelSpin( + ConstHandle2Channels self, + const Fraction32 channelSpin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByChannelSpin", + self, extract::channel, meta::channelSpin, channelSpin); +} + +// Set, by channelSpin +void +ChannelsChannelSetByChannelSpin( + ConstHandle2Channels self, + const Fraction32 channelSpin, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByChannelSpin", + self, extract::channel, meta::channelSpin, channelSpin, channel); +} + +// Has, by boundaryConditionValue +int +ChannelsChannelHasByBoundaryConditionValue( + ConstHandle2ConstChannels self, + const Float64 boundaryConditionValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByBoundaryConditionValue", + self, extract::channel, meta::boundaryConditionValue, boundaryConditionValue); +} + +// Get, by boundaryConditionValue, const +Handle2ConstChannel +ChannelsChannelGetByBoundaryConditionValueConst( + ConstHandle2ConstChannels self, + const Float64 boundaryConditionValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByBoundaryConditionValueConst", + self, extract::channel, meta::boundaryConditionValue, boundaryConditionValue); +} + +// Get, by boundaryConditionValue, non-const +Handle2Channel +ChannelsChannelGetByBoundaryConditionValue( + ConstHandle2Channels self, + const Float64 boundaryConditionValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByBoundaryConditionValue", + self, extract::channel, meta::boundaryConditionValue, boundaryConditionValue); +} + +// Set, by boundaryConditionValue +void +ChannelsChannelSetByBoundaryConditionValue( + ConstHandle2Channels self, + const Float64 boundaryConditionValue, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByBoundaryConditionValue", + self, extract::channel, meta::boundaryConditionValue, boundaryConditionValue, channel); +} + +// Has, by columnIndex +int +ChannelsChannelHasByColumnIndex( + ConstHandle2ConstChannels self, + const Integer32 columnIndex +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByColumnIndex", + self, extract::channel, meta::columnIndex, columnIndex); +} + +// Get, by columnIndex, const +Handle2ConstChannel +ChannelsChannelGetByColumnIndexConst( + ConstHandle2ConstChannels self, + const Integer32 columnIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByColumnIndexConst", + self, extract::channel, meta::columnIndex, columnIndex); +} + +// Get, by columnIndex, non-const +Handle2Channel +ChannelsChannelGetByColumnIndex( + ConstHandle2Channels self, + const Integer32 columnIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByColumnIndex", + self, extract::channel, meta::columnIndex, columnIndex); +} + +// Set, by columnIndex +void +ChannelsChannelSetByColumnIndex( + ConstHandle2Channels self, + const Integer32 columnIndex, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByColumnIndex", + self, extract::channel, meta::columnIndex, columnIndex, channel); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Channels/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels.h new file mode 100644 index 000000000..8699b42e7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels.h @@ -0,0 +1,351 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_CHANNELS +#define C_INTERFACE_TEST_V2_0_RESONANCES_CHANNELS + +#include "GNDStk.h" +#include "v2.0/resonances/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 +extern_c Handle2Channels +ChannelsDefault(); + +// --- Create, general, const +extern_c Handle2ConstChannels +ChannelsCreateConst( + ConstHandle2Channel *const channel, const size_t channelSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +ChannelsChannelHasByLabel( + ConstHandle2ConstChannels self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstChannel +ChannelsChannelGetByLabelConst( + ConstHandle2ConstChannels self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Channel +ChannelsChannelGetByLabel( + ConstHandle2Channels self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ChannelsChannelSetByLabel( + ConstHandle2Channels self, + const XMLName label, + ConstHandle2ConstChannel channel +); + +// +++ 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 +); + +// +++ Has, by L +extern_c int +ChannelsChannelHasByL( + ConstHandle2ConstChannels self, + const Integer32 L +); + +// --- Get, by L, const +extern_c Handle2ConstChannel +ChannelsChannelGetByLConst( + ConstHandle2ConstChannels self, + const Integer32 L +); + +// +++ Get, by L, non-const +extern_c Handle2Channel +ChannelsChannelGetByL( + ConstHandle2Channels self, + const Integer32 L +); + +// +++ Set, by L +extern_c void +ChannelsChannelSetByL( + ConstHandle2Channels self, + const Integer32 L, + ConstHandle2ConstChannel channel +); + +// +++ Has, by channelSpin +extern_c int +ChannelsChannelHasByChannelSpin( + ConstHandle2ConstChannels self, + const Fraction32 channelSpin +); + +// --- Get, by channelSpin, const +extern_c Handle2ConstChannel +ChannelsChannelGetByChannelSpinConst( + ConstHandle2ConstChannels self, + const Fraction32 channelSpin +); + +// +++ Get, by channelSpin, non-const +extern_c Handle2Channel +ChannelsChannelGetByChannelSpin( + ConstHandle2Channels self, + const Fraction32 channelSpin +); + +// +++ Set, by channelSpin +extern_c void +ChannelsChannelSetByChannelSpin( + ConstHandle2Channels self, + const Fraction32 channelSpin, + ConstHandle2ConstChannel channel +); + +// +++ Has, by boundaryConditionValue +extern_c int +ChannelsChannelHasByBoundaryConditionValue( + ConstHandle2ConstChannels self, + const Float64 boundaryConditionValue +); + +// --- Get, by boundaryConditionValue, const +extern_c Handle2ConstChannel +ChannelsChannelGetByBoundaryConditionValueConst( + ConstHandle2ConstChannels self, + const Float64 boundaryConditionValue +); + +// +++ Get, by boundaryConditionValue, non-const +extern_c Handle2Channel +ChannelsChannelGetByBoundaryConditionValue( + ConstHandle2Channels self, + const Float64 boundaryConditionValue +); + +// +++ Set, by boundaryConditionValue +extern_c void +ChannelsChannelSetByBoundaryConditionValue( + ConstHandle2Channels self, + const Float64 boundaryConditionValue, + ConstHandle2ConstChannel channel +); + +// +++ Has, by columnIndex +extern_c int +ChannelsChannelHasByColumnIndex( + ConstHandle2ConstChannels self, + const Integer32 columnIndex +); + +// --- Get, by columnIndex, const +extern_c Handle2ConstChannel +ChannelsChannelGetByColumnIndexConst( + ConstHandle2ConstChannels self, + const Integer32 columnIndex +); + +// +++ Get, by columnIndex, non-const +extern_c Handle2Channel +ChannelsChannelGetByColumnIndex( + ConstHandle2Channels self, + const Integer32 columnIndex +); + +// +++ Set, by columnIndex +extern_c void +ChannelsChannelSetByColumnIndex( + ConstHandle2Channels self, + const Integer32 columnIndex, + ConstHandle2ConstChannel channel +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Channels/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Channels/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval.cpp new file mode 100644 index 000000000..9b9715be7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval.cpp @@ -0,0 +1,280 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/EnergyInterval.hpp" +#include "EnergyInterval.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EnergyIntervalClass; +using CPP = multigroup::EnergyInterval; + +static const std::string CLASSNAME = "EnergyInterval"; + +namespace extract { + static auto index = [](auto &obj) { return &obj.index; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto domainUnit = [](auto &obj) { return &obj.domainUnit; }; +} + +using CPPRMatrix = resonances::RMatrix; +using CPPBreitWigner = resonances::BreitWigner; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergyInterval +EnergyIntervalDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2EnergyInterval +EnergyIntervalDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergyInterval +EnergyIntervalCreateConst( + const Integer32 index, + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, +) { + ConstHandle2EnergyInterval handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + domainMin, + domainMax, + domainUnit + ); + return handle; +} + +// Create, general +Handle2EnergyInterval +EnergyIntervalCreate( + const Integer32 index, + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, +) { + ConstHandle2EnergyInterval handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + 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 +EnergyIntervalAssign(ConstHandle2EnergyInterval self, ConstHandle2ConstEnergyInterval from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EnergyIntervalDelete(ConstHandle2ConstEnergyInterval self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EnergyIntervalRead(ConstHandle2EnergyInterval self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EnergyIntervalWrite(ConstHandle2ConstEnergyInterval self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EnergyIntervalPrint(ConstHandle2ConstEnergyInterval self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EnergyIntervalPrintXML(ConstHandle2ConstEnergyInterval self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EnergyIntervalPrintJSON(ConstHandle2ConstEnergyInterval self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +EnergyIntervalIndexHas(ConstHandle2ConstEnergyInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +Integer32 +EnergyIntervalIndexGet(ConstHandle2ConstEnergyInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +EnergyIntervalIndexSet(ConstHandle2EnergyInterval self, const Integer32 index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +EnergyIntervalDomainMinHas(ConstHandle2ConstEnergyInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +Float64 +EnergyIntervalDomainMinGet(ConstHandle2ConstEnergyInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +EnergyIntervalDomainMinSet(ConstHandle2EnergyInterval self, const Float64 domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +EnergyIntervalDomainMaxHas(ConstHandle2ConstEnergyInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +Float64 +EnergyIntervalDomainMaxGet(ConstHandle2ConstEnergyInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +EnergyIntervalDomainMaxSet(ConstHandle2EnergyInterval self, const Float64 domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// Has +int +EnergyIntervalDomainUnitHas(ConstHandle2ConstEnergyInterval self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainUnitHas", self, extract::domainUnit); +} + +// Get +// Returns by value +XMLName +EnergyIntervalDomainUnitGet(ConstHandle2ConstEnergyInterval self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainUnitGet", self, extract::domainUnit); +} + +// Set +void +EnergyIntervalDomainUnitSet(ConstHandle2EnergyInterval self, const XMLName domainUnit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainUnitSet", self, extract::domainUnit, domainUnit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/EnergyInterval/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval.h new file mode 100644 index 000000000..d205fd929 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval.h @@ -0,0 +1,219 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// EnergyInterval is the basic handle type in this file. Example: +// // Create a default EnergyInterval object: +// EnergyInterval handle = EnergyIntervalDefault(); +// Functions involving EnergyInterval are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_RESONANCES_ENERGYINTERVAL +#define C_INTERFACE_TEST_V2_0_RESONANCES_ENERGYINTERVAL + +#include "GNDStk.h" +#include "v2.0/resonances/RMatrix.h" +#include "v2.0/resonances/BreitWigner.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EnergyIntervalClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ EnergyInterval +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EnergyIntervalClass *EnergyInterval; + +// --- Const-aware handles. +typedef const struct EnergyIntervalClass *const ConstHandle2ConstEnergyInterval; +typedef struct EnergyIntervalClass *const ConstHandle2EnergyInterval; +typedef const struct EnergyIntervalClass * Handle2ConstEnergyInterval; +typedef struct EnergyIntervalClass * Handle2EnergyInterval; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEnergyInterval +EnergyIntervalDefaultConst(); + +// +++ Create, default +extern_c Handle2EnergyInterval +EnergyIntervalDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergyInterval +EnergyIntervalCreateConst( + const Integer32 index, + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, +); + +// +++ Create, general +extern_c Handle2EnergyInterval +EnergyIntervalCreate( + const Integer32 index, + const Float64 domainMin, + const Float64 domainMax, + const XMLName 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 +EnergyIntervalAssign(ConstHandle2EnergyInterval self, ConstHandle2ConstEnergyInterval from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EnergyIntervalDelete(ConstHandle2ConstEnergyInterval self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EnergyIntervalRead(ConstHandle2EnergyInterval self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EnergyIntervalWrite(ConstHandle2ConstEnergyInterval self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EnergyIntervalPrint(ConstHandle2ConstEnergyInterval self); + +// +++ Print to standard output, as XML +extern_c int +EnergyIntervalPrintXML(ConstHandle2ConstEnergyInterval self); + +// +++ Print to standard output, as JSON +extern_c int +EnergyIntervalPrintJSON(ConstHandle2ConstEnergyInterval self); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyIntervalIndexHas(ConstHandle2ConstEnergyInterval self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +EnergyIntervalIndexGet(ConstHandle2ConstEnergyInterval self); + +// +++ Set +extern_c void +EnergyIntervalIndexSet(ConstHandle2EnergyInterval self, const Integer32 index); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyIntervalDomainMinHas(ConstHandle2ConstEnergyInterval self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +EnergyIntervalDomainMinGet(ConstHandle2ConstEnergyInterval self); + +// +++ Set +extern_c void +EnergyIntervalDomainMinSet(ConstHandle2EnergyInterval self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyIntervalDomainMaxHas(ConstHandle2ConstEnergyInterval self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +EnergyIntervalDomainMaxGet(ConstHandle2ConstEnergyInterval self); + +// +++ Set +extern_c void +EnergyIntervalDomainMaxSet(ConstHandle2EnergyInterval self, const Float64 domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyIntervalDomainUnitHas(ConstHandle2ConstEnergyInterval self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyIntervalDomainUnitGet(ConstHandle2ConstEnergyInterval self); + +// +++ Set +extern_c void +EnergyIntervalDomainUnitSet(ConstHandle2EnergyInterval self, const XMLName domainUnit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/EnergyInterval/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyInterval/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals.cpp new file mode 100644 index 000000000..7408eb1a1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals.cpp @@ -0,0 +1,427 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/EnergyIntervals.hpp" +#include "EnergyIntervals.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EnergyIntervalsClass; +using CPP = multigroup::EnergyIntervals; + +static const std::string CLASSNAME = "EnergyIntervals"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto energyInterval = [](auto &obj) { return &obj.energyInterval; }; +} + +using CPPEnergyInterval = resonances::EnergyInterval; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergyIntervals +EnergyIntervalsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2EnergyIntervals +EnergyIntervalsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergyIntervals +EnergyIntervalsCreateConst( + const XMLName label, + ConstHandle2EnergyInterval *const energyInterval, const size_t energyIntervalSize +) { + ConstHandle2EnergyIntervals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + std::vector{} + ); + for (size_t EnergyIntervalN = 0; EnergyIntervalN < energyIntervalSize; ++EnergyIntervalN) + EnergyIntervalsEnergyIntervalAdd(handle, energyInterval[EnergyIntervalN]); + return handle; +} + +// Create, general +Handle2EnergyIntervals +EnergyIntervalsCreate( + const XMLName label, + ConstHandle2EnergyInterval *const energyInterval, const size_t energyIntervalSize +) { + ConstHandle2EnergyIntervals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + std::vector{} + ); + for (size_t EnergyIntervalN = 0; EnergyIntervalN < energyIntervalSize; ++EnergyIntervalN) + EnergyIntervalsEnergyIntervalAdd(handle, energyInterval[EnergyIntervalN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EnergyIntervalsAssign(ConstHandle2EnergyIntervals self, ConstHandle2ConstEnergyIntervals from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EnergyIntervalsDelete(ConstHandle2ConstEnergyIntervals self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EnergyIntervalsRead(ConstHandle2EnergyIntervals self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EnergyIntervalsWrite(ConstHandle2ConstEnergyIntervals self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EnergyIntervalsPrint(ConstHandle2ConstEnergyIntervals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EnergyIntervalsPrintXML(ConstHandle2ConstEnergyIntervals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EnergyIntervalsPrintJSON(ConstHandle2ConstEnergyIntervals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +EnergyIntervalsLabelHas(ConstHandle2ConstEnergyIntervals self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +EnergyIntervalsLabelGet(ConstHandle2ConstEnergyIntervals self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EnergyIntervalsLabelSet(ConstHandle2EnergyIntervals self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: energyInterval +// ----------------------------------------------------------------------------- + +// Has +int +EnergyIntervalsEnergyIntervalHas(ConstHandle2ConstEnergyIntervals self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EnergyIntervalHas", self, extract::energyInterval); +} + +// Clear +void +EnergyIntervalsEnergyIntervalClear(ConstHandle2EnergyIntervals self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"EnergyIntervalClear", self, extract::energyInterval); +} + +// Size +size_t +EnergyIntervalsEnergyIntervalSize(ConstHandle2ConstEnergyIntervals self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"EnergyIntervalSize", self, extract::energyInterval); +} + +// Add +void +EnergyIntervalsEnergyIntervalAdd(ConstHandle2EnergyIntervals self, ConstHandle2ConstEnergyInterval energyInterval) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"EnergyIntervalAdd", self, extract::energyInterval, energyInterval); +} + +// Get, by index \in [0,size), const +Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetConst(ConstHandle2ConstEnergyIntervals self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"EnergyIntervalGetConst", self, extract::energyInterval, index_); +} + +// Get, by index \in [0,size), non-const +Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGet(ConstHandle2EnergyIntervals self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"EnergyIntervalGet", self, extract::energyInterval, index_); +} + +// Set, by index \in [0,size) +void +EnergyIntervalsEnergyIntervalSet( + ConstHandle2EnergyIntervals self, + const size_t index_, + ConstHandle2ConstEnergyInterval energyInterval +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"EnergyIntervalSet", self, extract::energyInterval, index_, energyInterval); +} + +// Has, by index +int +EnergyIntervalsEnergyIntervalHasByIndex( + ConstHandle2ConstEnergyIntervals self, + const Integer32 index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalHasByIndex", + self, extract::energyInterval, meta::index, index); +} + +// Get, by index, const +Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetByIndexConst( + ConstHandle2ConstEnergyIntervals self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalGetByIndexConst", + self, extract::energyInterval, meta::index, index); +} + +// Get, by index, non-const +Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGetByIndex( + ConstHandle2EnergyIntervals self, + const Integer32 index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalGetByIndex", + self, extract::energyInterval, meta::index, index); +} + +// Set, by index +void +EnergyIntervalsEnergyIntervalSetByIndex( + ConstHandle2EnergyIntervals self, + const Integer32 index, + ConstHandle2ConstEnergyInterval energyInterval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalSetByIndex", + self, extract::energyInterval, meta::index, index, energyInterval); +} + +// Has, by domainMin +int +EnergyIntervalsEnergyIntervalHasByDomainMin( + ConstHandle2ConstEnergyIntervals self, + const Float64 domainMin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalHasByDomainMin", + self, extract::energyInterval, meta::domainMin, domainMin); +} + +// Get, by domainMin, const +Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainMinConst( + ConstHandle2ConstEnergyIntervals self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalGetByDomainMinConst", + self, extract::energyInterval, meta::domainMin, domainMin); +} + +// Get, by domainMin, non-const +Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainMin( + ConstHandle2EnergyIntervals self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalGetByDomainMin", + self, extract::energyInterval, meta::domainMin, domainMin); +} + +// Set, by domainMin +void +EnergyIntervalsEnergyIntervalSetByDomainMin( + ConstHandle2EnergyIntervals self, + const Float64 domainMin, + ConstHandle2ConstEnergyInterval energyInterval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalSetByDomainMin", + self, extract::energyInterval, meta::domainMin, domainMin, energyInterval); +} + +// Has, by domainMax +int +EnergyIntervalsEnergyIntervalHasByDomainMax( + ConstHandle2ConstEnergyIntervals self, + const Float64 domainMax +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalHasByDomainMax", + self, extract::energyInterval, meta::domainMax, domainMax); +} + +// Get, by domainMax, const +Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainMaxConst( + ConstHandle2ConstEnergyIntervals self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalGetByDomainMaxConst", + self, extract::energyInterval, meta::domainMax, domainMax); +} + +// Get, by domainMax, non-const +Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainMax( + ConstHandle2EnergyIntervals self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalGetByDomainMax", + self, extract::energyInterval, meta::domainMax, domainMax); +} + +// Set, by domainMax +void +EnergyIntervalsEnergyIntervalSetByDomainMax( + ConstHandle2EnergyIntervals self, + const Float64 domainMax, + ConstHandle2ConstEnergyInterval energyInterval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalSetByDomainMax", + self, extract::energyInterval, meta::domainMax, domainMax, energyInterval); +} + +// Has, by domainUnit +int +EnergyIntervalsEnergyIntervalHasByDomainUnit( + ConstHandle2ConstEnergyIntervals self, + const XMLName domainUnit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalHasByDomainUnit", + self, extract::energyInterval, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, const +Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainUnitConst( + ConstHandle2ConstEnergyIntervals self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalGetByDomainUnitConst", + self, extract::energyInterval, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, non-const +Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainUnit( + ConstHandle2EnergyIntervals self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalGetByDomainUnit", + self, extract::energyInterval, meta::domainUnit, domainUnit); +} + +// Set, by domainUnit +void +EnergyIntervalsEnergyIntervalSetByDomainUnit( + ConstHandle2EnergyIntervals self, + const XMLName domainUnit, + ConstHandle2ConstEnergyInterval energyInterval +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"EnergyIntervalSetByDomainUnit", + self, extract::energyInterval, meta::domainUnit, domainUnit, energyInterval); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/EnergyIntervals/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals.h new file mode 100644 index 000000000..958a382f7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals.h @@ -0,0 +1,313 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// EnergyIntervals is the basic handle type in this file. Example: +// // Create a default EnergyIntervals object: +// EnergyIntervals handle = EnergyIntervalsDefault(); +// Functions involving EnergyIntervals are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_RESONANCES_ENERGYINTERVALS +#define C_INTERFACE_TEST_V2_0_RESONANCES_ENERGYINTERVALS + +#include "GNDStk.h" +#include "v2.0/resonances/EnergyInterval.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EnergyIntervalsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ EnergyIntervals +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EnergyIntervalsClass *EnergyIntervals; + +// --- Const-aware handles. +typedef const struct EnergyIntervalsClass *const ConstHandle2ConstEnergyIntervals; +typedef struct EnergyIntervalsClass *const ConstHandle2EnergyIntervals; +typedef const struct EnergyIntervalsClass * Handle2ConstEnergyIntervals; +typedef struct EnergyIntervalsClass * Handle2EnergyIntervals; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEnergyIntervals +EnergyIntervalsDefaultConst(); + +// +++ Create, default +extern_c Handle2EnergyIntervals +EnergyIntervalsDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergyIntervals +EnergyIntervalsCreateConst( + const XMLName label, + ConstHandle2EnergyInterval *const energyInterval, const size_t energyIntervalSize +); + +// +++ Create, general +extern_c Handle2EnergyIntervals +EnergyIntervalsCreate( + const XMLName label, + ConstHandle2EnergyInterval *const energyInterval, const size_t energyIntervalSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EnergyIntervalsAssign(ConstHandle2EnergyIntervals self, ConstHandle2ConstEnergyIntervals from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EnergyIntervalsDelete(ConstHandle2ConstEnergyIntervals self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EnergyIntervalsRead(ConstHandle2EnergyIntervals self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EnergyIntervalsWrite(ConstHandle2ConstEnergyIntervals self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EnergyIntervalsPrint(ConstHandle2ConstEnergyIntervals self); + +// +++ Print to standard output, as XML +extern_c int +EnergyIntervalsPrintXML(ConstHandle2ConstEnergyIntervals self); + +// +++ Print to standard output, as JSON +extern_c int +EnergyIntervalsPrintJSON(ConstHandle2ConstEnergyIntervals self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyIntervalsLabelHas(ConstHandle2ConstEnergyIntervals self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyIntervalsLabelGet(ConstHandle2ConstEnergyIntervals self); + +// +++ Set +extern_c void +EnergyIntervalsLabelSet(ConstHandle2EnergyIntervals self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: energyInterval +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyIntervalsEnergyIntervalHas(ConstHandle2ConstEnergyIntervals self); + +// +++ Clear +extern_c void +EnergyIntervalsEnergyIntervalClear(ConstHandle2EnergyIntervals self); + +// +++ Size +extern_c size_t +EnergyIntervalsEnergyIntervalSize(ConstHandle2ConstEnergyIntervals self); + +// +++ Add +extern_c void +EnergyIntervalsEnergyIntervalAdd(ConstHandle2EnergyIntervals self, ConstHandle2ConstEnergyInterval energyInterval); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetConst(ConstHandle2ConstEnergyIntervals self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGet(ConstHandle2EnergyIntervals self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +EnergyIntervalsEnergyIntervalSet( + ConstHandle2EnergyIntervals self, + const size_t index_, + ConstHandle2ConstEnergyInterval energyInterval +); + +// +++ Has, by index +extern_c int +EnergyIntervalsEnergyIntervalHasByIndex( + ConstHandle2ConstEnergyIntervals self, + const Integer32 index +); + +// --- Get, by index, const +extern_c Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetByIndexConst( + ConstHandle2ConstEnergyIntervals self, + const Integer32 index +); + +// +++ Get, by index, non-const +extern_c Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGetByIndex( + ConstHandle2EnergyIntervals self, + const Integer32 index +); + +// +++ Set, by index +extern_c void +EnergyIntervalsEnergyIntervalSetByIndex( + ConstHandle2EnergyIntervals self, + const Integer32 index, + ConstHandle2ConstEnergyInterval energyInterval +); + +// +++ Has, by domainMin +extern_c int +EnergyIntervalsEnergyIntervalHasByDomainMin( + ConstHandle2ConstEnergyIntervals self, + const Float64 domainMin +); + +// --- Get, by domainMin, const +extern_c Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainMinConst( + ConstHandle2ConstEnergyIntervals self, + const Float64 domainMin +); + +// +++ Get, by domainMin, non-const +extern_c Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainMin( + ConstHandle2EnergyIntervals self, + const Float64 domainMin +); + +// +++ Set, by domainMin +extern_c void +EnergyIntervalsEnergyIntervalSetByDomainMin( + ConstHandle2EnergyIntervals self, + const Float64 domainMin, + ConstHandle2ConstEnergyInterval energyInterval +); + +// +++ Has, by domainMax +extern_c int +EnergyIntervalsEnergyIntervalHasByDomainMax( + ConstHandle2ConstEnergyIntervals self, + const Float64 domainMax +); + +// --- Get, by domainMax, const +extern_c Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainMaxConst( + ConstHandle2ConstEnergyIntervals self, + const Float64 domainMax +); + +// +++ Get, by domainMax, non-const +extern_c Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainMax( + ConstHandle2EnergyIntervals self, + const Float64 domainMax +); + +// +++ Set, by domainMax +extern_c void +EnergyIntervalsEnergyIntervalSetByDomainMax( + ConstHandle2EnergyIntervals self, + const Float64 domainMax, + ConstHandle2ConstEnergyInterval energyInterval +); + +// +++ Has, by domainUnit +extern_c int +EnergyIntervalsEnergyIntervalHasByDomainUnit( + ConstHandle2ConstEnergyIntervals self, + const XMLName domainUnit +); + +// --- Get, by domainUnit, const +extern_c Handle2ConstEnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainUnitConst( + ConstHandle2ConstEnergyIntervals self, + const XMLName domainUnit +); + +// +++ Get, by domainUnit, non-const +extern_c Handle2EnergyInterval +EnergyIntervalsEnergyIntervalGetByDomainUnit( + ConstHandle2EnergyIntervals self, + const XMLName domainUnit +); + +// +++ Set, by domainUnit +extern_c void +EnergyIntervalsEnergyIntervalSetByDomainUnit( + ConstHandle2EnergyIntervals self, + const XMLName domainUnit, + ConstHandle2ConstEnergyInterval energyInterval +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/EnergyIntervals/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/EnergyIntervals/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix.cpp new file mode 100644 index 000000000..e04b977f3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix.cpp @@ -0,0 +1,382 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/ExternalRMatrix.hpp" +#include "ExternalRMatrix.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ExternalRMatrixClass; +using CPP = multigroup::ExternalRMatrix; + +static const std::string CLASSNAME = "ExternalRMatrix"; + +namespace extract { + static auto type = [](auto &obj) { return &obj.type; }; + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDouble = containers::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstExternalRMatrix +ExternalRMatrixDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ExternalRMatrix +ExternalRMatrixDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstExternalRMatrix +ExternalRMatrixCreateConst( + const XMLName type, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2ExternalRMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + type, + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + ExternalRMatrixDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Create, general +Handle2ExternalRMatrix +ExternalRMatrixCreate( + const XMLName type, + ConstHandle2Double *const Double, const size_t DoubleSize +) { + ConstHandle2ExternalRMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + type, + std::vector{} + ); + for (size_t DoubleN = 0; DoubleN < DoubleSize; ++DoubleN) + ExternalRMatrixDoubleAdd(handle, Double[DoubleN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ExternalRMatrixAssign(ConstHandle2ExternalRMatrix self, ConstHandle2ConstExternalRMatrix from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ExternalRMatrixDelete(ConstHandle2ConstExternalRMatrix self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ExternalRMatrixRead(ConstHandle2ExternalRMatrix self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ExternalRMatrixWrite(ConstHandle2ConstExternalRMatrix self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ExternalRMatrixPrint(ConstHandle2ConstExternalRMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ExternalRMatrixPrintXML(ConstHandle2ConstExternalRMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ExternalRMatrixPrintJSON(ConstHandle2ConstExternalRMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// Has +int +ExternalRMatrixTypeHas(ConstHandle2ConstExternalRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TypeHas", self, extract::type); +} + +// Get +// Returns by value +XMLName +ExternalRMatrixTypeGet(ConstHandle2ConstExternalRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +ExternalRMatrixTypeSet(ConstHandle2ExternalRMatrix self, const XMLName type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +ExternalRMatrixDoubleHas(ConstHandle2ConstExternalRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Clear +void +ExternalRMatrixDoubleClear(ConstHandle2ExternalRMatrix self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DoubleClear", self, extract::Double); +} + +// Size +size_t +ExternalRMatrixDoubleSize(ConstHandle2ConstExternalRMatrix self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DoubleSize", self, extract::Double); +} + +// Add +void +ExternalRMatrixDoubleAdd(ConstHandle2ExternalRMatrix self, ConstHandle2ConstDouble Double) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DoubleAdd", self, extract::Double, Double); +} + +// Get, by index \in [0,size), const +Handle2ConstDouble +ExternalRMatrixDoubleGetConst(ConstHandle2ConstExternalRMatrix self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Double +ExternalRMatrixDoubleGet(ConstHandle2ExternalRMatrix self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double, index_); +} + +// Set, by index \in [0,size) +void +ExternalRMatrixDoubleSet( + ConstHandle2ExternalRMatrix self, + const size_t index_, + ConstHandle2ConstDouble Double +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, index_, Double); +} + +// Has, by label +int +ExternalRMatrixDoubleHasByLabel( + ConstHandle2ConstExternalRMatrix self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByLabel", + self, extract::Double, meta::label, label); +} + +// Get, by label, const +Handle2ConstDouble +ExternalRMatrixDoubleGetByLabelConst( + ConstHandle2ConstExternalRMatrix self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabelConst", + self, extract::Double, meta::label, label); +} + +// Get, by label, non-const +Handle2Double +ExternalRMatrixDoubleGetByLabel( + ConstHandle2ExternalRMatrix self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByLabel", + self, extract::Double, meta::label, label); +} + +// Set, by label +void +ExternalRMatrixDoubleSetByLabel( + ConstHandle2ExternalRMatrix self, + const XMLName label, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByLabel", + self, extract::Double, meta::label, label, Double); +} + +// Has, by unit +int +ExternalRMatrixDoubleHasByUnit( + ConstHandle2ConstExternalRMatrix self, + const XMLName unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByUnit", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstDouble +ExternalRMatrixDoubleGetByUnitConst( + ConstHandle2ConstExternalRMatrix self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnitConst", + self, extract::Double, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Double +ExternalRMatrixDoubleGetByUnit( + ConstHandle2ExternalRMatrix self, + const XMLName unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByUnit", + self, extract::Double, meta::unit, unit); +} + +// Set, by unit +void +ExternalRMatrixDoubleSetByUnit( + ConstHandle2ExternalRMatrix self, + const XMLName unit, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByUnit", + self, extract::Double, meta::unit, unit, Double); +} + +// Has, by value +int +ExternalRMatrixDoubleHasByValue( + ConstHandle2ConstExternalRMatrix self, + const Float64 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DoubleHasByValue", + self, extract::Double, meta::value, value); +} + +// Get, by value, const +Handle2ConstDouble +ExternalRMatrixDoubleGetByValueConst( + ConstHandle2ConstExternalRMatrix self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValueConst", + self, extract::Double, meta::value, value); +} + +// Get, by value, non-const +Handle2Double +ExternalRMatrixDoubleGetByValue( + ConstHandle2ExternalRMatrix self, + const Float64 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DoubleGetByValue", + self, extract::Double, meta::value, value); +} + +// Set, by value +void +ExternalRMatrixDoubleSetByValue( + ConstHandle2ExternalRMatrix self, + const Float64 value, + ConstHandle2ConstDouble Double +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DoubleSetByValue", + self, extract::Double, meta::value, value, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/ExternalRMatrix/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix.h new file mode 100644 index 000000000..09a92ac37 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix.h @@ -0,0 +1,284 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ExternalRMatrix is the basic handle type in this file. Example: +// // Create a default ExternalRMatrix object: +// ExternalRMatrix handle = ExternalRMatrixDefault(); +// Functions involving ExternalRMatrix are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_RESONANCES_EXTERNALRMATRIX +#define C_INTERFACE_TEST_V2_0_RESONANCES_EXTERNALRMATRIX + +#include "GNDStk.h" +#include "v2.0/containers/Double.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ExternalRMatrixClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ExternalRMatrix +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ExternalRMatrixClass *ExternalRMatrix; + +// --- Const-aware handles. +typedef const struct ExternalRMatrixClass *const ConstHandle2ConstExternalRMatrix; +typedef struct ExternalRMatrixClass *const ConstHandle2ExternalRMatrix; +typedef const struct ExternalRMatrixClass * Handle2ConstExternalRMatrix; +typedef struct ExternalRMatrixClass * Handle2ExternalRMatrix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstExternalRMatrix +ExternalRMatrixDefaultConst(); + +// +++ Create, default +extern_c Handle2ExternalRMatrix +ExternalRMatrixDefault(); + +// --- Create, general, const +extern_c Handle2ConstExternalRMatrix +ExternalRMatrixCreateConst( + const XMLName type, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Create, general +extern_c Handle2ExternalRMatrix +ExternalRMatrixCreate( + const XMLName type, + ConstHandle2Double *const Double, const size_t DoubleSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ExternalRMatrixAssign(ConstHandle2ExternalRMatrix self, ConstHandle2ConstExternalRMatrix from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ExternalRMatrixDelete(ConstHandle2ConstExternalRMatrix self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ExternalRMatrixRead(ConstHandle2ExternalRMatrix self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ExternalRMatrixWrite(ConstHandle2ConstExternalRMatrix self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ExternalRMatrixPrint(ConstHandle2ConstExternalRMatrix self); + +// +++ Print to standard output, as XML +extern_c int +ExternalRMatrixPrintXML(ConstHandle2ConstExternalRMatrix self); + +// +++ Print to standard output, as JSON +extern_c int +ExternalRMatrixPrintJSON(ConstHandle2ConstExternalRMatrix self); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExternalRMatrixTypeHas(ConstHandle2ConstExternalRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ExternalRMatrixTypeGet(ConstHandle2ConstExternalRMatrix self); + +// +++ Set +extern_c void +ExternalRMatrixTypeSet(ConstHandle2ExternalRMatrix self, const XMLName type); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExternalRMatrixDoubleHas(ConstHandle2ConstExternalRMatrix self); + +// +++ Clear +extern_c void +ExternalRMatrixDoubleClear(ConstHandle2ExternalRMatrix self); + +// +++ Size +extern_c size_t +ExternalRMatrixDoubleSize(ConstHandle2ConstExternalRMatrix self); + +// +++ Add +extern_c void +ExternalRMatrixDoubleAdd(ConstHandle2ExternalRMatrix self, ConstHandle2ConstDouble Double); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDouble +ExternalRMatrixDoubleGetConst(ConstHandle2ConstExternalRMatrix self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Double +ExternalRMatrixDoubleGet(ConstHandle2ExternalRMatrix self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ExternalRMatrixDoubleSet( + ConstHandle2ExternalRMatrix self, + const size_t index_, + ConstHandle2ConstDouble Double +); + +// +++ Has, by label +extern_c int +ExternalRMatrixDoubleHasByLabel( + ConstHandle2ConstExternalRMatrix self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstDouble +ExternalRMatrixDoubleGetByLabelConst( + ConstHandle2ConstExternalRMatrix self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Double +ExternalRMatrixDoubleGetByLabel( + ConstHandle2ExternalRMatrix self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ExternalRMatrixDoubleSetByLabel( + ConstHandle2ExternalRMatrix self, + const XMLName label, + ConstHandle2ConstDouble Double +); + +// +++ Has, by unit +extern_c int +ExternalRMatrixDoubleHasByUnit( + ConstHandle2ConstExternalRMatrix self, + const XMLName unit +); + +// --- Get, by unit, const +extern_c Handle2ConstDouble +ExternalRMatrixDoubleGetByUnitConst( + ConstHandle2ConstExternalRMatrix self, + const XMLName unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Double +ExternalRMatrixDoubleGetByUnit( + ConstHandle2ExternalRMatrix self, + const XMLName unit +); + +// +++ Set, by unit +extern_c void +ExternalRMatrixDoubleSetByUnit( + ConstHandle2ExternalRMatrix self, + const XMLName unit, + ConstHandle2ConstDouble Double +); + +// +++ Has, by value +extern_c int +ExternalRMatrixDoubleHasByValue( + ConstHandle2ConstExternalRMatrix self, + const Float64 value +); + +// --- Get, by value, const +extern_c Handle2ConstDouble +ExternalRMatrixDoubleGetByValueConst( + ConstHandle2ConstExternalRMatrix self, + const Float64 value +); + +// +++ Get, by value, non-const +extern_c Handle2Double +ExternalRMatrixDoubleGetByValue( + ConstHandle2ExternalRMatrix self, + const Float64 value +); + +// +++ Set, by value +extern_c void +ExternalRMatrixDoubleSetByValue( + ConstHandle2ExternalRMatrix self, + const Float64 value, + ConstHandle2ConstDouble Double +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/ExternalRMatrix/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ExternalRMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/HardSphereRadius.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/HardSphereRadius.cpp new file mode 100644 index 000000000..734d1e973 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/HardSphereRadius.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/HardSphereRadius.hpp" +#include "HardSphereRadius.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Constant1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstHardSphereRadius +HardSphereRadiusDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/resonances/HardSphereRadius/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/HardSphereRadius.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/HardSphereRadius.h new file mode 100644 index 000000000..6cd174946 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/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_TEST_V2_0_RESONANCES_HARDSPHERERADIUS +#define C_INTERFACE_TEST_V2_0_RESONANCES_HARDSPHERERADIUS + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2HardSphereRadius +HardSphereRadiusDefault(); + +// --- Create, general, const +extern_c Handle2ConstHardSphereRadius +HardSphereRadiusCreateConst( + ConstHandle2ConstConstant1d constant1d +); + +// +++ Create, general +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/resonances/HardSphereRadius/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/HardSphereRadius/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/HardSphereRadius/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/HardSphereRadius/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/HardSphereRadius/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/J.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/J.cpp new file mode 100644 index 000000000..a676c43ba --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/J.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/J.hpp" +#include "J.h" + +using namespace njoy::GNDStk; +using namespace test::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 = resonances::LevelSpacing; +using CPPWidths = resonances::Widths; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstJ +JDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2J +JDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstJ +JCreateConst( + const XMLName label, + const Fraction32 value, + ConstHandle2ConstLevelSpacing levelSpacing, + ConstHandle2ConstWidths widths +) { + ConstHandle2J handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + detail::tocpp(levelSpacing), + detail::tocpp(widths) + ); + return handle; +} + +// Create, general +Handle2J +JCreate( + const XMLName label, + const Fraction32 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 +XMLName +JLabelGet(ConstHandle2ConstJ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +JLabelSet(ConstHandle2J self, const XMLName 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 +Fraction32 +JValueGet(ConstHandle2ConstJ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +JValueSet(ConstHandle2J self, const Fraction32 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/resonances/J/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/J.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/J.h new file mode 100644 index 000000000..06dc4464e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/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_TEST_V2_0_RESONANCES_J +#define C_INTERFACE_TEST_V2_0_RESONANCES_J + +#include "GNDStk.h" +#include "v2.0/resonances/LevelSpacing.h" +#include "v2.0/resonances/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 +extern_c Handle2J +JDefault(); + +// --- Create, general, const +extern_c Handle2ConstJ +JCreateConst( + const XMLName label, + const Fraction32 value, + ConstHandle2ConstLevelSpacing levelSpacing, + ConstHandle2ConstWidths widths +); + +// +++ Create, general +extern_c Handle2J +JCreate( + const XMLName label, + const Fraction32 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 XMLName +JLabelGet(ConstHandle2ConstJ self); + +// +++ Set +extern_c void +JLabelSet(ConstHandle2J self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +JValueHas(ConstHandle2ConstJ self); + +// +++ Get +// +++ Returns by value +extern_c Fraction32 +JValueGet(ConstHandle2ConstJ self); + +// +++ Set +extern_c void +JValueSet(ConstHandle2J self, const Fraction32 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/resonances/J/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/J/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/J/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/J/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/J/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Js.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Js.cpp new file mode 100644 index 000000000..e8f8d5b86 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Js.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/Js.hpp" +#include "Js.h" + +using namespace njoy::GNDStk; +using namespace test::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 = resonances::J; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstJs +JsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +JsJHasByLabel( + ConstHandle2ConstJs self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"JHasByLabel", + self, extract::J, meta::label, label); +} + +// Get, by label, const +Handle2ConstJ +JsJGetByLabelConst( + ConstHandle2ConstJs self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"JGetByLabelConst", + self, extract::J, meta::label, label); +} + +// Get, by label, non-const +Handle2J +JsJGetByLabel( + ConstHandle2Js self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"JGetByLabel", + self, extract::J, meta::label, label); +} + +// Set, by label +void +JsJSetByLabel( + ConstHandle2Js self, + const XMLName label, + ConstHandle2ConstJ J +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"JSetByLabel", + self, extract::J, meta::label, label, J); +} + +// Has, by value +int +JsJHasByValue( + ConstHandle2ConstJs self, + const Fraction32 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"JHasByValue", + self, extract::J, meta::value, value); +} + +// Get, by value, const +Handle2ConstJ +JsJGetByValueConst( + ConstHandle2ConstJs self, + const Fraction32 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"JGetByValueConst", + self, extract::J, meta::value, value); +} + +// Get, by value, non-const +Handle2J +JsJGetByValue( + ConstHandle2Js self, + const Fraction32 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"JGetByValue", + self, extract::J, meta::value, value); +} + +// Set, by value +void +JsJSetByValue( + ConstHandle2Js self, + const Fraction32 value, + ConstHandle2ConstJ J +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"JSetByValue", + self, extract::J, meta::value, value, J); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Js/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Js.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Js.h new file mode 100644 index 000000000..618eaf26b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Js.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_JS +#define C_INTERFACE_TEST_V2_0_RESONANCES_JS + +#include "GNDStk.h" +#include "v2.0/resonances/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 +extern_c Handle2Js +JsDefault(); + +// --- Create, general, const +extern_c Handle2ConstJs +JsCreateConst( + ConstHandle2J *const J, const size_t JSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +JsJHasByLabel( + ConstHandle2ConstJs self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstJ +JsJGetByLabelConst( + ConstHandle2ConstJs self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2J +JsJGetByLabel( + ConstHandle2Js self, + const XMLName label +); + +// +++ Set, by label +extern_c void +JsJSetByLabel( + ConstHandle2Js self, + const XMLName label, + ConstHandle2ConstJ J +); + +// +++ Has, by value +extern_c int +JsJHasByValue( + ConstHandle2ConstJs self, + const Fraction32 value +); + +// --- Get, by value, const +extern_c Handle2ConstJ +JsJGetByValueConst( + ConstHandle2ConstJs self, + const Fraction32 value +); + +// +++ Get, by value, non-const +extern_c Handle2J +JsJGetByValue( + ConstHandle2Js self, + const Fraction32 value +); + +// +++ Set, by value +extern_c void +JsJSetByValue( + ConstHandle2Js self, + const Fraction32 value, + ConstHandle2ConstJ J +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Js/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Js/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Js/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Js/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Js/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/L.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/L.cpp new file mode 100644 index 000000000..13cb05a0b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/L.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/L.hpp" +#include "L.h" + +using namespace njoy::GNDStk; +using namespace test::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 = resonances::Js; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstL +LDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2L +LDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstL +LCreateConst( + const XMLName label, + const Integer32 value, + ConstHandle2ConstJs Js +) { + ConstHandle2L handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + detail::tocpp(Js) + ); + return handle; +} + +// Create, general +Handle2L +LCreate( + const XMLName label, + const Integer32 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 +XMLName +LLabelGet(ConstHandle2ConstL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +LLabelSet(ConstHandle2L self, const XMLName 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 +Integer32 +LValueGet(ConstHandle2ConstL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +LValueSet(ConstHandle2L self, const Integer32 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/resonances/L/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/L.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/L.h new file mode 100644 index 000000000..e46f3287c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/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_TEST_V2_0_RESONANCES_L +#define C_INTERFACE_TEST_V2_0_RESONANCES_L + +#include "GNDStk.h" +#include "v2.0/resonances/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 +extern_c Handle2L +LDefault(); + +// --- Create, general, const +extern_c Handle2ConstL +LCreateConst( + const XMLName label, + const Integer32 value, + ConstHandle2ConstJs Js +); + +// +++ Create, general +extern_c Handle2L +LCreate( + const XMLName label, + const Integer32 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 XMLName +LLabelGet(ConstHandle2ConstL self); + +// +++ Set +extern_c void +LLabelSet(ConstHandle2L self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LValueHas(ConstHandle2ConstL self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +LValueGet(ConstHandle2ConstL self); + +// +++ Set +extern_c void +LValueSet(ConstHandle2L self, const Integer32 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/resonances/L/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/L/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/L/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/L/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/L/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing.cpp new file mode 100644 index 000000000..7f55dc2fc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/LevelSpacing.hpp" +#include "LevelSpacing.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = LevelSpacingClass; +using CPP = multigroup::LevelSpacing; + +static const std::string CLASSNAME = "LevelSpacing"; + +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; }; +} + +using CPPConstant1d = containers::Constant1d; +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLevelSpacing +LevelSpacingDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2LevelSpacing +LevelSpacingDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLevelSpacing +LevelSpacingCreateConst( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2LevelSpacing handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(constant1d), + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2LevelSpacing +LevelSpacingCreate( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2LevelSpacing handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(constant1d), + 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 +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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +LevelSpacingRegions1dHas(ConstHandle2ConstLevelSpacing self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +LevelSpacingRegions1dGetConst(ConstHandle2ConstLevelSpacing self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +LevelSpacingRegions1dGet(ConstHandle2LevelSpacing self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +LevelSpacingRegions1dSet(ConstHandle2LevelSpacing self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/LevelSpacing/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing.h new file mode 100644 index 000000000..6c1dad538 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing.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. +// +// 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_TEST_V2_0_RESONANCES_LEVELSPACING +#define C_INTERFACE_TEST_V2_0_RESONANCES_LEVELSPACING + +#include "GNDStk.h" +#include "v2.0/containers/Constant1d.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.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 +extern_c Handle2LevelSpacing +LevelSpacingDefault(); + +// --- Create, general, const +extern_c Handle2ConstLevelSpacing +LevelSpacingCreateConst( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2LevelSpacing +LevelSpacingCreate( + ConstHandle2ConstConstant1d constant1d, + 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 +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: 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); + + +// ----------------------------------------------------------------------------- +// 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: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LevelSpacingRegions1dHas(ConstHandle2ConstLevelSpacing self); + +// --- Get, const +extern_c Handle2ConstRegions1d +LevelSpacingRegions1dGetConst(ConstHandle2ConstLevelSpacing self); + +// +++ Get, non-const +extern_c Handle2Regions1d +LevelSpacingRegions1dGet(ConstHandle2LevelSpacing self); + +// +++ Set +extern_c void +LevelSpacingRegions1dSet(ConstHandle2LevelSpacing self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/LevelSpacing/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/LevelSpacing/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls.cpp new file mode 100644 index 000000000..186580f90 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/Ls.hpp" +#include "Ls.h" + +using namespace njoy::GNDStk; +using namespace test::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 = resonances::L; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLs +LsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +LsLHasByLabel( + ConstHandle2ConstLs self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LHasByLabel", + self, extract::L, meta::label, label); +} + +// Get, by label, const +Handle2ConstL +LsLGetByLabelConst( + ConstHandle2ConstLs self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LGetByLabelConst", + self, extract::L, meta::label, label); +} + +// Get, by label, non-const +Handle2L +LsLGetByLabel( + ConstHandle2Ls self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LGetByLabel", + self, extract::L, meta::label, label); +} + +// Set, by label +void +LsLSetByLabel( + ConstHandle2Ls self, + const XMLName label, + ConstHandle2ConstL L +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LSetByLabel", + self, extract::L, meta::label, label, L); +} + +// Has, by value +int +LsLHasByValue( + ConstHandle2ConstLs self, + const Integer32 value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LHasByValue", + self, extract::L, meta::value, value); +} + +// Get, by value, const +Handle2ConstL +LsLGetByValueConst( + ConstHandle2ConstLs self, + const Integer32 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LGetByValueConst", + self, extract::L, meta::value, value); +} + +// Get, by value, non-const +Handle2L +LsLGetByValue( + ConstHandle2Ls self, + const Integer32 value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LGetByValue", + self, extract::L, meta::value, value); +} + +// Set, by value +void +LsLSetByValue( + ConstHandle2Ls self, + const Integer32 value, + ConstHandle2ConstL L +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LSetByValue", + self, extract::L, meta::value, value, L); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Ls/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls.h new file mode 100644 index 000000000..cc6cdf7dd --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_LS +#define C_INTERFACE_TEST_V2_0_RESONANCES_LS + +#include "GNDStk.h" +#include "v2.0/resonances/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 +extern_c Handle2Ls +LsDefault(); + +// --- Create, general, const +extern_c Handle2ConstLs +LsCreateConst( + ConstHandle2L *const L, const size_t LSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +LsLHasByLabel( + ConstHandle2ConstLs self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstL +LsLGetByLabelConst( + ConstHandle2ConstLs self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2L +LsLGetByLabel( + ConstHandle2Ls self, + const XMLName label +); + +// +++ Set, by label +extern_c void +LsLSetByLabel( + ConstHandle2Ls self, + const XMLName label, + ConstHandle2ConstL L +); + +// +++ Has, by value +extern_c int +LsLHasByValue( + ConstHandle2ConstLs self, + const Integer32 value +); + +// --- Get, by value, const +extern_c Handle2ConstL +LsLGetByValueConst( + ConstHandle2ConstLs self, + const Integer32 value +); + +// +++ Get, by value, non-const +extern_c Handle2L +LsLGetByValue( + ConstHandle2Ls self, + const Integer32 value +); + +// +++ Set, by value +extern_c void +LsLSetByValue( + ConstHandle2Ls self, + const Integer32 value, + ConstHandle2ConstL L +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Ls/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Ls/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix.cpp new file mode 100644 index 000000000..4e6e8b837 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix.cpp @@ -0,0 +1,547 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/RMatrix.hpp" +#include "RMatrix.h" + +using namespace njoy::GNDStk; +using namespace test::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 boundaryConditionValue = [](auto &obj) { return &obj.boundaryConditionValue; }; + static auto calculateChannelRadius = [](auto &obj) { return &obj.calculateChannelRadius; }; + static auto calculatePenetrability = [](auto &obj) { return &obj.calculatePenetrability; }; + static auto useForSelfShieldingOnly = [](auto &obj) { return &obj.useForSelfShieldingOnly; }; + static auto supportsAngularReconstruction = [](auto &obj) { return &obj.supportsAngularReconstruction; }; + static auto PoPs_database = [](auto &obj) { return &obj.PoPs_database; }; + static auto resonanceReactions = [](auto &obj) { return &obj.resonanceReactions; }; + static auto spinGroups = [](auto &obj) { return &obj.spinGroups; }; +} + +using CPPPoPs_database = pops::PoPs_database; +using CPPResonanceReactions = resonances::ResonanceReactions; +using CPPSpinGroups = resonances::SpinGroups; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRMatrix +RMatrixDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2RMatrix +RMatrixDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRMatrix +RMatrixCreateConst( + const XMLName label, + const XMLName approximation, + const enums::BoundaryCondition boundaryCondition, + const Float64 boundaryConditionValue, + const bool calculateChannelRadius, + const bool calculatePenetrability, + const bool useForSelfShieldingOnly, + const bool supportsAngularReconstruction, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstSpinGroups spinGroups +) { + ConstHandle2RMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + approximation, + boundaryCondition, + boundaryConditionValue, + calculateChannelRadius, + calculatePenetrability, + useForSelfShieldingOnly, + supportsAngularReconstruction, + detail::tocpp(PoPs_database), + detail::tocpp(resonanceReactions), + detail::tocpp(spinGroups) + ); + return handle; +} + +// Create, general +Handle2RMatrix +RMatrixCreate( + const XMLName label, + const XMLName approximation, + const enums::BoundaryCondition boundaryCondition, + const Float64 boundaryConditionValue, + const bool calculateChannelRadius, + const bool calculatePenetrability, + const bool useForSelfShieldingOnly, + const bool supportsAngularReconstruction, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstSpinGroups spinGroups +) { + ConstHandle2RMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + approximation, + boundaryCondition, + boundaryConditionValue, + calculateChannelRadius, + calculatePenetrability, + useForSelfShieldingOnly, + supportsAngularReconstruction, + detail::tocpp(PoPs_database), + 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 +XMLName +RMatrixLabelGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +RMatrixLabelSet(ConstHandle2RMatrix self, const XMLName 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 +XMLName +RMatrixApproximationGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ApproximationGet", self, extract::approximation); +} + +// Set +void +RMatrixApproximationSet(ConstHandle2RMatrix self, const XMLName 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 +enums::BoundaryCondition +RMatrixBoundaryConditionGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BoundaryConditionGet", self, extract::boundaryCondition); +} + +// Set +void +RMatrixBoundaryConditionSet(ConstHandle2RMatrix self, const enums::BoundaryCondition boundaryCondition) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BoundaryConditionSet", self, extract::boundaryCondition, boundaryCondition); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: boundaryConditionValue +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixBoundaryConditionValueHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BoundaryConditionValueHas", self, extract::boundaryConditionValue); +} + +// Get +// Returns by value +Float64 +RMatrixBoundaryConditionValueGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BoundaryConditionValueGet", self, extract::boundaryConditionValue); +} + +// Set +void +RMatrixBoundaryConditionValueSet(ConstHandle2RMatrix self, const Float64 boundaryConditionValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BoundaryConditionValueSet", self, extract::boundaryConditionValue, boundaryConditionValue); +} + + +// ----------------------------------------------------------------------------- +// 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: calculatePenetrability +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixCalculatePenetrabilityHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CalculatePenetrabilityHas", self, extract::calculatePenetrability); +} + +// Get +// Returns by value +bool +RMatrixCalculatePenetrabilityGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CalculatePenetrabilityGet", self, extract::calculatePenetrability); +} + +// Set +void +RMatrixCalculatePenetrabilitySet(ConstHandle2RMatrix self, const bool calculatePenetrability) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CalculatePenetrabilitySet", self, extract::calculatePenetrability, calculatePenetrability); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: useForSelfShieldingOnly +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixUseForSelfShieldingOnlyHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UseForSelfShieldingOnlyHas", self, extract::useForSelfShieldingOnly); +} + +// Get +// Returns by value +bool +RMatrixUseForSelfShieldingOnlyGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UseForSelfShieldingOnlyGet", self, extract::useForSelfShieldingOnly); +} + +// Set +void +RMatrixUseForSelfShieldingOnlySet(ConstHandle2RMatrix self, const bool useForSelfShieldingOnly) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UseForSelfShieldingOnlySet", self, extract::useForSelfShieldingOnly, useForSelfShieldingOnly); +} + + +// ----------------------------------------------------------------------------- +// 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_database +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixPoPs_databaseHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PoPs_databaseHas", self, extract::PoPs_database); +} + +// Get, const +Handle2ConstPoPs_database +RMatrixPoPs_databaseGetConst(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPs_databaseGetConst", self, extract::PoPs_database); +} + +// Get, non-const +Handle2PoPs_database +RMatrixPoPs_databaseGet(ConstHandle2RMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPs_databaseGet", self, extract::PoPs_database); +} + +// Set +void +RMatrixPoPs_databaseSet(ConstHandle2RMatrix self, ConstHandle2ConstPoPs_database PoPs_database) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PoPs_databaseSet", self, extract::PoPs_database, PoPs_database); +} + + +// ----------------------------------------------------------------------------- +// 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/resonances/RMatrix/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix.h new file mode 100644 index 000000000..23162f601 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix.h @@ -0,0 +1,369 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_RMATRIX +#define C_INTERFACE_TEST_V2_0_RESONANCES_RMATRIX + +#include "GNDStk.h" +#include "v2.0/pops/PoPs_database.h" +#include "v2.0/resonances/ResonanceReactions.h" +#include "v2.0/resonances/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 +extern_c Handle2RMatrix +RMatrixDefault(); + +// --- Create, general, const +extern_c Handle2ConstRMatrix +RMatrixCreateConst( + const XMLName label, + const XMLName approximation, + const enums::BoundaryCondition boundaryCondition, + const Float64 boundaryConditionValue, + const bool calculateChannelRadius, + const bool calculatePenetrability, + const bool useForSelfShieldingOnly, + const bool supportsAngularReconstruction, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstSpinGroups spinGroups +); + +// +++ Create, general +extern_c Handle2RMatrix +RMatrixCreate( + const XMLName label, + const XMLName approximation, + const enums::BoundaryCondition boundaryCondition, + const Float64 boundaryConditionValue, + const bool calculateChannelRadius, + const bool calculatePenetrability, + const bool useForSelfShieldingOnly, + const bool supportsAngularReconstruction, + ConstHandle2ConstPoPs_database PoPs_database, + 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 XMLName +RMatrixLabelGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixLabelSet(ConstHandle2RMatrix self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: approximation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixApproximationHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +RMatrixApproximationGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixApproximationSet(ConstHandle2RMatrix self, const XMLName approximation); + + +// ----------------------------------------------------------------------------- +// Metadatum: boundaryCondition +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixBoundaryConditionHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c enums::BoundaryCondition +RMatrixBoundaryConditionGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixBoundaryConditionSet(ConstHandle2RMatrix self, const enums::BoundaryCondition boundaryCondition); + + +// ----------------------------------------------------------------------------- +// Metadatum: boundaryConditionValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixBoundaryConditionValueHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +RMatrixBoundaryConditionValueGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixBoundaryConditionValueSet(ConstHandle2RMatrix self, const Float64 boundaryConditionValue); + + +// ----------------------------------------------------------------------------- +// 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: calculatePenetrability +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixCalculatePenetrabilityHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c bool +RMatrixCalculatePenetrabilityGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixCalculatePenetrabilitySet(ConstHandle2RMatrix self, const bool calculatePenetrability); + + +// ----------------------------------------------------------------------------- +// Metadatum: useForSelfShieldingOnly +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixUseForSelfShieldingOnlyHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c bool +RMatrixUseForSelfShieldingOnlyGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixUseForSelfShieldingOnlySet(ConstHandle2RMatrix self, const bool useForSelfShieldingOnly); + + +// ----------------------------------------------------------------------------- +// 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_database +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixPoPs_databaseHas(ConstHandle2ConstRMatrix self); + +// --- Get, const +extern_c Handle2ConstPoPs_database +RMatrixPoPs_databaseGetConst(ConstHandle2ConstRMatrix self); + +// +++ Get, non-const +extern_c Handle2PoPs_database +RMatrixPoPs_databaseGet(ConstHandle2RMatrix self); + +// +++ Set +extern_c void +RMatrixPoPs_databaseSet(ConstHandle2RMatrix self, ConstHandle2ConstPoPs_database PoPs_database); + + +// ----------------------------------------------------------------------------- +// 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/resonances/RMatrix/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/RMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved.cpp new file mode 100644 index 000000000..d3050c1c4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved.cpp @@ -0,0 +1,246 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/Resolved.hpp" +#include "Resolved.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; +} + +using CPPRMatrix = resonances::RMatrix; +using CPPBreitWigner = resonances::BreitWigner; +using CPPEnergyIntervals = resonances::EnergyIntervals; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResolved +ResolvedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Resolved +ResolvedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResolved +ResolvedCreateConst( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, +) { + ConstHandle2Resolved handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + domainMin, + domainMax, + domainUnit + ); + return handle; +} + +// Create, general +Handle2Resolved +ResolvedCreate( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, +) { + ConstHandle2Resolved handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + 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 +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 +Float64 +ResolvedDomainMinGet(ConstHandle2ConstResolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +ResolvedDomainMinSet(ConstHandle2Resolved self, const Float64 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 +Float64 +ResolvedDomainMaxGet(ConstHandle2ConstResolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +ResolvedDomainMaxSet(ConstHandle2Resolved self, const Float64 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 +XMLName +ResolvedDomainUnitGet(ConstHandle2ConstResolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainUnitGet", self, extract::domainUnit); +} + +// Set +void +ResolvedDomainUnitSet(ConstHandle2Resolved self, const XMLName domainUnit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainUnitSet", self, extract::domainUnit, domainUnit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Resolved/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved.h new file mode 100644 index 000000000..d232c85d7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved.h @@ -0,0 +1,200 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_RESOLVED +#define C_INTERFACE_TEST_V2_0_RESONANCES_RESOLVED + +#include "GNDStk.h" +#include "v2.0/resonances/RMatrix.h" +#include "v2.0/resonances/BreitWigner.h" +#include "v2.0/resonances/EnergyIntervals.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 +extern_c Handle2Resolved +ResolvedDefault(); + +// --- Create, general, const +extern_c Handle2ConstResolved +ResolvedCreateConst( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, +); + +// +++ Create, general +extern_c Handle2Resolved +ResolvedCreate( + const Float64 domainMin, + const Float64 domainMax, + const XMLName 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 +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 Float64 +ResolvedDomainMinGet(ConstHandle2ConstResolved self); + +// +++ Set +extern_c void +ResolvedDomainMinSet(ConstHandle2Resolved self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResolvedDomainMaxHas(ConstHandle2ConstResolved self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +ResolvedDomainMaxGet(ConstHandle2ConstResolved self); + +// +++ Set +extern_c void +ResolvedDomainMaxSet(ConstHandle2Resolved self, const Float64 domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResolvedDomainUnitHas(ConstHandle2ConstResolved self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ResolvedDomainUnitGet(ConstHandle2ConstResolved self); + +// +++ Set +extern_c void +ResolvedDomainUnitSet(ConstHandle2Resolved self, const XMLName domainUnit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Resolved/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resolved/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceParameters.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceParameters.cpp new file mode 100644 index 000000000..063ac56e6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceParameters.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/ResonanceParameters.hpp" +#include "ResonanceParameters.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Table; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonanceParameters +ResonanceParametersDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/resonances/ResonanceParameters/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceParameters.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceParameters.h new file mode 100644 index 000000000..620f47006 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/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_TEST_V2_0_RESONANCES_RESONANCEPARAMETERS +#define C_INTERFACE_TEST_V2_0_RESONANCES_RESONANCEPARAMETERS + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2ResonanceParameters +ResonanceParametersDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonanceParameters +ResonanceParametersCreateConst( + ConstHandle2ConstTable table +); + +// +++ Create, general +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/resonances/ResonanceParameters/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceParameters/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceParameters/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceParameters/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceParameters/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction.cpp new file mode 100644 index 000000000..8e4a28e66 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction.cpp @@ -0,0 +1,450 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/ResonanceReaction.hpp" +#include "ResonanceReaction.h" + +using namespace njoy::GNDStk; +using namespace test::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 boundaryConditionValue = [](auto &obj) { return &obj.boundaryConditionValue; }; + static auto eliminated = [](auto &obj) { return &obj.eliminated; }; + static auto Q = [](auto &obj) { return &obj.Q; }; + static auto scatteringRadius = [](auto &obj) { return &obj.scatteringRadius; }; + static auto hardSphereRadius = [](auto &obj) { return &obj.hardSphereRadius; }; + static auto link = [](auto &obj) { return &obj.link; }; +} + +using CPPQ = common::Q; +using CPPScatteringRadius = resonances::ScatteringRadius; +using CPPHardSphereRadius = resonances::HardSphereRadius; +using CPPLink = containers::Link; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonanceReaction +ResonanceReactionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ResonanceReaction +ResonanceReactionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResonanceReaction +ResonanceReactionCreateConst( + const XMLName label, + const XMLName ejectile, + const Float64 boundaryConditionValue, + const bool eliminated, + ConstHandle2ConstQ Q, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstLink link +) { + ConstHandle2ResonanceReaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + ejectile, + boundaryConditionValue, + eliminated, + detail::tocpp(Q), + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius), + detail::tocpp(link) + ); + return handle; +} + +// Create, general +Handle2ResonanceReaction +ResonanceReactionCreate( + const XMLName label, + const XMLName ejectile, + const Float64 boundaryConditionValue, + const bool eliminated, + ConstHandle2ConstQ Q, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstLink link +) { + ConstHandle2ResonanceReaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + ejectile, + boundaryConditionValue, + eliminated, + detail::tocpp(Q), + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius), + detail::tocpp(link) + ); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +ResonanceReactionLabelGet(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ResonanceReactionLabelSet(ConstHandle2ResonanceReaction self, const XMLName 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 +XMLName +ResonanceReactionEjectileGet(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EjectileGet", self, extract::ejectile); +} + +// Set +void +ResonanceReactionEjectileSet(ConstHandle2ResonanceReaction self, const XMLName ejectile) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EjectileSet", self, extract::ejectile, ejectile); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: boundaryConditionValue +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceReactionBoundaryConditionValueHas(ConstHandle2ConstResonanceReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BoundaryConditionValueHas", self, extract::boundaryConditionValue); +} + +// Get +// Returns by value +Float64 +ResonanceReactionBoundaryConditionValueGet(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BoundaryConditionValueGet", self, extract::boundaryConditionValue); +} + +// Set +void +ResonanceReactionBoundaryConditionValueSet(ConstHandle2ResonanceReaction self, const Float64 boundaryConditionValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BoundaryConditionValueSet", self, extract::boundaryConditionValue, boundaryConditionValue); +} + + +// ----------------------------------------------------------------------------- +// 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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: 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/ResonanceReaction/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction.h new file mode 100644 index 000000000..ddc5ba5a9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction.h @@ -0,0 +1,313 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_RESONANCEREACTION +#define C_INTERFACE_TEST_V2_0_RESONANCES_RESONANCEREACTION + +#include "GNDStk.h" +#include "v2.0/common/Q.h" +#include "v2.0/resonances/ScatteringRadius.h" +#include "v2.0/resonances/HardSphereRadius.h" +#include "v2.0/containers/Link.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 +extern_c Handle2ResonanceReaction +ResonanceReactionDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonanceReaction +ResonanceReactionCreateConst( + const XMLName label, + const XMLName ejectile, + const Float64 boundaryConditionValue, + const bool eliminated, + ConstHandle2ConstQ Q, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstLink link +); + +// +++ Create, general +extern_c Handle2ResonanceReaction +ResonanceReactionCreate( + const XMLName label, + const XMLName ejectile, + const Float64 boundaryConditionValue, + const bool eliminated, + ConstHandle2ConstQ Q, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstLink link +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +ResonanceReactionLabelGet(ConstHandle2ConstResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionLabelSet(ConstHandle2ResonanceReaction self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: ejectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionEjectileHas(ConstHandle2ConstResonanceReaction self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ResonanceReactionEjectileGet(ConstHandle2ConstResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionEjectileSet(ConstHandle2ResonanceReaction self, const XMLName ejectile); + + +// ----------------------------------------------------------------------------- +// Metadatum: boundaryConditionValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionBoundaryConditionValueHas(ConstHandle2ConstResonanceReaction self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +ResonanceReactionBoundaryConditionValueGet(ConstHandle2ConstResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionBoundaryConditionValueSet(ConstHandle2ResonanceReaction self, const Float64 boundaryConditionValue); + + +// ----------------------------------------------------------------------------- +// 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: 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); + + +// ----------------------------------------------------------------------------- +// 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: 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/ResonanceReaction/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReaction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions.cpp new file mode 100644 index 000000000..df7e1dd6e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions.cpp @@ -0,0 +1,392 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/ResonanceReactions.hpp" +#include "ResonanceReactions.h" + +using namespace njoy::GNDStk; +using namespace test::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 = resonances::ResonanceReaction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonanceReactions +ResonanceReactionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +ResonanceReactionsResonanceReactionHasByLabel( + ConstHandle2ConstResonanceReactions self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionHasByLabel", + self, extract::resonanceReaction, meta::label, label); +} + +// Get, by label, const +Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByLabelConst( + ConstHandle2ConstResonanceReactions self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByLabelConst", + self, extract::resonanceReaction, meta::label, label); +} + +// Get, by label, non-const +Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByLabel( + ConstHandle2ResonanceReactions self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByLabel", + self, extract::resonanceReaction, meta::label, label); +} + +// Set, by label +void +ResonanceReactionsResonanceReactionSetByLabel( + ConstHandle2ResonanceReactions self, + const XMLName label, + ConstHandle2ConstResonanceReaction resonanceReaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionSetByLabel", + self, extract::resonanceReaction, meta::label, label, resonanceReaction); +} + +// Has, by ejectile +int +ResonanceReactionsResonanceReactionHasByEjectile( + ConstHandle2ConstResonanceReactions self, + const XMLName ejectile +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionHasByEjectile", + self, extract::resonanceReaction, meta::ejectile, ejectile); +} + +// Get, by ejectile, const +Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByEjectileConst( + ConstHandle2ConstResonanceReactions self, + const XMLName ejectile +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByEjectileConst", + self, extract::resonanceReaction, meta::ejectile, ejectile); +} + +// Get, by ejectile, non-const +Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByEjectile( + ConstHandle2ResonanceReactions self, + const XMLName ejectile +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByEjectile", + self, extract::resonanceReaction, meta::ejectile, ejectile); +} + +// Set, by ejectile +void +ResonanceReactionsResonanceReactionSetByEjectile( + ConstHandle2ResonanceReactions self, + const XMLName ejectile, + ConstHandle2ConstResonanceReaction resonanceReaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionSetByEjectile", + self, extract::resonanceReaction, meta::ejectile, ejectile, resonanceReaction); +} + +// Has, by boundaryConditionValue +int +ResonanceReactionsResonanceReactionHasByBoundaryConditionValue( + ConstHandle2ConstResonanceReactions self, + const Float64 boundaryConditionValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionHasByBoundaryConditionValue", + self, extract::resonanceReaction, meta::boundaryConditionValue, boundaryConditionValue); +} + +// Get, by boundaryConditionValue, const +Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByBoundaryConditionValueConst( + ConstHandle2ConstResonanceReactions self, + const Float64 boundaryConditionValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByBoundaryConditionValueConst", + self, extract::resonanceReaction, meta::boundaryConditionValue, boundaryConditionValue); +} + +// Get, by boundaryConditionValue, non-const +Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByBoundaryConditionValue( + ConstHandle2ResonanceReactions self, + const Float64 boundaryConditionValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByBoundaryConditionValue", + self, extract::resonanceReaction, meta::boundaryConditionValue, boundaryConditionValue); +} + +// Set, by boundaryConditionValue +void +ResonanceReactionsResonanceReactionSetByBoundaryConditionValue( + ConstHandle2ResonanceReactions self, + const Float64 boundaryConditionValue, + ConstHandle2ConstResonanceReaction resonanceReaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionSetByBoundaryConditionValue", + self, extract::resonanceReaction, meta::boundaryConditionValue, boundaryConditionValue, resonanceReaction); +} + +// 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/resonances/ResonanceReactions/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions.h new file mode 100644 index 000000000..eecdf3099 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions.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. +// +// 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_TEST_V2_0_RESONANCES_RESONANCEREACTIONS +#define C_INTERFACE_TEST_V2_0_RESONANCES_RESONANCEREACTIONS + +#include "GNDStk.h" +#include "v2.0/resonances/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 +extern_c Handle2ResonanceReactions +ResonanceReactionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonanceReactions +ResonanceReactionsCreateConst( + ConstHandle2ResonanceReaction *const resonanceReaction, const size_t resonanceReactionSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +ResonanceReactionsResonanceReactionHasByLabel( + ConstHandle2ConstResonanceReactions self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByLabelConst( + ConstHandle2ConstResonanceReactions self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByLabel( + ConstHandle2ResonanceReactions self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ResonanceReactionsResonanceReactionSetByLabel( + ConstHandle2ResonanceReactions self, + const XMLName label, + ConstHandle2ConstResonanceReaction resonanceReaction +); + +// +++ Has, by ejectile +extern_c int +ResonanceReactionsResonanceReactionHasByEjectile( + ConstHandle2ConstResonanceReactions self, + const XMLName ejectile +); + +// --- Get, by ejectile, const +extern_c Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByEjectileConst( + ConstHandle2ConstResonanceReactions self, + const XMLName ejectile +); + +// +++ Get, by ejectile, non-const +extern_c Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByEjectile( + ConstHandle2ResonanceReactions self, + const XMLName ejectile +); + +// +++ Set, by ejectile +extern_c void +ResonanceReactionsResonanceReactionSetByEjectile( + ConstHandle2ResonanceReactions self, + const XMLName ejectile, + ConstHandle2ConstResonanceReaction resonanceReaction +); + +// +++ Has, by boundaryConditionValue +extern_c int +ResonanceReactionsResonanceReactionHasByBoundaryConditionValue( + ConstHandle2ConstResonanceReactions self, + const Float64 boundaryConditionValue +); + +// --- Get, by boundaryConditionValue, const +extern_c Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByBoundaryConditionValueConst( + ConstHandle2ConstResonanceReactions self, + const Float64 boundaryConditionValue +); + +// +++ Get, by boundaryConditionValue, non-const +extern_c Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByBoundaryConditionValue( + ConstHandle2ResonanceReactions self, + const Float64 boundaryConditionValue +); + +// +++ Set, by boundaryConditionValue +extern_c void +ResonanceReactionsResonanceReactionSetByBoundaryConditionValue( + ConstHandle2ResonanceReactions self, + const Float64 boundaryConditionValue, + ConstHandle2ConstResonanceReaction resonanceReaction +); + +// +++ 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/resonances/ResonanceReactions/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ResonanceReactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances.cpp new file mode 100644 index 000000000..d4042b901 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances.cpp @@ -0,0 +1,677 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/Resonances.hpp" +#include "Resonances.h" + +using namespace njoy::GNDStk; +using namespace test::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 hardSphereRadius = [](auto &obj) { return &obj.hardSphereRadius; }; + static auto resolved = [](auto &obj) { return &obj.resolved; }; + static auto unresolved = [](auto &obj) { return &obj.unresolved; }; +} + +using CPPScatteringRadius = resonances::ScatteringRadius; +using CPPHardSphereRadius = resonances::HardSphereRadius; +using CPPResolved = resonances::Resolved; +using CPPUnresolved = resonances::Unresolved; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonances +ResonancesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Resonances +ResonancesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResonances +ResonancesCreateConst( + const XMLName href, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2Resolved *const resolved, const size_t resolvedSize, + ConstHandle2Unresolved *const unresolved, const size_t unresolvedSize +) { + ConstHandle2Resonances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href, + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius), + std::vector{}, + std::vector{} + ); + for (size_t ResolvedN = 0; ResolvedN < resolvedSize; ++ResolvedN) + ResonancesResolvedAdd(handle, resolved[ResolvedN]); + for (size_t UnresolvedN = 0; UnresolvedN < unresolvedSize; ++UnresolvedN) + ResonancesUnresolvedAdd(handle, unresolved[UnresolvedN]); + return handle; +} + +// Create, general +Handle2Resonances +ResonancesCreate( + const XMLName href, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2Resolved *const resolved, const size_t resolvedSize, + ConstHandle2Unresolved *const unresolved, const size_t unresolvedSize +) { + ConstHandle2Resonances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href, + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius), + std::vector{}, + std::vector{} + ); + for (size_t ResolvedN = 0; ResolvedN < resolvedSize; ++ResolvedN) + ResonancesResolvedAdd(handle, resolved[ResolvedN]); + for (size_t UnresolvedN = 0; UnresolvedN < unresolvedSize; ++UnresolvedN) + ResonancesUnresolvedAdd(handle, unresolved[UnresolvedN]); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +ResonancesHrefGet(ConstHandle2ConstResonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ResonancesHrefSet(ConstHandle2Resonances self, const XMLName 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: hardSphereRadius +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesHardSphereRadiusHas(ConstHandle2ConstResonances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HardSphereRadiusHas", self, extract::hardSphereRadius); +} + +// Get, const +Handle2ConstHardSphereRadius +ResonancesHardSphereRadiusGetConst(ConstHandle2ConstResonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGetConst", self, extract::hardSphereRadius); +} + +// Get, non-const +Handle2HardSphereRadius +ResonancesHardSphereRadiusGet(ConstHandle2Resonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGet", self, extract::hardSphereRadius); +} + +// Set +void +ResonancesHardSphereRadiusSet(ConstHandle2Resonances self, ConstHandle2ConstHardSphereRadius hardSphereRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HardSphereRadiusSet", self, extract::hardSphereRadius, hardSphereRadius); +} + + +// ----------------------------------------------------------------------------- +// Child: resolved +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesResolvedHas(ConstHandle2ConstResonances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResolvedHas", self, extract::resolved); +} + +// Clear +void +ResonancesResolvedClear(ConstHandle2Resonances self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ResolvedClear", self, extract::resolved); +} + +// Size +size_t +ResonancesResolvedSize(ConstHandle2ConstResonances self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ResolvedSize", self, extract::resolved); +} + +// Add +void +ResonancesResolvedAdd(ConstHandle2Resonances self, ConstHandle2ConstResolved resolved) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ResolvedAdd", self, extract::resolved, resolved); +} + +// Get, by index \in [0,size), const +Handle2ConstResolved +ResonancesResolvedGetConst(ConstHandle2ConstResonances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ResolvedGetConst", self, extract::resolved, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Resolved +ResonancesResolvedGet(ConstHandle2Resonances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ResolvedGet", self, extract::resolved, index_); +} + +// Set, by index \in [0,size) +void +ResonancesResolvedSet( + ConstHandle2Resonances self, + const size_t index_, + ConstHandle2ConstResolved resolved +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ResolvedSet", self, extract::resolved, index_, resolved); +} + +// Has, by domainMin +int +ResonancesResolvedHasByDomainMin( + ConstHandle2ConstResonances self, + const Float64 domainMin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedHasByDomainMin", + self, extract::resolved, meta::domainMin, domainMin); +} + +// Get, by domainMin, const +Handle2ConstResolved +ResonancesResolvedGetByDomainMinConst( + ConstHandle2ConstResonances self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedGetByDomainMinConst", + self, extract::resolved, meta::domainMin, domainMin); +} + +// Get, by domainMin, non-const +Handle2Resolved +ResonancesResolvedGetByDomainMin( + ConstHandle2Resonances self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedGetByDomainMin", + self, extract::resolved, meta::domainMin, domainMin); +} + +// Set, by domainMin +void +ResonancesResolvedSetByDomainMin( + ConstHandle2Resonances self, + const Float64 domainMin, + ConstHandle2ConstResolved resolved +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedSetByDomainMin", + self, extract::resolved, meta::domainMin, domainMin, resolved); +} + +// Has, by domainMax +int +ResonancesResolvedHasByDomainMax( + ConstHandle2ConstResonances self, + const Float64 domainMax +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedHasByDomainMax", + self, extract::resolved, meta::domainMax, domainMax); +} + +// Get, by domainMax, const +Handle2ConstResolved +ResonancesResolvedGetByDomainMaxConst( + ConstHandle2ConstResonances self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedGetByDomainMaxConst", + self, extract::resolved, meta::domainMax, domainMax); +} + +// Get, by domainMax, non-const +Handle2Resolved +ResonancesResolvedGetByDomainMax( + ConstHandle2Resonances self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedGetByDomainMax", + self, extract::resolved, meta::domainMax, domainMax); +} + +// Set, by domainMax +void +ResonancesResolvedSetByDomainMax( + ConstHandle2Resonances self, + const Float64 domainMax, + ConstHandle2ConstResolved resolved +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedSetByDomainMax", + self, extract::resolved, meta::domainMax, domainMax, resolved); +} + +// Has, by domainUnit +int +ResonancesResolvedHasByDomainUnit( + ConstHandle2ConstResonances self, + const XMLName domainUnit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedHasByDomainUnit", + self, extract::resolved, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, const +Handle2ConstResolved +ResonancesResolvedGetByDomainUnitConst( + ConstHandle2ConstResonances self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedGetByDomainUnitConst", + self, extract::resolved, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, non-const +Handle2Resolved +ResonancesResolvedGetByDomainUnit( + ConstHandle2Resonances self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedGetByDomainUnit", + self, extract::resolved, meta::domainUnit, domainUnit); +} + +// Set, by domainUnit +void +ResonancesResolvedSetByDomainUnit( + ConstHandle2Resonances self, + const XMLName domainUnit, + ConstHandle2ConstResolved resolved +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ResolvedSetByDomainUnit", + self, extract::resolved, meta::domainUnit, domainUnit, resolved); +} + + +// ----------------------------------------------------------------------------- +// Child: unresolved +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesUnresolvedHas(ConstHandle2ConstResonances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnresolvedHas", self, extract::unresolved); +} + +// Clear +void +ResonancesUnresolvedClear(ConstHandle2Resonances self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"UnresolvedClear", self, extract::unresolved); +} + +// Size +size_t +ResonancesUnresolvedSize(ConstHandle2ConstResonances self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"UnresolvedSize", self, extract::unresolved); +} + +// Add +void +ResonancesUnresolvedAdd(ConstHandle2Resonances self, ConstHandle2ConstUnresolved unresolved) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"UnresolvedAdd", self, extract::unresolved, unresolved); +} + +// Get, by index \in [0,size), const +Handle2ConstUnresolved +ResonancesUnresolvedGetConst(ConstHandle2ConstResonances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"UnresolvedGetConst", self, extract::unresolved, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Unresolved +ResonancesUnresolvedGet(ConstHandle2Resonances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"UnresolvedGet", self, extract::unresolved, index_); +} + +// Set, by index \in [0,size) +void +ResonancesUnresolvedSet( + ConstHandle2Resonances self, + const size_t index_, + ConstHandle2ConstUnresolved unresolved +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"UnresolvedSet", self, extract::unresolved, index_, unresolved); +} + +// Has, by domainMin +int +ResonancesUnresolvedHasByDomainMin( + ConstHandle2ConstResonances self, + const Float64 domainMin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedHasByDomainMin", + self, extract::unresolved, meta::domainMin, domainMin); +} + +// Get, by domainMin, const +Handle2ConstUnresolved +ResonancesUnresolvedGetByDomainMinConst( + ConstHandle2ConstResonances self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedGetByDomainMinConst", + self, extract::unresolved, meta::domainMin, domainMin); +} + +// Get, by domainMin, non-const +Handle2Unresolved +ResonancesUnresolvedGetByDomainMin( + ConstHandle2Resonances self, + const Float64 domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedGetByDomainMin", + self, extract::unresolved, meta::domainMin, domainMin); +} + +// Set, by domainMin +void +ResonancesUnresolvedSetByDomainMin( + ConstHandle2Resonances self, + const Float64 domainMin, + ConstHandle2ConstUnresolved unresolved +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedSetByDomainMin", + self, extract::unresolved, meta::domainMin, domainMin, unresolved); +} + +// Has, by domainMax +int +ResonancesUnresolvedHasByDomainMax( + ConstHandle2ConstResonances self, + const Float64 domainMax +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedHasByDomainMax", + self, extract::unresolved, meta::domainMax, domainMax); +} + +// Get, by domainMax, const +Handle2ConstUnresolved +ResonancesUnresolvedGetByDomainMaxConst( + ConstHandle2ConstResonances self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedGetByDomainMaxConst", + self, extract::unresolved, meta::domainMax, domainMax); +} + +// Get, by domainMax, non-const +Handle2Unresolved +ResonancesUnresolvedGetByDomainMax( + ConstHandle2Resonances self, + const Float64 domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedGetByDomainMax", + self, extract::unresolved, meta::domainMax, domainMax); +} + +// Set, by domainMax +void +ResonancesUnresolvedSetByDomainMax( + ConstHandle2Resonances self, + const Float64 domainMax, + ConstHandle2ConstUnresolved unresolved +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedSetByDomainMax", + self, extract::unresolved, meta::domainMax, domainMax, unresolved); +} + +// Has, by domainUnit +int +ResonancesUnresolvedHasByDomainUnit( + ConstHandle2ConstResonances self, + const XMLName domainUnit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedHasByDomainUnit", + self, extract::unresolved, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, const +Handle2ConstUnresolved +ResonancesUnresolvedGetByDomainUnitConst( + ConstHandle2ConstResonances self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedGetByDomainUnitConst", + self, extract::unresolved, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, non-const +Handle2Unresolved +ResonancesUnresolvedGetByDomainUnit( + ConstHandle2Resonances self, + const XMLName domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedGetByDomainUnit", + self, extract::unresolved, meta::domainUnit, domainUnit); +} + +// Set, by domainUnit +void +ResonancesUnresolvedSetByDomainUnit( + ConstHandle2Resonances self, + const XMLName domainUnit, + ConstHandle2ConstUnresolved unresolved +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"UnresolvedSetByDomainUnit", + self, extract::unresolved, meta::domainUnit, domainUnit, unresolved); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Resonances/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances.h new file mode 100644 index 000000000..c66d48b6b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances.h @@ -0,0 +1,459 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_RESONANCES +#define C_INTERFACE_TEST_V2_0_RESONANCES_RESONANCES + +#include "GNDStk.h" +#include "v2.0/resonances/ScatteringRadius.h" +#include "v2.0/resonances/HardSphereRadius.h" +#include "v2.0/resonances/Resolved.h" +#include "v2.0/resonances/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 +extern_c Handle2Resonances +ResonancesDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonances +ResonancesCreateConst( + const XMLName href, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2Resolved *const resolved, const size_t resolvedSize, + ConstHandle2Unresolved *const unresolved, const size_t unresolvedSize +); + +// +++ Create, general +extern_c Handle2Resonances +ResonancesCreate( + const XMLName href, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2Resolved *const resolved, const size_t resolvedSize, + ConstHandle2Unresolved *const unresolved, const size_t unresolvedSize +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +ResonancesHrefGet(ConstHandle2ConstResonances self); + +// +++ Set +extern_c void +ResonancesHrefSet(ConstHandle2Resonances self, const XMLName 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: hardSphereRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesHardSphereRadiusHas(ConstHandle2ConstResonances self); + +// --- Get, const +extern_c Handle2ConstHardSphereRadius +ResonancesHardSphereRadiusGetConst(ConstHandle2ConstResonances self); + +// +++ Get, non-const +extern_c Handle2HardSphereRadius +ResonancesHardSphereRadiusGet(ConstHandle2Resonances self); + +// +++ Set +extern_c void +ResonancesHardSphereRadiusSet(ConstHandle2Resonances self, ConstHandle2ConstHardSphereRadius hardSphereRadius); + + +// ----------------------------------------------------------------------------- +// Child: resolved +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesResolvedHas(ConstHandle2ConstResonances self); + +// +++ Clear +extern_c void +ResonancesResolvedClear(ConstHandle2Resonances self); + +// +++ Size +extern_c size_t +ResonancesResolvedSize(ConstHandle2ConstResonances self); + +// +++ Add +extern_c void +ResonancesResolvedAdd(ConstHandle2Resonances self, ConstHandle2ConstResolved resolved); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstResolved +ResonancesResolvedGetConst(ConstHandle2ConstResonances self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Resolved +ResonancesResolvedGet(ConstHandle2Resonances self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ResonancesResolvedSet( + ConstHandle2Resonances self, + const size_t index_, + ConstHandle2ConstResolved resolved +); + +// +++ Has, by domainMin +extern_c int +ResonancesResolvedHasByDomainMin( + ConstHandle2ConstResonances self, + const Float64 domainMin +); + +// --- Get, by domainMin, const +extern_c Handle2ConstResolved +ResonancesResolvedGetByDomainMinConst( + ConstHandle2ConstResonances self, + const Float64 domainMin +); + +// +++ Get, by domainMin, non-const +extern_c Handle2Resolved +ResonancesResolvedGetByDomainMin( + ConstHandle2Resonances self, + const Float64 domainMin +); + +// +++ Set, by domainMin +extern_c void +ResonancesResolvedSetByDomainMin( + ConstHandle2Resonances self, + const Float64 domainMin, + ConstHandle2ConstResolved resolved +); + +// +++ Has, by domainMax +extern_c int +ResonancesResolvedHasByDomainMax( + ConstHandle2ConstResonances self, + const Float64 domainMax +); + +// --- Get, by domainMax, const +extern_c Handle2ConstResolved +ResonancesResolvedGetByDomainMaxConst( + ConstHandle2ConstResonances self, + const Float64 domainMax +); + +// +++ Get, by domainMax, non-const +extern_c Handle2Resolved +ResonancesResolvedGetByDomainMax( + ConstHandle2Resonances self, + const Float64 domainMax +); + +// +++ Set, by domainMax +extern_c void +ResonancesResolvedSetByDomainMax( + ConstHandle2Resonances self, + const Float64 domainMax, + ConstHandle2ConstResolved resolved +); + +// +++ Has, by domainUnit +extern_c int +ResonancesResolvedHasByDomainUnit( + ConstHandle2ConstResonances self, + const XMLName domainUnit +); + +// --- Get, by domainUnit, const +extern_c Handle2ConstResolved +ResonancesResolvedGetByDomainUnitConst( + ConstHandle2ConstResonances self, + const XMLName domainUnit +); + +// +++ Get, by domainUnit, non-const +extern_c Handle2Resolved +ResonancesResolvedGetByDomainUnit( + ConstHandle2Resonances self, + const XMLName domainUnit +); + +// +++ Set, by domainUnit +extern_c void +ResonancesResolvedSetByDomainUnit( + ConstHandle2Resonances self, + const XMLName domainUnit, + ConstHandle2ConstResolved resolved +); + + +// ----------------------------------------------------------------------------- +// Child: unresolved +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesUnresolvedHas(ConstHandle2ConstResonances self); + +// +++ Clear +extern_c void +ResonancesUnresolvedClear(ConstHandle2Resonances self); + +// +++ Size +extern_c size_t +ResonancesUnresolvedSize(ConstHandle2ConstResonances self); + +// +++ Add +extern_c void +ResonancesUnresolvedAdd(ConstHandle2Resonances self, ConstHandle2ConstUnresolved unresolved); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstUnresolved +ResonancesUnresolvedGetConst(ConstHandle2ConstResonances self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Unresolved +ResonancesUnresolvedGet(ConstHandle2Resonances self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ResonancesUnresolvedSet( + ConstHandle2Resonances self, + const size_t index_, + ConstHandle2ConstUnresolved unresolved +); + +// +++ Has, by domainMin +extern_c int +ResonancesUnresolvedHasByDomainMin( + ConstHandle2ConstResonances self, + const Float64 domainMin +); + +// --- Get, by domainMin, const +extern_c Handle2ConstUnresolved +ResonancesUnresolvedGetByDomainMinConst( + ConstHandle2ConstResonances self, + const Float64 domainMin +); + +// +++ Get, by domainMin, non-const +extern_c Handle2Unresolved +ResonancesUnresolvedGetByDomainMin( + ConstHandle2Resonances self, + const Float64 domainMin +); + +// +++ Set, by domainMin +extern_c void +ResonancesUnresolvedSetByDomainMin( + ConstHandle2Resonances self, + const Float64 domainMin, + ConstHandle2ConstUnresolved unresolved +); + +// +++ Has, by domainMax +extern_c int +ResonancesUnresolvedHasByDomainMax( + ConstHandle2ConstResonances self, + const Float64 domainMax +); + +// --- Get, by domainMax, const +extern_c Handle2ConstUnresolved +ResonancesUnresolvedGetByDomainMaxConst( + ConstHandle2ConstResonances self, + const Float64 domainMax +); + +// +++ Get, by domainMax, non-const +extern_c Handle2Unresolved +ResonancesUnresolvedGetByDomainMax( + ConstHandle2Resonances self, + const Float64 domainMax +); + +// +++ Set, by domainMax +extern_c void +ResonancesUnresolvedSetByDomainMax( + ConstHandle2Resonances self, + const Float64 domainMax, + ConstHandle2ConstUnresolved unresolved +); + +// +++ Has, by domainUnit +extern_c int +ResonancesUnresolvedHasByDomainUnit( + ConstHandle2ConstResonances self, + const XMLName domainUnit +); + +// --- Get, by domainUnit, const +extern_c Handle2ConstUnresolved +ResonancesUnresolvedGetByDomainUnitConst( + ConstHandle2ConstResonances self, + const XMLName domainUnit +); + +// +++ Get, by domainUnit, non-const +extern_c Handle2Unresolved +ResonancesUnresolvedGetByDomainUnit( + ConstHandle2Resonances self, + const XMLName domainUnit +); + +// +++ Set, by domainUnit +extern_c void +ResonancesUnresolvedSetByDomainUnit( + ConstHandle2Resonances self, + const XMLName domainUnit, + ConstHandle2ConstUnresolved unresolved +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Resonances/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Resonances/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius.cpp new file mode 100644 index 000000000..bcc00a445 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius.cpp @@ -0,0 +1,141 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/ScatteringRadius.hpp" +#include "ScatteringRadius.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ScatteringRadiusClass; +using CPP = multigroup::ScatteringRadius; + +static const std::string CLASSNAME = "ScatteringRadius"; + +namespace extract { +} + +using CPPConstant1d = containers::Constant1d; +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstScatteringRadius +ScatteringRadiusDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ScatteringRadius +ScatteringRadiusDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstScatteringRadius +ScatteringRadiusCreateConst( +) { + ConstHandle2ScatteringRadius handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2ScatteringRadius +ScatteringRadiusCreate( +) { + ConstHandle2ScatteringRadius 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/ScatteringRadius/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius.h new file mode 100644 index 000000000..b216ba3eb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius.h @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_SCATTERINGRADIUS +#define C_INTERFACE_TEST_V2_0_RESONANCES_SCATTERINGRADIUS + +#include "GNDStk.h" +#include "v2.0/containers/Constant1d.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.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 +extern_c Handle2ScatteringRadius +ScatteringRadiusDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringRadius +ScatteringRadiusCreateConst( +); + +// +++ Create, general +extern_c Handle2ScatteringRadius +ScatteringRadiusCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/ScatteringRadius/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/ScatteringRadius/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroup.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroup.cpp new file mode 100644 index 000000000..6c5f49978 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroup.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/SpinGroup.hpp" +#include "SpinGroup.h" + +using namespace njoy::GNDStk; +using namespace test::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 = resonances::Channels; +using CPPResonanceParameters = resonances::ResonanceParameters; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpinGroup +SpinGroupDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2SpinGroup +SpinGroupDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSpinGroup +SpinGroupCreateConst( + const XMLName label, + const Fraction32 spin, + const Integer32 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 +Handle2SpinGroup +SpinGroupCreate( + const XMLName label, + const Fraction32 spin, + const Integer32 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 +XMLName +SpinGroupLabelGet(ConstHandle2ConstSpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +SpinGroupLabelSet(ConstHandle2SpinGroup self, const XMLName 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 +Fraction32 +SpinGroupSpinGet(ConstHandle2ConstSpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGet", self, extract::spin); +} + +// Set +void +SpinGroupSpinSet(ConstHandle2SpinGroup self, const Fraction32 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 +Integer32 +SpinGroupParityGet(ConstHandle2ConstSpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGet", self, extract::parity); +} + +// Set +void +SpinGroupParitySet(ConstHandle2SpinGroup self, const Integer32 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/resonances/SpinGroup/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroup.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroup.h new file mode 100644 index 000000000..607efa0a5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/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_TEST_V2_0_RESONANCES_SPINGROUP +#define C_INTERFACE_TEST_V2_0_RESONANCES_SPINGROUP + +#include "GNDStk.h" +#include "v2.0/resonances/Channels.h" +#include "v2.0/resonances/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 +extern_c Handle2SpinGroup +SpinGroupDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpinGroup +SpinGroupCreateConst( + const XMLName label, + const Fraction32 spin, + const Integer32 parity, + ConstHandle2ConstChannels channels, + ConstHandle2ConstResonanceParameters resonanceParameters +); + +// +++ Create, general +extern_c Handle2SpinGroup +SpinGroupCreate( + const XMLName label, + const Fraction32 spin, + const Integer32 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 XMLName +SpinGroupLabelGet(ConstHandle2ConstSpinGroup self); + +// +++ Set +extern_c void +SpinGroupLabelSet(ConstHandle2SpinGroup self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: spin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinGroupSpinHas(ConstHandle2ConstSpinGroup self); + +// +++ Get +// +++ Returns by value +extern_c Fraction32 +SpinGroupSpinGet(ConstHandle2ConstSpinGroup self); + +// +++ Set +extern_c void +SpinGroupSpinSet(ConstHandle2SpinGroup self, const Fraction32 spin); + + +// ----------------------------------------------------------------------------- +// Metadatum: parity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinGroupParityHas(ConstHandle2ConstSpinGroup self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +SpinGroupParityGet(ConstHandle2ConstSpinGroup self); + +// +++ Set +extern_c void +SpinGroupParitySet(ConstHandle2SpinGroup self, const Integer32 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/resonances/SpinGroup/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroup/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroup/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroup/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroup/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups.cpp new file mode 100644 index 000000000..c098c1a77 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/SpinGroups.hpp" +#include "SpinGroups.h" + +using namespace njoy::GNDStk; +using namespace test::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 = resonances::SpinGroup; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpinGroups +SpinGroupsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by label +int +SpinGroupsSpinGroupHasByLabel( + ConstHandle2ConstSpinGroups self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupHasByLabel", + self, extract::spinGroup, meta::label, label); +} + +// Get, by label, const +Handle2ConstSpinGroup +SpinGroupsSpinGroupGetByLabelConst( + ConstHandle2ConstSpinGroups self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetByLabelConst", + self, extract::spinGroup, meta::label, label); +} + +// Get, by label, non-const +Handle2SpinGroup +SpinGroupsSpinGroupGetByLabel( + ConstHandle2SpinGroups self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetByLabel", + self, extract::spinGroup, meta::label, label); +} + +// Set, by label +void +SpinGroupsSpinGroupSetByLabel( + ConstHandle2SpinGroups self, + const XMLName label, + ConstHandle2ConstSpinGroup spinGroup +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupSetByLabel", + self, extract::spinGroup, meta::label, label, spinGroup); +} + +// Has, by spin +int +SpinGroupsSpinGroupHasBySpin( + ConstHandle2ConstSpinGroups self, + const Fraction32 spin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupHasBySpin", + self, extract::spinGroup, meta::spin, spin); +} + +// Get, by spin, const +Handle2ConstSpinGroup +SpinGroupsSpinGroupGetBySpinConst( + ConstHandle2ConstSpinGroups self, + const Fraction32 spin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetBySpinConst", + self, extract::spinGroup, meta::spin, spin); +} + +// Get, by spin, non-const +Handle2SpinGroup +SpinGroupsSpinGroupGetBySpin( + ConstHandle2SpinGroups self, + const Fraction32 spin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetBySpin", + self, extract::spinGroup, meta::spin, spin); +} + +// Set, by spin +void +SpinGroupsSpinGroupSetBySpin( + ConstHandle2SpinGroups self, + const Fraction32 spin, + ConstHandle2ConstSpinGroup spinGroup +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupSetBySpin", + self, extract::spinGroup, meta::spin, spin, spinGroup); +} + +// Has, by parity +int +SpinGroupsSpinGroupHasByParity( + ConstHandle2ConstSpinGroups self, + const Integer32 parity +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupHasByParity", + self, extract::spinGroup, meta::parity, parity); +} + +// Get, by parity, const +Handle2ConstSpinGroup +SpinGroupsSpinGroupGetByParityConst( + ConstHandle2ConstSpinGroups self, + const Integer32 parity +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetByParityConst", + self, extract::spinGroup, meta::parity, parity); +} + +// Get, by parity, non-const +Handle2SpinGroup +SpinGroupsSpinGroupGetByParity( + ConstHandle2SpinGroups self, + const Integer32 parity +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetByParity", + self, extract::spinGroup, meta::parity, parity); +} + +// Set, by parity +void +SpinGroupsSpinGroupSetByParity( + ConstHandle2SpinGroups self, + const Integer32 parity, + ConstHandle2ConstSpinGroup spinGroup +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupSetByParity", + self, extract::spinGroup, meta::parity, parity, spinGroup); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/SpinGroups/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups.h new file mode 100644 index 000000000..18a672747 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups.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. +// +// 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_TEST_V2_0_RESONANCES_SPINGROUPS +#define C_INTERFACE_TEST_V2_0_RESONANCES_SPINGROUPS + +#include "GNDStk.h" +#include "v2.0/resonances/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 +extern_c Handle2SpinGroups +SpinGroupsDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpinGroups +SpinGroupsCreateConst( + ConstHandle2SpinGroup *const spinGroup, const size_t spinGroupSize +); + +// +++ Create, general +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 +); + +// +++ Has, by label +extern_c int +SpinGroupsSpinGroupHasByLabel( + ConstHandle2ConstSpinGroups self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstSpinGroup +SpinGroupsSpinGroupGetByLabelConst( + ConstHandle2ConstSpinGroups self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2SpinGroup +SpinGroupsSpinGroupGetByLabel( + ConstHandle2SpinGroups self, + const XMLName label +); + +// +++ Set, by label +extern_c void +SpinGroupsSpinGroupSetByLabel( + ConstHandle2SpinGroups self, + const XMLName label, + ConstHandle2ConstSpinGroup spinGroup +); + +// +++ Has, by spin +extern_c int +SpinGroupsSpinGroupHasBySpin( + ConstHandle2ConstSpinGroups self, + const Fraction32 spin +); + +// --- Get, by spin, const +extern_c Handle2ConstSpinGroup +SpinGroupsSpinGroupGetBySpinConst( + ConstHandle2ConstSpinGroups self, + const Fraction32 spin +); + +// +++ Get, by spin, non-const +extern_c Handle2SpinGroup +SpinGroupsSpinGroupGetBySpin( + ConstHandle2SpinGroups self, + const Fraction32 spin +); + +// +++ Set, by spin +extern_c void +SpinGroupsSpinGroupSetBySpin( + ConstHandle2SpinGroups self, + const Fraction32 spin, + ConstHandle2ConstSpinGroup spinGroup +); + +// +++ Has, by parity +extern_c int +SpinGroupsSpinGroupHasByParity( + ConstHandle2ConstSpinGroups self, + const Integer32 parity +); + +// --- Get, by parity, const +extern_c Handle2ConstSpinGroup +SpinGroupsSpinGroupGetByParityConst( + ConstHandle2ConstSpinGroups self, + const Integer32 parity +); + +// +++ Get, by parity, non-const +extern_c Handle2SpinGroup +SpinGroupsSpinGroupGetByParity( + ConstHandle2SpinGroups self, + const Integer32 parity +); + +// +++ Set, by parity +extern_c void +SpinGroupsSpinGroupSetByParity( + ConstHandle2SpinGroups self, + const Integer32 parity, + ConstHandle2ConstSpinGroup spinGroup +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/SpinGroups/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/SpinGroups/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths.cpp new file mode 100644 index 000000000..44023ca28 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths.cpp @@ -0,0 +1,458 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/TabulatedWidths.hpp" +#include "TabulatedWidths.h" + +using namespace njoy::GNDStk; +using namespace test::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 PoPs_database = [](auto &obj) { return &obj.PoPs_database; }; + static auto scatteringRadius = [](auto &obj) { return &obj.scatteringRadius; }; + static auto hardSphereRadius = [](auto &obj) { return &obj.hardSphereRadius; }; + static auto resonanceReactions = [](auto &obj) { return &obj.resonanceReactions; }; + static auto Ls = [](auto &obj) { return &obj.Ls; }; +} + +using CPPPoPs_database = pops::PoPs_database; +using CPPScatteringRadius = resonances::ScatteringRadius; +using CPPHardSphereRadius = resonances::HardSphereRadius; +using CPPResonanceReactions = resonances::ResonanceReactions; +using CPPLs = resonances::Ls; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTabulatedWidths +TabulatedWidthsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2TabulatedWidths +TabulatedWidthsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTabulatedWidths +TabulatedWidthsCreateConst( + const XMLName label, + const XMLName approximation, + const bool useForSelfShieldingOnly, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstLs Ls +) { + ConstHandle2TabulatedWidths handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + approximation, + useForSelfShieldingOnly, + detail::tocpp(PoPs_database), + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius), + detail::tocpp(resonanceReactions), + detail::tocpp(Ls) + ); + return handle; +} + +// Create, general +Handle2TabulatedWidths +TabulatedWidthsCreate( + const XMLName label, + const XMLName approximation, + const bool useForSelfShieldingOnly, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstLs Ls +) { + ConstHandle2TabulatedWidths handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + approximation, + useForSelfShieldingOnly, + detail::tocpp(PoPs_database), + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius), + detail::tocpp(resonanceReactions), + detail::tocpp(Ls) + ); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +TabulatedWidthsLabelGet(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +TabulatedWidthsLabelSet(ConstHandle2TabulatedWidths self, const XMLName 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 +XMLName +TabulatedWidthsApproximationGet(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ApproximationGet", self, extract::approximation); +} + +// Set +void +TabulatedWidthsApproximationSet(ConstHandle2TabulatedWidths self, const XMLName 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: PoPs_database +// ----------------------------------------------------------------------------- + +// Has +int +TabulatedWidthsPoPs_databaseHas(ConstHandle2ConstTabulatedWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PoPs_databaseHas", self, extract::PoPs_database); +} + +// Get, const +Handle2ConstPoPs_database +TabulatedWidthsPoPs_databaseGetConst(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPs_databaseGetConst", self, extract::PoPs_database); +} + +// Get, non-const +Handle2PoPs_database +TabulatedWidthsPoPs_databaseGet(ConstHandle2TabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPs_databaseGet", self, extract::PoPs_database); +} + +// Set +void +TabulatedWidthsPoPs_databaseSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstPoPs_database PoPs_database) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PoPs_databaseSet", self, extract::PoPs_database, PoPs_database); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Child: hardSphereRadius +// ----------------------------------------------------------------------------- + +// Has +int +TabulatedWidthsHardSphereRadiusHas(ConstHandle2ConstTabulatedWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HardSphereRadiusHas", self, extract::hardSphereRadius); +} + +// Get, const +Handle2ConstHardSphereRadius +TabulatedWidthsHardSphereRadiusGetConst(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGetConst", self, extract::hardSphereRadius); +} + +// Get, non-const +Handle2HardSphereRadius +TabulatedWidthsHardSphereRadiusGet(ConstHandle2TabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGet", self, extract::hardSphereRadius); +} + +// Set +void +TabulatedWidthsHardSphereRadiusSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstHardSphereRadius hardSphereRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HardSphereRadiusSet", self, extract::hardSphereRadius, hardSphereRadius); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/TabulatedWidths/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths.h new file mode 100644 index 000000000..30ef0ced9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths.h @@ -0,0 +1,317 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_TABULATEDWIDTHS +#define C_INTERFACE_TEST_V2_0_RESONANCES_TABULATEDWIDTHS + +#include "GNDStk.h" +#include "v2.0/pops/PoPs_database.h" +#include "v2.0/resonances/ScatteringRadius.h" +#include "v2.0/resonances/HardSphereRadius.h" +#include "v2.0/resonances/ResonanceReactions.h" +#include "v2.0/resonances/Ls.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 +extern_c Handle2TabulatedWidths +TabulatedWidthsDefault(); + +// --- Create, general, const +extern_c Handle2ConstTabulatedWidths +TabulatedWidthsCreateConst( + const XMLName label, + const XMLName approximation, + const bool useForSelfShieldingOnly, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstLs Ls +); + +// +++ Create, general +extern_c Handle2TabulatedWidths +TabulatedWidthsCreate( + const XMLName label, + const XMLName approximation, + const bool useForSelfShieldingOnly, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstLs Ls +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +TabulatedWidthsLabelGet(ConstHandle2ConstTabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsLabelSet(ConstHandle2TabulatedWidths self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: approximation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsApproximationHas(ConstHandle2ConstTabulatedWidths self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TabulatedWidthsApproximationGet(ConstHandle2ConstTabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsApproximationSet(ConstHandle2TabulatedWidths self, const XMLName 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: PoPs_database +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsPoPs_databaseHas(ConstHandle2ConstTabulatedWidths self); + +// --- Get, const +extern_c Handle2ConstPoPs_database +TabulatedWidthsPoPs_databaseGetConst(ConstHandle2ConstTabulatedWidths self); + +// +++ Get, non-const +extern_c Handle2PoPs_database +TabulatedWidthsPoPs_databaseGet(ConstHandle2TabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsPoPs_databaseSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstPoPs_database PoPs_database); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Child: hardSphereRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsHardSphereRadiusHas(ConstHandle2ConstTabulatedWidths self); + +// --- Get, const +extern_c Handle2ConstHardSphereRadius +TabulatedWidthsHardSphereRadiusGetConst(ConstHandle2ConstTabulatedWidths self); + +// +++ Get, non-const +extern_c Handle2HardSphereRadius +TabulatedWidthsHardSphereRadiusGet(ConstHandle2TabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsHardSphereRadiusSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstHardSphereRadius hardSphereRadius); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/TabulatedWidths/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/TabulatedWidths/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved.cpp new file mode 100644 index 000000000..2ad7e64a5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved.cpp @@ -0,0 +1,244 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/Unresolved.hpp" +#include "Unresolved.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; +} + +using CPPTabulatedWidths = resonances::TabulatedWidths; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUnresolved +UnresolvedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Unresolved +UnresolvedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnresolved +UnresolvedCreateConst( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, +) { + ConstHandle2Unresolved handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + domainMin, + domainMax, + domainUnit + ); + return handle; +} + +// Create, general +Handle2Unresolved +UnresolvedCreate( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, +) { + ConstHandle2Unresolved handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + 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 +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 +Float64 +UnresolvedDomainMinGet(ConstHandle2ConstUnresolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +UnresolvedDomainMinSet(ConstHandle2Unresolved self, const Float64 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 +Float64 +UnresolvedDomainMaxGet(ConstHandle2ConstUnresolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +UnresolvedDomainMaxSet(ConstHandle2Unresolved self, const Float64 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 +XMLName +UnresolvedDomainUnitGet(ConstHandle2ConstUnresolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainUnitGet", self, extract::domainUnit); +} + +// Set +void +UnresolvedDomainUnitSet(ConstHandle2Unresolved self, const XMLName domainUnit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainUnitSet", self, extract::domainUnit, domainUnit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Unresolved/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved.h new file mode 100644 index 000000000..631607fdf --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved.h @@ -0,0 +1,198 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_UNRESOLVED +#define C_INTERFACE_TEST_V2_0_RESONANCES_UNRESOLVED + +#include "GNDStk.h" +#include "v2.0/resonances/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 +extern_c Handle2Unresolved +UnresolvedDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnresolved +UnresolvedCreateConst( + const Float64 domainMin, + const Float64 domainMax, + const XMLName domainUnit, +); + +// +++ Create, general +extern_c Handle2Unresolved +UnresolvedCreate( + const Float64 domainMin, + const Float64 domainMax, + const XMLName 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 +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 Float64 +UnresolvedDomainMinGet(ConstHandle2ConstUnresolved self); + +// +++ Set +extern_c void +UnresolvedDomainMinSet(ConstHandle2Unresolved self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnresolvedDomainMaxHas(ConstHandle2ConstUnresolved self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +UnresolvedDomainMaxGet(ConstHandle2ConstUnresolved self); + +// +++ Set +extern_c void +UnresolvedDomainMaxSet(ConstHandle2Unresolved self, const Float64 domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnresolvedDomainUnitHas(ConstHandle2ConstUnresolved self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +UnresolvedDomainUnitGet(ConstHandle2ConstUnresolved self); + +// +++ Set +extern_c void +UnresolvedDomainUnitSet(ConstHandle2Unresolved self, const XMLName domainUnit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Unresolved/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Unresolved/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Width.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Width.cpp new file mode 100644 index 000000000..3919b42d2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Width.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/Width.hpp" +#include "Width.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = WidthClass; +using CPP = multigroup::Width; + +static const std::string CLASSNAME = "Width"; + +namespace extract { + static auto resonanceReaction = [](auto &obj) { return &obj.resonanceReaction; }; + static auto degreesOfFreedom = [](auto &obj) { return &obj.degreesOfFreedom; }; + static auto constant1d = [](auto &obj) { return &obj.constant1d; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPConstant1d = containers::Constant1d; +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstWidth +WidthDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Width +WidthDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstWidth +WidthCreateConst( + const char *const resonanceReaction, + const Float64 degreesOfFreedom, + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Width handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + resonanceReaction, + degreesOfFreedom, + detail::tocpp(constant1d), + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2Width +WidthCreate( + const char *const resonanceReaction, + const Float64 degreesOfFreedom, + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Width handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + resonanceReaction, + degreesOfFreedom, + detail::tocpp(constant1d), + 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 +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: 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 +Float64 +WidthDegreesOfFreedomGet(ConstHandle2ConstWidth self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DegreesOfFreedomGet", self, extract::degreesOfFreedom); +} + +// Set +void +WidthDegreesOfFreedomSet(ConstHandle2Width self, const Float64 degreesOfFreedom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DegreesOfFreedomSet", self, extract::degreesOfFreedom, degreesOfFreedom); +} + + +// ----------------------------------------------------------------------------- +// 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: 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: 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/resonances/Width/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Width.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Width.h new file mode 100644 index 000000000..7cef99271 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Width.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. +// +// 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_TEST_V2_0_RESONANCES_WIDTH +#define C_INTERFACE_TEST_V2_0_RESONANCES_WIDTH + +#include "GNDStk.h" +#include "v2.0/containers/Constant1d.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/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 +extern_c Handle2Width +WidthDefault(); + +// --- Create, general, const +extern_c Handle2ConstWidth +WidthCreateConst( + const char *const resonanceReaction, + const Float64 degreesOfFreedom, + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2Width +WidthCreate( + const char *const resonanceReaction, + const Float64 degreesOfFreedom, + ConstHandle2ConstConstant1d constant1d, + 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 +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: 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 Float64 +WidthDegreesOfFreedomGet(ConstHandle2ConstWidth self); + +// +++ Set +extern_c void +WidthDegreesOfFreedomSet(ConstHandle2Width self, const Float64 degreesOfFreedom); + + +// ----------------------------------------------------------------------------- +// 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: 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: 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/resonances/Width/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Width/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Width/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Width/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Width/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths.cpp new file mode 100644 index 000000000..159d79b74 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/resonances/Widths.hpp" +#include "Widths.h" + +using namespace njoy::GNDStk; +using namespace test::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 = resonances::Width; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstWidths +WidthsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// 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); +} + +// Has, by degreesOfFreedom +int +WidthsWidthHasByDegreesOfFreedom( + ConstHandle2ConstWidths self, + const Float64 degreesOfFreedom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"WidthHasByDegreesOfFreedom", + self, extract::width, meta::degreesOfFreedom, degreesOfFreedom); +} + +// Get, by degreesOfFreedom, const +Handle2ConstWidth +WidthsWidthGetByDegreesOfFreedomConst( + ConstHandle2ConstWidths self, + const Float64 degreesOfFreedom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"WidthGetByDegreesOfFreedomConst", + self, extract::width, meta::degreesOfFreedom, degreesOfFreedom); +} + +// Get, by degreesOfFreedom, non-const +Handle2Width +WidthsWidthGetByDegreesOfFreedom( + ConstHandle2Widths self, + const Float64 degreesOfFreedom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"WidthGetByDegreesOfFreedom", + self, extract::width, meta::degreesOfFreedom, degreesOfFreedom); +} + +// Set, by degreesOfFreedom +void +WidthsWidthSetByDegreesOfFreedom( + ConstHandle2Widths self, + const Float64 degreesOfFreedom, + ConstHandle2ConstWidth width +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"WidthSetByDegreesOfFreedom", + self, extract::width, meta::degreesOfFreedom, degreesOfFreedom, width); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Widths/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths.h new file mode 100644 index 000000000..6cba6e6de --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_RESONANCES_WIDTHS +#define C_INTERFACE_TEST_V2_0_RESONANCES_WIDTHS + +#include "GNDStk.h" +#include "v2.0/resonances/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 +extern_c Handle2Widths +WidthsDefault(); + +// --- Create, general, const +extern_c Handle2ConstWidths +WidthsCreateConst( + ConstHandle2Width *const width, const size_t widthSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ Has, by degreesOfFreedom +extern_c int +WidthsWidthHasByDegreesOfFreedom( + ConstHandle2ConstWidths self, + const Float64 degreesOfFreedom +); + +// --- Get, by degreesOfFreedom, const +extern_c Handle2ConstWidth +WidthsWidthGetByDegreesOfFreedomConst( + ConstHandle2ConstWidths self, + const Float64 degreesOfFreedom +); + +// +++ Get, by degreesOfFreedom, non-const +extern_c Handle2Width +WidthsWidthGetByDegreesOfFreedom( + ConstHandle2Widths self, + const Float64 degreesOfFreedom +); + +// +++ Set, by degreesOfFreedom +extern_c void +WidthsWidthSetByDegreesOfFreedom( + ConstHandle2Widths self, + const Float64 degreesOfFreedom, + ConstHandle2ConstWidth width +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/resonances/Widths/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/resonances/Widths/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed.cpp new file mode 100644 index 000000000..7f560fa58 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/AngularDistributionReconstructed.hpp" +#include "AngularDistributionReconstructed.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AngularDistributionReconstructedClass; +using CPP = multigroup::AngularDistributionReconstructed; + +static const std::string CLASSNAME = "AngularDistributionReconstructed"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto temperature = [](auto &obj) { return &obj.temperature; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPTemperature = styles::Temperature; +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAngularDistributionReconstructed +AngularDistributionReconstructedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AngularDistributionReconstructed +AngularDistributionReconstructedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAngularDistributionReconstructed +AngularDistributionReconstructedCreateConst( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2AngularDistributionReconstructed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + label, + derivedFrom, + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2AngularDistributionReconstructed +AngularDistributionReconstructedCreate( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2AngularDistributionReconstructed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + label, + derivedFrom, + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AngularDistributionReconstructedAssign(ConstHandle2AngularDistributionReconstructed self, ConstHandle2ConstAngularDistributionReconstructed from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AngularDistributionReconstructedDelete(ConstHandle2ConstAngularDistributionReconstructed self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AngularDistributionReconstructedRead(ConstHandle2AngularDistributionReconstructed self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AngularDistributionReconstructedWrite(ConstHandle2ConstAngularDistributionReconstructed self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AngularDistributionReconstructedPrint(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AngularDistributionReconstructedPrintXML(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AngularDistributionReconstructedPrintJSON(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +AngularDistributionReconstructedDateHas(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +AngularDistributionReconstructedDateGet(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +AngularDistributionReconstructedDateSet(ConstHandle2AngularDistributionReconstructed self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AngularDistributionReconstructedLabelHas(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +AngularDistributionReconstructedLabelGet(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AngularDistributionReconstructedLabelSet(ConstHandle2AngularDistributionReconstructed self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +AngularDistributionReconstructedDerivedFromHas(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +AngularDistributionReconstructedDerivedFromGet(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +AngularDistributionReconstructedDerivedFromSet(ConstHandle2AngularDistributionReconstructed self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// Has +int +AngularDistributionReconstructedTemperatureHas(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TemperatureHas", self, extract::temperature); +} + +// Get, const +Handle2ConstTemperature +AngularDistributionReconstructedTemperatureGetConst(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGetConst", self, extract::temperature); +} + +// Get, non-const +Handle2Temperature +AngularDistributionReconstructedTemperatureGet(ConstHandle2AngularDistributionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGet", self, extract::temperature); +} + +// Set +void +AngularDistributionReconstructedTemperatureSet(ConstHandle2AngularDistributionReconstructed self, ConstHandle2ConstTemperature temperature) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TemperatureSet", self, extract::temperature, temperature); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +AngularDistributionReconstructedDocumentationHas(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +AngularDistributionReconstructedDocumentationGetConst(ConstHandle2ConstAngularDistributionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +AngularDistributionReconstructedDocumentationGet(ConstHandle2AngularDistributionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +AngularDistributionReconstructedDocumentationSet(ConstHandle2AngularDistributionReconstructed self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/AngularDistributionReconstructed/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed.h b/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed.h new file mode 100644 index 000000000..43a9efc07 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed.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. +// +// AngularDistributionReconstructed is the basic handle type in this file. Example: +// // Create a default AngularDistributionReconstructed object: +// AngularDistributionReconstructed handle = AngularDistributionReconstructedDefault(); +// Functions involving AngularDistributionReconstructed are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_ANGULARDISTRIBUTIONRECONSTRUCTED +#define C_INTERFACE_TEST_V2_0_STYLES_ANGULARDISTRIBUTIONRECONSTRUCTED + +#include "GNDStk.h" +#include "v2.0/styles/Temperature.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AngularDistributionReconstructedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AngularDistributionReconstructed +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AngularDistributionReconstructedClass *AngularDistributionReconstructed; + +// --- Const-aware handles. +typedef const struct AngularDistributionReconstructedClass *const ConstHandle2ConstAngularDistributionReconstructed; +typedef struct AngularDistributionReconstructedClass *const ConstHandle2AngularDistributionReconstructed; +typedef const struct AngularDistributionReconstructedClass * Handle2ConstAngularDistributionReconstructed; +typedef struct AngularDistributionReconstructedClass * Handle2AngularDistributionReconstructed; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAngularDistributionReconstructed +AngularDistributionReconstructedDefaultConst(); + +// +++ Create, default +extern_c Handle2AngularDistributionReconstructed +AngularDistributionReconstructedDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngularDistributionReconstructed +AngularDistributionReconstructedCreateConst( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2AngularDistributionReconstructed +AngularDistributionReconstructedCreate( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AngularDistributionReconstructedAssign(ConstHandle2AngularDistributionReconstructed self, ConstHandle2ConstAngularDistributionReconstructed from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AngularDistributionReconstructedDelete(ConstHandle2ConstAngularDistributionReconstructed self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AngularDistributionReconstructedRead(ConstHandle2AngularDistributionReconstructed self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AngularDistributionReconstructedWrite(ConstHandle2ConstAngularDistributionReconstructed self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AngularDistributionReconstructedPrint(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Print to standard output, as XML +extern_c int +AngularDistributionReconstructedPrintXML(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Print to standard output, as JSON +extern_c int +AngularDistributionReconstructedPrintJSON(ConstHandle2ConstAngularDistributionReconstructed self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularDistributionReconstructedDateHas(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AngularDistributionReconstructedDateGet(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Set +extern_c void +AngularDistributionReconstructedDateSet(ConstHandle2AngularDistributionReconstructed self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularDistributionReconstructedLabelHas(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AngularDistributionReconstructedLabelGet(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Set +extern_c void +AngularDistributionReconstructedLabelSet(ConstHandle2AngularDistributionReconstructed self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularDistributionReconstructedDerivedFromHas(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AngularDistributionReconstructedDerivedFromGet(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Set +extern_c void +AngularDistributionReconstructedDerivedFromSet(ConstHandle2AngularDistributionReconstructed self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularDistributionReconstructedTemperatureHas(ConstHandle2ConstAngularDistributionReconstructed self); + +// --- Get, const +extern_c Handle2ConstTemperature +AngularDistributionReconstructedTemperatureGetConst(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Get, non-const +extern_c Handle2Temperature +AngularDistributionReconstructedTemperatureGet(ConstHandle2AngularDistributionReconstructed self); + +// +++ Set +extern_c void +AngularDistributionReconstructedTemperatureSet(ConstHandle2AngularDistributionReconstructed self, ConstHandle2ConstTemperature temperature); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularDistributionReconstructedDocumentationHas(ConstHandle2ConstAngularDistributionReconstructed self); + +// --- Get, const +extern_c Handle2ConstDocumentation +AngularDistributionReconstructedDocumentationGetConst(ConstHandle2ConstAngularDistributionReconstructed self); + +// +++ Get, non-const +extern_c Handle2Documentation +AngularDistributionReconstructedDocumentationGet(ConstHandle2AngularDistributionReconstructed self); + +// +++ Set +extern_c void +AngularDistributionReconstructedDocumentationSet(ConstHandle2AngularDistributionReconstructed self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/AngularDistributionReconstructed/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/AngularDistributionReconstructed/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData.cpp new file mode 100644 index 000000000..eef831122 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/AverageProductData.hpp" +#include "AverageProductData.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AverageProductDataClass; +using CPP = multigroup::AverageProductData; + +static const std::string CLASSNAME = "AverageProductData"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto temperature = [](auto &obj) { return &obj.temperature; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPTemperature = styles::Temperature; +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageProductData +AverageProductDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AverageProductData +AverageProductDataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAverageProductData +AverageProductDataCreateConst( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2AverageProductData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + label, + derivedFrom, + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2AverageProductData +AverageProductDataCreate( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2AverageProductData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + label, + derivedFrom, + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AverageProductDataAssign(ConstHandle2AverageProductData self, ConstHandle2ConstAverageProductData from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AverageProductDataDelete(ConstHandle2ConstAverageProductData self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AverageProductDataRead(ConstHandle2AverageProductData self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AverageProductDataWrite(ConstHandle2ConstAverageProductData self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AverageProductDataPrint(ConstHandle2ConstAverageProductData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AverageProductDataPrintXML(ConstHandle2ConstAverageProductData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AverageProductDataPrintJSON(ConstHandle2ConstAverageProductData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductDataDateHas(ConstHandle2ConstAverageProductData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +AverageProductDataDateGet(ConstHandle2ConstAverageProductData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +AverageProductDataDateSet(ConstHandle2AverageProductData self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductDataLabelHas(ConstHandle2ConstAverageProductData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +AverageProductDataLabelGet(ConstHandle2ConstAverageProductData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AverageProductDataLabelSet(ConstHandle2AverageProductData self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductDataDerivedFromHas(ConstHandle2ConstAverageProductData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +AverageProductDataDerivedFromGet(ConstHandle2ConstAverageProductData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +AverageProductDataDerivedFromSet(ConstHandle2AverageProductData self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductDataTemperatureHas(ConstHandle2ConstAverageProductData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TemperatureHas", self, extract::temperature); +} + +// Get, const +Handle2ConstTemperature +AverageProductDataTemperatureGetConst(ConstHandle2ConstAverageProductData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGetConst", self, extract::temperature); +} + +// Get, non-const +Handle2Temperature +AverageProductDataTemperatureGet(ConstHandle2AverageProductData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGet", self, extract::temperature); +} + +// Set +void +AverageProductDataTemperatureSet(ConstHandle2AverageProductData self, ConstHandle2ConstTemperature temperature) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TemperatureSet", self, extract::temperature, temperature); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductDataDocumentationHas(ConstHandle2ConstAverageProductData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +AverageProductDataDocumentationGetConst(ConstHandle2ConstAverageProductData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +AverageProductDataDocumentationGet(ConstHandle2AverageProductData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +AverageProductDataDocumentationSet(ConstHandle2AverageProductData self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/AverageProductData/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData.h b/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData.h new file mode 100644 index 000000000..1565421d0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData.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. +// +// AverageProductData is the basic handle type in this file. Example: +// // Create a default AverageProductData object: +// AverageProductData handle = AverageProductDataDefault(); +// Functions involving AverageProductData are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_AVERAGEPRODUCTDATA +#define C_INTERFACE_TEST_V2_0_STYLES_AVERAGEPRODUCTDATA + +#include "GNDStk.h" +#include "v2.0/styles/Temperature.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AverageProductDataClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AverageProductData +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AverageProductDataClass *AverageProductData; + +// --- Const-aware handles. +typedef const struct AverageProductDataClass *const ConstHandle2ConstAverageProductData; +typedef struct AverageProductDataClass *const ConstHandle2AverageProductData; +typedef const struct AverageProductDataClass * Handle2ConstAverageProductData; +typedef struct AverageProductDataClass * Handle2AverageProductData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAverageProductData +AverageProductDataDefaultConst(); + +// +++ Create, default +extern_c Handle2AverageProductData +AverageProductDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageProductData +AverageProductDataCreateConst( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2AverageProductData +AverageProductDataCreate( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AverageProductDataAssign(ConstHandle2AverageProductData self, ConstHandle2ConstAverageProductData from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AverageProductDataDelete(ConstHandle2ConstAverageProductData self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AverageProductDataRead(ConstHandle2AverageProductData self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AverageProductDataWrite(ConstHandle2ConstAverageProductData self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AverageProductDataPrint(ConstHandle2ConstAverageProductData self); + +// +++ Print to standard output, as XML +extern_c int +AverageProductDataPrintXML(ConstHandle2ConstAverageProductData self); + +// +++ Print to standard output, as JSON +extern_c int +AverageProductDataPrintJSON(ConstHandle2ConstAverageProductData self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductDataDateHas(ConstHandle2ConstAverageProductData self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AverageProductDataDateGet(ConstHandle2ConstAverageProductData self); + +// +++ Set +extern_c void +AverageProductDataDateSet(ConstHandle2AverageProductData self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductDataLabelHas(ConstHandle2ConstAverageProductData self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AverageProductDataLabelGet(ConstHandle2ConstAverageProductData self); + +// +++ Set +extern_c void +AverageProductDataLabelSet(ConstHandle2AverageProductData self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductDataDerivedFromHas(ConstHandle2ConstAverageProductData self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AverageProductDataDerivedFromGet(ConstHandle2ConstAverageProductData self); + +// +++ Set +extern_c void +AverageProductDataDerivedFromSet(ConstHandle2AverageProductData self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductDataTemperatureHas(ConstHandle2ConstAverageProductData self); + +// --- Get, const +extern_c Handle2ConstTemperature +AverageProductDataTemperatureGetConst(ConstHandle2ConstAverageProductData self); + +// +++ Get, non-const +extern_c Handle2Temperature +AverageProductDataTemperatureGet(ConstHandle2AverageProductData self); + +// +++ Set +extern_c void +AverageProductDataTemperatureSet(ConstHandle2AverageProductData self, ConstHandle2ConstTemperature temperature); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductDataDocumentationHas(ConstHandle2ConstAverageProductData self); + +// --- Get, const +extern_c Handle2ConstDocumentation +AverageProductDataDocumentationGetConst(ConstHandle2ConstAverageProductData self); + +// +++ Get, non-const +extern_c Handle2Documentation +AverageProductDataDocumentationGet(ConstHandle2AverageProductData self); + +// +++ Set +extern_c void +AverageProductDataDocumentationSet(ConstHandle2AverageProductData self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/AverageProductData/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/AverageProductData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko.cpp new file mode 100644 index 000000000..1502bac34 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/Bondarenko.hpp" +#include "Bondarenko.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BondarenkoClass; +using CPP = multigroup::Bondarenko; + +static const std::string CLASSNAME = "Bondarenko"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto sigmaZeros = [](auto &obj) { return &obj.sigmaZeros; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPSigmaZeros = styles::SigmaZeros; +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBondarenko +BondarenkoDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Bondarenko +BondarenkoDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBondarenko +BondarenkoCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstSigmaZeros sigmaZeros, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2Bondarenko handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + detail::tocpp(sigmaZeros), + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2Bondarenko +BondarenkoCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstSigmaZeros sigmaZeros, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2Bondarenko handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + detail::tocpp(sigmaZeros), + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BondarenkoAssign(ConstHandle2Bondarenko self, ConstHandle2ConstBondarenko from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BondarenkoDelete(ConstHandle2ConstBondarenko self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BondarenkoRead(ConstHandle2Bondarenko self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BondarenkoWrite(ConstHandle2ConstBondarenko self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BondarenkoPrint(ConstHandle2ConstBondarenko self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BondarenkoPrintXML(ConstHandle2ConstBondarenko self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BondarenkoPrintJSON(ConstHandle2ConstBondarenko self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +BondarenkoDateHas(ConstHandle2ConstBondarenko self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +BondarenkoDateGet(ConstHandle2ConstBondarenko self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +BondarenkoDateSet(ConstHandle2Bondarenko self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +BondarenkoDerivedFromHas(ConstHandle2ConstBondarenko self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +BondarenkoDerivedFromGet(ConstHandle2ConstBondarenko self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +BondarenkoDerivedFromSet(ConstHandle2Bondarenko self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +BondarenkoLabelHas(ConstHandle2ConstBondarenko self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +BondarenkoLabelGet(ConstHandle2ConstBondarenko self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +BondarenkoLabelSet(ConstHandle2Bondarenko self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: sigmaZeros +// ----------------------------------------------------------------------------- + +// Has +int +BondarenkoSigmaZerosHas(ConstHandle2ConstBondarenko self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SigmaZerosHas", self, extract::sigmaZeros); +} + +// Get, const +Handle2ConstSigmaZeros +BondarenkoSigmaZerosGetConst(ConstHandle2ConstBondarenko self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SigmaZerosGetConst", self, extract::sigmaZeros); +} + +// Get, non-const +Handle2SigmaZeros +BondarenkoSigmaZerosGet(ConstHandle2Bondarenko self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SigmaZerosGet", self, extract::sigmaZeros); +} + +// Set +void +BondarenkoSigmaZerosSet(ConstHandle2Bondarenko self, ConstHandle2ConstSigmaZeros sigmaZeros) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SigmaZerosSet", self, extract::sigmaZeros, sigmaZeros); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +BondarenkoDocumentationHas(ConstHandle2ConstBondarenko self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +BondarenkoDocumentationGetConst(ConstHandle2ConstBondarenko self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +BondarenkoDocumentationGet(ConstHandle2Bondarenko self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +BondarenkoDocumentationSet(ConstHandle2Bondarenko self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Bondarenko/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko.h new file mode 100644 index 000000000..bd64692ac --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko.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. +// +// Bondarenko is the basic handle type in this file. Example: +// // Create a default Bondarenko object: +// Bondarenko handle = BondarenkoDefault(); +// Functions involving Bondarenko are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_BONDARENKO +#define C_INTERFACE_TEST_V2_0_STYLES_BONDARENKO + +#include "GNDStk.h" +#include "v2.0/styles/SigmaZeros.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BondarenkoClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Bondarenko +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BondarenkoClass *Bondarenko; + +// --- Const-aware handles. +typedef const struct BondarenkoClass *const ConstHandle2ConstBondarenko; +typedef struct BondarenkoClass *const ConstHandle2Bondarenko; +typedef const struct BondarenkoClass * Handle2ConstBondarenko; +typedef struct BondarenkoClass * Handle2Bondarenko; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBondarenko +BondarenkoDefaultConst(); + +// +++ Create, default +extern_c Handle2Bondarenko +BondarenkoDefault(); + +// --- Create, general, const +extern_c Handle2ConstBondarenko +BondarenkoCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstSigmaZeros sigmaZeros, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2Bondarenko +BondarenkoCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstSigmaZeros sigmaZeros, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BondarenkoAssign(ConstHandle2Bondarenko self, ConstHandle2ConstBondarenko from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BondarenkoDelete(ConstHandle2ConstBondarenko self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BondarenkoRead(ConstHandle2Bondarenko self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BondarenkoWrite(ConstHandle2ConstBondarenko self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BondarenkoPrint(ConstHandle2ConstBondarenko self); + +// +++ Print to standard output, as XML +extern_c int +BondarenkoPrintXML(ConstHandle2ConstBondarenko self); + +// +++ Print to standard output, as JSON +extern_c int +BondarenkoPrintJSON(ConstHandle2ConstBondarenko self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BondarenkoDateHas(ConstHandle2ConstBondarenko self); + +// +++ Get +// +++ Returns by value +extern_c const char * +BondarenkoDateGet(ConstHandle2ConstBondarenko self); + +// +++ Set +extern_c void +BondarenkoDateSet(ConstHandle2Bondarenko self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BondarenkoDerivedFromHas(ConstHandle2ConstBondarenko self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BondarenkoDerivedFromGet(ConstHandle2ConstBondarenko self); + +// +++ Set +extern_c void +BondarenkoDerivedFromSet(ConstHandle2Bondarenko self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BondarenkoLabelHas(ConstHandle2ConstBondarenko self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BondarenkoLabelGet(ConstHandle2ConstBondarenko self); + +// +++ Set +extern_c void +BondarenkoLabelSet(ConstHandle2Bondarenko self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: sigmaZeros +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BondarenkoSigmaZerosHas(ConstHandle2ConstBondarenko self); + +// --- Get, const +extern_c Handle2ConstSigmaZeros +BondarenkoSigmaZerosGetConst(ConstHandle2ConstBondarenko self); + +// +++ Get, non-const +extern_c Handle2SigmaZeros +BondarenkoSigmaZerosGet(ConstHandle2Bondarenko self); + +// +++ Set +extern_c void +BondarenkoSigmaZerosSet(ConstHandle2Bondarenko self, ConstHandle2ConstSigmaZeros sigmaZeros); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BondarenkoDocumentationHas(ConstHandle2ConstBondarenko self); + +// --- Get, const +extern_c Handle2ConstDocumentation +BondarenkoDocumentationGetConst(ConstHandle2ConstBondarenko self); + +// +++ Get, non-const +extern_c Handle2Documentation +BondarenkoDocumentationGet(ConstHandle2Bondarenko self); + +// +++ Set +extern_c void +BondarenkoDocumentationSet(ConstHandle2Bondarenko self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Bondarenko/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Bondarenko/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.cpp new file mode 100644 index 000000000..9fdf30344 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.hpp" +#include "CoulombPlusNuclearElasticMuCutoff.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CoulombPlusNuclearElasticMuCutoffClass; +using CPP = multigroup::CoulombPlusNuclearElasticMuCutoff; + +static const std::string CLASSNAME = "CoulombPlusNuclearElasticMuCutoff"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto muCutoff = [](auto &obj) { return &obj.muCutoff; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCoulombPlusNuclearElasticMuCutoff +CoulombPlusNuclearElasticMuCutoffDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CoulombPlusNuclearElasticMuCutoff +CoulombPlusNuclearElasticMuCutoffDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCoulombPlusNuclearElasticMuCutoff +CoulombPlusNuclearElasticMuCutoffCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Float64 muCutoff, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2CoulombPlusNuclearElasticMuCutoff handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + muCutoff, + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2CoulombPlusNuclearElasticMuCutoff +CoulombPlusNuclearElasticMuCutoffCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Float64 muCutoff, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2CoulombPlusNuclearElasticMuCutoff handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + muCutoff, + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CoulombPlusNuclearElasticMuCutoffAssign(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CoulombPlusNuclearElasticMuCutoffDelete(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CoulombPlusNuclearElasticMuCutoffRead(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CoulombPlusNuclearElasticMuCutoffWrite(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CoulombPlusNuclearElasticMuCutoffPrint(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CoulombPlusNuclearElasticMuCutoffPrintXML(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CoulombPlusNuclearElasticMuCutoffPrintJSON(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticMuCutoffDateHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +CoulombPlusNuclearElasticMuCutoffDateGet(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +CoulombPlusNuclearElasticMuCutoffDateSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticMuCutoffDerivedFromHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +CoulombPlusNuclearElasticMuCutoffDerivedFromGet(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +CoulombPlusNuclearElasticMuCutoffDerivedFromSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticMuCutoffLabelHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CoulombPlusNuclearElasticMuCutoffLabelGet(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CoulombPlusNuclearElasticMuCutoffLabelSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: muCutoff +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticMuCutoffMuCutoffHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MuCutoffHas", self, extract::muCutoff); +} + +// Get +// Returns by value +Float64 +CoulombPlusNuclearElasticMuCutoffMuCutoffGet(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MuCutoffGet", self, extract::muCutoff); +} + +// Set +void +CoulombPlusNuclearElasticMuCutoffMuCutoffSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const Float64 muCutoff) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MuCutoffSet", self, extract::muCutoff, muCutoff); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticMuCutoffDocumentationHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +CoulombPlusNuclearElasticMuCutoffDocumentationGetConst(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +CoulombPlusNuclearElasticMuCutoffDocumentationGet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +CoulombPlusNuclearElasticMuCutoffDocumentationSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.h b/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.h new file mode 100644 index 000000000..564af65c4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.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. +// +// CoulombPlusNuclearElasticMuCutoff is the basic handle type in this file. Example: +// // Create a default CoulombPlusNuclearElasticMuCutoff object: +// CoulombPlusNuclearElasticMuCutoff handle = CoulombPlusNuclearElasticMuCutoffDefault(); +// Functions involving CoulombPlusNuclearElasticMuCutoff are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_COULOMBPLUSNUCLEARELASTICMUCUTOFF +#define C_INTERFACE_TEST_V2_0_STYLES_COULOMBPLUSNUCLEARELASTICMUCUTOFF + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CoulombPlusNuclearElasticMuCutoffClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CoulombPlusNuclearElasticMuCutoff +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CoulombPlusNuclearElasticMuCutoffClass *CoulombPlusNuclearElasticMuCutoff; + +// --- Const-aware handles. +typedef const struct CoulombPlusNuclearElasticMuCutoffClass *const ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff; +typedef struct CoulombPlusNuclearElasticMuCutoffClass *const ConstHandle2CoulombPlusNuclearElasticMuCutoff; +typedef const struct CoulombPlusNuclearElasticMuCutoffClass * Handle2ConstCoulombPlusNuclearElasticMuCutoff; +typedef struct CoulombPlusNuclearElasticMuCutoffClass * Handle2CoulombPlusNuclearElasticMuCutoff; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCoulombPlusNuclearElasticMuCutoff +CoulombPlusNuclearElasticMuCutoffDefaultConst(); + +// +++ Create, default +extern_c Handle2CoulombPlusNuclearElasticMuCutoff +CoulombPlusNuclearElasticMuCutoffDefault(); + +// --- Create, general, const +extern_c Handle2ConstCoulombPlusNuclearElasticMuCutoff +CoulombPlusNuclearElasticMuCutoffCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Float64 muCutoff, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2CoulombPlusNuclearElasticMuCutoff +CoulombPlusNuclearElasticMuCutoffCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Float64 muCutoff, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CoulombPlusNuclearElasticMuCutoffAssign(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CoulombPlusNuclearElasticMuCutoffDelete(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CoulombPlusNuclearElasticMuCutoffRead(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CoulombPlusNuclearElasticMuCutoffWrite(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CoulombPlusNuclearElasticMuCutoffPrint(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Print to standard output, as XML +extern_c int +CoulombPlusNuclearElasticMuCutoffPrintXML(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Print to standard output, as JSON +extern_c int +CoulombPlusNuclearElasticMuCutoffPrintJSON(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticMuCutoffDateHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CoulombPlusNuclearElasticMuCutoffDateGet(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticMuCutoffDateSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticMuCutoffDerivedFromHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CoulombPlusNuclearElasticMuCutoffDerivedFromGet(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticMuCutoffDerivedFromSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticMuCutoffLabelHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CoulombPlusNuclearElasticMuCutoffLabelGet(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticMuCutoffLabelSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: muCutoff +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticMuCutoffMuCutoffHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +CoulombPlusNuclearElasticMuCutoffMuCutoffGet(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticMuCutoffMuCutoffSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, const Float64 muCutoff); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticMuCutoffDocumentationHas(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// --- Get, const +extern_c Handle2ConstDocumentation +CoulombPlusNuclearElasticMuCutoffDocumentationGetConst(ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff self); + +// +++ Get, non-const +extern_c Handle2Documentation +CoulombPlusNuclearElasticMuCutoffDocumentationGet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticMuCutoffDocumentationSet(ConstHandle2CoulombPlusNuclearElasticMuCutoff self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed.cpp new file mode 100644 index 000000000..851465b80 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/CrossSectionReconstructed.hpp" +#include "CrossSectionReconstructed.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CrossSectionReconstructedClass; +using CPP = multigroup::CrossSectionReconstructed; + +static const std::string CLASSNAME = "CrossSectionReconstructed"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto temperature = [](auto &obj) { return &obj.temperature; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPTemperature = styles::Temperature; +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCrossSectionReconstructed +CrossSectionReconstructedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CrossSectionReconstructed +CrossSectionReconstructedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCrossSectionReconstructed +CrossSectionReconstructedCreateConst( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2CrossSectionReconstructed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + label, + derivedFrom, + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2CrossSectionReconstructed +CrossSectionReconstructedCreate( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2CrossSectionReconstructed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + label, + derivedFrom, + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionReconstructedLabelHas(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CrossSectionReconstructedLabelGet(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CrossSectionReconstructedLabelSet(ConstHandle2CrossSectionReconstructed self, const XMLName 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 +XMLName +CrossSectionReconstructedDerivedFromGet(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +CrossSectionReconstructedDerivedFromSet(ConstHandle2CrossSectionReconstructed self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionReconstructedTemperatureHas(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TemperatureHas", self, extract::temperature); +} + +// Get, const +Handle2ConstTemperature +CrossSectionReconstructedTemperatureGetConst(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGetConst", self, extract::temperature); +} + +// Get, non-const +Handle2Temperature +CrossSectionReconstructedTemperatureGet(ConstHandle2CrossSectionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGet", self, extract::temperature); +} + +// Set +void +CrossSectionReconstructedTemperatureSet(ConstHandle2CrossSectionReconstructed self, ConstHandle2ConstTemperature temperature) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TemperatureSet", self, extract::temperature, temperature); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionReconstructedDocumentationHas(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +CrossSectionReconstructedDocumentationGetConst(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +CrossSectionReconstructedDocumentationGet(ConstHandle2CrossSectionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +CrossSectionReconstructedDocumentationSet(ConstHandle2CrossSectionReconstructed self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/CrossSectionReconstructed/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed.h b/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed.h new file mode 100644 index 000000000..47dad4eae --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed.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. +// +// 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_TEST_V2_0_STYLES_CROSSSECTIONRECONSTRUCTED +#define C_INTERFACE_TEST_V2_0_STYLES_CROSSSECTIONRECONSTRUCTED + +#include "GNDStk.h" +#include "v2.0/styles/Temperature.h" +#include "v2.0/documentation/Documentation.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 +extern_c Handle2CrossSectionReconstructed +CrossSectionReconstructedDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSectionReconstructed +CrossSectionReconstructedCreateConst( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2CrossSectionReconstructed +CrossSectionReconstructedCreate( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionReconstructedLabelHas(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CrossSectionReconstructedLabelGet(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Set +extern_c void +CrossSectionReconstructedLabelSet(ConstHandle2CrossSectionReconstructed self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionReconstructedDerivedFromHas(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CrossSectionReconstructedDerivedFromGet(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Set +extern_c void +CrossSectionReconstructedDerivedFromSet(ConstHandle2CrossSectionReconstructed self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionReconstructedTemperatureHas(ConstHandle2ConstCrossSectionReconstructed self); + +// --- Get, const +extern_c Handle2ConstTemperature +CrossSectionReconstructedTemperatureGetConst(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Get, non-const +extern_c Handle2Temperature +CrossSectionReconstructedTemperatureGet(ConstHandle2CrossSectionReconstructed self); + +// +++ Set +extern_c void +CrossSectionReconstructedTemperatureSet(ConstHandle2CrossSectionReconstructed self, ConstHandle2ConstTemperature temperature); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionReconstructedDocumentationHas(ConstHandle2ConstCrossSectionReconstructed self); + +// --- Get, const +extern_c Handle2ConstDocumentation +CrossSectionReconstructedDocumentationGetConst(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Get, non-const +extern_c Handle2Documentation +CrossSectionReconstructedDocumentationGet(ConstHandle2CrossSectionReconstructed self); + +// +++ Set +extern_c void +CrossSectionReconstructedDocumentationSet(ConstHandle2CrossSectionReconstructed self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/CrossSectionReconstructed/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/CrossSectionReconstructed/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins.cpp new file mode 100644 index 000000000..a3ad0b4b7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/EqualProbableBins.hpp" +#include "EqualProbableBins.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EqualProbableBinsClass; +using CPP = multigroup::EqualProbableBins; + +static const std::string CLASSNAME = "EqualProbableBins"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto numberOfBins = [](auto &obj) { return &obj.numberOfBins; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEqualProbableBins +EqualProbableBinsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2EqualProbableBins +EqualProbableBinsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEqualProbableBins +EqualProbableBinsCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 numberOfBins, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2EqualProbableBins handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + numberOfBins, + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2EqualProbableBins +EqualProbableBinsCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 numberOfBins, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2EqualProbableBins handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + numberOfBins, + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EqualProbableBinsAssign(ConstHandle2EqualProbableBins self, ConstHandle2ConstEqualProbableBins from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EqualProbableBinsDelete(ConstHandle2ConstEqualProbableBins self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EqualProbableBinsRead(ConstHandle2EqualProbableBins self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EqualProbableBinsWrite(ConstHandle2ConstEqualProbableBins self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EqualProbableBinsPrint(ConstHandle2ConstEqualProbableBins self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EqualProbableBinsPrintXML(ConstHandle2ConstEqualProbableBins self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EqualProbableBinsPrintJSON(ConstHandle2ConstEqualProbableBins self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +EqualProbableBinsDateHas(ConstHandle2ConstEqualProbableBins self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +EqualProbableBinsDateGet(ConstHandle2ConstEqualProbableBins self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +EqualProbableBinsDateSet(ConstHandle2EqualProbableBins self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +EqualProbableBinsDerivedFromHas(ConstHandle2ConstEqualProbableBins self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +EqualProbableBinsDerivedFromGet(ConstHandle2ConstEqualProbableBins self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +EqualProbableBinsDerivedFromSet(ConstHandle2EqualProbableBins self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +EqualProbableBinsLabelHas(ConstHandle2ConstEqualProbableBins self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +EqualProbableBinsLabelGet(ConstHandle2ConstEqualProbableBins self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EqualProbableBinsLabelSet(ConstHandle2EqualProbableBins self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: numberOfBins +// ----------------------------------------------------------------------------- + +// Has +int +EqualProbableBinsNumberOfBinsHas(ConstHandle2ConstEqualProbableBins self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NumberOfBinsHas", self, extract::numberOfBins); +} + +// Get +// Returns by value +Integer32 +EqualProbableBinsNumberOfBinsGet(ConstHandle2ConstEqualProbableBins self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NumberOfBinsGet", self, extract::numberOfBins); +} + +// Set +void +EqualProbableBinsNumberOfBinsSet(ConstHandle2EqualProbableBins self, const Integer32 numberOfBins) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NumberOfBinsSet", self, extract::numberOfBins, numberOfBins); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +EqualProbableBinsDocumentationHas(ConstHandle2ConstEqualProbableBins self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +EqualProbableBinsDocumentationGetConst(ConstHandle2ConstEqualProbableBins self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +EqualProbableBinsDocumentationGet(ConstHandle2EqualProbableBins self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +EqualProbableBinsDocumentationSet(ConstHandle2EqualProbableBins self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/EqualProbableBins/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins.h b/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins.h new file mode 100644 index 000000000..bb2915fc7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins.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. +// +// EqualProbableBins is the basic handle type in this file. Example: +// // Create a default EqualProbableBins object: +// EqualProbableBins handle = EqualProbableBinsDefault(); +// Functions involving EqualProbableBins are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_EQUALPROBABLEBINS +#define C_INTERFACE_TEST_V2_0_STYLES_EQUALPROBABLEBINS + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EqualProbableBinsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ EqualProbableBins +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EqualProbableBinsClass *EqualProbableBins; + +// --- Const-aware handles. +typedef const struct EqualProbableBinsClass *const ConstHandle2ConstEqualProbableBins; +typedef struct EqualProbableBinsClass *const ConstHandle2EqualProbableBins; +typedef const struct EqualProbableBinsClass * Handle2ConstEqualProbableBins; +typedef struct EqualProbableBinsClass * Handle2EqualProbableBins; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEqualProbableBins +EqualProbableBinsDefaultConst(); + +// +++ Create, default +extern_c Handle2EqualProbableBins +EqualProbableBinsDefault(); + +// --- Create, general, const +extern_c Handle2ConstEqualProbableBins +EqualProbableBinsCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 numberOfBins, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2EqualProbableBins +EqualProbableBinsCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 numberOfBins, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EqualProbableBinsAssign(ConstHandle2EqualProbableBins self, ConstHandle2ConstEqualProbableBins from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EqualProbableBinsDelete(ConstHandle2ConstEqualProbableBins self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EqualProbableBinsRead(ConstHandle2EqualProbableBins self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EqualProbableBinsWrite(ConstHandle2ConstEqualProbableBins self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EqualProbableBinsPrint(ConstHandle2ConstEqualProbableBins self); + +// +++ Print to standard output, as XML +extern_c int +EqualProbableBinsPrintXML(ConstHandle2ConstEqualProbableBins self); + +// +++ Print to standard output, as JSON +extern_c int +EqualProbableBinsPrintJSON(ConstHandle2ConstEqualProbableBins self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EqualProbableBinsDateHas(ConstHandle2ConstEqualProbableBins self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EqualProbableBinsDateGet(ConstHandle2ConstEqualProbableBins self); + +// +++ Set +extern_c void +EqualProbableBinsDateSet(ConstHandle2EqualProbableBins self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EqualProbableBinsDerivedFromHas(ConstHandle2ConstEqualProbableBins self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EqualProbableBinsDerivedFromGet(ConstHandle2ConstEqualProbableBins self); + +// +++ Set +extern_c void +EqualProbableBinsDerivedFromSet(ConstHandle2EqualProbableBins self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EqualProbableBinsLabelHas(ConstHandle2ConstEqualProbableBins self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EqualProbableBinsLabelGet(ConstHandle2ConstEqualProbableBins self); + +// +++ Set +extern_c void +EqualProbableBinsLabelSet(ConstHandle2EqualProbableBins self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: numberOfBins +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EqualProbableBinsNumberOfBinsHas(ConstHandle2ConstEqualProbableBins self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +EqualProbableBinsNumberOfBinsGet(ConstHandle2ConstEqualProbableBins self); + +// +++ Set +extern_c void +EqualProbableBinsNumberOfBinsSet(ConstHandle2EqualProbableBins self, const Integer32 numberOfBins); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EqualProbableBinsDocumentationHas(ConstHandle2ConstEqualProbableBins self); + +// --- Get, const +extern_c Handle2ConstDocumentation +EqualProbableBinsDocumentationGetConst(ConstHandle2ConstEqualProbableBins self); + +// +++ Get, non-const +extern_c Handle2Documentation +EqualProbableBinsDocumentationGet(ConstHandle2EqualProbableBins self); + +// +++ Set +extern_c void +EqualProbableBinsDocumentationSet(ConstHandle2EqualProbableBins self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/EqualProbableBins/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/EqualProbableBins/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated.cpp new file mode 100644 index 000000000..2dc6940a1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated.cpp @@ -0,0 +1,442 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/Evaluated.hpp" +#include "Evaluated.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = EvaluatedClass; +using CPP = multigroup::Evaluated; + +static const std::string CLASSNAME = "Evaluated"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto library = [](auto &obj) { return &obj.library; }; + static auto version = [](auto &obj) { return &obj.version; }; + static auto projectileEnergyDomain = [](auto &obj) { return &obj.projectileEnergyDomain; }; + static auto temperature = [](auto &obj) { return &obj.temperature; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPProjectileEnergyDomain = styles::ProjectileEnergyDomain; +using CPPTemperature = styles::Temperature; +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEvaluated +EvaluatedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Evaluated +EvaluatedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEvaluated +EvaluatedCreateConst( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + const XMLName library, + const XMLName version, + ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2Evaluated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + label, + derivedFrom, + library, + version, + detail::tocpp(projectileEnergyDomain), + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2Evaluated +EvaluatedCreate( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + const XMLName library, + const XMLName version, + ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2Evaluated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + label, + derivedFrom, + library, + version, + detail::tocpp(projectileEnergyDomain), + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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: label +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedLabelHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +EvaluatedLabelGet(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EvaluatedLabelSet(ConstHandle2Evaluated self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedDerivedFromHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +EvaluatedDerivedFromGet(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +EvaluatedDerivedFromSet(ConstHandle2Evaluated self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: library +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedLibraryHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LibraryHas", self, extract::library); +} + +// Get +// Returns by value +XMLName +EvaluatedLibraryGet(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LibraryGet", self, extract::library); +} + +// Set +void +EvaluatedLibrarySet(ConstHandle2Evaluated self, const XMLName 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 +XMLName +EvaluatedVersionGet(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"VersionGet", self, extract::version); +} + +// Set +void +EvaluatedVersionSet(ConstHandle2Evaluated self, const XMLName version) +{ + detail::setField + (CLASSNAME, CLASSNAME+"VersionSet", self, extract::version, version); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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: 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Evaluated/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated.h new file mode 100644 index 000000000..179c76a17 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated.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. +// +// 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_TEST_V2_0_STYLES_EVALUATED +#define C_INTERFACE_TEST_V2_0_STYLES_EVALUATED + +#include "GNDStk.h" +#include "v2.0/styles/ProjectileEnergyDomain.h" +#include "v2.0/styles/Temperature.h" +#include "v2.0/documentation/Documentation.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 +extern_c Handle2Evaluated +EvaluatedDefault(); + +// --- Create, general, const +extern_c Handle2ConstEvaluated +EvaluatedCreateConst( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + const XMLName library, + const XMLName version, + ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2Evaluated +EvaluatedCreate( + const char *const date, + const XMLName label, + const XMLName derivedFrom, + const XMLName library, + const XMLName version, + ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedLabelHas(ConstHandle2ConstEvaluated self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EvaluatedLabelGet(ConstHandle2ConstEvaluated self); + +// +++ Set +extern_c void +EvaluatedLabelSet(ConstHandle2Evaluated self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedDerivedFromHas(ConstHandle2ConstEvaluated self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EvaluatedDerivedFromGet(ConstHandle2ConstEvaluated self); + +// +++ Set +extern_c void +EvaluatedDerivedFromSet(ConstHandle2Evaluated self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: library +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedLibraryHas(ConstHandle2ConstEvaluated self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EvaluatedLibraryGet(ConstHandle2ConstEvaluated self); + +// +++ Set +extern_c void +EvaluatedLibrarySet(ConstHandle2Evaluated self, const XMLName library); + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedVersionHas(ConstHandle2ConstEvaluated self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EvaluatedVersionGet(ConstHandle2ConstEvaluated self); + +// +++ Set +extern_c void +EvaluatedVersionSet(ConstHandle2Evaluated self, const XMLName version); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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: 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Evaluated/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Evaluated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Flux.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Flux.cpp new file mode 100644 index 000000000..bacd3d95b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Flux.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/Flux.hpp" +#include "Flux.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = FluxClass; +using CPP = multigroup::Flux; + +static const std::string CLASSNAME = "Flux"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; +} + +using CPPXYs2d = containers::XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFlux +FluxDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Flux +FluxDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFlux +FluxCreateConst( + const XMLName label, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2Flux handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(XYs2d) + ); + return handle; +} + +// Create, general +Handle2Flux +FluxCreate( + const XMLName label, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2Flux handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + 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 +FluxAssign(ConstHandle2Flux self, ConstHandle2ConstFlux from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FluxDelete(ConstHandle2ConstFlux self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FluxRead(ConstHandle2Flux self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FluxWrite(ConstHandle2ConstFlux self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FluxPrint(ConstHandle2ConstFlux self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FluxPrintXML(ConstHandle2ConstFlux self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FluxPrintJSON(ConstHandle2ConstFlux self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +FluxLabelHas(ConstHandle2ConstFlux self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +FluxLabelGet(ConstHandle2ConstFlux self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +FluxLabelSet(ConstHandle2Flux self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +FluxXYs2dHas(ConstHandle2ConstFlux self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +FluxXYs2dGetConst(ConstHandle2ConstFlux self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +FluxXYs2dGet(ConstHandle2Flux self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +FluxXYs2dSet(ConstHandle2Flux self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Flux/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Flux.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Flux.h new file mode 100644 index 000000000..43d559ddc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Flux.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. +// +// Flux is the basic handle type in this file. Example: +// // Create a default Flux object: +// Flux handle = FluxDefault(); +// Functions involving Flux are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_FLUX +#define C_INTERFACE_TEST_V2_0_STYLES_FLUX + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FluxClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Flux +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FluxClass *Flux; + +// --- Const-aware handles. +typedef const struct FluxClass *const ConstHandle2ConstFlux; +typedef struct FluxClass *const ConstHandle2Flux; +typedef const struct FluxClass * Handle2ConstFlux; +typedef struct FluxClass * Handle2Flux; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFlux +FluxDefaultConst(); + +// +++ Create, default +extern_c Handle2Flux +FluxDefault(); + +// --- Create, general, const +extern_c Handle2ConstFlux +FluxCreateConst( + const XMLName label, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general +extern_c Handle2Flux +FluxCreate( + const XMLName label, + 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 +FluxAssign(ConstHandle2Flux self, ConstHandle2ConstFlux from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FluxDelete(ConstHandle2ConstFlux self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FluxRead(ConstHandle2Flux self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FluxWrite(ConstHandle2ConstFlux self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FluxPrint(ConstHandle2ConstFlux self); + +// +++ Print to standard output, as XML +extern_c int +FluxPrintXML(ConstHandle2ConstFlux self); + +// +++ Print to standard output, as JSON +extern_c int +FluxPrintJSON(ConstHandle2ConstFlux self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FluxLabelHas(ConstHandle2ConstFlux self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +FluxLabelGet(ConstHandle2ConstFlux self); + +// +++ Set +extern_c void +FluxLabelSet(ConstHandle2Flux self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FluxXYs2dHas(ConstHandle2ConstFlux self); + +// --- Get, const +extern_c Handle2ConstXYs2d +FluxXYs2dGetConst(ConstHandle2ConstFlux self); + +// +++ Get, non-const +extern_c Handle2XYs2d +FluxXYs2dGet(ConstHandle2Flux self); + +// +++ Set +extern_c void +FluxXYs2dSet(ConstHandle2Flux self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Flux/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Flux/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Flux/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Flux/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Flux/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection.cpp new file mode 100644 index 000000000..2523c4e2d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/GriddedCrossSection.hpp" +#include "GriddedCrossSection.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = GriddedCrossSectionClass; +using CPP = multigroup::GriddedCrossSection; + +static const std::string CLASSNAME = "GriddedCrossSection"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto grid = [](auto &obj) { return &obj.grid; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPGrid = containers::Grid; +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGriddedCrossSection +GriddedCrossSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2GriddedCrossSection +GriddedCrossSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGriddedCrossSection +GriddedCrossSectionCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstGrid grid, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2GriddedCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + detail::tocpp(grid), + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2GriddedCrossSection +GriddedCrossSectionCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstGrid grid, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2GriddedCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + detail::tocpp(grid), + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +GriddedCrossSectionAssign(ConstHandle2GriddedCrossSection self, ConstHandle2ConstGriddedCrossSection from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +GriddedCrossSectionDelete(ConstHandle2ConstGriddedCrossSection self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +GriddedCrossSectionRead(ConstHandle2GriddedCrossSection self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +GriddedCrossSectionWrite(ConstHandle2ConstGriddedCrossSection self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +GriddedCrossSectionPrint(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +GriddedCrossSectionPrintXML(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +GriddedCrossSectionPrintJSON(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +GriddedCrossSectionDateHas(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +GriddedCrossSectionDateGet(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +GriddedCrossSectionDateSet(ConstHandle2GriddedCrossSection self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +GriddedCrossSectionDerivedFromHas(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +GriddedCrossSectionDerivedFromGet(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +GriddedCrossSectionDerivedFromSet(ConstHandle2GriddedCrossSection self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +GriddedCrossSectionLabelHas(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +GriddedCrossSectionLabelGet(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +GriddedCrossSectionLabelSet(ConstHandle2GriddedCrossSection self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: grid +// ----------------------------------------------------------------------------- + +// Has +int +GriddedCrossSectionGridHas(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GridHas", self, extract::grid); +} + +// Get, const +Handle2ConstGrid +GriddedCrossSectionGridGetConst(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GridGetConst", self, extract::grid); +} + +// Get, non-const +Handle2Grid +GriddedCrossSectionGridGet(ConstHandle2GriddedCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GridGet", self, extract::grid); +} + +// Set +void +GriddedCrossSectionGridSet(ConstHandle2GriddedCrossSection self, ConstHandle2ConstGrid grid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GridSet", self, extract::grid, grid); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +GriddedCrossSectionDocumentationHas(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +GriddedCrossSectionDocumentationGetConst(ConstHandle2ConstGriddedCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +GriddedCrossSectionDocumentationGet(ConstHandle2GriddedCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +GriddedCrossSectionDocumentationSet(ConstHandle2GriddedCrossSection self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/GriddedCrossSection/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection.h b/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection.h new file mode 100644 index 000000000..92b3d1adb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection.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. +// +// GriddedCrossSection is the basic handle type in this file. Example: +// // Create a default GriddedCrossSection object: +// GriddedCrossSection handle = GriddedCrossSectionDefault(); +// Functions involving GriddedCrossSection are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_GRIDDEDCROSSSECTION +#define C_INTERFACE_TEST_V2_0_STYLES_GRIDDEDCROSSSECTION + +#include "GNDStk.h" +#include "v2.0/containers/Grid.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct GriddedCrossSectionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ GriddedCrossSection +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct GriddedCrossSectionClass *GriddedCrossSection; + +// --- Const-aware handles. +typedef const struct GriddedCrossSectionClass *const ConstHandle2ConstGriddedCrossSection; +typedef struct GriddedCrossSectionClass *const ConstHandle2GriddedCrossSection; +typedef const struct GriddedCrossSectionClass * Handle2ConstGriddedCrossSection; +typedef struct GriddedCrossSectionClass * Handle2GriddedCrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGriddedCrossSection +GriddedCrossSectionDefaultConst(); + +// +++ Create, default +extern_c Handle2GriddedCrossSection +GriddedCrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstGriddedCrossSection +GriddedCrossSectionCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstGrid grid, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2GriddedCrossSection +GriddedCrossSectionCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstGrid grid, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +GriddedCrossSectionAssign(ConstHandle2GriddedCrossSection self, ConstHandle2ConstGriddedCrossSection from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +GriddedCrossSectionDelete(ConstHandle2ConstGriddedCrossSection self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +GriddedCrossSectionRead(ConstHandle2GriddedCrossSection self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +GriddedCrossSectionWrite(ConstHandle2ConstGriddedCrossSection self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +GriddedCrossSectionPrint(ConstHandle2ConstGriddedCrossSection self); + +// +++ Print to standard output, as XML +extern_c int +GriddedCrossSectionPrintXML(ConstHandle2ConstGriddedCrossSection self); + +// +++ Print to standard output, as JSON +extern_c int +GriddedCrossSectionPrintJSON(ConstHandle2ConstGriddedCrossSection self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GriddedCrossSectionDateHas(ConstHandle2ConstGriddedCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c const char * +GriddedCrossSectionDateGet(ConstHandle2ConstGriddedCrossSection self); + +// +++ Set +extern_c void +GriddedCrossSectionDateSet(ConstHandle2GriddedCrossSection self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GriddedCrossSectionDerivedFromHas(ConstHandle2ConstGriddedCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +GriddedCrossSectionDerivedFromGet(ConstHandle2ConstGriddedCrossSection self); + +// +++ Set +extern_c void +GriddedCrossSectionDerivedFromSet(ConstHandle2GriddedCrossSection self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GriddedCrossSectionLabelHas(ConstHandle2ConstGriddedCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +GriddedCrossSectionLabelGet(ConstHandle2ConstGriddedCrossSection self); + +// +++ Set +extern_c void +GriddedCrossSectionLabelSet(ConstHandle2GriddedCrossSection self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: grid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GriddedCrossSectionGridHas(ConstHandle2ConstGriddedCrossSection self); + +// --- Get, const +extern_c Handle2ConstGrid +GriddedCrossSectionGridGetConst(ConstHandle2ConstGriddedCrossSection self); + +// +++ Get, non-const +extern_c Handle2Grid +GriddedCrossSectionGridGet(ConstHandle2GriddedCrossSection self); + +// +++ Set +extern_c void +GriddedCrossSectionGridSet(ConstHandle2GriddedCrossSection self, ConstHandle2ConstGrid grid); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GriddedCrossSectionDocumentationHas(ConstHandle2ConstGriddedCrossSection self); + +// --- Get, const +extern_c Handle2ConstDocumentation +GriddedCrossSectionDocumentationGetConst(ConstHandle2ConstGriddedCrossSection self); + +// +++ Get, non-const +extern_c Handle2Documentation +GriddedCrossSectionDocumentationGet(ConstHandle2GriddedCrossSection self); + +// +++ Set +extern_c void +GriddedCrossSectionDocumentationSet(ConstHandle2GriddedCrossSection self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/GriddedCrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/GriddedCrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Heated.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Heated.cpp new file mode 100644 index 000000000..1f8a52791 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Heated.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/Heated.hpp" +#include "Heated.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = HeatedClass; +using CPP = multigroup::Heated; + +static const std::string CLASSNAME = "Heated"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto temperature = [](auto &obj) { return &obj.temperature; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPTemperature = styles::Temperature; +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstHeated +HeatedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Heated +HeatedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstHeated +HeatedCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2Heated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2Heated +HeatedCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2Heated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + detail::tocpp(temperature), + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +HeatedAssign(ConstHandle2Heated self, ConstHandle2ConstHeated from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +HeatedDelete(ConstHandle2ConstHeated self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +HeatedRead(ConstHandle2Heated self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +HeatedWrite(ConstHandle2ConstHeated self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +HeatedPrint(ConstHandle2ConstHeated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +HeatedPrintXML(ConstHandle2ConstHeated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +HeatedPrintJSON(ConstHandle2ConstHeated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +HeatedDateHas(ConstHandle2ConstHeated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +HeatedDateGet(ConstHandle2ConstHeated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +HeatedDateSet(ConstHandle2Heated self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +HeatedDerivedFromHas(ConstHandle2ConstHeated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +HeatedDerivedFromGet(ConstHandle2ConstHeated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +HeatedDerivedFromSet(ConstHandle2Heated self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +HeatedLabelHas(ConstHandle2ConstHeated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +HeatedLabelGet(ConstHandle2ConstHeated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +HeatedLabelSet(ConstHandle2Heated self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// Has +int +HeatedTemperatureHas(ConstHandle2ConstHeated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TemperatureHas", self, extract::temperature); +} + +// Get, const +Handle2ConstTemperature +HeatedTemperatureGetConst(ConstHandle2ConstHeated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGetConst", self, extract::temperature); +} + +// Get, non-const +Handle2Temperature +HeatedTemperatureGet(ConstHandle2Heated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGet", self, extract::temperature); +} + +// Set +void +HeatedTemperatureSet(ConstHandle2Heated self, ConstHandle2ConstTemperature temperature) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TemperatureSet", self, extract::temperature, temperature); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +HeatedDocumentationHas(ConstHandle2ConstHeated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +HeatedDocumentationGetConst(ConstHandle2ConstHeated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +HeatedDocumentationGet(ConstHandle2Heated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +HeatedDocumentationSet(ConstHandle2Heated self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Heated/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Heated.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Heated.h new file mode 100644 index 000000000..b9c000e7e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Heated.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. +// +// Heated is the basic handle type in this file. Example: +// // Create a default Heated object: +// Heated handle = HeatedDefault(); +// Functions involving Heated are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_HEATED +#define C_INTERFACE_TEST_V2_0_STYLES_HEATED + +#include "GNDStk.h" +#include "v2.0/styles/Temperature.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct HeatedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Heated +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct HeatedClass *Heated; + +// --- Const-aware handles. +typedef const struct HeatedClass *const ConstHandle2ConstHeated; +typedef struct HeatedClass *const ConstHandle2Heated; +typedef const struct HeatedClass * Handle2ConstHeated; +typedef struct HeatedClass * Handle2Heated; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstHeated +HeatedDefaultConst(); + +// +++ Create, default +extern_c Handle2Heated +HeatedDefault(); + +// --- Create, general, const +extern_c Handle2ConstHeated +HeatedCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2Heated +HeatedCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +HeatedAssign(ConstHandle2Heated self, ConstHandle2ConstHeated from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +HeatedDelete(ConstHandle2ConstHeated self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +HeatedRead(ConstHandle2Heated self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +HeatedWrite(ConstHandle2ConstHeated self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +HeatedPrint(ConstHandle2ConstHeated self); + +// +++ Print to standard output, as XML +extern_c int +HeatedPrintXML(ConstHandle2ConstHeated self); + +// +++ Print to standard output, as JSON +extern_c int +HeatedPrintJSON(ConstHandle2ConstHeated self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedDateHas(ConstHandle2ConstHeated self); + +// +++ Get +// +++ Returns by value +extern_c const char * +HeatedDateGet(ConstHandle2ConstHeated self); + +// +++ Set +extern_c void +HeatedDateSet(ConstHandle2Heated self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedDerivedFromHas(ConstHandle2ConstHeated self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +HeatedDerivedFromGet(ConstHandle2ConstHeated self); + +// +++ Set +extern_c void +HeatedDerivedFromSet(ConstHandle2Heated self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedLabelHas(ConstHandle2ConstHeated self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +HeatedLabelGet(ConstHandle2ConstHeated self); + +// +++ Set +extern_c void +HeatedLabelSet(ConstHandle2Heated self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedTemperatureHas(ConstHandle2ConstHeated self); + +// --- Get, const +extern_c Handle2ConstTemperature +HeatedTemperatureGetConst(ConstHandle2ConstHeated self); + +// +++ Get, non-const +extern_c Handle2Temperature +HeatedTemperatureGet(ConstHandle2Heated self); + +// +++ Set +extern_c void +HeatedTemperatureSet(ConstHandle2Heated self, ConstHandle2ConstTemperature temperature); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedDocumentationHas(ConstHandle2ConstHeated self); + +// --- Get, const +extern_c Handle2ConstDocumentation +HeatedDocumentationGetConst(ConstHandle2ConstHeated self); + +// +++ Get, non-const +extern_c Handle2Documentation +HeatedDocumentationGet(ConstHandle2Heated self); + +// +++ Set +extern_c void +HeatedDocumentationSet(ConstHandle2Heated self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Heated/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Heated/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Heated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Heated/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Heated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup.cpp new file mode 100644 index 000000000..c05677f3e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup.cpp @@ -0,0 +1,415 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/HeatedMultiGroup.hpp" +#include "HeatedMultiGroup.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = HeatedMultiGroupClass; +using CPP = multigroup::HeatedMultiGroup; + +static const std::string CLASSNAME = "HeatedMultiGroup"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto transportables = [](auto &obj) { return &obj.transportables; }; + static auto flux = [](auto &obj) { return &obj.flux; }; + static auto inverseSpeed = [](auto &obj) { return &obj.inverseSpeed; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPTransportables = styles::Transportables; +using CPPFlux = styles::Flux; +using CPPInverseSpeed = styles::InverseSpeed; +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstHeatedMultiGroup +HeatedMultiGroupDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2HeatedMultiGroup +HeatedMultiGroupDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstHeatedMultiGroup +HeatedMultiGroupCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstTransportables transportables, + ConstHandle2ConstFlux flux, + ConstHandle2ConstInverseSpeed inverseSpeed, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2HeatedMultiGroup handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + detail::tocpp(transportables), + detail::tocpp(flux), + detail::tocpp(inverseSpeed), + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2HeatedMultiGroup +HeatedMultiGroupCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstTransportables transportables, + ConstHandle2ConstFlux flux, + ConstHandle2ConstInverseSpeed inverseSpeed, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2HeatedMultiGroup handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + detail::tocpp(transportables), + detail::tocpp(flux), + detail::tocpp(inverseSpeed), + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +HeatedMultiGroupAssign(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstHeatedMultiGroup from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +HeatedMultiGroupDelete(ConstHandle2ConstHeatedMultiGroup self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +HeatedMultiGroupRead(ConstHandle2HeatedMultiGroup self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +HeatedMultiGroupWrite(ConstHandle2ConstHeatedMultiGroup self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +HeatedMultiGroupPrint(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +HeatedMultiGroupPrintXML(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +HeatedMultiGroupPrintJSON(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +HeatedMultiGroupDateHas(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +HeatedMultiGroupDateGet(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +HeatedMultiGroupDateSet(ConstHandle2HeatedMultiGroup self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +HeatedMultiGroupDerivedFromHas(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +HeatedMultiGroupDerivedFromGet(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +HeatedMultiGroupDerivedFromSet(ConstHandle2HeatedMultiGroup self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +HeatedMultiGroupLabelHas(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +HeatedMultiGroupLabelGet(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +HeatedMultiGroupLabelSet(ConstHandle2HeatedMultiGroup self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: transportables +// ----------------------------------------------------------------------------- + +// Has +int +HeatedMultiGroupTransportablesHas(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TransportablesHas", self, extract::transportables); +} + +// Get, const +Handle2ConstTransportables +HeatedMultiGroupTransportablesGetConst(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TransportablesGetConst", self, extract::transportables); +} + +// Get, non-const +Handle2Transportables +HeatedMultiGroupTransportablesGet(ConstHandle2HeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TransportablesGet", self, extract::transportables); +} + +// Set +void +HeatedMultiGroupTransportablesSet(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstTransportables transportables) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TransportablesSet", self, extract::transportables, transportables); +} + + +// ----------------------------------------------------------------------------- +// Child: flux +// ----------------------------------------------------------------------------- + +// Has +int +HeatedMultiGroupFluxHas(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FluxHas", self, extract::flux); +} + +// Get, const +Handle2ConstFlux +HeatedMultiGroupFluxGetConst(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FluxGetConst", self, extract::flux); +} + +// Get, non-const +Handle2Flux +HeatedMultiGroupFluxGet(ConstHandle2HeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FluxGet", self, extract::flux); +} + +// Set +void +HeatedMultiGroupFluxSet(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstFlux flux) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FluxSet", self, extract::flux, flux); +} + + +// ----------------------------------------------------------------------------- +// Child: inverseSpeed +// ----------------------------------------------------------------------------- + +// Has +int +HeatedMultiGroupInverseSpeedHas(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InverseSpeedHas", self, extract::inverseSpeed); +} + +// Get, const +Handle2ConstInverseSpeed +HeatedMultiGroupInverseSpeedGetConst(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InverseSpeedGetConst", self, extract::inverseSpeed); +} + +// Get, non-const +Handle2InverseSpeed +HeatedMultiGroupInverseSpeedGet(ConstHandle2HeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InverseSpeedGet", self, extract::inverseSpeed); +} + +// Set +void +HeatedMultiGroupInverseSpeedSet(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstInverseSpeed inverseSpeed) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InverseSpeedSet", self, extract::inverseSpeed, inverseSpeed); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +HeatedMultiGroupDocumentationHas(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +HeatedMultiGroupDocumentationGetConst(ConstHandle2ConstHeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +HeatedMultiGroupDocumentationGet(ConstHandle2HeatedMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +HeatedMultiGroupDocumentationSet(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/HeatedMultiGroup/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup.h b/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup.h new file mode 100644 index 000000000..62cf18673 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup.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. +// +// HeatedMultiGroup is the basic handle type in this file. Example: +// // Create a default HeatedMultiGroup object: +// HeatedMultiGroup handle = HeatedMultiGroupDefault(); +// Functions involving HeatedMultiGroup are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_HEATEDMULTIGROUP +#define C_INTERFACE_TEST_V2_0_STYLES_HEATEDMULTIGROUP + +#include "GNDStk.h" +#include "v2.0/styles/Transportables.h" +#include "v2.0/styles/Flux.h" +#include "v2.0/styles/InverseSpeed.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct HeatedMultiGroupClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ HeatedMultiGroup +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct HeatedMultiGroupClass *HeatedMultiGroup; + +// --- Const-aware handles. +typedef const struct HeatedMultiGroupClass *const ConstHandle2ConstHeatedMultiGroup; +typedef struct HeatedMultiGroupClass *const ConstHandle2HeatedMultiGroup; +typedef const struct HeatedMultiGroupClass * Handle2ConstHeatedMultiGroup; +typedef struct HeatedMultiGroupClass * Handle2HeatedMultiGroup; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstHeatedMultiGroup +HeatedMultiGroupDefaultConst(); + +// +++ Create, default +extern_c Handle2HeatedMultiGroup +HeatedMultiGroupDefault(); + +// --- Create, general, const +extern_c Handle2ConstHeatedMultiGroup +HeatedMultiGroupCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstTransportables transportables, + ConstHandle2ConstFlux flux, + ConstHandle2ConstInverseSpeed inverseSpeed, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2HeatedMultiGroup +HeatedMultiGroupCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstTransportables transportables, + ConstHandle2ConstFlux flux, + ConstHandle2ConstInverseSpeed inverseSpeed, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +HeatedMultiGroupAssign(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstHeatedMultiGroup from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +HeatedMultiGroupDelete(ConstHandle2ConstHeatedMultiGroup self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +HeatedMultiGroupRead(ConstHandle2HeatedMultiGroup self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +HeatedMultiGroupWrite(ConstHandle2ConstHeatedMultiGroup self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +HeatedMultiGroupPrint(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Print to standard output, as XML +extern_c int +HeatedMultiGroupPrintXML(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Print to standard output, as JSON +extern_c int +HeatedMultiGroupPrintJSON(ConstHandle2ConstHeatedMultiGroup self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedMultiGroupDateHas(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Get +// +++ Returns by value +extern_c const char * +HeatedMultiGroupDateGet(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Set +extern_c void +HeatedMultiGroupDateSet(ConstHandle2HeatedMultiGroup self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedMultiGroupDerivedFromHas(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +HeatedMultiGroupDerivedFromGet(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Set +extern_c void +HeatedMultiGroupDerivedFromSet(ConstHandle2HeatedMultiGroup self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedMultiGroupLabelHas(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +HeatedMultiGroupLabelGet(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Set +extern_c void +HeatedMultiGroupLabelSet(ConstHandle2HeatedMultiGroup self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: transportables +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedMultiGroupTransportablesHas(ConstHandle2ConstHeatedMultiGroup self); + +// --- Get, const +extern_c Handle2ConstTransportables +HeatedMultiGroupTransportablesGetConst(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Get, non-const +extern_c Handle2Transportables +HeatedMultiGroupTransportablesGet(ConstHandle2HeatedMultiGroup self); + +// +++ Set +extern_c void +HeatedMultiGroupTransportablesSet(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstTransportables transportables); + + +// ----------------------------------------------------------------------------- +// Child: flux +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedMultiGroupFluxHas(ConstHandle2ConstHeatedMultiGroup self); + +// --- Get, const +extern_c Handle2ConstFlux +HeatedMultiGroupFluxGetConst(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Get, non-const +extern_c Handle2Flux +HeatedMultiGroupFluxGet(ConstHandle2HeatedMultiGroup self); + +// +++ Set +extern_c void +HeatedMultiGroupFluxSet(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstFlux flux); + + +// ----------------------------------------------------------------------------- +// Child: inverseSpeed +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedMultiGroupInverseSpeedHas(ConstHandle2ConstHeatedMultiGroup self); + +// --- Get, const +extern_c Handle2ConstInverseSpeed +HeatedMultiGroupInverseSpeedGetConst(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Get, non-const +extern_c Handle2InverseSpeed +HeatedMultiGroupInverseSpeedGet(ConstHandle2HeatedMultiGroup self); + +// +++ Set +extern_c void +HeatedMultiGroupInverseSpeedSet(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstInverseSpeed inverseSpeed); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HeatedMultiGroupDocumentationHas(ConstHandle2ConstHeatedMultiGroup self); + +// --- Get, const +extern_c Handle2ConstDocumentation +HeatedMultiGroupDocumentationGetConst(ConstHandle2ConstHeatedMultiGroup self); + +// +++ Get, non-const +extern_c Handle2Documentation +HeatedMultiGroupDocumentationGet(ConstHandle2HeatedMultiGroup self); + +// +++ Set +extern_c void +HeatedMultiGroupDocumentationSet(ConstHandle2HeatedMultiGroup self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/HeatedMultiGroup/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/HeatedMultiGroup/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed.cpp new file mode 100644 index 000000000..0276dc4db --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/InverseSpeed.hpp" +#include "InverseSpeed.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = InverseSpeedClass; +using CPP = multigroup::InverseSpeed; + +static const std::string CLASSNAME = "InverseSpeed"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto gridded1d = [](auto &obj) { return &obj.gridded1d; }; +} + +using CPPGridded1d = containers::Gridded1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInverseSpeed +InverseSpeedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2InverseSpeed +InverseSpeedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInverseSpeed +InverseSpeedCreateConst( + const XMLName label, + ConstHandle2ConstGridded1d gridded1d +) { + ConstHandle2InverseSpeed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(gridded1d) + ); + return handle; +} + +// Create, general +Handle2InverseSpeed +InverseSpeedCreate( + const XMLName label, + ConstHandle2ConstGridded1d gridded1d +) { + ConstHandle2InverseSpeed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(gridded1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +InverseSpeedAssign(ConstHandle2InverseSpeed self, ConstHandle2ConstInverseSpeed from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +InverseSpeedDelete(ConstHandle2ConstInverseSpeed self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +InverseSpeedRead(ConstHandle2InverseSpeed self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +InverseSpeedWrite(ConstHandle2ConstInverseSpeed self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +InverseSpeedPrint(ConstHandle2ConstInverseSpeed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +InverseSpeedPrintXML(ConstHandle2ConstInverseSpeed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +InverseSpeedPrintJSON(ConstHandle2ConstInverseSpeed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +InverseSpeedLabelHas(ConstHandle2ConstInverseSpeed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +InverseSpeedLabelGet(ConstHandle2ConstInverseSpeed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +InverseSpeedLabelSet(ConstHandle2InverseSpeed self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// Has +int +InverseSpeedGridded1dHas(ConstHandle2ConstInverseSpeed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded1dHas", self, extract::gridded1d); +} + +// Get, const +Handle2ConstGridded1d +InverseSpeedGridded1dGetConst(ConstHandle2ConstInverseSpeed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGetConst", self, extract::gridded1d); +} + +// Get, non-const +Handle2Gridded1d +InverseSpeedGridded1dGet(ConstHandle2InverseSpeed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded1dGet", self, extract::gridded1d); +} + +// Set +void +InverseSpeedGridded1dSet(ConstHandle2InverseSpeed self, ConstHandle2ConstGridded1d gridded1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded1dSet", self, extract::gridded1d, gridded1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/InverseSpeed/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed.h b/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed.h new file mode 100644 index 000000000..735b886ad --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed.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. +// +// InverseSpeed is the basic handle type in this file. Example: +// // Create a default InverseSpeed object: +// InverseSpeed handle = InverseSpeedDefault(); +// Functions involving InverseSpeed are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_INVERSESPEED +#define C_INTERFACE_TEST_V2_0_STYLES_INVERSESPEED + +#include "GNDStk.h" +#include "v2.0/containers/Gridded1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct InverseSpeedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ InverseSpeed +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct InverseSpeedClass *InverseSpeed; + +// --- Const-aware handles. +typedef const struct InverseSpeedClass *const ConstHandle2ConstInverseSpeed; +typedef struct InverseSpeedClass *const ConstHandle2InverseSpeed; +typedef const struct InverseSpeedClass * Handle2ConstInverseSpeed; +typedef struct InverseSpeedClass * Handle2InverseSpeed; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstInverseSpeed +InverseSpeedDefaultConst(); + +// +++ Create, default +extern_c Handle2InverseSpeed +InverseSpeedDefault(); + +// --- Create, general, const +extern_c Handle2ConstInverseSpeed +InverseSpeedCreateConst( + const XMLName label, + ConstHandle2ConstGridded1d gridded1d +); + +// +++ Create, general +extern_c Handle2InverseSpeed +InverseSpeedCreate( + const XMLName label, + ConstHandle2ConstGridded1d gridded1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +InverseSpeedAssign(ConstHandle2InverseSpeed self, ConstHandle2ConstInverseSpeed from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +InverseSpeedDelete(ConstHandle2ConstInverseSpeed self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +InverseSpeedRead(ConstHandle2InverseSpeed self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +InverseSpeedWrite(ConstHandle2ConstInverseSpeed self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +InverseSpeedPrint(ConstHandle2ConstInverseSpeed self); + +// +++ Print to standard output, as XML +extern_c int +InverseSpeedPrintXML(ConstHandle2ConstInverseSpeed self); + +// +++ Print to standard output, as JSON +extern_c int +InverseSpeedPrintJSON(ConstHandle2ConstInverseSpeed self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InverseSpeedLabelHas(ConstHandle2ConstInverseSpeed self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +InverseSpeedLabelGet(ConstHandle2ConstInverseSpeed self); + +// +++ Set +extern_c void +InverseSpeedLabelSet(ConstHandle2InverseSpeed self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: gridded1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InverseSpeedGridded1dHas(ConstHandle2ConstInverseSpeed self); + +// --- Get, const +extern_c Handle2ConstGridded1d +InverseSpeedGridded1dGetConst(ConstHandle2ConstInverseSpeed self); + +// +++ Get, non-const +extern_c Handle2Gridded1d +InverseSpeedGridded1dGet(ConstHandle2InverseSpeed self); + +// +++ Set +extern_c void +InverseSpeedGridded1dSet(ConstHandle2InverseSpeed self, ConstHandle2ConstGridded1d gridded1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/InverseSpeed/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/InverseSpeed/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf.cpp new file mode 100644 index 000000000..cf944ab00 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/MonteCarlo_cdf.hpp" +#include "MonteCarlo_cdf.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MonteCarlo_cdfClass; +using CPP = multigroup::MonteCarlo_cdf; + +static const std::string CLASSNAME = "MonteCarlo_cdf"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMonteCarlo_cdf +MonteCarlo_cdfDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2MonteCarlo_cdf +MonteCarlo_cdfDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMonteCarlo_cdf +MonteCarlo_cdfCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2MonteCarlo_cdf handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2MonteCarlo_cdf +MonteCarlo_cdfCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2MonteCarlo_cdf handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MonteCarlo_cdfAssign(ConstHandle2MonteCarlo_cdf self, ConstHandle2ConstMonteCarlo_cdf from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MonteCarlo_cdfDelete(ConstHandle2ConstMonteCarlo_cdf self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MonteCarlo_cdfRead(ConstHandle2MonteCarlo_cdf self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MonteCarlo_cdfWrite(ConstHandle2ConstMonteCarlo_cdf self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MonteCarlo_cdfPrint(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MonteCarlo_cdfPrintXML(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MonteCarlo_cdfPrintJSON(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +MonteCarlo_cdfDateHas(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +MonteCarlo_cdfDateGet(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +MonteCarlo_cdfDateSet(ConstHandle2MonteCarlo_cdf self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +MonteCarlo_cdfDerivedFromHas(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +MonteCarlo_cdfDerivedFromGet(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +MonteCarlo_cdfDerivedFromSet(ConstHandle2MonteCarlo_cdf self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +MonteCarlo_cdfLabelHas(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +MonteCarlo_cdfLabelGet(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MonteCarlo_cdfLabelSet(ConstHandle2MonteCarlo_cdf self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +MonteCarlo_cdfDocumentationHas(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +MonteCarlo_cdfDocumentationGetConst(ConstHandle2ConstMonteCarlo_cdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +MonteCarlo_cdfDocumentationGet(ConstHandle2MonteCarlo_cdf self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +MonteCarlo_cdfDocumentationSet(ConstHandle2MonteCarlo_cdf self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/MonteCarlo_cdf/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf.h b/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf.h new file mode 100644 index 000000000..c62ef0138 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf.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. +// +// MonteCarlo_cdf is the basic handle type in this file. Example: +// // Create a default MonteCarlo_cdf object: +// MonteCarlo_cdf handle = MonteCarlo_cdfDefault(); +// Functions involving MonteCarlo_cdf are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_MONTECARLO_CDF +#define C_INTERFACE_TEST_V2_0_STYLES_MONTECARLO_CDF + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MonteCarlo_cdfClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ MonteCarlo_cdf +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MonteCarlo_cdfClass *MonteCarlo_cdf; + +// --- Const-aware handles. +typedef const struct MonteCarlo_cdfClass *const ConstHandle2ConstMonteCarlo_cdf; +typedef struct MonteCarlo_cdfClass *const ConstHandle2MonteCarlo_cdf; +typedef const struct MonteCarlo_cdfClass * Handle2ConstMonteCarlo_cdf; +typedef struct MonteCarlo_cdfClass * Handle2MonteCarlo_cdf; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMonteCarlo_cdf +MonteCarlo_cdfDefaultConst(); + +// +++ Create, default +extern_c Handle2MonteCarlo_cdf +MonteCarlo_cdfDefault(); + +// --- Create, general, const +extern_c Handle2ConstMonteCarlo_cdf +MonteCarlo_cdfCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2MonteCarlo_cdf +MonteCarlo_cdfCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MonteCarlo_cdfAssign(ConstHandle2MonteCarlo_cdf self, ConstHandle2ConstMonteCarlo_cdf from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MonteCarlo_cdfDelete(ConstHandle2ConstMonteCarlo_cdf self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MonteCarlo_cdfRead(ConstHandle2MonteCarlo_cdf self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MonteCarlo_cdfWrite(ConstHandle2ConstMonteCarlo_cdf self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MonteCarlo_cdfPrint(ConstHandle2ConstMonteCarlo_cdf self); + +// +++ Print to standard output, as XML +extern_c int +MonteCarlo_cdfPrintXML(ConstHandle2ConstMonteCarlo_cdf self); + +// +++ Print to standard output, as JSON +extern_c int +MonteCarlo_cdfPrintJSON(ConstHandle2ConstMonteCarlo_cdf self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MonteCarlo_cdfDateHas(ConstHandle2ConstMonteCarlo_cdf self); + +// +++ Get +// +++ Returns by value +extern_c const char * +MonteCarlo_cdfDateGet(ConstHandle2ConstMonteCarlo_cdf self); + +// +++ Set +extern_c void +MonteCarlo_cdfDateSet(ConstHandle2MonteCarlo_cdf self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MonteCarlo_cdfDerivedFromHas(ConstHandle2ConstMonteCarlo_cdf self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MonteCarlo_cdfDerivedFromGet(ConstHandle2ConstMonteCarlo_cdf self); + +// +++ Set +extern_c void +MonteCarlo_cdfDerivedFromSet(ConstHandle2MonteCarlo_cdf self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MonteCarlo_cdfLabelHas(ConstHandle2ConstMonteCarlo_cdf self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MonteCarlo_cdfLabelGet(ConstHandle2ConstMonteCarlo_cdf self); + +// +++ Set +extern_c void +MonteCarlo_cdfLabelSet(ConstHandle2MonteCarlo_cdf self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MonteCarlo_cdfDocumentationHas(ConstHandle2ConstMonteCarlo_cdf self); + +// --- Get, const +extern_c Handle2ConstDocumentation +MonteCarlo_cdfDocumentationGetConst(ConstHandle2ConstMonteCarlo_cdf self); + +// +++ Get, non-const +extern_c Handle2Documentation +MonteCarlo_cdfDocumentationGet(ConstHandle2MonteCarlo_cdf self); + +// +++ Set +extern_c void +MonteCarlo_cdfDocumentationSet(ConstHandle2MonteCarlo_cdf self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/MonteCarlo_cdf/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/MonteCarlo_cdf/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand.cpp new file mode 100644 index 000000000..9e7979994 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/MultiBand.hpp" +#include "MultiBand.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MultiBandClass; +using CPP = multigroup::MultiBand; + +static const std::string CLASSNAME = "MultiBand"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto numberOfBands = [](auto &obj) { return &obj.numberOfBands; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultiBand +MultiBandDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2MultiBand +MultiBandDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMultiBand +MultiBandCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 numberOfBands, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2MultiBand handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + numberOfBands, + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2MultiBand +MultiBandCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 numberOfBands, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2MultiBand handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + numberOfBands, + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MultiBandAssign(ConstHandle2MultiBand self, ConstHandle2ConstMultiBand from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MultiBandDelete(ConstHandle2ConstMultiBand self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MultiBandRead(ConstHandle2MultiBand self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MultiBandWrite(ConstHandle2ConstMultiBand self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MultiBandPrint(ConstHandle2ConstMultiBand self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MultiBandPrintXML(ConstHandle2ConstMultiBand self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MultiBandPrintJSON(ConstHandle2ConstMultiBand self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +MultiBandDateHas(ConstHandle2ConstMultiBand self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +MultiBandDateGet(ConstHandle2ConstMultiBand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +MultiBandDateSet(ConstHandle2MultiBand self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +MultiBandDerivedFromHas(ConstHandle2ConstMultiBand self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +MultiBandDerivedFromGet(ConstHandle2ConstMultiBand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +MultiBandDerivedFromSet(ConstHandle2MultiBand self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +MultiBandLabelHas(ConstHandle2ConstMultiBand self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +MultiBandLabelGet(ConstHandle2ConstMultiBand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MultiBandLabelSet(ConstHandle2MultiBand self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: numberOfBands +// ----------------------------------------------------------------------------- + +// Has +int +MultiBandNumberOfBandsHas(ConstHandle2ConstMultiBand self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NumberOfBandsHas", self, extract::numberOfBands); +} + +// Get +// Returns by value +Integer32 +MultiBandNumberOfBandsGet(ConstHandle2ConstMultiBand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NumberOfBandsGet", self, extract::numberOfBands); +} + +// Set +void +MultiBandNumberOfBandsSet(ConstHandle2MultiBand self, const Integer32 numberOfBands) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NumberOfBandsSet", self, extract::numberOfBands, numberOfBands); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +MultiBandDocumentationHas(ConstHandle2ConstMultiBand self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +MultiBandDocumentationGetConst(ConstHandle2ConstMultiBand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +MultiBandDocumentationGet(ConstHandle2MultiBand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +MultiBandDocumentationSet(ConstHandle2MultiBand self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/MultiBand/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand.h b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand.h new file mode 100644 index 000000000..b5d05678a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand.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. +// +// MultiBand is the basic handle type in this file. Example: +// // Create a default MultiBand object: +// MultiBand handle = MultiBandDefault(); +// Functions involving MultiBand are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_MULTIBAND +#define C_INTERFACE_TEST_V2_0_STYLES_MULTIBAND + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MultiBandClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ MultiBand +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MultiBandClass *MultiBand; + +// --- Const-aware handles. +typedef const struct MultiBandClass *const ConstHandle2ConstMultiBand; +typedef struct MultiBandClass *const ConstHandle2MultiBand; +typedef const struct MultiBandClass * Handle2ConstMultiBand; +typedef struct MultiBandClass * Handle2MultiBand; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMultiBand +MultiBandDefaultConst(); + +// +++ Create, default +extern_c Handle2MultiBand +MultiBandDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiBand +MultiBandCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 numberOfBands, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2MultiBand +MultiBandCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 numberOfBands, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MultiBandAssign(ConstHandle2MultiBand self, ConstHandle2ConstMultiBand from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MultiBandDelete(ConstHandle2ConstMultiBand self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MultiBandRead(ConstHandle2MultiBand self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MultiBandWrite(ConstHandle2ConstMultiBand self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MultiBandPrint(ConstHandle2ConstMultiBand self); + +// +++ Print to standard output, as XML +extern_c int +MultiBandPrintXML(ConstHandle2ConstMultiBand self); + +// +++ Print to standard output, as JSON +extern_c int +MultiBandPrintJSON(ConstHandle2ConstMultiBand self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiBandDateHas(ConstHandle2ConstMultiBand self); + +// +++ Get +// +++ Returns by value +extern_c const char * +MultiBandDateGet(ConstHandle2ConstMultiBand self); + +// +++ Set +extern_c void +MultiBandDateSet(ConstHandle2MultiBand self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiBandDerivedFromHas(ConstHandle2ConstMultiBand self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MultiBandDerivedFromGet(ConstHandle2ConstMultiBand self); + +// +++ Set +extern_c void +MultiBandDerivedFromSet(ConstHandle2MultiBand self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiBandLabelHas(ConstHandle2ConstMultiBand self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MultiBandLabelGet(ConstHandle2ConstMultiBand self); + +// +++ Set +extern_c void +MultiBandLabelSet(ConstHandle2MultiBand self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: numberOfBands +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiBandNumberOfBandsHas(ConstHandle2ConstMultiBand self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +MultiBandNumberOfBandsGet(ConstHandle2ConstMultiBand self); + +// +++ Set +extern_c void +MultiBandNumberOfBandsSet(ConstHandle2MultiBand self, const Integer32 numberOfBands); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiBandDocumentationHas(ConstHandle2ConstMultiBand self); + +// --- Get, const +extern_c Handle2ConstDocumentation +MultiBandDocumentationGetConst(ConstHandle2ConstMultiBand self); + +// +++ Get, non-const +extern_c Handle2Documentation +MultiBandDocumentationGet(ConstHandle2MultiBand self); + +// +++ Set +extern_c void +MultiBandDocumentationSet(ConstHandle2MultiBand self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/MultiBand/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiBand/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup.cpp new file mode 100644 index 000000000..ca314b680 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/MultiGroup.hpp" +#include "MultiGroup.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MultiGroupClass; +using CPP = multigroup::MultiGroup; + +static const std::string CLASSNAME = "MultiGroup"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto grid = [](auto &obj) { return &obj.grid; }; +} + +using CPPGrid = containers::Grid; + + +// ----------------------------------------------------------------------------- +// 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 XMLName label, + ConstHandle2ConstGrid grid +) { + ConstHandle2MultiGroup handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(grid) + ); + return handle; +} + +// Create, general +Handle2MultiGroup +MultiGroupCreate( + const XMLName label, + ConstHandle2ConstGrid grid +) { + ConstHandle2MultiGroup handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(grid) + ); + return handle; +} + +// Assign +// Use this to assign 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: label +// ----------------------------------------------------------------------------- + +// Has +int +MultiGroupLabelHas(ConstHandle2ConstMultiGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +MultiGroupLabelGet(ConstHandle2ConstMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MultiGroupLabelSet(ConstHandle2MultiGroup self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: grid +// ----------------------------------------------------------------------------- + +// Has +int +MultiGroupGridHas(ConstHandle2ConstMultiGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GridHas", self, extract::grid); +} + +// Get, const +Handle2ConstGrid +MultiGroupGridGetConst(ConstHandle2ConstMultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GridGetConst", self, extract::grid); +} + +// Get, non-const +Handle2Grid +MultiGroupGridGet(ConstHandle2MultiGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GridGet", self, extract::grid); +} + +// Set +void +MultiGroupGridSet(ConstHandle2MultiGroup self, ConstHandle2ConstGrid grid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GridSet", self, extract::grid, grid); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/MultiGroup/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup.h b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup.h new file mode 100644 index 000000000..325dc1791 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup.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. +// +// 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_TEST_V2_0_STYLES_MULTIGROUP +#define C_INTERFACE_TEST_V2_0_STYLES_MULTIGROUP + +#include "GNDStk.h" +#include "v2.0/containers/Grid.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 XMLName label, + ConstHandle2ConstGrid grid +); + +// +++ Create, general +extern_c Handle2MultiGroup +MultiGroupCreate( + const XMLName label, + ConstHandle2ConstGrid grid +); + +// +++ Assign +// +++ Use this to assign one handled 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiGroupLabelHas(ConstHandle2ConstMultiGroup self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MultiGroupLabelGet(ConstHandle2ConstMultiGroup self); + +// +++ Set +extern_c void +MultiGroupLabelSet(ConstHandle2MultiGroup self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: grid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiGroupGridHas(ConstHandle2ConstMultiGroup self); + +// --- Get, const +extern_c Handle2ConstGrid +MultiGroupGridGetConst(ConstHandle2ConstMultiGroup self); + +// +++ Get, non-const +extern_c Handle2Grid +MultiGroupGridGet(ConstHandle2MultiGroup self); + +// +++ Set +extern_c void +MultiGroupGridSet(ConstHandle2MultiGroup self, ConstHandle2ConstGrid grid); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/MultiGroup/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/MultiGroup/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain.cpp new file mode 100644 index 000000000..f551de9c0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain.cpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/ProjectileEnergyDomain.hpp" +#include "ProjectileEnergyDomain.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ProjectileEnergyDomainClass; +using CPP = multigroup::ProjectileEnergyDomain; + +static const std::string CLASSNAME = "ProjectileEnergyDomain"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto max = [](auto &obj) { return &obj.max; }; + static auto min = [](auto &obj) { return &obj.min; }; + 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 +Handle2ProjectileEnergyDomain +ProjectileEnergyDomainDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProjectileEnergyDomain +ProjectileEnergyDomainCreateConst( + const XMLName label, + const Float64 max, + const Float64 min, + const XMLName unit +) { + ConstHandle2ProjectileEnergyDomain handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + max, + min, + unit + ); + return handle; +} + +// Create, general +Handle2ProjectileEnergyDomain +ProjectileEnergyDomainCreate( + const XMLName label, + const Float64 max, + const Float64 min, + const XMLName unit +) { + ConstHandle2ProjectileEnergyDomain handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + max, + min, + 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: label +// ----------------------------------------------------------------------------- + +// Has +int +ProjectileEnergyDomainLabelHas(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ProjectileEnergyDomainLabelGet(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ProjectileEnergyDomainLabelSet(ConstHandle2ProjectileEnergyDomain self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: max +// ----------------------------------------------------------------------------- + +// Has +int +ProjectileEnergyDomainMaxHas(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MaxHas", self, extract::max); +} + +// Get +// Returns by value +Float64 +ProjectileEnergyDomainMaxGet(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MaxGet", self, extract::max); +} + +// Set +void +ProjectileEnergyDomainMaxSet(ConstHandle2ProjectileEnergyDomain self, const Float64 max) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MaxSet", self, extract::max, max); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: min +// ----------------------------------------------------------------------------- + +// Has +int +ProjectileEnergyDomainMinHas(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MinHas", self, extract::min); +} + +// Get +// Returns by value +Float64 +ProjectileEnergyDomainMinGet(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MinGet", self, extract::min); +} + +// Set +void +ProjectileEnergyDomainMinSet(ConstHandle2ProjectileEnergyDomain self, const Float64 min) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MinSet", self, extract::min, min); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +ProjectileEnergyDomainUnitHas(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +ProjectileEnergyDomainUnitGet(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +ProjectileEnergyDomainUnitSet(ConstHandle2ProjectileEnergyDomain self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/ProjectileEnergyDomain/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain.h b/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain.h new file mode 100644 index 000000000..b4428fb6b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain.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. +// +// 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_TEST_V2_0_STYLES_PROJECTILEENERGYDOMAIN +#define C_INTERFACE_TEST_V2_0_STYLES_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 +extern_c Handle2ProjectileEnergyDomain +ProjectileEnergyDomainDefault(); + +// --- Create, general, const +extern_c Handle2ConstProjectileEnergyDomain +ProjectileEnergyDomainCreateConst( + const XMLName label, + const Float64 max, + const Float64 min, + const XMLName unit +); + +// +++ Create, general +extern_c Handle2ProjectileEnergyDomain +ProjectileEnergyDomainCreate( + const XMLName label, + const Float64 max, + const Float64 min, + const XMLName 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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProjectileEnergyDomainLabelHas(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProjectileEnergyDomainLabelGet(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Set +extern_c void +ProjectileEnergyDomainLabelSet(ConstHandle2ProjectileEnergyDomain self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: max +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProjectileEnergyDomainMaxHas(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +ProjectileEnergyDomainMaxGet(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Set +extern_c void +ProjectileEnergyDomainMaxSet(ConstHandle2ProjectileEnergyDomain self, const Float64 max); + + +// ----------------------------------------------------------------------------- +// Metadatum: min +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProjectileEnergyDomainMinHas(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +ProjectileEnergyDomainMinGet(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Set +extern_c void +ProjectileEnergyDomainMinSet(ConstHandle2ProjectileEnergyDomain self, const Float64 min); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProjectileEnergyDomainUnitHas(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProjectileEnergyDomainUnitGet(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Set +extern_c void +ProjectileEnergyDomainUnitSet(ConstHandle2ProjectileEnergyDomain self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/ProjectileEnergyDomain/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/ProjectileEnergyDomain/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Realization.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Realization.cpp new file mode 100644 index 000000000..7cb077b1b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Realization.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/Realization.hpp" +#include "Realization.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = RealizationClass; +using CPP = multigroup::Realization; + +static const std::string CLASSNAME = "Realization"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRealization +RealizationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Realization +RealizationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRealization +RealizationCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2Realization handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2Realization +RealizationCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2Realization handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RealizationAssign(ConstHandle2Realization self, ConstHandle2ConstRealization from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RealizationDelete(ConstHandle2ConstRealization self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RealizationRead(ConstHandle2Realization self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RealizationWrite(ConstHandle2ConstRealization self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RealizationPrint(ConstHandle2ConstRealization self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RealizationPrintXML(ConstHandle2ConstRealization self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RealizationPrintJSON(ConstHandle2ConstRealization self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +RealizationDateHas(ConstHandle2ConstRealization self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +RealizationDateGet(ConstHandle2ConstRealization self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +RealizationDateSet(ConstHandle2Realization self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +RealizationDerivedFromHas(ConstHandle2ConstRealization self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +RealizationDerivedFromGet(ConstHandle2ConstRealization self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +RealizationDerivedFromSet(ConstHandle2Realization self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +RealizationLabelHas(ConstHandle2ConstRealization self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +RealizationLabelGet(ConstHandle2ConstRealization self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +RealizationLabelSet(ConstHandle2Realization self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +RealizationDocumentationHas(ConstHandle2ConstRealization self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +RealizationDocumentationGetConst(ConstHandle2ConstRealization self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +RealizationDocumentationGet(ConstHandle2Realization self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +RealizationDocumentationSet(ConstHandle2Realization self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Realization/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Realization.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Realization.h new file mode 100644 index 000000000..5218b0105 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Realization.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. +// +// Realization is the basic handle type in this file. Example: +// // Create a default Realization object: +// Realization handle = RealizationDefault(); +// Functions involving Realization are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_REALIZATION +#define C_INTERFACE_TEST_V2_0_STYLES_REALIZATION + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RealizationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Realization +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RealizationClass *Realization; + +// --- Const-aware handles. +typedef const struct RealizationClass *const ConstHandle2ConstRealization; +typedef struct RealizationClass *const ConstHandle2Realization; +typedef const struct RealizationClass * Handle2ConstRealization; +typedef struct RealizationClass * Handle2Realization; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRealization +RealizationDefaultConst(); + +// +++ Create, default +extern_c Handle2Realization +RealizationDefault(); + +// --- Create, general, const +extern_c Handle2ConstRealization +RealizationCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2Realization +RealizationCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RealizationAssign(ConstHandle2Realization self, ConstHandle2ConstRealization from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RealizationDelete(ConstHandle2ConstRealization self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RealizationRead(ConstHandle2Realization self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RealizationWrite(ConstHandle2ConstRealization self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RealizationPrint(ConstHandle2ConstRealization self); + +// +++ Print to standard output, as XML +extern_c int +RealizationPrintXML(ConstHandle2ConstRealization self); + +// +++ Print to standard output, as JSON +extern_c int +RealizationPrintJSON(ConstHandle2ConstRealization self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RealizationDateHas(ConstHandle2ConstRealization self); + +// +++ Get +// +++ Returns by value +extern_c const char * +RealizationDateGet(ConstHandle2ConstRealization self); + +// +++ Set +extern_c void +RealizationDateSet(ConstHandle2Realization self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RealizationDerivedFromHas(ConstHandle2ConstRealization self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +RealizationDerivedFromGet(ConstHandle2ConstRealization self); + +// +++ Set +extern_c void +RealizationDerivedFromSet(ConstHandle2Realization self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RealizationLabelHas(ConstHandle2ConstRealization self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +RealizationLabelGet(ConstHandle2ConstRealization self); + +// +++ Set +extern_c void +RealizationLabelSet(ConstHandle2Realization self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RealizationDocumentationHas(ConstHandle2ConstRealization self); + +// --- Get, const +extern_c Handle2ConstDocumentation +RealizationDocumentationGetConst(ConstHandle2ConstRealization self); + +// +++ Get, non-const +extern_c Handle2Documentation +RealizationDocumentationGet(ConstHandle2Realization self); + +// +++ Set +extern_c void +RealizationDocumentationSet(ConstHandle2Realization self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Realization/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Realization/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Realization/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Realization/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Realization/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros.cpp new file mode 100644 index 000000000..1321f1208 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/SigmaZeros.hpp" +#include "SigmaZeros.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = SigmaZerosClass; +using CPP = multigroup::SigmaZeros; + +static const std::string CLASSNAME = "SigmaZeros"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPValues = containers::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSigmaZeros +SigmaZerosDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2SigmaZeros +SigmaZerosDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSigmaZeros +SigmaZerosCreateConst( + const XMLName label, + ConstHandle2ConstValues values +) { + ConstHandle2SigmaZeros handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(values) + ); + return handle; +} + +// Create, general +Handle2SigmaZeros +SigmaZerosCreate( + const XMLName label, + ConstHandle2ConstValues values +) { + ConstHandle2SigmaZeros handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + 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 +SigmaZerosAssign(ConstHandle2SigmaZeros self, ConstHandle2ConstSigmaZeros from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SigmaZerosDelete(ConstHandle2ConstSigmaZeros self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SigmaZerosRead(ConstHandle2SigmaZeros self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SigmaZerosWrite(ConstHandle2ConstSigmaZeros self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SigmaZerosPrint(ConstHandle2ConstSigmaZeros self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SigmaZerosPrintXML(ConstHandle2ConstSigmaZeros self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SigmaZerosPrintJSON(ConstHandle2ConstSigmaZeros self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +SigmaZerosLabelHas(ConstHandle2ConstSigmaZeros self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +SigmaZerosLabelGet(ConstHandle2ConstSigmaZeros self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +SigmaZerosLabelSet(ConstHandle2SigmaZeros self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +SigmaZerosValuesHas(ConstHandle2ConstSigmaZeros self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +SigmaZerosValuesGetConst(ConstHandle2ConstSigmaZeros self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +SigmaZerosValuesGet(ConstHandle2SigmaZeros self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +SigmaZerosValuesSet(ConstHandle2SigmaZeros self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/SigmaZeros/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros.h b/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros.h new file mode 100644 index 000000000..d83242b5e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros.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. +// +// SigmaZeros is the basic handle type in this file. Example: +// // Create a default SigmaZeros object: +// SigmaZeros handle = SigmaZerosDefault(); +// Functions involving SigmaZeros are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_SIGMAZEROS +#define C_INTERFACE_TEST_V2_0_STYLES_SIGMAZEROS + +#include "GNDStk.h" +#include "v2.0/containers/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SigmaZerosClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ SigmaZeros +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SigmaZerosClass *SigmaZeros; + +// --- Const-aware handles. +typedef const struct SigmaZerosClass *const ConstHandle2ConstSigmaZeros; +typedef struct SigmaZerosClass *const ConstHandle2SigmaZeros; +typedef const struct SigmaZerosClass * Handle2ConstSigmaZeros; +typedef struct SigmaZerosClass * Handle2SigmaZeros; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSigmaZeros +SigmaZerosDefaultConst(); + +// +++ Create, default +extern_c Handle2SigmaZeros +SigmaZerosDefault(); + +// --- Create, general, const +extern_c Handle2ConstSigmaZeros +SigmaZerosCreateConst( + const XMLName label, + ConstHandle2ConstValues values +); + +// +++ Create, general +extern_c Handle2SigmaZeros +SigmaZerosCreate( + const XMLName label, + 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 +SigmaZerosAssign(ConstHandle2SigmaZeros self, ConstHandle2ConstSigmaZeros from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SigmaZerosDelete(ConstHandle2ConstSigmaZeros self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SigmaZerosRead(ConstHandle2SigmaZeros self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SigmaZerosWrite(ConstHandle2ConstSigmaZeros self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SigmaZerosPrint(ConstHandle2ConstSigmaZeros self); + +// +++ Print to standard output, as XML +extern_c int +SigmaZerosPrintXML(ConstHandle2ConstSigmaZeros self); + +// +++ Print to standard output, as JSON +extern_c int +SigmaZerosPrintJSON(ConstHandle2ConstSigmaZeros self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SigmaZerosLabelHas(ConstHandle2ConstSigmaZeros self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SigmaZerosLabelGet(ConstHandle2ConstSigmaZeros self); + +// +++ Set +extern_c void +SigmaZerosLabelSet(ConstHandle2SigmaZeros self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SigmaZerosValuesHas(ConstHandle2ConstSigmaZeros self); + +// --- Get, const +extern_c Handle2ConstValues +SigmaZerosValuesGetConst(ConstHandle2ConstSigmaZeros self); + +// +++ Get, non-const +extern_c Handle2Values +SigmaZerosValuesGet(ConstHandle2SigmaZeros self); + +// +++ Set +extern_c void +SigmaZerosValuesSet(ConstHandle2SigmaZeros self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/SigmaZeros/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/SigmaZeros/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter.cpp new file mode 100644 index 000000000..d56699cd5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/SnElasticUpScatter.hpp" +#include "SnElasticUpScatter.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = SnElasticUpScatterClass; +using CPP = multigroup::SnElasticUpScatter; + +static const std::string CLASSNAME = "SnElasticUpScatter"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto upperCalculatedGroup = [](auto &obj) { return &obj.upperCalculatedGroup; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSnElasticUpScatter +SnElasticUpScatterDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2SnElasticUpScatter +SnElasticUpScatterDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSnElasticUpScatter +SnElasticUpScatterCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 upperCalculatedGroup, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2SnElasticUpScatter handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + upperCalculatedGroup, + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2SnElasticUpScatter +SnElasticUpScatterCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 upperCalculatedGroup, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2SnElasticUpScatter handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + upperCalculatedGroup, + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SnElasticUpScatterAssign(ConstHandle2SnElasticUpScatter self, ConstHandle2ConstSnElasticUpScatter from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SnElasticUpScatterDelete(ConstHandle2ConstSnElasticUpScatter self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SnElasticUpScatterRead(ConstHandle2SnElasticUpScatter self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SnElasticUpScatterWrite(ConstHandle2ConstSnElasticUpScatter self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SnElasticUpScatterPrint(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SnElasticUpScatterPrintXML(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SnElasticUpScatterPrintJSON(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +SnElasticUpScatterDateHas(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +SnElasticUpScatterDateGet(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +SnElasticUpScatterDateSet(ConstHandle2SnElasticUpScatter self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +SnElasticUpScatterDerivedFromHas(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +SnElasticUpScatterDerivedFromGet(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +SnElasticUpScatterDerivedFromSet(ConstHandle2SnElasticUpScatter self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +SnElasticUpScatterLabelHas(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +SnElasticUpScatterLabelGet(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +SnElasticUpScatterLabelSet(ConstHandle2SnElasticUpScatter self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: upperCalculatedGroup +// ----------------------------------------------------------------------------- + +// Has +int +SnElasticUpScatterUpperCalculatedGroupHas(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UpperCalculatedGroupHas", self, extract::upperCalculatedGroup); +} + +// Get +// Returns by value +Integer32 +SnElasticUpScatterUpperCalculatedGroupGet(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UpperCalculatedGroupGet", self, extract::upperCalculatedGroup); +} + +// Set +void +SnElasticUpScatterUpperCalculatedGroupSet(ConstHandle2SnElasticUpScatter self, const Integer32 upperCalculatedGroup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UpperCalculatedGroupSet", self, extract::upperCalculatedGroup, upperCalculatedGroup); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +SnElasticUpScatterDocumentationHas(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +SnElasticUpScatterDocumentationGetConst(ConstHandle2ConstSnElasticUpScatter self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +SnElasticUpScatterDocumentationGet(ConstHandle2SnElasticUpScatter self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +SnElasticUpScatterDocumentationSet(ConstHandle2SnElasticUpScatter self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/SnElasticUpScatter/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter.h b/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter.h new file mode 100644 index 000000000..ac065028c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter.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. +// +// SnElasticUpScatter is the basic handle type in this file. Example: +// // Create a default SnElasticUpScatter object: +// SnElasticUpScatter handle = SnElasticUpScatterDefault(); +// Functions involving SnElasticUpScatter are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_SNELASTICUPSCATTER +#define C_INTERFACE_TEST_V2_0_STYLES_SNELASTICUPSCATTER + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SnElasticUpScatterClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ SnElasticUpScatter +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SnElasticUpScatterClass *SnElasticUpScatter; + +// --- Const-aware handles. +typedef const struct SnElasticUpScatterClass *const ConstHandle2ConstSnElasticUpScatter; +typedef struct SnElasticUpScatterClass *const ConstHandle2SnElasticUpScatter; +typedef const struct SnElasticUpScatterClass * Handle2ConstSnElasticUpScatter; +typedef struct SnElasticUpScatterClass * Handle2SnElasticUpScatter; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSnElasticUpScatter +SnElasticUpScatterDefaultConst(); + +// +++ Create, default +extern_c Handle2SnElasticUpScatter +SnElasticUpScatterDefault(); + +// --- Create, general, const +extern_c Handle2ConstSnElasticUpScatter +SnElasticUpScatterCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 upperCalculatedGroup, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2SnElasticUpScatter +SnElasticUpScatterCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + const Integer32 upperCalculatedGroup, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SnElasticUpScatterAssign(ConstHandle2SnElasticUpScatter self, ConstHandle2ConstSnElasticUpScatter from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SnElasticUpScatterDelete(ConstHandle2ConstSnElasticUpScatter self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SnElasticUpScatterRead(ConstHandle2SnElasticUpScatter self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SnElasticUpScatterWrite(ConstHandle2ConstSnElasticUpScatter self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SnElasticUpScatterPrint(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Print to standard output, as XML +extern_c int +SnElasticUpScatterPrintXML(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Print to standard output, as JSON +extern_c int +SnElasticUpScatterPrintJSON(ConstHandle2ConstSnElasticUpScatter self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SnElasticUpScatterDateHas(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SnElasticUpScatterDateGet(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Set +extern_c void +SnElasticUpScatterDateSet(ConstHandle2SnElasticUpScatter self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SnElasticUpScatterDerivedFromHas(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SnElasticUpScatterDerivedFromGet(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Set +extern_c void +SnElasticUpScatterDerivedFromSet(ConstHandle2SnElasticUpScatter self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SnElasticUpScatterLabelHas(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +SnElasticUpScatterLabelGet(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Set +extern_c void +SnElasticUpScatterLabelSet(ConstHandle2SnElasticUpScatter self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: upperCalculatedGroup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SnElasticUpScatterUpperCalculatedGroupHas(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +SnElasticUpScatterUpperCalculatedGroupGet(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Set +extern_c void +SnElasticUpScatterUpperCalculatedGroupSet(ConstHandle2SnElasticUpScatter self, const Integer32 upperCalculatedGroup); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SnElasticUpScatterDocumentationHas(ConstHandle2ConstSnElasticUpScatter self); + +// --- Get, const +extern_c Handle2ConstDocumentation +SnElasticUpScatterDocumentationGetConst(ConstHandle2ConstSnElasticUpScatter self); + +// +++ Get, non-const +extern_c Handle2Documentation +SnElasticUpScatterDocumentationGet(ConstHandle2SnElasticUpScatter self); + +// +++ Set +extern_c void +SnElasticUpScatterDocumentationSet(ConstHandle2SnElasticUpScatter self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/SnElasticUpScatter/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/SnElasticUpScatter/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Styles.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Styles.cpp new file mode 100644 index 000000000..8fc483428 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Styles.cpp @@ -0,0 +1,2617 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/Styles.hpp" +#include "Styles.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto angularDistributionReconstructed = [](auto &obj) { return &obj.angularDistributionReconstructed; }; + static auto CoulombPlusNuclearElasticMuCutoff = [](auto &obj) { return &obj.CoulombPlusNuclearElasticMuCutoff; }; + static auto heated = [](auto &obj) { return &obj.heated; }; + static auto averageProductData = [](auto &obj) { return &obj.averageProductData; }; + static auto MonteCarlo_cdf = [](auto &obj) { return &obj.MonteCarlo_cdf; }; + static auto griddedCrossSection = [](auto &obj) { return &obj.griddedCrossSection; }; + static auto URR_probabilityTables = [](auto &obj) { return &obj.URR_probabilityTables; }; + static auto heatedMultiGroup = [](auto &obj) { return &obj.heatedMultiGroup; }; + static auto SnElasticUpScatter = [](auto &obj) { return &obj.SnElasticUpScatter; }; +} + +using CPPEvaluated = styles::Evaluated; +using CPPCrossSectionReconstructed = styles::CrossSectionReconstructed; +using CPPAngularDistributionReconstructed = styles::AngularDistributionReconstructed; +using CPPCoulombPlusNuclearElasticMuCutoff = styles::CoulombPlusNuclearElasticMuCutoff; +using CPPHeated = styles::Heated; +using CPPAverageProductData = styles::AverageProductData; +using CPPMonteCarlo_cdf = styles::MonteCarlo_cdf; +using CPPGriddedCrossSection = styles::GriddedCrossSection; +using CPPURR_probabilityTables = styles::URR_probabilityTables; +using CPPHeatedMultiGroup = styles::HeatedMultiGroup; +using CPPSnElasticUpScatter = styles::SnElasticUpScatter; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstStyles +StylesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Styles +StylesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstStyles +StylesCreateConst( + ConstHandle2Evaluated *const evaluated, const size_t evaluatedSize, + ConstHandle2CrossSectionReconstructed *const crossSectionReconstructed, const size_t crossSectionReconstructedSize, + ConstHandle2AngularDistributionReconstructed *const angularDistributionReconstructed, const size_t angularDistributionReconstructedSize, + ConstHandle2CoulombPlusNuclearElasticMuCutoff *const CoulombPlusNuclearElasticMuCutoff, const size_t CoulombPlusNuclearElasticMuCutoffSize, + ConstHandle2Heated *const heated, const size_t heatedSize, + ConstHandle2AverageProductData *const averageProductData, const size_t averageProductDataSize, + ConstHandle2MonteCarlo_cdf *const MonteCarlo_cdf, const size_t MonteCarlo_cdfSize, + ConstHandle2GriddedCrossSection *const griddedCrossSection, const size_t griddedCrossSectionSize, + ConstHandle2URR_probabilityTables *const URR_probabilityTables, const size_t URR_probabilityTablesSize, + ConstHandle2HeatedMultiGroup *const heatedMultiGroup, const size_t heatedMultiGroupSize, + ConstHandle2SnElasticUpScatter *const SnElasticUpScatter, const size_t SnElasticUpScatterSize +) { + ConstHandle2Styles handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{} + ); + for (size_t EvaluatedN = 0; EvaluatedN < evaluatedSize; ++EvaluatedN) + StylesEvaluatedAdd(handle, evaluated[EvaluatedN]); + for (size_t CrossSectionReconstructedN = 0; CrossSectionReconstructedN < crossSectionReconstructedSize; ++CrossSectionReconstructedN) + StylesCrossSectionReconstructedAdd(handle, crossSectionReconstructed[CrossSectionReconstructedN]); + for (size_t AngularDistributionReconstructedN = 0; AngularDistributionReconstructedN < angularDistributionReconstructedSize; ++AngularDistributionReconstructedN) + StylesAngularDistributionReconstructedAdd(handle, angularDistributionReconstructed[AngularDistributionReconstructedN]); + for (size_t CoulombPlusNuclearElasticMuCutoffN = 0; CoulombPlusNuclearElasticMuCutoffN < CoulombPlusNuclearElasticMuCutoffSize; ++CoulombPlusNuclearElasticMuCutoffN) + StylesCoulombPlusNuclearElasticMuCutoffAdd(handle, CoulombPlusNuclearElasticMuCutoff[CoulombPlusNuclearElasticMuCutoffN]); + for (size_t HeatedN = 0; HeatedN < heatedSize; ++HeatedN) + StylesHeatedAdd(handle, heated[HeatedN]); + for (size_t AverageProductDataN = 0; AverageProductDataN < averageProductDataSize; ++AverageProductDataN) + StylesAverageProductDataAdd(handle, averageProductData[AverageProductDataN]); + for (size_t MonteCarlo_cdfN = 0; MonteCarlo_cdfN < MonteCarlo_cdfSize; ++MonteCarlo_cdfN) + StylesMonteCarlo_cdfAdd(handle, MonteCarlo_cdf[MonteCarlo_cdfN]); + for (size_t GriddedCrossSectionN = 0; GriddedCrossSectionN < griddedCrossSectionSize; ++GriddedCrossSectionN) + StylesGriddedCrossSectionAdd(handle, griddedCrossSection[GriddedCrossSectionN]); + for (size_t URR_probabilityTablesN = 0; URR_probabilityTablesN < URR_probabilityTablesSize; ++URR_probabilityTablesN) + StylesURR_probabilityTablesAdd(handle, URR_probabilityTables[URR_probabilityTablesN]); + for (size_t HeatedMultiGroupN = 0; HeatedMultiGroupN < heatedMultiGroupSize; ++HeatedMultiGroupN) + StylesHeatedMultiGroupAdd(handle, heatedMultiGroup[HeatedMultiGroupN]); + for (size_t SnElasticUpScatterN = 0; SnElasticUpScatterN < SnElasticUpScatterSize; ++SnElasticUpScatterN) + StylesSnElasticUpScatterAdd(handle, SnElasticUpScatter[SnElasticUpScatterN]); + return handle; +} + +// Create, general +Handle2Styles +StylesCreate( + ConstHandle2Evaluated *const evaluated, const size_t evaluatedSize, + ConstHandle2CrossSectionReconstructed *const crossSectionReconstructed, const size_t crossSectionReconstructedSize, + ConstHandle2AngularDistributionReconstructed *const angularDistributionReconstructed, const size_t angularDistributionReconstructedSize, + ConstHandle2CoulombPlusNuclearElasticMuCutoff *const CoulombPlusNuclearElasticMuCutoff, const size_t CoulombPlusNuclearElasticMuCutoffSize, + ConstHandle2Heated *const heated, const size_t heatedSize, + ConstHandle2AverageProductData *const averageProductData, const size_t averageProductDataSize, + ConstHandle2MonteCarlo_cdf *const MonteCarlo_cdf, const size_t MonteCarlo_cdfSize, + ConstHandle2GriddedCrossSection *const griddedCrossSection, const size_t griddedCrossSectionSize, + ConstHandle2URR_probabilityTables *const URR_probabilityTables, const size_t URR_probabilityTablesSize, + ConstHandle2HeatedMultiGroup *const heatedMultiGroup, const size_t heatedMultiGroupSize, + ConstHandle2SnElasticUpScatter *const SnElasticUpScatter, const size_t SnElasticUpScatterSize +) { + ConstHandle2Styles handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{} + ); + for (size_t EvaluatedN = 0; EvaluatedN < evaluatedSize; ++EvaluatedN) + StylesEvaluatedAdd(handle, evaluated[EvaluatedN]); + for (size_t CrossSectionReconstructedN = 0; CrossSectionReconstructedN < crossSectionReconstructedSize; ++CrossSectionReconstructedN) + StylesCrossSectionReconstructedAdd(handle, crossSectionReconstructed[CrossSectionReconstructedN]); + for (size_t AngularDistributionReconstructedN = 0; AngularDistributionReconstructedN < angularDistributionReconstructedSize; ++AngularDistributionReconstructedN) + StylesAngularDistributionReconstructedAdd(handle, angularDistributionReconstructed[AngularDistributionReconstructedN]); + for (size_t CoulombPlusNuclearElasticMuCutoffN = 0; CoulombPlusNuclearElasticMuCutoffN < CoulombPlusNuclearElasticMuCutoffSize; ++CoulombPlusNuclearElasticMuCutoffN) + StylesCoulombPlusNuclearElasticMuCutoffAdd(handle, CoulombPlusNuclearElasticMuCutoff[CoulombPlusNuclearElasticMuCutoffN]); + for (size_t HeatedN = 0; HeatedN < heatedSize; ++HeatedN) + StylesHeatedAdd(handle, heated[HeatedN]); + for (size_t AverageProductDataN = 0; AverageProductDataN < averageProductDataSize; ++AverageProductDataN) + StylesAverageProductDataAdd(handle, averageProductData[AverageProductDataN]); + for (size_t MonteCarlo_cdfN = 0; MonteCarlo_cdfN < MonteCarlo_cdfSize; ++MonteCarlo_cdfN) + StylesMonteCarlo_cdfAdd(handle, MonteCarlo_cdf[MonteCarlo_cdfN]); + for (size_t GriddedCrossSectionN = 0; GriddedCrossSectionN < griddedCrossSectionSize; ++GriddedCrossSectionN) + StylesGriddedCrossSectionAdd(handle, griddedCrossSection[GriddedCrossSectionN]); + for (size_t URR_probabilityTablesN = 0; URR_probabilityTablesN < URR_probabilityTablesSize; ++URR_probabilityTablesN) + StylesURR_probabilityTablesAdd(handle, URR_probabilityTables[URR_probabilityTablesN]); + for (size_t HeatedMultiGroupN = 0; HeatedMultiGroupN < heatedMultiGroupSize; ++HeatedMultiGroupN) + StylesHeatedMultiGroupAdd(handle, heatedMultiGroup[HeatedMultiGroupN]); + for (size_t SnElasticUpScatterN = 0; SnElasticUpScatterN < SnElasticUpScatterSize; ++SnElasticUpScatterN) + StylesSnElasticUpScatterAdd(handle, SnElasticUpScatter[SnElasticUpScatterN]); + return handle; +} + +// Assign +// Use this to assign 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); +} + +// Clear +void +StylesEvaluatedClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"EvaluatedClear", self, extract::evaluated); +} + +// Size +size_t +StylesEvaluatedSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"EvaluatedSize", self, extract::evaluated); +} + +// Add +void +StylesEvaluatedAdd(ConstHandle2Styles self, ConstHandle2ConstEvaluated evaluated) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"EvaluatedAdd", self, extract::evaluated, evaluated); +} + +// Get, by index \in [0,size), const +Handle2ConstEvaluated +StylesEvaluatedGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"EvaluatedGetConst", self, extract::evaluated, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Evaluated +StylesEvaluatedGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"EvaluatedGet", self, extract::evaluated, index_); +} + +// Set, by index \in [0,size) +void +StylesEvaluatedSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstEvaluated evaluated +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"EvaluatedSet", self, extract::evaluated, index_, evaluated); +} + +// Has, by date +int +StylesEvaluatedHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedHasByDate", + self, extract::evaluated, meta::date, date); +} + +// Get, by date, const +Handle2ConstEvaluated +StylesEvaluatedGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByDateConst", + self, extract::evaluated, meta::date, date); +} + +// Get, by date, non-const +Handle2Evaluated +StylesEvaluatedGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByDate", + self, extract::evaluated, meta::date, date); +} + +// Set, by date +void +StylesEvaluatedSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstEvaluated evaluated +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedSetByDate", + self, extract::evaluated, meta::date, date, evaluated); +} + +// Has, by label +int +StylesEvaluatedHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedHasByLabel", + self, extract::evaluated, meta::label, label); +} + +// Get, by label, const +Handle2ConstEvaluated +StylesEvaluatedGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByLabelConst", + self, extract::evaluated, meta::label, label); +} + +// Get, by label, non-const +Handle2Evaluated +StylesEvaluatedGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByLabel", + self, extract::evaluated, meta::label, label); +} + +// Set, by label +void +StylesEvaluatedSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstEvaluated evaluated +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedSetByLabel", + self, extract::evaluated, meta::label, label, evaluated); +} + +// Has, by derivedFrom +int +StylesEvaluatedHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedHasByDerivedFrom", + self, extract::evaluated, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstEvaluated +StylesEvaluatedGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByDerivedFromConst", + self, extract::evaluated, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2Evaluated +StylesEvaluatedGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByDerivedFrom", + self, extract::evaluated, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesEvaluatedSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstEvaluated evaluated +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedSetByDerivedFrom", + self, extract::evaluated, meta::derivedFrom, derivedFrom, evaluated); +} + +// Has, by library +int +StylesEvaluatedHasByLibrary( + ConstHandle2ConstStyles self, + const XMLName library +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedHasByLibrary", + self, extract::evaluated, meta::library, library); +} + +// Get, by library, const +Handle2ConstEvaluated +StylesEvaluatedGetByLibraryConst( + ConstHandle2ConstStyles self, + const XMLName library +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByLibraryConst", + self, extract::evaluated, meta::library, library); +} + +// Get, by library, non-const +Handle2Evaluated +StylesEvaluatedGetByLibrary( + ConstHandle2Styles self, + const XMLName library +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByLibrary", + self, extract::evaluated, meta::library, library); +} + +// Set, by library +void +StylesEvaluatedSetByLibrary( + ConstHandle2Styles self, + const XMLName library, + ConstHandle2ConstEvaluated evaluated +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedSetByLibrary", + self, extract::evaluated, meta::library, library, evaluated); +} + +// Has, by version +int +StylesEvaluatedHasByVersion( + ConstHandle2ConstStyles self, + const XMLName version +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedHasByVersion", + self, extract::evaluated, meta::version, version); +} + +// Get, by version, const +Handle2ConstEvaluated +StylesEvaluatedGetByVersionConst( + ConstHandle2ConstStyles self, + const XMLName version +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByVersionConst", + self, extract::evaluated, meta::version, version); +} + +// Get, by version, non-const +Handle2Evaluated +StylesEvaluatedGetByVersion( + ConstHandle2Styles self, + const XMLName version +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedGetByVersion", + self, extract::evaluated, meta::version, version); +} + +// Set, by version +void +StylesEvaluatedSetByVersion( + ConstHandle2Styles self, + const XMLName version, + ConstHandle2ConstEvaluated evaluated +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"EvaluatedSetByVersion", + self, extract::evaluated, meta::version, version, evaluated); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSectionReconstructed +// ----------------------------------------------------------------------------- + +// Has +int +StylesCrossSectionReconstructedHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedHas", self, extract::crossSectionReconstructed); +} + +// Clear +void +StylesCrossSectionReconstructedClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedClear", self, extract::crossSectionReconstructed); +} + +// Size +size_t +StylesCrossSectionReconstructedSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedSize", self, extract::crossSectionReconstructed); +} + +// Add +void +StylesCrossSectionReconstructedAdd(ConstHandle2Styles self, ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedAdd", self, extract::crossSectionReconstructed, crossSectionReconstructed); +} + +// Get, by index \in [0,size), const +Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGetConst", self, extract::crossSectionReconstructed, index_); +} + +// Get, by index \in [0,size), non-const +Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGet", self, extract::crossSectionReconstructed, index_); +} + +// Set, by index \in [0,size) +void +StylesCrossSectionReconstructedSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedSet", self, extract::crossSectionReconstructed, index_, crossSectionReconstructed); +} + +// Has, by date +int +StylesCrossSectionReconstructedHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedHasByDate", + self, extract::crossSectionReconstructed, meta::date, date); +} + +// Get, by date, const +Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGetByDateConst", + self, extract::crossSectionReconstructed, meta::date, date); +} + +// Get, by date, non-const +Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGetByDate", + self, extract::crossSectionReconstructed, meta::date, date); +} + +// Set, by date +void +StylesCrossSectionReconstructedSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedSetByDate", + self, extract::crossSectionReconstructed, meta::date, date, crossSectionReconstructed); +} + +// Has, by label +int +StylesCrossSectionReconstructedHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedHasByLabel", + self, extract::crossSectionReconstructed, meta::label, label); +} + +// Get, by label, const +Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGetByLabelConst", + self, extract::crossSectionReconstructed, meta::label, label); +} + +// Get, by label, non-const +Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGetByLabel", + self, extract::crossSectionReconstructed, meta::label, label); +} + +// Set, by label +void +StylesCrossSectionReconstructedSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedSetByLabel", + self, extract::crossSectionReconstructed, meta::label, label, crossSectionReconstructed); +} + +// Has, by derivedFrom +int +StylesCrossSectionReconstructedHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedHasByDerivedFrom", + self, extract::crossSectionReconstructed, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGetByDerivedFromConst", + self, extract::crossSectionReconstructed, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGetByDerivedFrom", + self, extract::crossSectionReconstructed, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesCrossSectionReconstructedSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedSetByDerivedFrom", + self, extract::crossSectionReconstructed, meta::derivedFrom, derivedFrom, crossSectionReconstructed); +} + + +// ----------------------------------------------------------------------------- +// Child: angularDistributionReconstructed +// ----------------------------------------------------------------------------- + +// Has +int +StylesAngularDistributionReconstructedHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedHas", self, extract::angularDistributionReconstructed); +} + +// Clear +void +StylesAngularDistributionReconstructedClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedClear", self, extract::angularDistributionReconstructed); +} + +// Size +size_t +StylesAngularDistributionReconstructedSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedSize", self, extract::angularDistributionReconstructed); +} + +// Add +void +StylesAngularDistributionReconstructedAdd(ConstHandle2Styles self, ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedAdd", self, extract::angularDistributionReconstructed, angularDistributionReconstructed); +} + +// Get, by index \in [0,size), const +Handle2ConstAngularDistributionReconstructed +StylesAngularDistributionReconstructedGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedGetConst", self, extract::angularDistributionReconstructed, index_); +} + +// Get, by index \in [0,size), non-const +Handle2AngularDistributionReconstructed +StylesAngularDistributionReconstructedGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedGet", self, extract::angularDistributionReconstructed, index_); +} + +// Set, by index \in [0,size) +void +StylesAngularDistributionReconstructedSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedSet", self, extract::angularDistributionReconstructed, index_, angularDistributionReconstructed); +} + +// Has, by date +int +StylesAngularDistributionReconstructedHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedHasByDate", + self, extract::angularDistributionReconstructed, meta::date, date); +} + +// Get, by date, const +Handle2ConstAngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedGetByDateConst", + self, extract::angularDistributionReconstructed, meta::date, date); +} + +// Get, by date, non-const +Handle2AngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedGetByDate", + self, extract::angularDistributionReconstructed, meta::date, date); +} + +// Set, by date +void +StylesAngularDistributionReconstructedSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedSetByDate", + self, extract::angularDistributionReconstructed, meta::date, date, angularDistributionReconstructed); +} + +// Has, by label +int +StylesAngularDistributionReconstructedHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedHasByLabel", + self, extract::angularDistributionReconstructed, meta::label, label); +} + +// Get, by label, const +Handle2ConstAngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedGetByLabelConst", + self, extract::angularDistributionReconstructed, meta::label, label); +} + +// Get, by label, non-const +Handle2AngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedGetByLabel", + self, extract::angularDistributionReconstructed, meta::label, label); +} + +// Set, by label +void +StylesAngularDistributionReconstructedSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedSetByLabel", + self, extract::angularDistributionReconstructed, meta::label, label, angularDistributionReconstructed); +} + +// Has, by derivedFrom +int +StylesAngularDistributionReconstructedHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedHasByDerivedFrom", + self, extract::angularDistributionReconstructed, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstAngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedGetByDerivedFromConst", + self, extract::angularDistributionReconstructed, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2AngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedGetByDerivedFrom", + self, extract::angularDistributionReconstructed, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesAngularDistributionReconstructedSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AngularDistributionReconstructedSetByDerivedFrom", + self, extract::angularDistributionReconstructed, meta::derivedFrom, derivedFrom, angularDistributionReconstructed); +} + + +// ----------------------------------------------------------------------------- +// Child: CoulombPlusNuclearElasticMuCutoff +// ----------------------------------------------------------------------------- + +// Has +int +StylesCoulombPlusNuclearElasticMuCutoffHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffHas", self, extract::CoulombPlusNuclearElasticMuCutoff); +} + +// Clear +void +StylesCoulombPlusNuclearElasticMuCutoffClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffClear", self, extract::CoulombPlusNuclearElasticMuCutoff); +} + +// Size +size_t +StylesCoulombPlusNuclearElasticMuCutoffSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffSize", self, extract::CoulombPlusNuclearElasticMuCutoff); +} + +// Add +void +StylesCoulombPlusNuclearElasticMuCutoffAdd(ConstHandle2Styles self, ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffAdd", self, extract::CoulombPlusNuclearElasticMuCutoff, CoulombPlusNuclearElasticMuCutoff); +} + +// Get, by index \in [0,size), const +Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGetConst", self, extract::CoulombPlusNuclearElasticMuCutoff, index_); +} + +// Get, by index \in [0,size), non-const +Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGet", self, extract::CoulombPlusNuclearElasticMuCutoff, index_); +} + +// Set, by index \in [0,size) +void +StylesCoulombPlusNuclearElasticMuCutoffSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffSet", self, extract::CoulombPlusNuclearElasticMuCutoff, index_, CoulombPlusNuclearElasticMuCutoff); +} + +// Has, by date +int +StylesCoulombPlusNuclearElasticMuCutoffHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffHasByDate", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::date, date); +} + +// Get, by date, const +Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGetByDateConst", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::date, date); +} + +// Get, by date, non-const +Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGetByDate", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::date, date); +} + +// Set, by date +void +StylesCoulombPlusNuclearElasticMuCutoffSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffSetByDate", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::date, date, CoulombPlusNuclearElasticMuCutoff); +} + +// Has, by derivedFrom +int +StylesCoulombPlusNuclearElasticMuCutoffHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffHasByDerivedFrom", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGetByDerivedFromConst", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGetByDerivedFrom", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesCoulombPlusNuclearElasticMuCutoffSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffSetByDerivedFrom", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::derivedFrom, derivedFrom, CoulombPlusNuclearElasticMuCutoff); +} + +// Has, by label +int +StylesCoulombPlusNuclearElasticMuCutoffHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffHasByLabel", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::label, label); +} + +// Get, by label, const +Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGetByLabelConst", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::label, label); +} + +// Get, by label, non-const +Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGetByLabel", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::label, label); +} + +// Set, by label +void +StylesCoulombPlusNuclearElasticMuCutoffSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffSetByLabel", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::label, label, CoulombPlusNuclearElasticMuCutoff); +} + +// Has, by muCutoff +int +StylesCoulombPlusNuclearElasticMuCutoffHasByMuCutoff( + ConstHandle2ConstStyles self, + const Float64 muCutoff +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffHasByMuCutoff", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::muCutoff, muCutoff); +} + +// Get, by muCutoff, const +Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByMuCutoffConst( + ConstHandle2ConstStyles self, + const Float64 muCutoff +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGetByMuCutoffConst", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::muCutoff, muCutoff); +} + +// Get, by muCutoff, non-const +Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByMuCutoff( + ConstHandle2Styles self, + const Float64 muCutoff +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffGetByMuCutoff", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::muCutoff, muCutoff); +} + +// Set, by muCutoff +void +StylesCoulombPlusNuclearElasticMuCutoffSetByMuCutoff( + ConstHandle2Styles self, + const Float64 muCutoff, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticMuCutoffSetByMuCutoff", + self, extract::CoulombPlusNuclearElasticMuCutoff, meta::muCutoff, muCutoff, CoulombPlusNuclearElasticMuCutoff); +} + + +// ----------------------------------------------------------------------------- +// Child: heated +// ----------------------------------------------------------------------------- + +// Has +int +StylesHeatedHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HeatedHas", self, extract::heated); +} + +// Clear +void +StylesHeatedClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"HeatedClear", self, extract::heated); +} + +// Size +size_t +StylesHeatedSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"HeatedSize", self, extract::heated); +} + +// Add +void +StylesHeatedAdd(ConstHandle2Styles self, ConstHandle2ConstHeated heated) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"HeatedAdd", self, extract::heated, heated); +} + +// Get, by index \in [0,size), const +Handle2ConstHeated +StylesHeatedGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"HeatedGetConst", self, extract::heated, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Heated +StylesHeatedGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"HeatedGet", self, extract::heated, index_); +} + +// Set, by index \in [0,size) +void +StylesHeatedSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstHeated heated +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"HeatedSet", self, extract::heated, index_, heated); +} + +// Has, by date +int +StylesHeatedHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"HeatedHasByDate", + self, extract::heated, meta::date, date); +} + +// Get, by date, const +Handle2ConstHeated +StylesHeatedGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedGetByDateConst", + self, extract::heated, meta::date, date); +} + +// Get, by date, non-const +Handle2Heated +StylesHeatedGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedGetByDate", + self, extract::heated, meta::date, date); +} + +// Set, by date +void +StylesHeatedSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstHeated heated +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"HeatedSetByDate", + self, extract::heated, meta::date, date, heated); +} + +// Has, by derivedFrom +int +StylesHeatedHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"HeatedHasByDerivedFrom", + self, extract::heated, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstHeated +StylesHeatedGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedGetByDerivedFromConst", + self, extract::heated, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2Heated +StylesHeatedGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedGetByDerivedFrom", + self, extract::heated, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesHeatedSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstHeated heated +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"HeatedSetByDerivedFrom", + self, extract::heated, meta::derivedFrom, derivedFrom, heated); +} + +// Has, by label +int +StylesHeatedHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"HeatedHasByLabel", + self, extract::heated, meta::label, label); +} + +// Get, by label, const +Handle2ConstHeated +StylesHeatedGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedGetByLabelConst", + self, extract::heated, meta::label, label); +} + +// Get, by label, non-const +Handle2Heated +StylesHeatedGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedGetByLabel", + self, extract::heated, meta::label, label); +} + +// Set, by label +void +StylesHeatedSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstHeated heated +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"HeatedSetByLabel", + self, extract::heated, meta::label, label, heated); +} + + +// ----------------------------------------------------------------------------- +// Child: averageProductData +// ----------------------------------------------------------------------------- + +// Has +int +StylesAverageProductDataHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AverageProductDataHas", self, extract::averageProductData); +} + +// Clear +void +StylesAverageProductDataClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AverageProductDataClear", self, extract::averageProductData); +} + +// Size +size_t +StylesAverageProductDataSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AverageProductDataSize", self, extract::averageProductData); +} + +// Add +void +StylesAverageProductDataAdd(ConstHandle2Styles self, ConstHandle2ConstAverageProductData averageProductData) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AverageProductDataAdd", self, extract::averageProductData, averageProductData); +} + +// Get, by index \in [0,size), const +Handle2ConstAverageProductData +StylesAverageProductDataGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AverageProductDataGetConst", self, extract::averageProductData, index_); +} + +// Get, by index \in [0,size), non-const +Handle2AverageProductData +StylesAverageProductDataGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AverageProductDataGet", self, extract::averageProductData, index_); +} + +// Set, by index \in [0,size) +void +StylesAverageProductDataSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstAverageProductData averageProductData +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AverageProductDataSet", self, extract::averageProductData, index_, averageProductData); +} + +// Has, by date +int +StylesAverageProductDataHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataHasByDate", + self, extract::averageProductData, meta::date, date); +} + +// Get, by date, const +Handle2ConstAverageProductData +StylesAverageProductDataGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataGetByDateConst", + self, extract::averageProductData, meta::date, date); +} + +// Get, by date, non-const +Handle2AverageProductData +StylesAverageProductDataGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataGetByDate", + self, extract::averageProductData, meta::date, date); +} + +// Set, by date +void +StylesAverageProductDataSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstAverageProductData averageProductData +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataSetByDate", + self, extract::averageProductData, meta::date, date, averageProductData); +} + +// Has, by label +int +StylesAverageProductDataHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataHasByLabel", + self, extract::averageProductData, meta::label, label); +} + +// Get, by label, const +Handle2ConstAverageProductData +StylesAverageProductDataGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataGetByLabelConst", + self, extract::averageProductData, meta::label, label); +} + +// Get, by label, non-const +Handle2AverageProductData +StylesAverageProductDataGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataGetByLabel", + self, extract::averageProductData, meta::label, label); +} + +// Set, by label +void +StylesAverageProductDataSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstAverageProductData averageProductData +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataSetByLabel", + self, extract::averageProductData, meta::label, label, averageProductData); +} + +// Has, by derivedFrom +int +StylesAverageProductDataHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataHasByDerivedFrom", + self, extract::averageProductData, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstAverageProductData +StylesAverageProductDataGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataGetByDerivedFromConst", + self, extract::averageProductData, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2AverageProductData +StylesAverageProductDataGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataGetByDerivedFrom", + self, extract::averageProductData, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesAverageProductDataSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstAverageProductData averageProductData +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageProductDataSetByDerivedFrom", + self, extract::averageProductData, meta::derivedFrom, derivedFrom, averageProductData); +} + + +// ----------------------------------------------------------------------------- +// Child: MonteCarlo_cdf +// ----------------------------------------------------------------------------- + +// Has +int +StylesMonteCarlo_cdfHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfHas", self, extract::MonteCarlo_cdf); +} + +// Clear +void +StylesMonteCarlo_cdfClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfClear", self, extract::MonteCarlo_cdf); +} + +// Size +size_t +StylesMonteCarlo_cdfSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfSize", self, extract::MonteCarlo_cdf); +} + +// Add +void +StylesMonteCarlo_cdfAdd(ConstHandle2Styles self, ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfAdd", self, extract::MonteCarlo_cdf, MonteCarlo_cdf); +} + +// Get, by index \in [0,size), const +Handle2ConstMonteCarlo_cdf +StylesMonteCarlo_cdfGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfGetConst", self, extract::MonteCarlo_cdf, index_); +} + +// Get, by index \in [0,size), non-const +Handle2MonteCarlo_cdf +StylesMonteCarlo_cdfGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfGet", self, extract::MonteCarlo_cdf, index_); +} + +// Set, by index \in [0,size) +void +StylesMonteCarlo_cdfSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfSet", self, extract::MonteCarlo_cdf, index_, MonteCarlo_cdf); +} + +// Has, by date +int +StylesMonteCarlo_cdfHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfHasByDate", + self, extract::MonteCarlo_cdf, meta::date, date); +} + +// Get, by date, const +Handle2ConstMonteCarlo_cdf +StylesMonteCarlo_cdfGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfGetByDateConst", + self, extract::MonteCarlo_cdf, meta::date, date); +} + +// Get, by date, non-const +Handle2MonteCarlo_cdf +StylesMonteCarlo_cdfGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfGetByDate", + self, extract::MonteCarlo_cdf, meta::date, date); +} + +// Set, by date +void +StylesMonteCarlo_cdfSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfSetByDate", + self, extract::MonteCarlo_cdf, meta::date, date, MonteCarlo_cdf); +} + +// Has, by derivedFrom +int +StylesMonteCarlo_cdfHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfHasByDerivedFrom", + self, extract::MonteCarlo_cdf, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstMonteCarlo_cdf +StylesMonteCarlo_cdfGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfGetByDerivedFromConst", + self, extract::MonteCarlo_cdf, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2MonteCarlo_cdf +StylesMonteCarlo_cdfGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfGetByDerivedFrom", + self, extract::MonteCarlo_cdf, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesMonteCarlo_cdfSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfSetByDerivedFrom", + self, extract::MonteCarlo_cdf, meta::derivedFrom, derivedFrom, MonteCarlo_cdf); +} + +// Has, by label +int +StylesMonteCarlo_cdfHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfHasByLabel", + self, extract::MonteCarlo_cdf, meta::label, label); +} + +// Get, by label, const +Handle2ConstMonteCarlo_cdf +StylesMonteCarlo_cdfGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfGetByLabelConst", + self, extract::MonteCarlo_cdf, meta::label, label); +} + +// Get, by label, non-const +Handle2MonteCarlo_cdf +StylesMonteCarlo_cdfGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfGetByLabel", + self, extract::MonteCarlo_cdf, meta::label, label); +} + +// Set, by label +void +StylesMonteCarlo_cdfSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MonteCarlo_cdfSetByLabel", + self, extract::MonteCarlo_cdf, meta::label, label, MonteCarlo_cdf); +} + + +// ----------------------------------------------------------------------------- +// Child: griddedCrossSection +// ----------------------------------------------------------------------------- + +// Has +int +StylesGriddedCrossSectionHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GriddedCrossSectionHas", self, extract::griddedCrossSection); +} + +// Clear +void +StylesGriddedCrossSectionClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"GriddedCrossSectionClear", self, extract::griddedCrossSection); +} + +// Size +size_t +StylesGriddedCrossSectionSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"GriddedCrossSectionSize", self, extract::griddedCrossSection); +} + +// Add +void +StylesGriddedCrossSectionAdd(ConstHandle2Styles self, ConstHandle2ConstGriddedCrossSection griddedCrossSection) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"GriddedCrossSectionAdd", self, extract::griddedCrossSection, griddedCrossSection); +} + +// Get, by index \in [0,size), const +Handle2ConstGriddedCrossSection +StylesGriddedCrossSectionGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"GriddedCrossSectionGetConst", self, extract::griddedCrossSection, index_); +} + +// Get, by index \in [0,size), non-const +Handle2GriddedCrossSection +StylesGriddedCrossSectionGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"GriddedCrossSectionGet", self, extract::griddedCrossSection, index_); +} + +// Set, by index \in [0,size) +void +StylesGriddedCrossSectionSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstGriddedCrossSection griddedCrossSection +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"GriddedCrossSectionSet", self, extract::griddedCrossSection, index_, griddedCrossSection); +} + +// Has, by date +int +StylesGriddedCrossSectionHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionHasByDate", + self, extract::griddedCrossSection, meta::date, date); +} + +// Get, by date, const +Handle2ConstGriddedCrossSection +StylesGriddedCrossSectionGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionGetByDateConst", + self, extract::griddedCrossSection, meta::date, date); +} + +// Get, by date, non-const +Handle2GriddedCrossSection +StylesGriddedCrossSectionGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionGetByDate", + self, extract::griddedCrossSection, meta::date, date); +} + +// Set, by date +void +StylesGriddedCrossSectionSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstGriddedCrossSection griddedCrossSection +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionSetByDate", + self, extract::griddedCrossSection, meta::date, date, griddedCrossSection); +} + +// Has, by derivedFrom +int +StylesGriddedCrossSectionHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionHasByDerivedFrom", + self, extract::griddedCrossSection, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstGriddedCrossSection +StylesGriddedCrossSectionGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionGetByDerivedFromConst", + self, extract::griddedCrossSection, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2GriddedCrossSection +StylesGriddedCrossSectionGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionGetByDerivedFrom", + self, extract::griddedCrossSection, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesGriddedCrossSectionSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstGriddedCrossSection griddedCrossSection +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionSetByDerivedFrom", + self, extract::griddedCrossSection, meta::derivedFrom, derivedFrom, griddedCrossSection); +} + +// Has, by label +int +StylesGriddedCrossSectionHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionHasByLabel", + self, extract::griddedCrossSection, meta::label, label); +} + +// Get, by label, const +Handle2ConstGriddedCrossSection +StylesGriddedCrossSectionGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionGetByLabelConst", + self, extract::griddedCrossSection, meta::label, label); +} + +// Get, by label, non-const +Handle2GriddedCrossSection +StylesGriddedCrossSectionGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionGetByLabel", + self, extract::griddedCrossSection, meta::label, label); +} + +// Set, by label +void +StylesGriddedCrossSectionSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstGriddedCrossSection griddedCrossSection +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GriddedCrossSectionSetByLabel", + self, extract::griddedCrossSection, meta::label, label, griddedCrossSection); +} + + +// ----------------------------------------------------------------------------- +// Child: URR_probabilityTables +// ----------------------------------------------------------------------------- + +// Has +int +StylesURR_probabilityTablesHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"URR_probabilityTablesHas", self, extract::URR_probabilityTables); +} + +// Clear +void +StylesURR_probabilityTablesClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"URR_probabilityTablesClear", self, extract::URR_probabilityTables); +} + +// Size +size_t +StylesURR_probabilityTablesSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"URR_probabilityTablesSize", self, extract::URR_probabilityTables); +} + +// Add +void +StylesURR_probabilityTablesAdd(ConstHandle2Styles self, ConstHandle2ConstURR_probabilityTables URR_probabilityTables) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"URR_probabilityTablesAdd", self, extract::URR_probabilityTables, URR_probabilityTables); +} + +// Get, by index \in [0,size), const +Handle2ConstURR_probabilityTables +StylesURR_probabilityTablesGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"URR_probabilityTablesGetConst", self, extract::URR_probabilityTables, index_); +} + +// Get, by index \in [0,size), non-const +Handle2URR_probabilityTables +StylesURR_probabilityTablesGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"URR_probabilityTablesGet", self, extract::URR_probabilityTables, index_); +} + +// Set, by index \in [0,size) +void +StylesURR_probabilityTablesSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstURR_probabilityTables URR_probabilityTables +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"URR_probabilityTablesSet", self, extract::URR_probabilityTables, index_, URR_probabilityTables); +} + +// Has, by date +int +StylesURR_probabilityTablesHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesHasByDate", + self, extract::URR_probabilityTables, meta::date, date); +} + +// Get, by date, const +Handle2ConstURR_probabilityTables +StylesURR_probabilityTablesGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesGetByDateConst", + self, extract::URR_probabilityTables, meta::date, date); +} + +// Get, by date, non-const +Handle2URR_probabilityTables +StylesURR_probabilityTablesGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesGetByDate", + self, extract::URR_probabilityTables, meta::date, date); +} + +// Set, by date +void +StylesURR_probabilityTablesSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstURR_probabilityTables URR_probabilityTables +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesSetByDate", + self, extract::URR_probabilityTables, meta::date, date, URR_probabilityTables); +} + +// Has, by derivedFrom +int +StylesURR_probabilityTablesHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesHasByDerivedFrom", + self, extract::URR_probabilityTables, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstURR_probabilityTables +StylesURR_probabilityTablesGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesGetByDerivedFromConst", + self, extract::URR_probabilityTables, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2URR_probabilityTables +StylesURR_probabilityTablesGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesGetByDerivedFrom", + self, extract::URR_probabilityTables, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesURR_probabilityTablesSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstURR_probabilityTables URR_probabilityTables +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesSetByDerivedFrom", + self, extract::URR_probabilityTables, meta::derivedFrom, derivedFrom, URR_probabilityTables); +} + +// Has, by label +int +StylesURR_probabilityTablesHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesHasByLabel", + self, extract::URR_probabilityTables, meta::label, label); +} + +// Get, by label, const +Handle2ConstURR_probabilityTables +StylesURR_probabilityTablesGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesGetByLabelConst", + self, extract::URR_probabilityTables, meta::label, label); +} + +// Get, by label, non-const +Handle2URR_probabilityTables +StylesURR_probabilityTablesGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesGetByLabel", + self, extract::URR_probabilityTables, meta::label, label); +} + +// Set, by label +void +StylesURR_probabilityTablesSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstURR_probabilityTables URR_probabilityTables +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"URR_probabilityTablesSetByLabel", + self, extract::URR_probabilityTables, meta::label, label, URR_probabilityTables); +} + + +// ----------------------------------------------------------------------------- +// Child: heatedMultiGroup +// ----------------------------------------------------------------------------- + +// Has +int +StylesHeatedMultiGroupHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HeatedMultiGroupHas", self, extract::heatedMultiGroup); +} + +// Clear +void +StylesHeatedMultiGroupClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"HeatedMultiGroupClear", self, extract::heatedMultiGroup); +} + +// Size +size_t +StylesHeatedMultiGroupSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"HeatedMultiGroupSize", self, extract::heatedMultiGroup); +} + +// Add +void +StylesHeatedMultiGroupAdd(ConstHandle2Styles self, ConstHandle2ConstHeatedMultiGroup heatedMultiGroup) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"HeatedMultiGroupAdd", self, extract::heatedMultiGroup, heatedMultiGroup); +} + +// Get, by index \in [0,size), const +Handle2ConstHeatedMultiGroup +StylesHeatedMultiGroupGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"HeatedMultiGroupGetConst", self, extract::heatedMultiGroup, index_); +} + +// Get, by index \in [0,size), non-const +Handle2HeatedMultiGroup +StylesHeatedMultiGroupGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"HeatedMultiGroupGet", self, extract::heatedMultiGroup, index_); +} + +// Set, by index \in [0,size) +void +StylesHeatedMultiGroupSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstHeatedMultiGroup heatedMultiGroup +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"HeatedMultiGroupSet", self, extract::heatedMultiGroup, index_, heatedMultiGroup); +} + +// Has, by date +int +StylesHeatedMultiGroupHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupHasByDate", + self, extract::heatedMultiGroup, meta::date, date); +} + +// Get, by date, const +Handle2ConstHeatedMultiGroup +StylesHeatedMultiGroupGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupGetByDateConst", + self, extract::heatedMultiGroup, meta::date, date); +} + +// Get, by date, non-const +Handle2HeatedMultiGroup +StylesHeatedMultiGroupGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupGetByDate", + self, extract::heatedMultiGroup, meta::date, date); +} + +// Set, by date +void +StylesHeatedMultiGroupSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstHeatedMultiGroup heatedMultiGroup +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupSetByDate", + self, extract::heatedMultiGroup, meta::date, date, heatedMultiGroup); +} + +// Has, by derivedFrom +int +StylesHeatedMultiGroupHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupHasByDerivedFrom", + self, extract::heatedMultiGroup, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstHeatedMultiGroup +StylesHeatedMultiGroupGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupGetByDerivedFromConst", + self, extract::heatedMultiGroup, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2HeatedMultiGroup +StylesHeatedMultiGroupGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupGetByDerivedFrom", + self, extract::heatedMultiGroup, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesHeatedMultiGroupSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstHeatedMultiGroup heatedMultiGroup +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupSetByDerivedFrom", + self, extract::heatedMultiGroup, meta::derivedFrom, derivedFrom, heatedMultiGroup); +} + +// Has, by label +int +StylesHeatedMultiGroupHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupHasByLabel", + self, extract::heatedMultiGroup, meta::label, label); +} + +// Get, by label, const +Handle2ConstHeatedMultiGroup +StylesHeatedMultiGroupGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupGetByLabelConst", + self, extract::heatedMultiGroup, meta::label, label); +} + +// Get, by label, non-const +Handle2HeatedMultiGroup +StylesHeatedMultiGroupGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupGetByLabel", + self, extract::heatedMultiGroup, meta::label, label); +} + +// Set, by label +void +StylesHeatedMultiGroupSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstHeatedMultiGroup heatedMultiGroup +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"HeatedMultiGroupSetByLabel", + self, extract::heatedMultiGroup, meta::label, label, heatedMultiGroup); +} + + +// ----------------------------------------------------------------------------- +// Child: SnElasticUpScatter +// ----------------------------------------------------------------------------- + +// Has +int +StylesSnElasticUpScatterHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SnElasticUpScatterHas", self, extract::SnElasticUpScatter); +} + +// Clear +void +StylesSnElasticUpScatterClear(ConstHandle2Styles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"SnElasticUpScatterClear", self, extract::SnElasticUpScatter); +} + +// Size +size_t +StylesSnElasticUpScatterSize(ConstHandle2ConstStyles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"SnElasticUpScatterSize", self, extract::SnElasticUpScatter); +} + +// Add +void +StylesSnElasticUpScatterAdd(ConstHandle2Styles self, ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"SnElasticUpScatterAdd", self, extract::SnElasticUpScatter, SnElasticUpScatter); +} + +// Get, by index \in [0,size), const +Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetConst(ConstHandle2ConstStyles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGetConst", self, extract::SnElasticUpScatter, index_); +} + +// Get, by index \in [0,size), non-const +Handle2SnElasticUpScatter +StylesSnElasticUpScatterGet(ConstHandle2Styles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGet", self, extract::SnElasticUpScatter, index_); +} + +// Set, by index \in [0,size) +void +StylesSnElasticUpScatterSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"SnElasticUpScatterSet", self, extract::SnElasticUpScatter, index_, SnElasticUpScatter); +} + +// Has, by date +int +StylesSnElasticUpScatterHasByDate( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterHasByDate", + self, extract::SnElasticUpScatter, meta::date, date); +} + +// Get, by date, const +Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGetByDateConst", + self, extract::SnElasticUpScatter, meta::date, date); +} + +// Get, by date, non-const +Handle2SnElasticUpScatter +StylesSnElasticUpScatterGetByDate( + ConstHandle2Styles self, + const char *const date +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGetByDate", + self, extract::SnElasticUpScatter, meta::date, date); +} + +// Set, by date +void +StylesSnElasticUpScatterSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterSetByDate", + self, extract::SnElasticUpScatter, meta::date, date, SnElasticUpScatter); +} + +// Has, by derivedFrom +int +StylesSnElasticUpScatterHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterHasByDerivedFrom", + self, extract::SnElasticUpScatter, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, const +Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGetByDerivedFromConst", + self, extract::SnElasticUpScatter, meta::derivedFrom, derivedFrom); +} + +// Get, by derivedFrom, non-const +Handle2SnElasticUpScatter +StylesSnElasticUpScatterGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGetByDerivedFrom", + self, extract::SnElasticUpScatter, meta::derivedFrom, derivedFrom); +} + +// Set, by derivedFrom +void +StylesSnElasticUpScatterSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterSetByDerivedFrom", + self, extract::SnElasticUpScatter, meta::derivedFrom, derivedFrom, SnElasticUpScatter); +} + +// Has, by label +int +StylesSnElasticUpScatterHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterHasByLabel", + self, extract::SnElasticUpScatter, meta::label, label); +} + +// Get, by label, const +Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGetByLabelConst", + self, extract::SnElasticUpScatter, meta::label, label); +} + +// Get, by label, non-const +Handle2SnElasticUpScatter +StylesSnElasticUpScatterGetByLabel( + ConstHandle2Styles self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGetByLabel", + self, extract::SnElasticUpScatter, meta::label, label); +} + +// Set, by label +void +StylesSnElasticUpScatterSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterSetByLabel", + self, extract::SnElasticUpScatter, meta::label, label, SnElasticUpScatter); +} + +// Has, by upperCalculatedGroup +int +StylesSnElasticUpScatterHasByUpperCalculatedGroup( + ConstHandle2ConstStyles self, + const Integer32 upperCalculatedGroup +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterHasByUpperCalculatedGroup", + self, extract::SnElasticUpScatter, meta::upperCalculatedGroup, upperCalculatedGroup); +} + +// Get, by upperCalculatedGroup, const +Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetByUpperCalculatedGroupConst( + ConstHandle2ConstStyles self, + const Integer32 upperCalculatedGroup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGetByUpperCalculatedGroupConst", + self, extract::SnElasticUpScatter, meta::upperCalculatedGroup, upperCalculatedGroup); +} + +// Get, by upperCalculatedGroup, non-const +Handle2SnElasticUpScatter +StylesSnElasticUpScatterGetByUpperCalculatedGroup( + ConstHandle2Styles self, + const Integer32 upperCalculatedGroup +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterGetByUpperCalculatedGroup", + self, extract::SnElasticUpScatter, meta::upperCalculatedGroup, upperCalculatedGroup); +} + +// Set, by upperCalculatedGroup +void +StylesSnElasticUpScatterSetByUpperCalculatedGroup( + ConstHandle2Styles self, + const Integer32 upperCalculatedGroup, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SnElasticUpScatterSetByUpperCalculatedGroup", + self, extract::SnElasticUpScatter, meta::upperCalculatedGroup, upperCalculatedGroup, SnElasticUpScatter); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Styles/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Styles.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Styles.h new file mode 100644 index 000000000..df4a5b242 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Styles.h @@ -0,0 +1,1650 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_STYLES_STYLES +#define C_INTERFACE_TEST_V2_0_STYLES_STYLES + +#include "GNDStk.h" +#include "v2.0/styles/Evaluated.h" +#include "v2.0/styles/CrossSectionReconstructed.h" +#include "v2.0/styles/AngularDistributionReconstructed.h" +#include "v2.0/styles/CoulombPlusNuclearElasticMuCutoff.h" +#include "v2.0/styles/Heated.h" +#include "v2.0/styles/AverageProductData.h" +#include "v2.0/styles/MonteCarlo_cdf.h" +#include "v2.0/styles/GriddedCrossSection.h" +#include "v2.0/styles/URR_probabilityTables.h" +#include "v2.0/styles/HeatedMultiGroup.h" +#include "v2.0/styles/SnElasticUpScatter.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 +extern_c Handle2Styles +StylesDefault(); + +// --- Create, general, const +extern_c Handle2ConstStyles +StylesCreateConst( + ConstHandle2Evaluated *const evaluated, const size_t evaluatedSize, + ConstHandle2CrossSectionReconstructed *const crossSectionReconstructed, const size_t crossSectionReconstructedSize, + ConstHandle2AngularDistributionReconstructed *const angularDistributionReconstructed, const size_t angularDistributionReconstructedSize, + ConstHandle2CoulombPlusNuclearElasticMuCutoff *const CoulombPlusNuclearElasticMuCutoff, const size_t CoulombPlusNuclearElasticMuCutoffSize, + ConstHandle2Heated *const heated, const size_t heatedSize, + ConstHandle2AverageProductData *const averageProductData, const size_t averageProductDataSize, + ConstHandle2MonteCarlo_cdf *const MonteCarlo_cdf, const size_t MonteCarlo_cdfSize, + ConstHandle2GriddedCrossSection *const griddedCrossSection, const size_t griddedCrossSectionSize, + ConstHandle2URR_probabilityTables *const URR_probabilityTables, const size_t URR_probabilityTablesSize, + ConstHandle2HeatedMultiGroup *const heatedMultiGroup, const size_t heatedMultiGroupSize, + ConstHandle2SnElasticUpScatter *const SnElasticUpScatter, const size_t SnElasticUpScatterSize +); + +// +++ Create, general +extern_c Handle2Styles +StylesCreate( + ConstHandle2Evaluated *const evaluated, const size_t evaluatedSize, + ConstHandle2CrossSectionReconstructed *const crossSectionReconstructed, const size_t crossSectionReconstructedSize, + ConstHandle2AngularDistributionReconstructed *const angularDistributionReconstructed, const size_t angularDistributionReconstructedSize, + ConstHandle2CoulombPlusNuclearElasticMuCutoff *const CoulombPlusNuclearElasticMuCutoff, const size_t CoulombPlusNuclearElasticMuCutoffSize, + ConstHandle2Heated *const heated, const size_t heatedSize, + ConstHandle2AverageProductData *const averageProductData, const size_t averageProductDataSize, + ConstHandle2MonteCarlo_cdf *const MonteCarlo_cdf, const size_t MonteCarlo_cdfSize, + ConstHandle2GriddedCrossSection *const griddedCrossSection, const size_t griddedCrossSectionSize, + ConstHandle2URR_probabilityTables *const URR_probabilityTables, const size_t URR_probabilityTablesSize, + ConstHandle2HeatedMultiGroup *const heatedMultiGroup, const size_t heatedMultiGroupSize, + ConstHandle2SnElasticUpScatter *const SnElasticUpScatter, const size_t SnElasticUpScatterSize +); + +// +++ Assign +// +++ Use this to assign one handled 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); + +// +++ Clear +extern_c void +StylesEvaluatedClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesEvaluatedSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesEvaluatedAdd(ConstHandle2Styles self, ConstHandle2ConstEvaluated evaluated); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstEvaluated +StylesEvaluatedGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Evaluated +StylesEvaluatedGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesEvaluatedSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstEvaluated evaluated +); + +// +++ Has, by date +extern_c int +StylesEvaluatedHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstEvaluated +StylesEvaluatedGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2Evaluated +StylesEvaluatedGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesEvaluatedSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstEvaluated evaluated +); + +// +++ Has, by label +extern_c int +StylesEvaluatedHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstEvaluated +StylesEvaluatedGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Evaluated +StylesEvaluatedGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesEvaluatedSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstEvaluated evaluated +); + +// +++ Has, by derivedFrom +extern_c int +StylesEvaluatedHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstEvaluated +StylesEvaluatedGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2Evaluated +StylesEvaluatedGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesEvaluatedSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstEvaluated evaluated +); + +// +++ Has, by library +extern_c int +StylesEvaluatedHasByLibrary( + ConstHandle2ConstStyles self, + const XMLName library +); + +// --- Get, by library, const +extern_c Handle2ConstEvaluated +StylesEvaluatedGetByLibraryConst( + ConstHandle2ConstStyles self, + const XMLName library +); + +// +++ Get, by library, non-const +extern_c Handle2Evaluated +StylesEvaluatedGetByLibrary( + ConstHandle2Styles self, + const XMLName library +); + +// +++ Set, by library +extern_c void +StylesEvaluatedSetByLibrary( + ConstHandle2Styles self, + const XMLName library, + ConstHandle2ConstEvaluated evaluated +); + +// +++ Has, by version +extern_c int +StylesEvaluatedHasByVersion( + ConstHandle2ConstStyles self, + const XMLName version +); + +// --- Get, by version, const +extern_c Handle2ConstEvaluated +StylesEvaluatedGetByVersionConst( + ConstHandle2ConstStyles self, + const XMLName version +); + +// +++ Get, by version, non-const +extern_c Handle2Evaluated +StylesEvaluatedGetByVersion( + ConstHandle2Styles self, + const XMLName version +); + +// +++ Set, by version +extern_c void +StylesEvaluatedSetByVersion( + ConstHandle2Styles self, + const XMLName version, + ConstHandle2ConstEvaluated evaluated +); + + +// ----------------------------------------------------------------------------- +// Child: crossSectionReconstructed +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesCrossSectionReconstructedHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesCrossSectionReconstructedClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesCrossSectionReconstructedSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesCrossSectionReconstructedAdd(ConstHandle2Styles self, ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesCrossSectionReconstructedSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +); + +// +++ Has, by date +extern_c int +StylesCrossSectionReconstructedHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesCrossSectionReconstructedSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +); + +// +++ Has, by label +extern_c int +StylesCrossSectionReconstructedHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesCrossSectionReconstructedSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +); + +// +++ Has, by derivedFrom +extern_c int +StylesCrossSectionReconstructedHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesCrossSectionReconstructedSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +); + + +// ----------------------------------------------------------------------------- +// Child: angularDistributionReconstructed +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesAngularDistributionReconstructedHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesAngularDistributionReconstructedClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesAngularDistributionReconstructedSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesAngularDistributionReconstructedAdd(ConstHandle2Styles self, ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAngularDistributionReconstructed +StylesAngularDistributionReconstructedGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2AngularDistributionReconstructed +StylesAngularDistributionReconstructedGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesAngularDistributionReconstructedSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed +); + +// +++ Has, by date +extern_c int +StylesAngularDistributionReconstructedHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstAngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2AngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesAngularDistributionReconstructedSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed +); + +// +++ Has, by label +extern_c int +StylesAngularDistributionReconstructedHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstAngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2AngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesAngularDistributionReconstructedSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed +); + +// +++ Has, by derivedFrom +extern_c int +StylesAngularDistributionReconstructedHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstAngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2AngularDistributionReconstructed +StylesAngularDistributionReconstructedGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesAngularDistributionReconstructedSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstAngularDistributionReconstructed angularDistributionReconstructed +); + + +// ----------------------------------------------------------------------------- +// Child: CoulombPlusNuclearElasticMuCutoff +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesCoulombPlusNuclearElasticMuCutoffHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesCoulombPlusNuclearElasticMuCutoffClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesCoulombPlusNuclearElasticMuCutoffSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesCoulombPlusNuclearElasticMuCutoffAdd(ConstHandle2Styles self, ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesCoulombPlusNuclearElasticMuCutoffSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +); + +// +++ Has, by date +extern_c int +StylesCoulombPlusNuclearElasticMuCutoffHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesCoulombPlusNuclearElasticMuCutoffSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +); + +// +++ Has, by derivedFrom +extern_c int +StylesCoulombPlusNuclearElasticMuCutoffHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesCoulombPlusNuclearElasticMuCutoffSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +); + +// +++ Has, by label +extern_c int +StylesCoulombPlusNuclearElasticMuCutoffHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesCoulombPlusNuclearElasticMuCutoffSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +); + +// +++ Has, by muCutoff +extern_c int +StylesCoulombPlusNuclearElasticMuCutoffHasByMuCutoff( + ConstHandle2ConstStyles self, + const Float64 muCutoff +); + +// --- Get, by muCutoff, const +extern_c Handle2ConstCoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByMuCutoffConst( + ConstHandle2ConstStyles self, + const Float64 muCutoff +); + +// +++ Get, by muCutoff, non-const +extern_c Handle2CoulombPlusNuclearElasticMuCutoff +StylesCoulombPlusNuclearElasticMuCutoffGetByMuCutoff( + ConstHandle2Styles self, + const Float64 muCutoff +); + +// +++ Set, by muCutoff +extern_c void +StylesCoulombPlusNuclearElasticMuCutoffSetByMuCutoff( + ConstHandle2Styles self, + const Float64 muCutoff, + ConstHandle2ConstCoulombPlusNuclearElasticMuCutoff CoulombPlusNuclearElasticMuCutoff +); + + +// ----------------------------------------------------------------------------- +// Child: heated +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesHeatedHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesHeatedClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesHeatedSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesHeatedAdd(ConstHandle2Styles self, ConstHandle2ConstHeated heated); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstHeated +StylesHeatedGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Heated +StylesHeatedGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesHeatedSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstHeated heated +); + +// +++ Has, by date +extern_c int +StylesHeatedHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstHeated +StylesHeatedGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2Heated +StylesHeatedGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesHeatedSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstHeated heated +); + +// +++ Has, by derivedFrom +extern_c int +StylesHeatedHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstHeated +StylesHeatedGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2Heated +StylesHeatedGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesHeatedSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstHeated heated +); + +// +++ Has, by label +extern_c int +StylesHeatedHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstHeated +StylesHeatedGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Heated +StylesHeatedGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesHeatedSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstHeated heated +); + + +// ----------------------------------------------------------------------------- +// Child: averageProductData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesAverageProductDataHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesAverageProductDataClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesAverageProductDataSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesAverageProductDataAdd(ConstHandle2Styles self, ConstHandle2ConstAverageProductData averageProductData); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAverageProductData +StylesAverageProductDataGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2AverageProductData +StylesAverageProductDataGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesAverageProductDataSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstAverageProductData averageProductData +); + +// +++ Has, by date +extern_c int +StylesAverageProductDataHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstAverageProductData +StylesAverageProductDataGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2AverageProductData +StylesAverageProductDataGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesAverageProductDataSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstAverageProductData averageProductData +); + +// +++ Has, by label +extern_c int +StylesAverageProductDataHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstAverageProductData +StylesAverageProductDataGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2AverageProductData +StylesAverageProductDataGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesAverageProductDataSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstAverageProductData averageProductData +); + +// +++ Has, by derivedFrom +extern_c int +StylesAverageProductDataHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstAverageProductData +StylesAverageProductDataGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2AverageProductData +StylesAverageProductDataGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesAverageProductDataSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstAverageProductData averageProductData +); + + +// ----------------------------------------------------------------------------- +// Child: MonteCarlo_cdf +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesMonteCarlo_cdfHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesMonteCarlo_cdfClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesMonteCarlo_cdfSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesMonteCarlo_cdfAdd(ConstHandle2Styles self, ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstMonteCarlo_cdf +StylesMonteCarlo_cdfGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2MonteCarlo_cdf +StylesMonteCarlo_cdfGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesMonteCarlo_cdfSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf +); + +// +++ Has, by date +extern_c int +StylesMonteCarlo_cdfHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstMonteCarlo_cdf +StylesMonteCarlo_cdfGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2MonteCarlo_cdf +StylesMonteCarlo_cdfGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesMonteCarlo_cdfSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf +); + +// +++ Has, by derivedFrom +extern_c int +StylesMonteCarlo_cdfHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstMonteCarlo_cdf +StylesMonteCarlo_cdfGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2MonteCarlo_cdf +StylesMonteCarlo_cdfGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesMonteCarlo_cdfSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf +); + +// +++ Has, by label +extern_c int +StylesMonteCarlo_cdfHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstMonteCarlo_cdf +StylesMonteCarlo_cdfGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2MonteCarlo_cdf +StylesMonteCarlo_cdfGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesMonteCarlo_cdfSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstMonteCarlo_cdf MonteCarlo_cdf +); + + +// ----------------------------------------------------------------------------- +// Child: griddedCrossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesGriddedCrossSectionHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesGriddedCrossSectionClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesGriddedCrossSectionSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesGriddedCrossSectionAdd(ConstHandle2Styles self, ConstHandle2ConstGriddedCrossSection griddedCrossSection); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstGriddedCrossSection +StylesGriddedCrossSectionGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2GriddedCrossSection +StylesGriddedCrossSectionGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesGriddedCrossSectionSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstGriddedCrossSection griddedCrossSection +); + +// +++ Has, by date +extern_c int +StylesGriddedCrossSectionHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstGriddedCrossSection +StylesGriddedCrossSectionGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2GriddedCrossSection +StylesGriddedCrossSectionGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesGriddedCrossSectionSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstGriddedCrossSection griddedCrossSection +); + +// +++ Has, by derivedFrom +extern_c int +StylesGriddedCrossSectionHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstGriddedCrossSection +StylesGriddedCrossSectionGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2GriddedCrossSection +StylesGriddedCrossSectionGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesGriddedCrossSectionSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstGriddedCrossSection griddedCrossSection +); + +// +++ Has, by label +extern_c int +StylesGriddedCrossSectionHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstGriddedCrossSection +StylesGriddedCrossSectionGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2GriddedCrossSection +StylesGriddedCrossSectionGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesGriddedCrossSectionSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstGriddedCrossSection griddedCrossSection +); + + +// ----------------------------------------------------------------------------- +// Child: URR_probabilityTables +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesURR_probabilityTablesHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesURR_probabilityTablesClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesURR_probabilityTablesSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesURR_probabilityTablesAdd(ConstHandle2Styles self, ConstHandle2ConstURR_probabilityTables URR_probabilityTables); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstURR_probabilityTables +StylesURR_probabilityTablesGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2URR_probabilityTables +StylesURR_probabilityTablesGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesURR_probabilityTablesSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstURR_probabilityTables URR_probabilityTables +); + +// +++ Has, by date +extern_c int +StylesURR_probabilityTablesHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstURR_probabilityTables +StylesURR_probabilityTablesGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2URR_probabilityTables +StylesURR_probabilityTablesGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesURR_probabilityTablesSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstURR_probabilityTables URR_probabilityTables +); + +// +++ Has, by derivedFrom +extern_c int +StylesURR_probabilityTablesHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstURR_probabilityTables +StylesURR_probabilityTablesGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2URR_probabilityTables +StylesURR_probabilityTablesGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesURR_probabilityTablesSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstURR_probabilityTables URR_probabilityTables +); + +// +++ Has, by label +extern_c int +StylesURR_probabilityTablesHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstURR_probabilityTables +StylesURR_probabilityTablesGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2URR_probabilityTables +StylesURR_probabilityTablesGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesURR_probabilityTablesSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstURR_probabilityTables URR_probabilityTables +); + + +// ----------------------------------------------------------------------------- +// Child: heatedMultiGroup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesHeatedMultiGroupHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesHeatedMultiGroupClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesHeatedMultiGroupSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesHeatedMultiGroupAdd(ConstHandle2Styles self, ConstHandle2ConstHeatedMultiGroup heatedMultiGroup); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstHeatedMultiGroup +StylesHeatedMultiGroupGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2HeatedMultiGroup +StylesHeatedMultiGroupGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesHeatedMultiGroupSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstHeatedMultiGroup heatedMultiGroup +); + +// +++ Has, by date +extern_c int +StylesHeatedMultiGroupHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstHeatedMultiGroup +StylesHeatedMultiGroupGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2HeatedMultiGroup +StylesHeatedMultiGroupGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesHeatedMultiGroupSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstHeatedMultiGroup heatedMultiGroup +); + +// +++ Has, by derivedFrom +extern_c int +StylesHeatedMultiGroupHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstHeatedMultiGroup +StylesHeatedMultiGroupGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2HeatedMultiGroup +StylesHeatedMultiGroupGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesHeatedMultiGroupSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstHeatedMultiGroup heatedMultiGroup +); + +// +++ Has, by label +extern_c int +StylesHeatedMultiGroupHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstHeatedMultiGroup +StylesHeatedMultiGroupGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2HeatedMultiGroup +StylesHeatedMultiGroupGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesHeatedMultiGroupSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstHeatedMultiGroup heatedMultiGroup +); + + +// ----------------------------------------------------------------------------- +// Child: SnElasticUpScatter +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesSnElasticUpScatterHas(ConstHandle2ConstStyles self); + +// +++ Clear +extern_c void +StylesSnElasticUpScatterClear(ConstHandle2Styles self); + +// +++ Size +extern_c size_t +StylesSnElasticUpScatterSize(ConstHandle2ConstStyles self); + +// +++ Add +extern_c void +StylesSnElasticUpScatterAdd(ConstHandle2Styles self, ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetConst(ConstHandle2ConstStyles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2SnElasticUpScatter +StylesSnElasticUpScatterGet(ConstHandle2Styles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +StylesSnElasticUpScatterSet( + ConstHandle2Styles self, + const size_t index_, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +); + +// +++ Has, by date +extern_c int +StylesSnElasticUpScatterHasByDate( + ConstHandle2ConstStyles self, + const char *const date +); + +// --- Get, by date, const +extern_c Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetByDateConst( + ConstHandle2ConstStyles self, + const char *const date +); + +// +++ Get, by date, non-const +extern_c Handle2SnElasticUpScatter +StylesSnElasticUpScatterGetByDate( + ConstHandle2Styles self, + const char *const date +); + +// +++ Set, by date +extern_c void +StylesSnElasticUpScatterSetByDate( + ConstHandle2Styles self, + const char *const date, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +); + +// +++ Has, by derivedFrom +extern_c int +StylesSnElasticUpScatterHasByDerivedFrom( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// --- Get, by derivedFrom, const +extern_c Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetByDerivedFromConst( + ConstHandle2ConstStyles self, + const XMLName derivedFrom +); + +// +++ Get, by derivedFrom, non-const +extern_c Handle2SnElasticUpScatter +StylesSnElasticUpScatterGetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom +); + +// +++ Set, by derivedFrom +extern_c void +StylesSnElasticUpScatterSetByDerivedFrom( + ConstHandle2Styles self, + const XMLName derivedFrom, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +); + +// +++ Has, by label +extern_c int +StylesSnElasticUpScatterHasByLabel( + ConstHandle2ConstStyles self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetByLabelConst( + ConstHandle2ConstStyles self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2SnElasticUpScatter +StylesSnElasticUpScatterGetByLabel( + ConstHandle2Styles self, + const XMLName label +); + +// +++ Set, by label +extern_c void +StylesSnElasticUpScatterSetByLabel( + ConstHandle2Styles self, + const XMLName label, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +); + +// +++ Has, by upperCalculatedGroup +extern_c int +StylesSnElasticUpScatterHasByUpperCalculatedGroup( + ConstHandle2ConstStyles self, + const Integer32 upperCalculatedGroup +); + +// --- Get, by upperCalculatedGroup, const +extern_c Handle2ConstSnElasticUpScatter +StylesSnElasticUpScatterGetByUpperCalculatedGroupConst( + ConstHandle2ConstStyles self, + const Integer32 upperCalculatedGroup +); + +// +++ Get, by upperCalculatedGroup, non-const +extern_c Handle2SnElasticUpScatter +StylesSnElasticUpScatterGetByUpperCalculatedGroup( + ConstHandle2Styles self, + const Integer32 upperCalculatedGroup +); + +// +++ Set, by upperCalculatedGroup +extern_c void +StylesSnElasticUpScatterSetByUpperCalculatedGroup( + ConstHandle2Styles self, + const Integer32 upperCalculatedGroup, + ConstHandle2ConstSnElasticUpScatter SnElasticUpScatter +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Styles/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Styles/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Styles/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Styles/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Styles/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature.cpp new file mode 100644 index 000000000..de914a885 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/Temperature.hpp" +#include "Temperature.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = TemperatureClass; +using CPP = multigroup::Temperature; + +static const std::string CLASSNAME = "Temperature"; + +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 documentation = [](auto &obj) { return &obj.documentation; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPDocumentation = documentation::Documentation; +using CPPUncertainty = pops::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTemperature +TemperatureDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Temperature +TemperatureDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTemperature +TemperatureCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Temperature handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit, + detail::tocpp(documentation), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2Temperature +TemperatureCreate( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Temperature handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + unit, + detail::tocpp(documentation), + 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 +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: label +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureLabelHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +TemperatureLabelGet(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +TemperatureLabelSet(ConstHandle2Temperature self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureValueHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +TemperatureValueGet(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +TemperatureValueSet(ConstHandle2Temperature self, const Float64 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 +XMLName +TemperatureUnitGet(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +TemperatureUnitSet(ConstHandle2Temperature self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureDocumentationHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +TemperatureDocumentationGetConst(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +TemperatureDocumentationGet(ConstHandle2Temperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +TemperatureDocumentationSet(ConstHandle2Temperature self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureUncertaintyHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +TemperatureUncertaintyGetConst(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +TemperatureUncertaintyGet(ConstHandle2Temperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +TemperatureUncertaintySet(ConstHandle2Temperature self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Temperature/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature.h new file mode 100644 index 000000000..5aa21c0da --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature.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. +// +// 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_TEST_V2_0_STYLES_TEMPERATURE +#define C_INTERFACE_TEST_V2_0_STYLES_TEMPERATURE + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" +#include "v2.0/pops/Uncertainty.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 +extern_c Handle2Temperature +TemperatureDefault(); + +// --- Create, general, const +extern_c Handle2ConstTemperature +TemperatureCreateConst( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2Temperature +TemperatureCreate( + const XMLName label, + const Float64 value, + const XMLName unit, + ConstHandle2ConstDocumentation documentation, + 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 +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: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureLabelHas(ConstHandle2ConstTemperature self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TemperatureLabelGet(ConstHandle2ConstTemperature self); + +// +++ Set +extern_c void +TemperatureLabelSet(ConstHandle2Temperature self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureValueHas(ConstHandle2ConstTemperature self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +TemperatureValueGet(ConstHandle2ConstTemperature self); + +// +++ Set +extern_c void +TemperatureValueSet(ConstHandle2Temperature self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureUnitHas(ConstHandle2ConstTemperature self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TemperatureUnitGet(ConstHandle2ConstTemperature self); + +// +++ Set +extern_c void +TemperatureUnitSet(ConstHandle2Temperature self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureDocumentationHas(ConstHandle2ConstTemperature self); + +// --- Get, const +extern_c Handle2ConstDocumentation +TemperatureDocumentationGetConst(ConstHandle2ConstTemperature self); + +// +++ Get, non-const +extern_c Handle2Documentation +TemperatureDocumentationGet(ConstHandle2Temperature self); + +// +++ Set +extern_c void +TemperatureDocumentationSet(ConstHandle2Temperature self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureUncertaintyHas(ConstHandle2ConstTemperature self); + +// --- Get, const +extern_c Handle2ConstUncertainty +TemperatureUncertaintyGetConst(ConstHandle2ConstTemperature self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +TemperatureUncertaintyGet(ConstHandle2Temperature self); + +// +++ Set +extern_c void +TemperatureUncertaintySet(ConstHandle2Temperature self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Temperature/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Temperature/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable.cpp new file mode 100644 index 000000000..102f073bf --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/Transportable.hpp" +#include "Transportable.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = TransportableClass; +using CPP = multigroup::Transportable; + +static const std::string CLASSNAME = "Transportable"; + +namespace extract { + static auto conserve = [](auto &obj) { return &obj.conserve; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto multiGroup = [](auto &obj) { return &obj.multiGroup; }; +} + +using CPPMultiGroup = styles::MultiGroup; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTransportable +TransportableDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Transportable +TransportableDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTransportable +TransportableCreateConst( + const XMLName conserve, + const XMLName label, + ConstHandle2ConstMultiGroup multiGroup +) { + ConstHandle2Transportable handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + conserve, + label, + detail::tocpp(multiGroup) + ); + return handle; +} + +// Create, general +Handle2Transportable +TransportableCreate( + const XMLName conserve, + const XMLName label, + ConstHandle2ConstMultiGroup multiGroup +) { + ConstHandle2Transportable handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + conserve, + label, + detail::tocpp(multiGroup) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +TransportableAssign(ConstHandle2Transportable self, ConstHandle2ConstTransportable from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +TransportableDelete(ConstHandle2ConstTransportable self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +TransportableRead(ConstHandle2Transportable self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +TransportableWrite(ConstHandle2ConstTransportable self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +TransportablePrint(ConstHandle2ConstTransportable self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +TransportablePrintXML(ConstHandle2ConstTransportable self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +TransportablePrintJSON(ConstHandle2ConstTransportable self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: conserve +// ----------------------------------------------------------------------------- + +// Has +int +TransportableConserveHas(ConstHandle2ConstTransportable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConserveHas", self, extract::conserve); +} + +// Get +// Returns by value +XMLName +TransportableConserveGet(ConstHandle2ConstTransportable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConserveGet", self, extract::conserve); +} + +// Set +void +TransportableConserveSet(ConstHandle2Transportable self, const XMLName conserve) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ConserveSet", self, extract::conserve, conserve); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +TransportableLabelHas(ConstHandle2ConstTransportable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +TransportableLabelGet(ConstHandle2ConstTransportable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +TransportableLabelSet(ConstHandle2Transportable self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: multiGroup +// ----------------------------------------------------------------------------- + +// Has +int +TransportableMultiGroupHas(ConstHandle2ConstTransportable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MultiGroupHas", self, extract::multiGroup); +} + +// Get, const +Handle2ConstMultiGroup +TransportableMultiGroupGetConst(ConstHandle2ConstTransportable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiGroupGetConst", self, extract::multiGroup); +} + +// Get, non-const +Handle2MultiGroup +TransportableMultiGroupGet(ConstHandle2Transportable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiGroupGet", self, extract::multiGroup); +} + +// Set +void +TransportableMultiGroupSet(ConstHandle2Transportable self, ConstHandle2ConstMultiGroup multiGroup) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MultiGroupSet", self, extract::multiGroup, multiGroup); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Transportable/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable.h new file mode 100644 index 000000000..0eaf4c506 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable.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. +// +// Transportable is the basic handle type in this file. Example: +// // Create a default Transportable object: +// Transportable handle = TransportableDefault(); +// Functions involving Transportable are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_TRANSPORTABLE +#define C_INTERFACE_TEST_V2_0_STYLES_TRANSPORTABLE + +#include "GNDStk.h" +#include "v2.0/styles/MultiGroup.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct TransportableClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Transportable +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct TransportableClass *Transportable; + +// --- Const-aware handles. +typedef const struct TransportableClass *const ConstHandle2ConstTransportable; +typedef struct TransportableClass *const ConstHandle2Transportable; +typedef const struct TransportableClass * Handle2ConstTransportable; +typedef struct TransportableClass * Handle2Transportable; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTransportable +TransportableDefaultConst(); + +// +++ Create, default +extern_c Handle2Transportable +TransportableDefault(); + +// --- Create, general, const +extern_c Handle2ConstTransportable +TransportableCreateConst( + const XMLName conserve, + const XMLName label, + ConstHandle2ConstMultiGroup multiGroup +); + +// +++ Create, general +extern_c Handle2Transportable +TransportableCreate( + const XMLName conserve, + const XMLName label, + ConstHandle2ConstMultiGroup multiGroup +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +TransportableAssign(ConstHandle2Transportable self, ConstHandle2ConstTransportable from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +TransportableDelete(ConstHandle2ConstTransportable self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +TransportableRead(ConstHandle2Transportable self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +TransportableWrite(ConstHandle2ConstTransportable self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +TransportablePrint(ConstHandle2ConstTransportable self); + +// +++ Print to standard output, as XML +extern_c int +TransportablePrintXML(ConstHandle2ConstTransportable self); + +// +++ Print to standard output, as JSON +extern_c int +TransportablePrintJSON(ConstHandle2ConstTransportable self); + + +// ----------------------------------------------------------------------------- +// Metadatum: conserve +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TransportableConserveHas(ConstHandle2ConstTransportable self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TransportableConserveGet(ConstHandle2ConstTransportable self); + +// +++ Set +extern_c void +TransportableConserveSet(ConstHandle2Transportable self, const XMLName conserve); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TransportableLabelHas(ConstHandle2ConstTransportable self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TransportableLabelGet(ConstHandle2ConstTransportable self); + +// +++ Set +extern_c void +TransportableLabelSet(ConstHandle2Transportable self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: multiGroup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TransportableMultiGroupHas(ConstHandle2ConstTransportable self); + +// --- Get, const +extern_c Handle2ConstMultiGroup +TransportableMultiGroupGetConst(ConstHandle2ConstTransportable self); + +// +++ Get, non-const +extern_c Handle2MultiGroup +TransportableMultiGroupGet(ConstHandle2Transportable self); + +// +++ Set +extern_c void +TransportableMultiGroupSet(ConstHandle2Transportable self, ConstHandle2ConstMultiGroup multiGroup); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Transportable/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportable/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables.cpp new file mode 100644 index 000000000..b3e6d6eb5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/Transportables.hpp" +#include "Transportables.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = TransportablesClass; +using CPP = multigroup::Transportables; + +static const std::string CLASSNAME = "Transportables"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto transportable = [](auto &obj) { return &obj.transportable; }; +} + +using CPPTransportable = styles::Transportable; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTransportables +TransportablesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Transportables +TransportablesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTransportables +TransportablesCreateConst( + const XMLName label, + ConstHandle2Transportable *const transportable, const size_t transportableSize +) { + ConstHandle2Transportables handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + std::vector{} + ); + for (size_t TransportableN = 0; TransportableN < transportableSize; ++TransportableN) + TransportablesTransportableAdd(handle, transportable[TransportableN]); + return handle; +} + +// Create, general +Handle2Transportables +TransportablesCreate( + const XMLName label, + ConstHandle2Transportable *const transportable, const size_t transportableSize +) { + ConstHandle2Transportables handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + std::vector{} + ); + for (size_t TransportableN = 0; TransportableN < transportableSize; ++TransportableN) + TransportablesTransportableAdd(handle, transportable[TransportableN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +TransportablesAssign(ConstHandle2Transportables self, ConstHandle2ConstTransportables from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +TransportablesDelete(ConstHandle2ConstTransportables self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +TransportablesRead(ConstHandle2Transportables self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +TransportablesWrite(ConstHandle2ConstTransportables self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +TransportablesPrint(ConstHandle2ConstTransportables self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +TransportablesPrintXML(ConstHandle2ConstTransportables self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +TransportablesPrintJSON(ConstHandle2ConstTransportables self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +TransportablesLabelHas(ConstHandle2ConstTransportables self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +TransportablesLabelGet(ConstHandle2ConstTransportables self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +TransportablesLabelSet(ConstHandle2Transportables self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: transportable +// ----------------------------------------------------------------------------- + +// Has +int +TransportablesTransportableHas(ConstHandle2ConstTransportables self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TransportableHas", self, extract::transportable); +} + +// Clear +void +TransportablesTransportableClear(ConstHandle2Transportables self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"TransportableClear", self, extract::transportable); +} + +// Size +size_t +TransportablesTransportableSize(ConstHandle2ConstTransportables self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"TransportableSize", self, extract::transportable); +} + +// Add +void +TransportablesTransportableAdd(ConstHandle2Transportables self, ConstHandle2ConstTransportable transportable) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"TransportableAdd", self, extract::transportable, transportable); +} + +// Get, by index \in [0,size), const +Handle2ConstTransportable +TransportablesTransportableGetConst(ConstHandle2ConstTransportables self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"TransportableGetConst", self, extract::transportable, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Transportable +TransportablesTransportableGet(ConstHandle2Transportables self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"TransportableGet", self, extract::transportable, index_); +} + +// Set, by index \in [0,size) +void +TransportablesTransportableSet( + ConstHandle2Transportables self, + const size_t index_, + ConstHandle2ConstTransportable transportable +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"TransportableSet", self, extract::transportable, index_, transportable); +} + +// Has, by conserve +int +TransportablesTransportableHasByConserve( + ConstHandle2ConstTransportables self, + const XMLName conserve +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TransportableHasByConserve", + self, extract::transportable, meta::conserve, conserve); +} + +// Get, by conserve, const +Handle2ConstTransportable +TransportablesTransportableGetByConserveConst( + ConstHandle2ConstTransportables self, + const XMLName conserve +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TransportableGetByConserveConst", + self, extract::transportable, meta::conserve, conserve); +} + +// Get, by conserve, non-const +Handle2Transportable +TransportablesTransportableGetByConserve( + ConstHandle2Transportables self, + const XMLName conserve +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TransportableGetByConserve", + self, extract::transportable, meta::conserve, conserve); +} + +// Set, by conserve +void +TransportablesTransportableSetByConserve( + ConstHandle2Transportables self, + const XMLName conserve, + ConstHandle2ConstTransportable transportable +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TransportableSetByConserve", + self, extract::transportable, meta::conserve, conserve, transportable); +} + +// Has, by label +int +TransportablesTransportableHasByLabel( + ConstHandle2ConstTransportables self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"TransportableHasByLabel", + self, extract::transportable, meta::label, label); +} + +// Get, by label, const +Handle2ConstTransportable +TransportablesTransportableGetByLabelConst( + ConstHandle2ConstTransportables self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TransportableGetByLabelConst", + self, extract::transportable, meta::label, label); +} + +// Get, by label, non-const +Handle2Transportable +TransportablesTransportableGetByLabel( + ConstHandle2Transportables self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"TransportableGetByLabel", + self, extract::transportable, meta::label, label); +} + +// Set, by label +void +TransportablesTransportableSetByLabel( + ConstHandle2Transportables self, + const XMLName label, + ConstHandle2ConstTransportable transportable +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"TransportableSetByLabel", + self, extract::transportable, meta::label, label, transportable); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Transportables/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables.h new file mode 100644 index 000000000..d1f5357f5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables.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. +// +// Transportables is the basic handle type in this file. Example: +// // Create a default Transportables object: +// Transportables handle = TransportablesDefault(); +// Functions involving Transportables are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_TRANSPORTABLES +#define C_INTERFACE_TEST_V2_0_STYLES_TRANSPORTABLES + +#include "GNDStk.h" +#include "v2.0/styles/Transportable.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct TransportablesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Transportables +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct TransportablesClass *Transportables; + +// --- Const-aware handles. +typedef const struct TransportablesClass *const ConstHandle2ConstTransportables; +typedef struct TransportablesClass *const ConstHandle2Transportables; +typedef const struct TransportablesClass * Handle2ConstTransportables; +typedef struct TransportablesClass * Handle2Transportables; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTransportables +TransportablesDefaultConst(); + +// +++ Create, default +extern_c Handle2Transportables +TransportablesDefault(); + +// --- Create, general, const +extern_c Handle2ConstTransportables +TransportablesCreateConst( + const XMLName label, + ConstHandle2Transportable *const transportable, const size_t transportableSize +); + +// +++ Create, general +extern_c Handle2Transportables +TransportablesCreate( + const XMLName label, + ConstHandle2Transportable *const transportable, const size_t transportableSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +TransportablesAssign(ConstHandle2Transportables self, ConstHandle2ConstTransportables from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +TransportablesDelete(ConstHandle2ConstTransportables self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +TransportablesRead(ConstHandle2Transportables self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +TransportablesWrite(ConstHandle2ConstTransportables self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +TransportablesPrint(ConstHandle2ConstTransportables self); + +// +++ Print to standard output, as XML +extern_c int +TransportablesPrintXML(ConstHandle2ConstTransportables self); + +// +++ Print to standard output, as JSON +extern_c int +TransportablesPrintJSON(ConstHandle2ConstTransportables self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TransportablesLabelHas(ConstHandle2ConstTransportables self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +TransportablesLabelGet(ConstHandle2ConstTransportables self); + +// +++ Set +extern_c void +TransportablesLabelSet(ConstHandle2Transportables self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: transportable +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TransportablesTransportableHas(ConstHandle2ConstTransportables self); + +// +++ Clear +extern_c void +TransportablesTransportableClear(ConstHandle2Transportables self); + +// +++ Size +extern_c size_t +TransportablesTransportableSize(ConstHandle2ConstTransportables self); + +// +++ Add +extern_c void +TransportablesTransportableAdd(ConstHandle2Transportables self, ConstHandle2ConstTransportable transportable); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstTransportable +TransportablesTransportableGetConst(ConstHandle2ConstTransportables self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Transportable +TransportablesTransportableGet(ConstHandle2Transportables self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +TransportablesTransportableSet( + ConstHandle2Transportables self, + const size_t index_, + ConstHandle2ConstTransportable transportable +); + +// +++ Has, by conserve +extern_c int +TransportablesTransportableHasByConserve( + ConstHandle2ConstTransportables self, + const XMLName conserve +); + +// --- Get, by conserve, const +extern_c Handle2ConstTransportable +TransportablesTransportableGetByConserveConst( + ConstHandle2ConstTransportables self, + const XMLName conserve +); + +// +++ Get, by conserve, non-const +extern_c Handle2Transportable +TransportablesTransportableGetByConserve( + ConstHandle2Transportables self, + const XMLName conserve +); + +// +++ Set, by conserve +extern_c void +TransportablesTransportableSetByConserve( + ConstHandle2Transportables self, + const XMLName conserve, + ConstHandle2ConstTransportable transportable +); + +// +++ Has, by label +extern_c int +TransportablesTransportableHasByLabel( + ConstHandle2ConstTransportables self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstTransportable +TransportablesTransportableGetByLabelConst( + ConstHandle2ConstTransportables self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Transportable +TransportablesTransportableGetByLabel( + ConstHandle2Transportables self, + const XMLName label +); + +// +++ Set, by label +extern_c void +TransportablesTransportableSetByLabel( + ConstHandle2Transportables self, + const XMLName label, + ConstHandle2ConstTransportable transportable +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/Transportables/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/Transportables/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables.cpp new file mode 100644 index 000000000..9331828e6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/styles/URR_probabilityTables.hpp" +#include "URR_probabilityTables.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = URR_probabilityTablesClass; +using CPP = multigroup::URR_probabilityTables; + +static const std::string CLASSNAME = "URR_probabilityTables"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; +} + +using CPPDocumentation = documentation::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstURR_probabilityTables +URR_probabilityTablesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2URR_probabilityTables +URR_probabilityTablesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstURR_probabilityTables +URR_probabilityTablesCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2URR_probabilityTables handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + date, + derivedFrom, + label, + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2URR_probabilityTables +URR_probabilityTablesCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2URR_probabilityTables handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + date, + derivedFrom, + label, + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +URR_probabilityTablesAssign(ConstHandle2URR_probabilityTables self, ConstHandle2ConstURR_probabilityTables from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +URR_probabilityTablesDelete(ConstHandle2ConstURR_probabilityTables self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +URR_probabilityTablesRead(ConstHandle2URR_probabilityTables self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +URR_probabilityTablesWrite(ConstHandle2ConstURR_probabilityTables self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +URR_probabilityTablesPrint(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +URR_probabilityTablesPrintXML(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +URR_probabilityTablesPrintJSON(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +URR_probabilityTablesDateHas(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +URR_probabilityTablesDateGet(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +URR_probabilityTablesDateSet(ConstHandle2URR_probabilityTables self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +URR_probabilityTablesDerivedFromHas(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +XMLName +URR_probabilityTablesDerivedFromGet(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +URR_probabilityTablesDerivedFromSet(ConstHandle2URR_probabilityTables self, const XMLName derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +URR_probabilityTablesLabelHas(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +URR_probabilityTablesLabelGet(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +URR_probabilityTablesLabelSet(ConstHandle2URR_probabilityTables self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +URR_probabilityTablesDocumentationHas(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +URR_probabilityTablesDocumentationGetConst(ConstHandle2ConstURR_probabilityTables self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +URR_probabilityTablesDocumentationGet(ConstHandle2URR_probabilityTables self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +URR_probabilityTablesDocumentationSet(ConstHandle2URR_probabilityTables self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/URR_probabilityTables/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables.h b/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables.h new file mode 100644 index 000000000..454f99bf1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables.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. +// +// URR_probabilityTables is the basic handle type in this file. Example: +// // Create a default URR_probabilityTables object: +// URR_probabilityTables handle = URR_probabilityTablesDefault(); +// Functions involving URR_probabilityTables are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_STYLES_URR_PROBABILITYTABLES +#define C_INTERFACE_TEST_V2_0_STYLES_URR_PROBABILITYTABLES + +#include "GNDStk.h" +#include "v2.0/documentation/Documentation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct URR_probabilityTablesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ URR_probabilityTables +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct URR_probabilityTablesClass *URR_probabilityTables; + +// --- Const-aware handles. +typedef const struct URR_probabilityTablesClass *const ConstHandle2ConstURR_probabilityTables; +typedef struct URR_probabilityTablesClass *const ConstHandle2URR_probabilityTables; +typedef const struct URR_probabilityTablesClass * Handle2ConstURR_probabilityTables; +typedef struct URR_probabilityTablesClass * Handle2URR_probabilityTables; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstURR_probabilityTables +URR_probabilityTablesDefaultConst(); + +// +++ Create, default +extern_c Handle2URR_probabilityTables +URR_probabilityTablesDefault(); + +// --- Create, general, const +extern_c Handle2ConstURR_probabilityTables +URR_probabilityTablesCreateConst( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +); + +// +++ Create, general +extern_c Handle2URR_probabilityTables +URR_probabilityTablesCreate( + const char *const date, + const XMLName derivedFrom, + const XMLName label, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +URR_probabilityTablesAssign(ConstHandle2URR_probabilityTables self, ConstHandle2ConstURR_probabilityTables from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +URR_probabilityTablesDelete(ConstHandle2ConstURR_probabilityTables self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +URR_probabilityTablesRead(ConstHandle2URR_probabilityTables self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +URR_probabilityTablesWrite(ConstHandle2ConstURR_probabilityTables self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +URR_probabilityTablesPrint(ConstHandle2ConstURR_probabilityTables self); + +// +++ Print to standard output, as XML +extern_c int +URR_probabilityTablesPrintXML(ConstHandle2ConstURR_probabilityTables self); + +// +++ Print to standard output, as JSON +extern_c int +URR_probabilityTablesPrintJSON(ConstHandle2ConstURR_probabilityTables self); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +URR_probabilityTablesDateHas(ConstHandle2ConstURR_probabilityTables self); + +// +++ Get +// +++ Returns by value +extern_c const char * +URR_probabilityTablesDateGet(ConstHandle2ConstURR_probabilityTables self); + +// +++ Set +extern_c void +URR_probabilityTablesDateSet(ConstHandle2URR_probabilityTables self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +URR_probabilityTablesDerivedFromHas(ConstHandle2ConstURR_probabilityTables self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +URR_probabilityTablesDerivedFromGet(ConstHandle2ConstURR_probabilityTables self); + +// +++ Set +extern_c void +URR_probabilityTablesDerivedFromSet(ConstHandle2URR_probabilityTables self, const XMLName derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +URR_probabilityTablesLabelHas(ConstHandle2ConstURR_probabilityTables self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +URR_probabilityTablesLabelGet(ConstHandle2ConstURR_probabilityTables self); + +// +++ Set +extern_c void +URR_probabilityTablesLabelSet(ConstHandle2URR_probabilityTables self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +URR_probabilityTablesDocumentationHas(ConstHandle2ConstURR_probabilityTables self); + +// --- Get, const +extern_c Handle2ConstDocumentation +URR_probabilityTablesDocumentationGetConst(ConstHandle2ConstURR_probabilityTables self); + +// +++ Get, non-const +extern_c Handle2Documentation +URR_probabilityTablesDocumentationGet(ConstHandle2URR_probabilityTables self); + +// +++ Set +extern_c void +URR_probabilityTablesDocumentationSet(ConstHandle2URR_probabilityTables self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/styles/URR_probabilityTables/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/styles/URR_probabilityTables/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/A.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/A.cpp new file mode 100644 index 000000000..234987951 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/A.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/A.hpp" +#include "A.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = AClass; +using CPP = multigroup::A; + +static const std::string CLASSNAME = "A"; + +namespace extract { +} + +using CPPXYs2d = containers::XYs2d; +using CPPRegions2d = containers::Regions2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstA +ADefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2A +ADefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstA +ACreateConst( +) { + ConstHandle2A handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2A +ACreate( +) { + ConstHandle2A 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 +AAssign(ConstHandle2A self, ConstHandle2ConstA from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ADelete(ConstHandle2ConstA self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ARead(ConstHandle2A self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AWrite(ConstHandle2ConstA self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +APrint(ConstHandle2ConstA self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +APrintXML(ConstHandle2ConstA self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +APrintJSON(ConstHandle2ConstA self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/A/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/A.h b/standards/gnds-2.0/test/c/src/v2.0/transport/A.h new file mode 100644 index 000000000..dba2e195a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/A.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. +// +// A is the basic handle type in this file. Example: +// // Create a default A object: +// A handle = ADefault(); +// Functions involving A are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TRANSPORT_A +#define C_INTERFACE_TEST_V2_0_TRANSPORT_A + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Regions2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ A +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AClass *A; + +// --- Const-aware handles. +typedef const struct AClass *const ConstHandle2ConstA; +typedef struct AClass *const ConstHandle2A; +typedef const struct AClass * Handle2ConstA; +typedef struct AClass * Handle2A; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstA +ADefaultConst(); + +// +++ Create, default +extern_c Handle2A +ADefault(); + +// --- Create, general, const +extern_c Handle2ConstA +ACreateConst( +); + +// +++ Create, general +extern_c Handle2A +ACreate( +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AAssign(ConstHandle2A self, ConstHandle2ConstA from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ADelete(ConstHandle2ConstA self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ARead(ConstHandle2A self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AWrite(ConstHandle2ConstA self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +APrint(ConstHandle2ConstA self); + +// +++ Print to standard output, as XML +extern_c int +APrintXML(ConstHandle2ConstA self); + +// +++ Print to standard output, as JSON +extern_c int +APrintJSON(ConstHandle2ConstA self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/A/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/A/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/A/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/A/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/A/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Add.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Add.cpp new file mode 100644 index 000000000..035e82f92 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Add.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Add.hpp" +#include "Add.h" + +using namespace njoy::GNDStk; +using namespace test::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 +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 +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/transport/Add/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Add.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Add.h new file mode 100644 index 000000000..27978d753 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_ADD +#define C_INTERFACE_TEST_V2_0_TRANSPORT_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 +extern_c Handle2Add +AddDefault(); + +// --- Create, general, const +extern_c Handle2ConstAdd +AddCreateConst( + const char *const href +); + +// +++ Create, general +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/transport/Add/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Add/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Add/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Add/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Add/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/AngularEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularEnergy.cpp new file mode 100644 index 000000000..dfbfde8ed --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularEnergy.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/AngularEnergy.hpp" +#include "AngularEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::XYs3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAngularEnergy +AngularEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AngularEnergy +AngularEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAngularEnergy +AngularEnergyCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstXYs3d XYs3d +) { + ConstHandle2AngularEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(XYs3d) + ); + return handle; +} + +// Create, general +Handle2AngularEnergy +AngularEnergyCreate( + const XMLName label, + const XMLName 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 +XMLName +AngularEnergyLabelGet(ConstHandle2ConstAngularEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AngularEnergyLabelSet(ConstHandle2AngularEnergy self, const XMLName 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 +XMLName +AngularEnergyProductFrameGet(ConstHandle2ConstAngularEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +AngularEnergyProductFrameSet(ConstHandle2AngularEnergy self, const XMLName 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/transport/AngularEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/AngularEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularEnergy.h new file mode 100644 index 000000000..70f49c7a4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_ANGULARENERGY +#define C_INTERFACE_TEST_V2_0_TRANSPORT_ANGULARENERGY + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2AngularEnergy +AngularEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngularEnergy +AngularEnergyCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstXYs3d XYs3d +); + +// +++ Create, general +extern_c Handle2AngularEnergy +AngularEnergyCreate( + const XMLName label, + const XMLName 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 XMLName +AngularEnergyLabelGet(ConstHandle2ConstAngularEnergy self); + +// +++ Set +extern_c void +AngularEnergyLabelSet(ConstHandle2AngularEnergy self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularEnergyProductFrameHas(ConstHandle2ConstAngularEnergy self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AngularEnergyProductFrameGet(ConstHandle2ConstAngularEnergy self); + +// +++ Set +extern_c void +AngularEnergyProductFrameSet(ConstHandle2AngularEnergy self, const XMLName 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/transport/AngularEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/AngularEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/AngularEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/AngularTwoBody.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularTwoBody.cpp new file mode 100644 index 000000000..84ab52962 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularTwoBody.cpp @@ -0,0 +1,380 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/AngularTwoBody.hpp" +#include "AngularTwoBody.h" + +using namespace njoy::GNDStk; +using namespace test::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 isotropic2d = [](auto &obj) { return &obj.isotropic2d; }; + static auto recoil = [](auto &obj) { return &obj.recoil; }; +} + +using CPPXYs2d = containers::XYs2d; +using CPPRegions2d = containers::Regions2d; +using CPPIsotropic2d = transport::Isotropic2d; +using CPPRecoil = transport::Recoil; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAngularTwoBody +AngularTwoBodyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2AngularTwoBody +AngularTwoBodyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAngularTwoBody +AngularTwoBodyCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstRecoil recoil +) { + ConstHandle2AngularTwoBody handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(XYs2d), + detail::tocpp(regions2d), + detail::tocpp(isotropic2d), + detail::tocpp(recoil) + ); + return handle; +} + +// Create, general +Handle2AngularTwoBody +AngularTwoBodyCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstRecoil recoil +) { + ConstHandle2AngularTwoBody handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(XYs2d), + detail::tocpp(regions2d), + detail::tocpp(isotropic2d), + detail::tocpp(recoil) + ); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +AngularTwoBodyLabelGet(ConstHandle2ConstAngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AngularTwoBodyLabelSet(ConstHandle2AngularTwoBody self, const XMLName 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 +XMLName +AngularTwoBodyProductFrameGet(ConstHandle2ConstAngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +AngularTwoBodyProductFrameSet(ConstHandle2AngularTwoBody self, const XMLName 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/AngularTwoBody/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/AngularTwoBody.h b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularTwoBody.h new file mode 100644 index 000000000..91ed4d122 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_ANGULARTWOBODY +#define C_INTERFACE_TEST_V2_0_TRANSPORT_ANGULARTWOBODY + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Regions2d.h" +#include "v2.0/transport/Isotropic2d.h" +#include "v2.0/transport/Recoil.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 +extern_c Handle2AngularTwoBody +AngularTwoBodyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngularTwoBody +AngularTwoBodyCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstRecoil recoil +); + +// +++ Create, general +extern_c Handle2AngularTwoBody +AngularTwoBodyCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstRecoil recoil +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +AngularTwoBodyLabelGet(ConstHandle2ConstAngularTwoBody self); + +// +++ Set +extern_c void +AngularTwoBodyLabelSet(ConstHandle2AngularTwoBody self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularTwoBodyProductFrameHas(ConstHandle2ConstAngularTwoBody self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +AngularTwoBodyProductFrameGet(ConstHandle2ConstAngularTwoBody self); + +// +++ Set +extern_c void +AngularTwoBodyProductFrameSet(ConstHandle2AngularTwoBody self, const XMLName 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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/AngularTwoBody/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/AngularTwoBody/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularTwoBody/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/AngularTwoBody/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/AngularTwoBody/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated.cpp new file mode 100644 index 000000000..dfc93b4ba --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Angular_uncorrelated.hpp" +#include "Angular_uncorrelated.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Angular_uncorrelatedClass; +using CPP = multigroup::Angular_uncorrelated; + +static const std::string CLASSNAME = "Angular_uncorrelated"; + +namespace extract { + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; + static auto isotropic2d = [](auto &obj) { return &obj.isotropic2d; }; + static auto forward = [](auto &obj) { return &obj.forward; }; +} + +using CPPXYs2d = containers::XYs2d; +using CPPIsotropic2d = transport::Isotropic2d; +using CPPForward = transport::Forward; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAngular_uncorrelated +Angular_uncorrelatedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Angular_uncorrelated +Angular_uncorrelatedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAngular_uncorrelated +Angular_uncorrelatedCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstForward forward +) { + ConstHandle2Angular_uncorrelated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs2d), + detail::tocpp(isotropic2d), + detail::tocpp(forward) + ); + return handle; +} + +// Create, general +Handle2Angular_uncorrelated +Angular_uncorrelatedCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstForward forward +) { + ConstHandle2Angular_uncorrelated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs2d), + detail::tocpp(isotropic2d), + detail::tocpp(forward) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Angular_uncorrelatedAssign(ConstHandle2Angular_uncorrelated self, ConstHandle2ConstAngular_uncorrelated from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Angular_uncorrelatedDelete(ConstHandle2ConstAngular_uncorrelated self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Angular_uncorrelatedRead(ConstHandle2Angular_uncorrelated self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Angular_uncorrelatedWrite(ConstHandle2ConstAngular_uncorrelated self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Angular_uncorrelatedPrint(ConstHandle2ConstAngular_uncorrelated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Angular_uncorrelatedPrintXML(ConstHandle2ConstAngular_uncorrelated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Angular_uncorrelatedPrintJSON(ConstHandle2ConstAngular_uncorrelated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +Angular_uncorrelatedXYs2dHas(ConstHandle2ConstAngular_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +Angular_uncorrelatedXYs2dGetConst(ConstHandle2ConstAngular_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +Angular_uncorrelatedXYs2dGet(ConstHandle2Angular_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +Angular_uncorrelatedXYs2dSet(ConstHandle2Angular_uncorrelated self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Child: isotropic2d +// ----------------------------------------------------------------------------- + +// Has +int +Angular_uncorrelatedIsotropic2dHas(ConstHandle2ConstAngular_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Isotropic2dHas", self, extract::isotropic2d); +} + +// Get, const +Handle2ConstIsotropic2d +Angular_uncorrelatedIsotropic2dGetConst(ConstHandle2ConstAngular_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Isotropic2dGetConst", self, extract::isotropic2d); +} + +// Get, non-const +Handle2Isotropic2d +Angular_uncorrelatedIsotropic2dGet(ConstHandle2Angular_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Isotropic2dGet", self, extract::isotropic2d); +} + +// Set +void +Angular_uncorrelatedIsotropic2dSet(ConstHandle2Angular_uncorrelated self, ConstHandle2ConstIsotropic2d isotropic2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Isotropic2dSet", self, extract::isotropic2d, isotropic2d); +} + + +// ----------------------------------------------------------------------------- +// Child: forward +// ----------------------------------------------------------------------------- + +// Has +int +Angular_uncorrelatedForwardHas(ConstHandle2ConstAngular_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ForwardHas", self, extract::forward); +} + +// Get, const +Handle2ConstForward +Angular_uncorrelatedForwardGetConst(ConstHandle2ConstAngular_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ForwardGetConst", self, extract::forward); +} + +// Get, non-const +Handle2Forward +Angular_uncorrelatedForwardGet(ConstHandle2Angular_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ForwardGet", self, extract::forward); +} + +// Set +void +Angular_uncorrelatedForwardSet(ConstHandle2Angular_uncorrelated self, ConstHandle2ConstForward forward) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ForwardSet", self, extract::forward, forward); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Angular_uncorrelated/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated.h new file mode 100644 index 000000000..eb857441d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated.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. +// +// Angular_uncorrelated is the basic handle type in this file. Example: +// // Create a default Angular_uncorrelated object: +// Angular_uncorrelated handle = Angular_uncorrelatedDefault(); +// Functions involving Angular_uncorrelated are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TRANSPORT_ANGULAR_UNCORRELATED +#define C_INTERFACE_TEST_V2_0_TRANSPORT_ANGULAR_UNCORRELATED + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/transport/Isotropic2d.h" +#include "v2.0/transport/Forward.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Angular_uncorrelatedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Angular_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 Angular_uncorrelatedClass *Angular_uncorrelated; + +// --- Const-aware handles. +typedef const struct Angular_uncorrelatedClass *const ConstHandle2ConstAngular_uncorrelated; +typedef struct Angular_uncorrelatedClass *const ConstHandle2Angular_uncorrelated; +typedef const struct Angular_uncorrelatedClass * Handle2ConstAngular_uncorrelated; +typedef struct Angular_uncorrelatedClass * Handle2Angular_uncorrelated; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAngular_uncorrelated +Angular_uncorrelatedDefaultConst(); + +// +++ Create, default +extern_c Handle2Angular_uncorrelated +Angular_uncorrelatedDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngular_uncorrelated +Angular_uncorrelatedCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstForward forward +); + +// +++ Create, general +extern_c Handle2Angular_uncorrelated +Angular_uncorrelatedCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstForward forward +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Angular_uncorrelatedAssign(ConstHandle2Angular_uncorrelated self, ConstHandle2ConstAngular_uncorrelated from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Angular_uncorrelatedDelete(ConstHandle2ConstAngular_uncorrelated self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Angular_uncorrelatedRead(ConstHandle2Angular_uncorrelated self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Angular_uncorrelatedWrite(ConstHandle2ConstAngular_uncorrelated self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Angular_uncorrelatedPrint(ConstHandle2ConstAngular_uncorrelated self); + +// +++ Print to standard output, as XML +extern_c int +Angular_uncorrelatedPrintXML(ConstHandle2ConstAngular_uncorrelated self); + +// +++ Print to standard output, as JSON +extern_c int +Angular_uncorrelatedPrintJSON(ConstHandle2ConstAngular_uncorrelated self); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Angular_uncorrelatedXYs2dHas(ConstHandle2ConstAngular_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstXYs2d +Angular_uncorrelatedXYs2dGetConst(ConstHandle2ConstAngular_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2XYs2d +Angular_uncorrelatedXYs2dGet(ConstHandle2Angular_uncorrelated self); + +// +++ Set +extern_c void +Angular_uncorrelatedXYs2dSet(ConstHandle2Angular_uncorrelated self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Child: isotropic2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Angular_uncorrelatedIsotropic2dHas(ConstHandle2ConstAngular_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstIsotropic2d +Angular_uncorrelatedIsotropic2dGetConst(ConstHandle2ConstAngular_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2Isotropic2d +Angular_uncorrelatedIsotropic2dGet(ConstHandle2Angular_uncorrelated self); + +// +++ Set +extern_c void +Angular_uncorrelatedIsotropic2dSet(ConstHandle2Angular_uncorrelated self, ConstHandle2ConstIsotropic2d isotropic2d); + + +// ----------------------------------------------------------------------------- +// Child: forward +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Angular_uncorrelatedForwardHas(ConstHandle2ConstAngular_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstForward +Angular_uncorrelatedForwardGetConst(ConstHandle2ConstAngular_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2Forward +Angular_uncorrelatedForwardGet(ConstHandle2Angular_uncorrelated self); + +// +++ Set +extern_c void +Angular_uncorrelatedForwardSet(ConstHandle2Angular_uncorrelated self, ConstHandle2ConstForward forward); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Angular_uncorrelated/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Angular_uncorrelated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Background.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Background.cpp new file mode 100644 index 000000000..477c68a73 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Background.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Background.hpp" +#include "Background.h" + +using namespace njoy::GNDStk; +using namespace test::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 unresolvedRegion = [](auto &obj) { return &obj.unresolvedRegion; }; + static auto fastRegion = [](auto &obj) { return &obj.fastRegion; }; +} + +using CPPResolvedRegion = transport::ResolvedRegion; +using CPPUnresolvedRegion = transport::UnresolvedRegion; +using CPPFastRegion = transport::FastRegion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBackground +BackgroundDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Background +BackgroundDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBackground +BackgroundCreateConst( + ConstHandle2ConstResolvedRegion resolvedRegion, + ConstHandle2ConstUnresolvedRegion unresolvedRegion, + ConstHandle2ConstFastRegion fastRegion +) { + ConstHandle2Background handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(resolvedRegion), + detail::tocpp(unresolvedRegion), + detail::tocpp(fastRegion) + ); + return handle; +} + +// Create, general +Handle2Background +BackgroundCreate( + ConstHandle2ConstResolvedRegion resolvedRegion, + ConstHandle2ConstUnresolvedRegion unresolvedRegion, + ConstHandle2ConstFastRegion fastRegion +) { + ConstHandle2Background handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(resolvedRegion), + detail::tocpp(unresolvedRegion), + detail::tocpp(fastRegion) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Background/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Background.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Background.h new file mode 100644 index 000000000..4fd72a052 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_BACKGROUND +#define C_INTERFACE_TEST_V2_0_TRANSPORT_BACKGROUND + +#include "GNDStk.h" +#include "v2.0/transport/ResolvedRegion.h" +#include "v2.0/transport/UnresolvedRegion.h" +#include "v2.0/transport/FastRegion.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 +extern_c Handle2Background +BackgroundDefault(); + +// --- Create, general, const +extern_c Handle2ConstBackground +BackgroundCreateConst( + ConstHandle2ConstResolvedRegion resolvedRegion, + ConstHandle2ConstUnresolvedRegion unresolvedRegion, + ConstHandle2ConstFastRegion fastRegion +); + +// +++ Create, general +extern_c Handle2Background +BackgroundCreate( + ConstHandle2ConstResolvedRegion resolvedRegion, + ConstHandle2ConstUnresolvedRegion unresolvedRegion, + ConstHandle2ConstFastRegion fastRegion +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Background/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Background/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Background/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Background/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Background/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Branching1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching1d.cpp new file mode 100644 index 000000000..89e319d42 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching1d.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Branching1d.hpp" +#include "Branching1d.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2Branching1d +Branching1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBranching1d +Branching1dCreateConst( + const XMLName label +) { + ConstHandle2Branching1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label + ); + return handle; +} + +// Create, general +Handle2Branching1d +Branching1dCreate( + const XMLName 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 +XMLName +Branching1dLabelGet(ConstHandle2ConstBranching1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Branching1dLabelSet(ConstHandle2Branching1d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Branching1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Branching1d.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching1d.h new file mode 100644 index 000000000..137d549dc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_BRANCHING1D +#define C_INTERFACE_TEST_V2_0_TRANSPORT_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 +extern_c Handle2Branching1d +Branching1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstBranching1d +Branching1dCreateConst( + const XMLName label +); + +// +++ Create, general +extern_c Handle2Branching1d +Branching1dCreate( + const XMLName 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 XMLName +Branching1dLabelGet(ConstHandle2ConstBranching1d self); + +// +++ Set +extern_c void +Branching1dLabelSet(ConstHandle2Branching1d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Branching1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Branching1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Branching1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Branching3d.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching3d.cpp new file mode 100644 index 000000000..5cc714def --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching3d.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Branching3d.hpp" +#include "Branching3d.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2Branching3d +Branching3dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBranching3d +Branching3dCreateConst( + const XMLName label, + const XMLName productFrame +) { + ConstHandle2Branching3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame + ); + return handle; +} + +// Create, general +Handle2Branching3d +Branching3dCreate( + const XMLName label, + const XMLName 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 +XMLName +Branching3dLabelGet(ConstHandle2ConstBranching3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Branching3dLabelSet(ConstHandle2Branching3d self, const XMLName 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 +XMLName +Branching3dProductFrameGet(ConstHandle2ConstBranching3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +Branching3dProductFrameSet(ConstHandle2Branching3d self, const XMLName productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Branching3d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Branching3d.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching3d.h new file mode 100644 index 000000000..20d55231f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_BRANCHING3D +#define C_INTERFACE_TEST_V2_0_TRANSPORT_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 +extern_c Handle2Branching3d +Branching3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstBranching3d +Branching3dCreateConst( + const XMLName label, + const XMLName productFrame +); + +// +++ Create, general +extern_c Handle2Branching3d +Branching3dCreate( + const XMLName label, + const XMLName 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 XMLName +Branching3dLabelGet(ConstHandle2ConstBranching3d self); + +// +++ Set +extern_c void +Branching3dLabelSet(ConstHandle2Branching3d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Branching3dProductFrameHas(ConstHandle2ConstBranching3d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +Branching3dProductFrameGet(ConstHandle2ConstBranching3d self); + +// +++ Set +extern_c void +Branching3dProductFrameSet(ConstHandle2Branching3d self, const XMLName productFrame); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Branching3d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Branching3d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Branching3d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Branching3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton.cpp new file mode 100644 index 000000000..c50c21c1f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/CoherentPhoton.hpp" +#include "CoherentPhoton.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CoherentPhotonClass; +using CPP = multigroup::CoherentPhoton; + +static const std::string CLASSNAME = "CoherentPhoton"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCoherentPhoton +CoherentPhotonDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CoherentPhoton +CoherentPhotonDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCoherentPhoton +CoherentPhotonCreateConst() +{ + ConstHandle2CoherentPhoton handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2CoherentPhoton +CoherentPhotonCreate() +{ + ConstHandle2CoherentPhoton 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 +CoherentPhotonAssign(ConstHandle2CoherentPhoton self, ConstHandle2ConstCoherentPhoton from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CoherentPhotonDelete(ConstHandle2ConstCoherentPhoton self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CoherentPhotonRead(ConstHandle2CoherentPhoton self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CoherentPhotonWrite(ConstHandle2ConstCoherentPhoton self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CoherentPhotonPrint(ConstHandle2ConstCoherentPhoton self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CoherentPhotonPrintXML(ConstHandle2ConstCoherentPhoton self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CoherentPhotonPrintJSON(ConstHandle2ConstCoherentPhoton self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/CoherentPhoton/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton.h b/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton.h new file mode 100644 index 000000000..348bf1900 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton.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. +// +// CoherentPhoton is the basic handle type in this file. Example: +// // Create a default CoherentPhoton object: +// CoherentPhoton handle = CoherentPhotonDefault(); +// Functions involving CoherentPhoton are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TRANSPORT_COHERENTPHOTON +#define C_INTERFACE_TEST_V2_0_TRANSPORT_COHERENTPHOTON + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CoherentPhotonClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CoherentPhoton +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CoherentPhotonClass *CoherentPhoton; + +// --- Const-aware handles. +typedef const struct CoherentPhotonClass *const ConstHandle2ConstCoherentPhoton; +typedef struct CoherentPhotonClass *const ConstHandle2CoherentPhoton; +typedef const struct CoherentPhotonClass * Handle2ConstCoherentPhoton; +typedef struct CoherentPhotonClass * Handle2CoherentPhoton; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCoherentPhoton +CoherentPhotonDefaultConst(); + +// +++ Create, default +extern_c Handle2CoherentPhoton +CoherentPhotonDefault(); + +// --- Create, general, const +extern_c Handle2ConstCoherentPhoton +CoherentPhotonCreateConst(); + +// +++ Create, general +extern_c Handle2CoherentPhoton +CoherentPhotonCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CoherentPhotonAssign(ConstHandle2CoherentPhoton self, ConstHandle2ConstCoherentPhoton from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CoherentPhotonDelete(ConstHandle2ConstCoherentPhoton self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CoherentPhotonRead(ConstHandle2CoherentPhoton self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CoherentPhotonWrite(ConstHandle2ConstCoherentPhoton self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CoherentPhotonPrint(ConstHandle2ConstCoherentPhoton self); + +// +++ Print to standard output, as XML +extern_c int +CoherentPhotonPrintXML(ConstHandle2ConstCoherentPhoton self); + +// +++ Print to standard output, as JSON +extern_c int +CoherentPhotonPrintJSON(ConstHandle2ConstCoherentPhoton self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/CoherentPhoton/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/CoherentPhoton/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection.cpp new file mode 100644 index 000000000..e9efc1d3b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection.cpp @@ -0,0 +1,182 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/CrossSection.hpp" +#include "CrossSection.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CrossSectionClass; +using CPP = multigroup::CrossSection; + +static const std::string CLASSNAME = "CrossSection"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; +using CPPResonancesWithBackground = transport::ResonancesWithBackground; +using CPPCoulombPlusNuclearElastic = cpTransport::CoulombPlusNuclearElastic; +using CPPThermalNeutronScatteringLaw1d = tsl::ThermalNeutronScatteringLaw1d; +using CPPReference = transport::Reference; +using CPPGridded1d = containers::Gridded1d; +using CPPYs1d = containers::Ys1d; +using CPPURR_probabilityTables1d = transport::URR_probabilityTables1d; + + +// ----------------------------------------------------------------------------- +// 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( + const XMLName label, +) { + ConstHandle2CrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label + ); + return handle; +} + +// Create, general +Handle2CrossSection +CrossSectionCreate( + const XMLName label, +) { + ConstHandle2CrossSection 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionLabelHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CrossSectionLabelGet(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CrossSectionLabelSet(ConstHandle2CrossSection self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/CrossSection/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection.h b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection.h new file mode 100644 index 000000000..39a259bee --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection.h @@ -0,0 +1,166 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TRANSPORT_CROSSSECTION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_CROSSSECTION + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.h" +#include "v2.0/transport/ResonancesWithBackground.h" +#include "v2.0/cpTransport/CoulombPlusNuclearElastic.h" +#include "v2.0/tsl/ThermalNeutronScatteringLaw1d.h" +#include "v2.0/transport/Reference.h" +#include "v2.0/containers/Gridded1d.h" +#include "v2.0/containers/Ys1d.h" +#include "v2.0/transport/URR_probabilityTables1d.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( + const XMLName label, +); + +// +++ Create, general +extern_c Handle2CrossSection +CrossSectionCreate( + const XMLName 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 +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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionLabelHas(ConstHandle2ConstCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CrossSectionLabelGet(ConstHandle2ConstCrossSection self); + +// +++ Set +extern_c void +CrossSectionLabelSet(ConstHandle2CrossSection self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/CrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSum.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSum.cpp new file mode 100644 index 000000000..3570af29b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSum.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/CrossSectionSum.hpp" +#include "CrossSectionSum.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CrossSectionSumClass; +using CPP = multigroup::CrossSectionSum; + +static const std::string CLASSNAME = "CrossSectionSum"; + +namespace extract { + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto Q = [](auto &obj) { return &obj.Q; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; + static auto summands = [](auto &obj) { return &obj.summands; }; +} + +using CPPQ = common::Q; +using CPPCrossSection = transport::CrossSection; +using CPPSummands = transport::Summands; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCrossSectionSum +CrossSectionSumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CrossSectionSum +CrossSectionSumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCrossSectionSum +CrossSectionSumCreateConst( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstQ Q, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstSummands summands +) { + ConstHandle2CrossSectionSum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MT, + label, + detail::tocpp(Q), + detail::tocpp(crossSection), + detail::tocpp(summands) + ); + return handle; +} + +// Create, general +Handle2CrossSectionSum +CrossSectionSumCreate( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstQ Q, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstSummands summands +) { + ConstHandle2CrossSectionSum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MT, + label, + detail::tocpp(Q), + detail::tocpp(crossSection), + 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 +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: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionSumENDFMTHas(ConstHandle2ConstCrossSectionSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +Integer32 +CrossSectionSumENDFMTGet(ConstHandle2ConstCrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +CrossSectionSumENDFMTSet(ConstHandle2CrossSectionSum self, const Integer32 ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionSumLabelHas(ConstHandle2ConstCrossSectionSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +CrossSectionSumLabelGet(ConstHandle2ConstCrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CrossSectionSumLabelSet(ConstHandle2CrossSectionSum self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/CrossSectionSum/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSum.h b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSum.h new file mode 100644 index 000000000..872933b09 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_CROSSSECTIONSUM +#define C_INTERFACE_TEST_V2_0_TRANSPORT_CROSSSECTIONSUM + +#include "GNDStk.h" +#include "v2.0/common/Q.h" +#include "v2.0/transport/CrossSection.h" +#include "v2.0/transport/Summands.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 +extern_c Handle2CrossSectionSum +CrossSectionSumDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSectionSum +CrossSectionSumCreateConst( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstQ Q, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstSummands summands +); + +// +++ Create, general +extern_c Handle2CrossSectionSum +CrossSectionSumCreate( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstQ Q, + ConstHandle2ConstCrossSection crossSection, + 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 +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: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionSumENDFMTHas(ConstHandle2ConstCrossSectionSum self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +CrossSectionSumENDFMTGet(ConstHandle2ConstCrossSectionSum self); + +// +++ Set +extern_c void +CrossSectionSumENDFMTSet(ConstHandle2CrossSectionSum self, const Integer32 ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionSumLabelHas(ConstHandle2ConstCrossSectionSum self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CrossSectionSumLabelGet(ConstHandle2ConstCrossSectionSum self); + +// +++ Set +extern_c void +CrossSectionSumLabelSet(ConstHandle2CrossSectionSum self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/CrossSectionSum/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSum/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSum/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums.cpp new file mode 100644 index 000000000..644d2b26d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/CrossSectionSums.hpp" +#include "CrossSectionSums.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::CrossSectionSum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCrossSectionSums +CrossSectionSumsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by ENDF_MT +int +CrossSectionSumsCrossSectionSumHasByENDFMT( + ConstHandle2ConstCrossSectionSums self, + const Integer32 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 Integer32 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 Integer32 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 Integer32 ENDF_MT, + ConstHandle2ConstCrossSectionSum crossSectionSum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumSetByENDFMT", + self, extract::crossSectionSum, meta::ENDF_MT, ENDF_MT, crossSectionSum); +} + +// Has, by label +int +CrossSectionSumsCrossSectionSumHasByLabel( + ConstHandle2ConstCrossSectionSums self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumHasByLabel", + self, extract::crossSectionSum, meta::label, label); +} + +// Get, by label, const +Handle2ConstCrossSectionSum +CrossSectionSumsCrossSectionSumGetByLabelConst( + ConstHandle2ConstCrossSectionSums self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumGetByLabelConst", + self, extract::crossSectionSum, meta::label, label); +} + +// Get, by label, non-const +Handle2CrossSectionSum +CrossSectionSumsCrossSectionSumGetByLabel( + ConstHandle2CrossSectionSums self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumGetByLabel", + self, extract::crossSectionSum, meta::label, label); +} + +// Set, by label +void +CrossSectionSumsCrossSectionSumSetByLabel( + ConstHandle2CrossSectionSums self, + const XMLName label, + ConstHandle2ConstCrossSectionSum crossSectionSum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumSetByLabel", + self, extract::crossSectionSum, meta::label, label, crossSectionSum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/CrossSectionSums/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums.h b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums.h new file mode 100644 index 000000000..04bfd0f53 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TRANSPORT_CROSSSECTIONSUMS +#define C_INTERFACE_TEST_V2_0_TRANSPORT_CROSSSECTIONSUMS + +#include "GNDStk.h" +#include "v2.0/transport/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 +extern_c Handle2CrossSectionSums +CrossSectionSumsDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSectionSums +CrossSectionSumsCreateConst( + ConstHandle2CrossSectionSum *const crossSectionSum, const size_t crossSectionSumSize +); + +// +++ Create, general +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 +); + +// +++ Has, by ENDF_MT +extern_c int +CrossSectionSumsCrossSectionSumHasByENDFMT( + ConstHandle2ConstCrossSectionSums self, + const Integer32 ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstCrossSectionSum +CrossSectionSumsCrossSectionSumGetByENDFMTConst( + ConstHandle2ConstCrossSectionSums self, + const Integer32 ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2CrossSectionSum +CrossSectionSumsCrossSectionSumGetByENDFMT( + ConstHandle2CrossSectionSums self, + const Integer32 ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +CrossSectionSumsCrossSectionSumSetByENDFMT( + ConstHandle2CrossSectionSums self, + const Integer32 ENDF_MT, + ConstHandle2ConstCrossSectionSum crossSectionSum +); + +// +++ Has, by label +extern_c int +CrossSectionSumsCrossSectionSumHasByLabel( + ConstHandle2ConstCrossSectionSums self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstCrossSectionSum +CrossSectionSumsCrossSectionSumGetByLabelConst( + ConstHandle2ConstCrossSectionSums self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2CrossSectionSum +CrossSectionSumsCrossSectionSumGetByLabel( + ConstHandle2CrossSectionSums self, + const XMLName label +); + +// +++ Set, by label +extern_c void +CrossSectionSumsCrossSectionSumSetByLabel( + ConstHandle2CrossSectionSums self, + const XMLName label, + ConstHandle2ConstCrossSectionSum crossSectionSum +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/CrossSectionSums/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/CrossSectionSums/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/DiscreteGamma.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/DiscreteGamma.cpp new file mode 100644 index 000000000..eaf428cc4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/DiscreteGamma.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/DiscreteGamma.hpp" +#include "DiscreteGamma.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = DiscreteGammaClass; +using CPP = multigroup::DiscreteGamma; + +static const std::string CLASSNAME = "DiscreteGamma"; + +namespace extract { + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto axes = [](auto &obj) { return &obj.axes; }; +} + +using CPPAxes = containers::Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDiscreteGamma +DiscreteGammaDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2DiscreteGamma +DiscreteGammaDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDiscreteGamma +DiscreteGammaCreateConst( + const Float64 domainMax, + const Float64 domainMin, + const Float64 value, + ConstHandle2ConstAxes axes +) { + ConstHandle2DiscreteGamma handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + domainMax, + domainMin, + value, + detail::tocpp(axes) + ); + return handle; +} + +// Create, general +Handle2DiscreteGamma +DiscreteGammaCreate( + const Float64 domainMax, + const Float64 domainMin, + const Float64 value, + ConstHandle2ConstAxes axes +) { + ConstHandle2DiscreteGamma handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + domainMax, + domainMin, + value, + 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: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteGammaDomainMaxHas(ConstHandle2ConstDiscreteGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +Float64 +DiscreteGammaDomainMaxGet(ConstHandle2ConstDiscreteGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +DiscreteGammaDomainMaxSet(ConstHandle2DiscreteGamma self, const Float64 domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteGammaDomainMinHas(ConstHandle2ConstDiscreteGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +Float64 +DiscreteGammaDomainMinGet(ConstHandle2ConstDiscreteGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +DiscreteGammaDomainMinSet(ConstHandle2DiscreteGamma self, const Float64 domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteGammaValueHas(ConstHandle2ConstDiscreteGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +DiscreteGammaValueGet(ConstHandle2ConstDiscreteGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +DiscreteGammaValueSet(ConstHandle2DiscreteGamma self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// 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/transport/DiscreteGamma/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/DiscreteGamma.h b/standards/gnds-2.0/test/c/src/v2.0/transport/DiscreteGamma.h new file mode 100644 index 000000000..6fc041f1a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_DISCRETEGAMMA +#define C_INTERFACE_TEST_V2_0_TRANSPORT_DISCRETEGAMMA + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2DiscreteGamma +DiscreteGammaDefault(); + +// --- Create, general, const +extern_c Handle2ConstDiscreteGamma +DiscreteGammaCreateConst( + const Float64 domainMax, + const Float64 domainMin, + const Float64 value, + ConstHandle2ConstAxes axes +); + +// +++ Create, general +extern_c Handle2DiscreteGamma +DiscreteGammaCreate( + const Float64 domainMax, + const Float64 domainMin, + const Float64 value, + 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: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteGammaDomainMaxHas(ConstHandle2ConstDiscreteGamma self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +DiscreteGammaDomainMaxGet(ConstHandle2ConstDiscreteGamma self); + +// +++ Set +extern_c void +DiscreteGammaDomainMaxSet(ConstHandle2DiscreteGamma self, const Float64 domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteGammaDomainMinHas(ConstHandle2ConstDiscreteGamma self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +DiscreteGammaDomainMinGet(ConstHandle2ConstDiscreteGamma self); + +// +++ Set +extern_c void +DiscreteGammaDomainMinSet(ConstHandle2DiscreteGamma self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteGammaValueHas(ConstHandle2ConstDiscreteGamma self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +DiscreteGammaValueGet(ConstHandle2ConstDiscreteGamma self); + +// +++ Set +extern_c void +DiscreteGammaValueSet(ConstHandle2DiscreteGamma self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// 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/transport/DiscreteGamma/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/DiscreteGamma/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/DiscreteGamma/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/DiscreteGamma/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/DiscreteGamma/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution.cpp new file mode 100644 index 000000000..83f5cf8cf --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Distribution.hpp" +#include "Distribution.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = DistributionClass; +using CPP = multigroup::Distribution; + +static const std::string CLASSNAME = "Distribution"; + +namespace extract { +} + +using CPPAngularTwoBody = transport::AngularTwoBody; +using CPPUncorrelated = transport::Uncorrelated; +using CPPAngularEnergy = transport::AngularEnergy; +using CPPEnergyAngular = transport::EnergyAngular; +using CPPKalbachMann = transport::KalbachMann; +using CPPReference = transport::Reference; +using CPPBranching3d = transport::Branching3d; +using CPPCoulombPlusNuclearElastic = cpTransport::CoulombPlusNuclearElastic; +using CPPThermalNeutronScatteringLaw = tsl::ThermalNeutronScatteringLaw; +using CPPCoherentPhotonScattering = atomic::CoherentPhotonScattering; +using CPPIncoherentPhotonScattering = atomic::IncoherentPhotonScattering; +using CPPUnspecified = transport::Unspecified; +using CPPMultiGroup3d = transport::MultiGroup3d; +using CPPAngularEnergyMC = processed::AngularEnergyMC; +using CPPEnergyAngularMC = processed::EnergyAngularMC; +using CPPXYs2d = containers::XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDistribution +DistributionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Distribution +DistributionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDistribution +DistributionCreateConst( +) { + ConstHandle2Distribution handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2Distribution +DistributionCreate( +) { + ConstHandle2Distribution 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Distribution/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution.h new file mode 100644 index 000000000..bc20a49df --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution.h @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TRANSPORT_DISTRIBUTION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_DISTRIBUTION + +#include "GNDStk.h" +#include "v2.0/transport/AngularTwoBody.h" +#include "v2.0/transport/Uncorrelated.h" +#include "v2.0/transport/AngularEnergy.h" +#include "v2.0/transport/EnergyAngular.h" +#include "v2.0/transport/KalbachMann.h" +#include "v2.0/transport/Reference.h" +#include "v2.0/transport/Branching3d.h" +#include "v2.0/cpTransport/CoulombPlusNuclearElastic.h" +#include "v2.0/tsl/ThermalNeutronScatteringLaw.h" +#include "v2.0/atomic/CoherentPhotonScattering.h" +#include "v2.0/atomic/IncoherentPhotonScattering.h" +#include "v2.0/transport/Unspecified.h" +#include "v2.0/transport/MultiGroup3d.h" +#include "v2.0/processed/AngularEnergyMC.h" +#include "v2.0/processed/EnergyAngularMC.h" +#include "v2.0/containers/XYs2d.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 +extern_c Handle2Distribution +DistributionDefault(); + +// --- Create, general, const +extern_c Handle2ConstDistribution +DistributionCreateConst( +); + +// +++ Create, general +extern_c Handle2Distribution +DistributionCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Distribution/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Distribution/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection.cpp new file mode 100644 index 000000000..6ff4d8e5b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection.cpp @@ -0,0 +1,525 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/DoubleDifferentialCrossSection.hpp" +#include "DoubleDifferentialCrossSection.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = DoubleDifferentialCrossSectionClass; +using CPP = multigroup::DoubleDifferentialCrossSection; + +static const std::string CLASSNAME = "DoubleDifferentialCrossSection"; + +namespace extract { + static auto regions3d = [](auto &obj) { return &obj.regions3d; }; + static auto XYs3d = [](auto &obj) { return &obj.XYs3d; }; + static auto CoulombPlusNuclearElastic = [](auto &obj) { return &obj.CoulombPlusNuclearElastic; }; + static auto reference = [](auto &obj) { return &obj.reference; }; + 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 CPPRegions3d = containers::Regions3d; +using CPPXYs3d = containers::XYs3d; +using CPPCoulombPlusNuclearElastic = cpTransport::CoulombPlusNuclearElastic; +using CPPReference = transport::Reference; +using CPPCoherentPhotonScattering = atomic::CoherentPhotonScattering; +using CPPIncoherentPhotonScattering = atomic::IncoherentPhotonScattering; +using CPPThermalNeutronScatteringLaw_coherentElastic = tsl::ThermalNeutronScatteringLaw_coherentElastic; +using CPPThermalNeutronScatteringLaw_incoherentElastic = tsl::ThermalNeutronScatteringLaw_incoherentElastic; +using CPPThermalNeutronScatteringLaw_incoherentInelastic = tsl::ThermalNeutronScatteringLaw_incoherentInelastic; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDoubleDifferentialCrossSection +DoubleDifferentialCrossSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2DoubleDifferentialCrossSection +DoubleDifferentialCrossSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDoubleDifferentialCrossSection +DoubleDifferentialCrossSectionCreateConst( + ConstHandle2ConstRegions3d regions3d, + ConstHandle2ConstXYs3d XYs3d, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstReference reference, + 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(regions3d), + detail::tocpp(XYs3d), + detail::tocpp(CoulombPlusNuclearElastic), + detail::tocpp(reference), + detail::tocpp(coherentPhotonScattering), + detail::tocpp(incoherentPhotonScattering), + detail::tocpp(thermalNeutronScatteringLaw_coherentElastic), + detail::tocpp(thermalNeutronScatteringLaw_incoherentElastic), + detail::tocpp(thermalNeutronScatteringLaw_incoherentInelastic) + ); + return handle; +} + +// Create, general +Handle2DoubleDifferentialCrossSection +DoubleDifferentialCrossSectionCreate( + ConstHandle2ConstRegions3d regions3d, + ConstHandle2ConstXYs3d XYs3d, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstReference reference, + 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(regions3d), + detail::tocpp(XYs3d), + detail::tocpp(CoulombPlusNuclearElastic), + detail::tocpp(reference), + 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: regions3d +// ----------------------------------------------------------------------------- + +// Has +int +DoubleDifferentialCrossSectionRegions3dHas(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions3dHas", self, extract::regions3d); +} + +// Get, const +Handle2ConstRegions3d +DoubleDifferentialCrossSectionRegions3dGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions3dGetConst", self, extract::regions3d); +} + +// Get, non-const +Handle2Regions3d +DoubleDifferentialCrossSectionRegions3dGet(ConstHandle2DoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions3dGet", self, extract::regions3d); +} + +// Set +void +DoubleDifferentialCrossSectionRegions3dSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstRegions3d regions3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions3dSet", self, extract::regions3d, regions3d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs3d +// ----------------------------------------------------------------------------- + +// Has +int +DoubleDifferentialCrossSectionXYs3dHas(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs3dHas", self, extract::XYs3d); +} + +// Get, const +Handle2ConstXYs3d +DoubleDifferentialCrossSectionXYs3dGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs3dGetConst", self, extract::XYs3d); +} + +// Get, non-const +Handle2XYs3d +DoubleDifferentialCrossSectionXYs3dGet(ConstHandle2DoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs3dGet", self, extract::XYs3d); +} + +// Set +void +DoubleDifferentialCrossSectionXYs3dSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstXYs3d XYs3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs3dSet", self, extract::XYs3d, XYs3d); +} + + +// ----------------------------------------------------------------------------- +// 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: reference +// ----------------------------------------------------------------------------- + +// Has +int +DoubleDifferentialCrossSectionReferenceHas(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ReferenceHas", self, extract::reference); +} + +// Get, const +Handle2ConstReference +DoubleDifferentialCrossSectionReferenceGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReferenceGetConst", self, extract::reference); +} + +// Get, non-const +Handle2Reference +DoubleDifferentialCrossSectionReferenceGet(ConstHandle2DoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReferenceGet", self, extract::reference); +} + +// Set +void +DoubleDifferentialCrossSectionReferenceSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstReference reference) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ReferenceSet", self, extract::reference, reference); +} + + +// ----------------------------------------------------------------------------- +// 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/transport/DoubleDifferentialCrossSection/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection.h b/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection.h new file mode 100644 index 000000000..1b811b6a4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection.h @@ -0,0 +1,353 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TRANSPORT_DOUBLEDIFFERENTIALCROSSSECTION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_DOUBLEDIFFERENTIALCROSSSECTION + +#include "GNDStk.h" +#include "v2.0/containers/Regions3d.h" +#include "v2.0/containers/XYs3d.h" +#include "v2.0/cpTransport/CoulombPlusNuclearElastic.h" +#include "v2.0/transport/Reference.h" +#include "v2.0/atomic/CoherentPhotonScattering.h" +#include "v2.0/atomic/IncoherentPhotonScattering.h" +#include "v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.h" +#include "v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.h" +#include "v2.0/tsl/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 +extern_c Handle2DoubleDifferentialCrossSection +DoubleDifferentialCrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstDoubleDifferentialCrossSection +DoubleDifferentialCrossSectionCreateConst( + ConstHandle2ConstRegions3d regions3d, + ConstHandle2ConstXYs3d XYs3d, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstReference reference, + ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering, + ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering, + ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic thermalNeutronScatteringLaw_coherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic thermalNeutronScatteringLaw_incoherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic thermalNeutronScatteringLaw_incoherentInelastic +); + +// +++ Create, general +extern_c Handle2DoubleDifferentialCrossSection +DoubleDifferentialCrossSectionCreate( + ConstHandle2ConstRegions3d regions3d, + ConstHandle2ConstXYs3d XYs3d, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstReference reference, + 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: regions3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleDifferentialCrossSectionRegions3dHas(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// --- Get, const +extern_c Handle2ConstRegions3d +DoubleDifferentialCrossSectionRegions3dGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Get, non-const +extern_c Handle2Regions3d +DoubleDifferentialCrossSectionRegions3dGet(ConstHandle2DoubleDifferentialCrossSection self); + +// +++ Set +extern_c void +DoubleDifferentialCrossSectionRegions3dSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstRegions3d regions3d); + + +// ----------------------------------------------------------------------------- +// Child: XYs3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleDifferentialCrossSectionXYs3dHas(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// --- Get, const +extern_c Handle2ConstXYs3d +DoubleDifferentialCrossSectionXYs3dGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Get, non-const +extern_c Handle2XYs3d +DoubleDifferentialCrossSectionXYs3dGet(ConstHandle2DoubleDifferentialCrossSection self); + +// +++ Set +extern_c void +DoubleDifferentialCrossSectionXYs3dSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstXYs3d XYs3d); + + +// ----------------------------------------------------------------------------- +// 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: reference +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleDifferentialCrossSectionReferenceHas(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// --- Get, const +extern_c Handle2ConstReference +DoubleDifferentialCrossSectionReferenceGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Get, non-const +extern_c Handle2Reference +DoubleDifferentialCrossSectionReferenceGet(ConstHandle2DoubleDifferentialCrossSection self); + +// +++ Set +extern_c void +DoubleDifferentialCrossSectionReferenceSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstReference reference); + + +// ----------------------------------------------------------------------------- +// 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/transport/DoubleDifferentialCrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/DoubleDifferentialCrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/EnergyAngular.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/EnergyAngular.cpp new file mode 100644 index 000000000..33b99bbad --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/EnergyAngular.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/EnergyAngular.hpp" +#include "EnergyAngular.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::XYs3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergyAngular +EnergyAngularDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2EnergyAngular +EnergyAngularDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergyAngular +EnergyAngularCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstXYs3d XYs3d +) { + ConstHandle2EnergyAngular handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(XYs3d) + ); + return handle; +} + +// Create, general +Handle2EnergyAngular +EnergyAngularCreate( + const XMLName label, + const XMLName 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 +XMLName +EnergyAngularLabelGet(ConstHandle2ConstEnergyAngular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EnergyAngularLabelSet(ConstHandle2EnergyAngular self, const XMLName 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 +XMLName +EnergyAngularProductFrameGet(ConstHandle2ConstEnergyAngular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +EnergyAngularProductFrameSet(ConstHandle2EnergyAngular self, const XMLName 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/transport/EnergyAngular/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/EnergyAngular.h b/standards/gnds-2.0/test/c/src/v2.0/transport/EnergyAngular.h new file mode 100644 index 000000000..600d98fb4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_ENERGYANGULAR +#define C_INTERFACE_TEST_V2_0_TRANSPORT_ENERGYANGULAR + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2EnergyAngular +EnergyAngularDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergyAngular +EnergyAngularCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstXYs3d XYs3d +); + +// +++ Create, general +extern_c Handle2EnergyAngular +EnergyAngularCreate( + const XMLName label, + const XMLName 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 XMLName +EnergyAngularLabelGet(ConstHandle2ConstEnergyAngular self); + +// +++ Set +extern_c void +EnergyAngularLabelSet(ConstHandle2EnergyAngular self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyAngularProductFrameHas(ConstHandle2ConstEnergyAngular self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +EnergyAngularProductFrameGet(ConstHandle2ConstEnergyAngular self); + +// +++ Set +extern_c void +EnergyAngularProductFrameSet(ConstHandle2EnergyAngular self, const XMLName 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/transport/EnergyAngular/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/EnergyAngular/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/EnergyAngular/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/EnergyAngular/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/EnergyAngular/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated.cpp new file mode 100644 index 000000000..7b81403c8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated.cpp @@ -0,0 +1,611 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Energy_uncorrelated.hpp" +#include "Energy_uncorrelated.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = Energy_uncorrelatedClass; +using CPP = multigroup::Energy_uncorrelated; + +static const std::string CLASSNAME = "Energy_uncorrelated"; + +namespace extract { + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; + static auto regions2d = [](auto &obj) { return &obj.regions2d; }; + static auto generalEvaporation = [](auto &obj) { return &obj.generalEvaporation; }; + static auto discreteGamma = [](auto &obj) { return &obj.discreteGamma; }; + static auto primaryGamma = [](auto &obj) { return &obj.primaryGamma; }; + static auto NBodyPhaseSpace = [](auto &obj) { return &obj.NBodyPhaseSpace; }; + 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 Watt = [](auto &obj) { return &obj.Watt; }; + static auto MadlandNix = [](auto &obj) { return &obj.MadlandNix; }; +} + +using CPPXYs2d = containers::XYs2d; +using CPPRegions2d = containers::Regions2d; +using CPPGeneralEvaporation = transport::GeneralEvaporation; +using CPPDiscreteGamma = transport::DiscreteGamma; +using CPPPrimaryGamma = transport::PrimaryGamma; +using CPPNBodyPhaseSpace = transport::NBodyPhaseSpace; +using CPPEvaporation = transport::Evaporation; +using CPPWeightedFunctionals = transport::WeightedFunctionals; +using CPPSimpleMaxwellianFission = fissionTransport::SimpleMaxwellianFission; +using CPPWatt = fissionTransport::Watt; +using CPPMadlandNix = fissionTransport::MadlandNix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergy_uncorrelated +Energy_uncorrelatedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Energy_uncorrelated +Energy_uncorrelatedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergy_uncorrelated +Energy_uncorrelatedCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstDiscreteGamma discreteGamma, + ConstHandle2ConstPrimaryGamma primaryGamma, + ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstWeightedFunctionals weightedFunctionals, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstWatt Watt, + ConstHandle2ConstMadlandNix MadlandNix +) { + ConstHandle2Energy_uncorrelated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs2d), + detail::tocpp(regions2d), + detail::tocpp(generalEvaporation), + detail::tocpp(discreteGamma), + detail::tocpp(primaryGamma), + detail::tocpp(NBodyPhaseSpace), + detail::tocpp(evaporation), + detail::tocpp(weightedFunctionals), + detail::tocpp(simpleMaxwellianFission), + detail::tocpp(Watt), + detail::tocpp(MadlandNix) + ); + return handle; +} + +// Create, general +Handle2Energy_uncorrelated +Energy_uncorrelatedCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstDiscreteGamma discreteGamma, + ConstHandle2ConstPrimaryGamma primaryGamma, + ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstWeightedFunctionals weightedFunctionals, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstWatt Watt, + ConstHandle2ConstMadlandNix MadlandNix +) { + ConstHandle2Energy_uncorrelated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs2d), + detail::tocpp(regions2d), + detail::tocpp(generalEvaporation), + detail::tocpp(discreteGamma), + detail::tocpp(primaryGamma), + detail::tocpp(NBodyPhaseSpace), + detail::tocpp(evaporation), + detail::tocpp(weightedFunctionals), + detail::tocpp(simpleMaxwellianFission), + detail::tocpp(Watt), + 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 +Energy_uncorrelatedAssign(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstEnergy_uncorrelated from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Energy_uncorrelatedDelete(ConstHandle2ConstEnergy_uncorrelated self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Energy_uncorrelatedRead(ConstHandle2Energy_uncorrelated self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Energy_uncorrelatedWrite(ConstHandle2ConstEnergy_uncorrelated self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Energy_uncorrelatedPrint(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Energy_uncorrelatedPrintXML(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Energy_uncorrelatedPrintJSON(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedXYs2dHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +Energy_uncorrelatedXYs2dGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +Energy_uncorrelatedXYs2dGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +Energy_uncorrelatedXYs2dSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedRegions2dHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions2dHas", self, extract::regions2d); +} + +// Get, const +Handle2ConstRegions2d +Energy_uncorrelatedRegions2dGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGetConst", self, extract::regions2d); +} + +// Get, non-const +Handle2Regions2d +Energy_uncorrelatedRegions2dGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGet", self, extract::regions2d); +} + +// Set +void +Energy_uncorrelatedRegions2dSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstRegions2d regions2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions2dSet", self, extract::regions2d, regions2d); +} + + +// ----------------------------------------------------------------------------- +// Child: generalEvaporation +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedGeneralEvaporationHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GeneralEvaporationHas", self, extract::generalEvaporation); +} + +// Get, const +Handle2ConstGeneralEvaporation +Energy_uncorrelatedGeneralEvaporationGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GeneralEvaporationGetConst", self, extract::generalEvaporation); +} + +// Get, non-const +Handle2GeneralEvaporation +Energy_uncorrelatedGeneralEvaporationGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GeneralEvaporationGet", self, extract::generalEvaporation); +} + +// Set +void +Energy_uncorrelatedGeneralEvaporationSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstGeneralEvaporation generalEvaporation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GeneralEvaporationSet", self, extract::generalEvaporation, generalEvaporation); +} + + +// ----------------------------------------------------------------------------- +// Child: discreteGamma +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedDiscreteGammaHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DiscreteGammaHas", self, extract::discreteGamma); +} + +// Get, const +Handle2ConstDiscreteGamma +Energy_uncorrelatedDiscreteGammaGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DiscreteGammaGetConst", self, extract::discreteGamma); +} + +// Get, non-const +Handle2DiscreteGamma +Energy_uncorrelatedDiscreteGammaGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DiscreteGammaGet", self, extract::discreteGamma); +} + +// Set +void +Energy_uncorrelatedDiscreteGammaSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstDiscreteGamma discreteGamma) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DiscreteGammaSet", self, extract::discreteGamma, discreteGamma); +} + + +// ----------------------------------------------------------------------------- +// Child: primaryGamma +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedPrimaryGammaHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PrimaryGammaHas", self, extract::primaryGamma); +} + +// Get, const +Handle2ConstPrimaryGamma +Energy_uncorrelatedPrimaryGammaGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PrimaryGammaGetConst", self, extract::primaryGamma); +} + +// Get, non-const +Handle2PrimaryGamma +Energy_uncorrelatedPrimaryGammaGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PrimaryGammaGet", self, extract::primaryGamma); +} + +// Set +void +Energy_uncorrelatedPrimaryGammaSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstPrimaryGamma primaryGamma) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PrimaryGammaSet", self, extract::primaryGamma, primaryGamma); +} + + +// ----------------------------------------------------------------------------- +// Child: NBodyPhaseSpace +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedNBodyPhaseSpaceHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NBodyPhaseSpaceHas", self, extract::NBodyPhaseSpace); +} + +// Get, const +Handle2ConstNBodyPhaseSpace +Energy_uncorrelatedNBodyPhaseSpaceGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NBodyPhaseSpaceGetConst", self, extract::NBodyPhaseSpace); +} + +// Get, non-const +Handle2NBodyPhaseSpace +Energy_uncorrelatedNBodyPhaseSpaceGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NBodyPhaseSpaceGet", self, extract::NBodyPhaseSpace); +} + +// Set +void +Energy_uncorrelatedNBodyPhaseSpaceSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NBodyPhaseSpaceSet", self, extract::NBodyPhaseSpace, NBodyPhaseSpace); +} + + +// ----------------------------------------------------------------------------- +// Child: evaporation +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedEvaporationHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaporationHas", self, extract::evaporation); +} + +// Get, const +Handle2ConstEvaporation +Energy_uncorrelatedEvaporationGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaporationGetConst", self, extract::evaporation); +} + +// Get, non-const +Handle2Evaporation +Energy_uncorrelatedEvaporationGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaporationGet", self, extract::evaporation); +} + +// Set +void +Energy_uncorrelatedEvaporationSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstEvaporation evaporation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaporationSet", self, extract::evaporation, evaporation); +} + + +// ----------------------------------------------------------------------------- +// Child: weightedFunctionals +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedWeightedFunctionalsHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"WeightedFunctionalsHas", self, extract::weightedFunctionals); +} + +// Get, const +Handle2ConstWeightedFunctionals +Energy_uncorrelatedWeightedFunctionalsGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WeightedFunctionalsGetConst", self, extract::weightedFunctionals); +} + +// Get, non-const +Handle2WeightedFunctionals +Energy_uncorrelatedWeightedFunctionalsGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WeightedFunctionalsGet", self, extract::weightedFunctionals); +} + +// Set +void +Energy_uncorrelatedWeightedFunctionalsSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstWeightedFunctionals weightedFunctionals) +{ + detail::setField + (CLASSNAME, CLASSNAME+"WeightedFunctionalsSet", self, extract::weightedFunctionals, weightedFunctionals); +} + + +// ----------------------------------------------------------------------------- +// Child: simpleMaxwellianFission +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedSimpleMaxwellianFissionHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionHas", self, extract::simpleMaxwellianFission); +} + +// Get, const +Handle2ConstSimpleMaxwellianFission +Energy_uncorrelatedSimpleMaxwellianFissionGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionGetConst", self, extract::simpleMaxwellianFission); +} + +// Get, non-const +Handle2SimpleMaxwellianFission +Energy_uncorrelatedSimpleMaxwellianFissionGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionGet", self, extract::simpleMaxwellianFission); +} + +// Set +void +Energy_uncorrelatedSimpleMaxwellianFissionSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionSet", self, extract::simpleMaxwellianFission, simpleMaxwellianFission); +} + + +// ----------------------------------------------------------------------------- +// Child: Watt +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedWattHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"WattHas", self, extract::Watt); +} + +// Get, const +Handle2ConstWatt +Energy_uncorrelatedWattGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WattGetConst", self, extract::Watt); +} + +// Get, non-const +Handle2Watt +Energy_uncorrelatedWattGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WattGet", self, extract::Watt); +} + +// Set +void +Energy_uncorrelatedWattSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstWatt Watt) +{ + detail::setField + (CLASSNAME, CLASSNAME+"WattSet", self, extract::Watt, Watt); +} + + +// ----------------------------------------------------------------------------- +// Child: MadlandNix +// ----------------------------------------------------------------------------- + +// Has +int +Energy_uncorrelatedMadlandNixHas(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MadlandNixHas", self, extract::MadlandNix); +} + +// Get, const +Handle2ConstMadlandNix +Energy_uncorrelatedMadlandNixGetConst(ConstHandle2ConstEnergy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MadlandNixGetConst", self, extract::MadlandNix); +} + +// Get, non-const +Handle2MadlandNix +Energy_uncorrelatedMadlandNixGet(ConstHandle2Energy_uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MadlandNixGet", self, extract::MadlandNix); +} + +// Set +void +Energy_uncorrelatedMadlandNixSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstMadlandNix MadlandNix) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MadlandNixSet", self, extract::MadlandNix, MadlandNix); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Energy_uncorrelated/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated.h new file mode 100644 index 000000000..70d23ec5d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated.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. +// +// Energy_uncorrelated is the basic handle type in this file. Example: +// // Create a default Energy_uncorrelated object: +// Energy_uncorrelated handle = Energy_uncorrelatedDefault(); +// Functions involving Energy_uncorrelated are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TRANSPORT_ENERGY_UNCORRELATED +#define C_INTERFACE_TEST_V2_0_TRANSPORT_ENERGY_UNCORRELATED + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Regions2d.h" +#include "v2.0/transport/GeneralEvaporation.h" +#include "v2.0/transport/DiscreteGamma.h" +#include "v2.0/transport/PrimaryGamma.h" +#include "v2.0/transport/NBodyPhaseSpace.h" +#include "v2.0/transport/Evaporation.h" +#include "v2.0/transport/WeightedFunctionals.h" +#include "v2.0/fissionTransport/SimpleMaxwellianFission.h" +#include "v2.0/fissionTransport/Watt.h" +#include "v2.0/fissionTransport/MadlandNix.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Energy_uncorrelatedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Energy_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 Energy_uncorrelatedClass *Energy_uncorrelated; + +// --- Const-aware handles. +typedef const struct Energy_uncorrelatedClass *const ConstHandle2ConstEnergy_uncorrelated; +typedef struct Energy_uncorrelatedClass *const ConstHandle2Energy_uncorrelated; +typedef const struct Energy_uncorrelatedClass * Handle2ConstEnergy_uncorrelated; +typedef struct Energy_uncorrelatedClass * Handle2Energy_uncorrelated; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEnergy_uncorrelated +Energy_uncorrelatedDefaultConst(); + +// +++ Create, default +extern_c Handle2Energy_uncorrelated +Energy_uncorrelatedDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergy_uncorrelated +Energy_uncorrelatedCreateConst( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstDiscreteGamma discreteGamma, + ConstHandle2ConstPrimaryGamma primaryGamma, + ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstWeightedFunctionals weightedFunctionals, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstWatt Watt, + ConstHandle2ConstMadlandNix MadlandNix +); + +// +++ Create, general +extern_c Handle2Energy_uncorrelated +Energy_uncorrelatedCreate( + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstDiscreteGamma discreteGamma, + ConstHandle2ConstPrimaryGamma primaryGamma, + ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstWeightedFunctionals weightedFunctionals, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstWatt Watt, + 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 +Energy_uncorrelatedAssign(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstEnergy_uncorrelated from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Energy_uncorrelatedDelete(ConstHandle2ConstEnergy_uncorrelated self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Energy_uncorrelatedRead(ConstHandle2Energy_uncorrelated self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Energy_uncorrelatedWrite(ConstHandle2ConstEnergy_uncorrelated self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Energy_uncorrelatedPrint(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Print to standard output, as XML +extern_c int +Energy_uncorrelatedPrintXML(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Print to standard output, as JSON +extern_c int +Energy_uncorrelatedPrintJSON(ConstHandle2ConstEnergy_uncorrelated self); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedXYs2dHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstXYs2d +Energy_uncorrelatedXYs2dGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2XYs2d +Energy_uncorrelatedXYs2dGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedXYs2dSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedRegions2dHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstRegions2d +Energy_uncorrelatedRegions2dGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2Regions2d +Energy_uncorrelatedRegions2dGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedRegions2dSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstRegions2d regions2d); + + +// ----------------------------------------------------------------------------- +// Child: generalEvaporation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedGeneralEvaporationHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstGeneralEvaporation +Energy_uncorrelatedGeneralEvaporationGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2GeneralEvaporation +Energy_uncorrelatedGeneralEvaporationGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedGeneralEvaporationSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstGeneralEvaporation generalEvaporation); + + +// ----------------------------------------------------------------------------- +// Child: discreteGamma +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedDiscreteGammaHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstDiscreteGamma +Energy_uncorrelatedDiscreteGammaGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2DiscreteGamma +Energy_uncorrelatedDiscreteGammaGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedDiscreteGammaSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstDiscreteGamma discreteGamma); + + +// ----------------------------------------------------------------------------- +// Child: primaryGamma +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedPrimaryGammaHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstPrimaryGamma +Energy_uncorrelatedPrimaryGammaGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2PrimaryGamma +Energy_uncorrelatedPrimaryGammaGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedPrimaryGammaSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstPrimaryGamma primaryGamma); + + +// ----------------------------------------------------------------------------- +// Child: NBodyPhaseSpace +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedNBodyPhaseSpaceHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstNBodyPhaseSpace +Energy_uncorrelatedNBodyPhaseSpaceGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2NBodyPhaseSpace +Energy_uncorrelatedNBodyPhaseSpaceGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedNBodyPhaseSpaceSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace); + + +// ----------------------------------------------------------------------------- +// Child: evaporation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedEvaporationHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstEvaporation +Energy_uncorrelatedEvaporationGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2Evaporation +Energy_uncorrelatedEvaporationGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedEvaporationSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstEvaporation evaporation); + + +// ----------------------------------------------------------------------------- +// Child: weightedFunctionals +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedWeightedFunctionalsHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstWeightedFunctionals +Energy_uncorrelatedWeightedFunctionalsGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2WeightedFunctionals +Energy_uncorrelatedWeightedFunctionalsGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedWeightedFunctionalsSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstWeightedFunctionals weightedFunctionals); + + +// ----------------------------------------------------------------------------- +// Child: simpleMaxwellianFission +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedSimpleMaxwellianFissionHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstSimpleMaxwellianFission +Energy_uncorrelatedSimpleMaxwellianFissionGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2SimpleMaxwellianFission +Energy_uncorrelatedSimpleMaxwellianFissionGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedSimpleMaxwellianFissionSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission); + + +// ----------------------------------------------------------------------------- +// Child: Watt +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedWattHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstWatt +Energy_uncorrelatedWattGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2Watt +Energy_uncorrelatedWattGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedWattSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstWatt Watt); + + +// ----------------------------------------------------------------------------- +// Child: MadlandNix +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Energy_uncorrelatedMadlandNixHas(ConstHandle2ConstEnergy_uncorrelated self); + +// --- Get, const +extern_c Handle2ConstMadlandNix +Energy_uncorrelatedMadlandNixGetConst(ConstHandle2ConstEnergy_uncorrelated self); + +// +++ Get, non-const +extern_c Handle2MadlandNix +Energy_uncorrelatedMadlandNixGet(ConstHandle2Energy_uncorrelated self); + +// +++ Set +extern_c void +Energy_uncorrelatedMadlandNixSet(ConstHandle2Energy_uncorrelated self, ConstHandle2ConstMadlandNix MadlandNix); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Energy_uncorrelated/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Energy_uncorrelated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Evaporation.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Evaporation.cpp new file mode 100644 index 000000000..1d017c9b5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Evaporation.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Evaporation.hpp" +#include "Evaporation.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::U; +using CPPTheta = transport::Theta; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEvaporation +EvaporationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/transport/Evaporation/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Evaporation.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Evaporation.h new file mode 100644 index 000000000..fc98770f7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_EVAPORATION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_EVAPORATION + +#include "GNDStk.h" +#include "v2.0/transport/U.h" +#include "v2.0/transport/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 +extern_c Handle2Evaporation +EvaporationDefault(); + +// --- Create, general, const +extern_c Handle2ConstEvaporation +EvaporationCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +); + +// +++ Create, general +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/transport/Evaporation/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Evaporation/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Evaporation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Evaporation/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Evaporation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/F.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/F.cpp new file mode 100644 index 000000000..bcfd021b3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/F.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/F.hpp" +#include "F.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = FClass; +using CPP = multigroup::F; + +static const std::string CLASSNAME = "F"; + +namespace extract { +} + +using CPPXYs2d = containers::XYs2d; +using CPPRegions2d = containers::Regions2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstF +FDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2F +FDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstF +FCreateConst( +) { + ConstHandle2F handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2F +FCreate( +) { + ConstHandle2F 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/F/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/F.h b/standards/gnds-2.0/test/c/src/v2.0/transport/F.h new file mode 100644 index 000000000..b6b07f78b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/F.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. +// +// 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_TEST_V2_0_TRANSPORT_F +#define C_INTERFACE_TEST_V2_0_TRANSPORT_F + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Regions2d.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 +extern_c Handle2F +FDefault(); + +// --- Create, general, const +extern_c Handle2ConstF +FCreateConst( +); + +// +++ Create, general +extern_c Handle2F +FCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/F/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/F/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/F/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/F/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/F/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion.cpp new file mode 100644 index 000000000..9c71edd03 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/FastRegion.hpp" +#include "FastRegion.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = FastRegionClass; +using CPP = multigroup::FastRegion; + +static const std::string CLASSNAME = "FastRegion"; + +namespace extract { +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFastRegion +FastRegionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2FastRegion +FastRegionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFastRegion +FastRegionCreateConst( +) { + ConstHandle2FastRegion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2FastRegion +FastRegionCreate( +) { + ConstHandle2FastRegion 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/FastRegion/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion.h b/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion.h new file mode 100644 index 000000000..1f9f0787a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion.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. +// +// 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_TEST_V2_0_TRANSPORT_FASTREGION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_FASTREGION + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/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 +extern_c Handle2FastRegion +FastRegionDefault(); + +// --- Create, general, const +extern_c Handle2ConstFastRegion +FastRegionCreateConst( +); + +// +++ Create, general +extern_c Handle2FastRegion +FastRegionCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/FastRegion/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/FastRegion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Forward.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Forward.cpp new file mode 100644 index 000000000..6b5e2f254 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Forward.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Forward.hpp" +#include "Forward.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ForwardClass; +using CPP = multigroup::Forward; + +static const std::string CLASSNAME = "Forward"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstForward +ForwardDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Forward +ForwardDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstForward +ForwardCreateConst() +{ + ConstHandle2Forward handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2Forward +ForwardCreate() +{ + ConstHandle2Forward 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 +ForwardAssign(ConstHandle2Forward self, ConstHandle2ConstForward from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ForwardDelete(ConstHandle2ConstForward self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ForwardRead(ConstHandle2Forward self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ForwardWrite(ConstHandle2ConstForward self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ForwardPrint(ConstHandle2ConstForward self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ForwardPrintXML(ConstHandle2ConstForward self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ForwardPrintJSON(ConstHandle2ConstForward self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Forward/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Forward.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Forward.h new file mode 100644 index 000000000..fe06c98a2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Forward.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. +// +// Forward is the basic handle type in this file. Example: +// // Create a default Forward object: +// Forward handle = ForwardDefault(); +// Functions involving Forward are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TRANSPORT_FORWARD +#define C_INTERFACE_TEST_V2_0_TRANSPORT_FORWARD + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ForwardClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Forward +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ForwardClass *Forward; + +// --- Const-aware handles. +typedef const struct ForwardClass *const ConstHandle2ConstForward; +typedef struct ForwardClass *const ConstHandle2Forward; +typedef const struct ForwardClass * Handle2ConstForward; +typedef struct ForwardClass * Handle2Forward; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstForward +ForwardDefaultConst(); + +// +++ Create, default +extern_c Handle2Forward +ForwardDefault(); + +// --- Create, general, const +extern_c Handle2ConstForward +ForwardCreateConst(); + +// +++ Create, general +extern_c Handle2Forward +ForwardCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ForwardAssign(ConstHandle2Forward self, ConstHandle2ConstForward from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ForwardDelete(ConstHandle2ConstForward self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ForwardRead(ConstHandle2Forward self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ForwardWrite(ConstHandle2ConstForward self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ForwardPrint(ConstHandle2ConstForward self); + +// +++ Print to standard output, as XML +extern_c int +ForwardPrintXML(ConstHandle2ConstForward self); + +// +++ Print to standard output, as JSON +extern_c int +ForwardPrintJSON(ConstHandle2ConstForward self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Forward/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Forward/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Forward/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Forward/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Forward/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/G.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/G.cpp new file mode 100644 index 000000000..63aa4e17f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/G.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/G.hpp" +#include "G.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstG +GDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2G +GDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstG +GCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2G handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general +Handle2G +GCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2G 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 +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); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +GRegions1dHas(ConstHandle2ConstG self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +GRegions1dGetConst(ConstHandle2ConstG self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +GRegions1dGet(ConstHandle2G self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +GRegions1dSet(ConstHandle2G self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/G/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/G.h b/standards/gnds-2.0/test/c/src/v2.0/transport/G.h new file mode 100644 index 000000000..8f7fc9526 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/G.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. +// +// 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_TEST_V2_0_TRANSPORT_G +#define C_INTERFACE_TEST_V2_0_TRANSPORT_G + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Regions1d.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 +extern_c Handle2G +GDefault(); + +// --- Create, general, const +extern_c Handle2ConstG +GCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +extern_c Handle2G +GCreate( + 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 +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); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GRegions1dHas(ConstHandle2ConstG self); + +// --- Get, const +extern_c Handle2ConstRegions1d +GRegions1dGetConst(ConstHandle2ConstG self); + +// +++ Get, non-const +extern_c Handle2Regions1d +GRegions1dGet(ConstHandle2G self); + +// +++ Set +extern_c void +GRegions1dSet(ConstHandle2G self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/G/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/G/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/G/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/G/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/G/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/GeneralEvaporation.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/GeneralEvaporation.cpp new file mode 100644 index 000000000..fe5857172 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/GeneralEvaporation.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/GeneralEvaporation.hpp" +#include "GeneralEvaporation.h" + +using namespace njoy::GNDStk; +using namespace test::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 g = [](auto &obj) { return &obj.g; }; + static auto theta = [](auto &obj) { return &obj.theta; }; +} + +using CPPU = transport::U; +using CPPG = transport::G; +using CPPTheta = transport::Theta; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGeneralEvaporation +GeneralEvaporationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2GeneralEvaporation +GeneralEvaporationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGeneralEvaporation +GeneralEvaporationCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstG g, + ConstHandle2ConstTheta theta +) { + ConstHandle2GeneralEvaporation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(U), + detail::tocpp(g), + detail::tocpp(theta) + ); + return handle; +} + +// Create, general +Handle2GeneralEvaporation +GeneralEvaporationCreate( + ConstHandle2ConstU U, + ConstHandle2ConstG g, + ConstHandle2ConstTheta theta +) { + ConstHandle2GeneralEvaporation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(U), + detail::tocpp(g), + 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 +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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/GeneralEvaporation/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/GeneralEvaporation.h b/standards/gnds-2.0/test/c/src/v2.0/transport/GeneralEvaporation.h new file mode 100644 index 000000000..cbc527484 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_GENERALEVAPORATION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_GENERALEVAPORATION + +#include "GNDStk.h" +#include "v2.0/transport/U.h" +#include "v2.0/transport/G.h" +#include "v2.0/transport/Theta.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 +extern_c Handle2GeneralEvaporation +GeneralEvaporationDefault(); + +// --- Create, general, const +extern_c Handle2ConstGeneralEvaporation +GeneralEvaporationCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstG g, + ConstHandle2ConstTheta theta +); + +// +++ Create, general +extern_c Handle2GeneralEvaporation +GeneralEvaporationCreate( + ConstHandle2ConstU U, + ConstHandle2ConstG g, + 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 +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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/GeneralEvaporation/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/GeneralEvaporation/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/GeneralEvaporation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/GeneralEvaporation/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/GeneralEvaporation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton.cpp new file mode 100644 index 000000000..185d78651 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/IncoherentPhoton.hpp" +#include "IncoherentPhoton.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = IncoherentPhotonClass; +using CPP = multigroup::IncoherentPhoton; + +static const std::string CLASSNAME = "IncoherentPhoton"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIncoherentPhoton +IncoherentPhotonDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2IncoherentPhoton +IncoherentPhotonDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIncoherentPhoton +IncoherentPhotonCreateConst() +{ + ConstHandle2IncoherentPhoton handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2IncoherentPhoton +IncoherentPhotonCreate() +{ + ConstHandle2IncoherentPhoton 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 +IncoherentPhotonAssign(ConstHandle2IncoherentPhoton self, ConstHandle2ConstIncoherentPhoton from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IncoherentPhotonDelete(ConstHandle2ConstIncoherentPhoton self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IncoherentPhotonRead(ConstHandle2IncoherentPhoton self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IncoherentPhotonWrite(ConstHandle2ConstIncoherentPhoton self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IncoherentPhotonPrint(ConstHandle2ConstIncoherentPhoton self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IncoherentPhotonPrintXML(ConstHandle2ConstIncoherentPhoton self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IncoherentPhotonPrintJSON(ConstHandle2ConstIncoherentPhoton self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/IncoherentPhoton/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton.h b/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton.h new file mode 100644 index 000000000..d684f03ca --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton.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. +// +// IncoherentPhoton is the basic handle type in this file. Example: +// // Create a default IncoherentPhoton object: +// IncoherentPhoton handle = IncoherentPhotonDefault(); +// Functions involving IncoherentPhoton are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TRANSPORT_INCOHERENTPHOTON +#define C_INTERFACE_TEST_V2_0_TRANSPORT_INCOHERENTPHOTON + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IncoherentPhotonClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ IncoherentPhoton +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IncoherentPhotonClass *IncoherentPhoton; + +// --- Const-aware handles. +typedef const struct IncoherentPhotonClass *const ConstHandle2ConstIncoherentPhoton; +typedef struct IncoherentPhotonClass *const ConstHandle2IncoherentPhoton; +typedef const struct IncoherentPhotonClass * Handle2ConstIncoherentPhoton; +typedef struct IncoherentPhotonClass * Handle2IncoherentPhoton; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIncoherentPhoton +IncoherentPhotonDefaultConst(); + +// +++ Create, default +extern_c Handle2IncoherentPhoton +IncoherentPhotonDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncoherentPhoton +IncoherentPhotonCreateConst(); + +// +++ Create, general +extern_c Handle2IncoherentPhoton +IncoherentPhotonCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IncoherentPhotonAssign(ConstHandle2IncoherentPhoton self, ConstHandle2ConstIncoherentPhoton from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IncoherentPhotonDelete(ConstHandle2ConstIncoherentPhoton self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IncoherentPhotonRead(ConstHandle2IncoherentPhoton self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IncoherentPhotonWrite(ConstHandle2ConstIncoherentPhoton self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IncoherentPhotonPrint(ConstHandle2ConstIncoherentPhoton self); + +// +++ Print to standard output, as XML +extern_c int +IncoherentPhotonPrintXML(ConstHandle2ConstIncoherentPhoton self); + +// +++ Print to standard output, as JSON +extern_c int +IncoherentPhotonPrintJSON(ConstHandle2ConstIncoherentPhoton self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/IncoherentPhoton/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/IncoherentPhoton/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions.cpp new file mode 100644 index 000000000..a90f831cc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/IncompleteReactions.hpp" +#include "IncompleteReactions.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::Reaction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIncompleteReactions +IncompleteReactionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2IncompleteReactions +IncompleteReactionsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIncompleteReactions +IncompleteReactionsCreateConst( + ConstHandle2ConstReaction reaction +) { + ConstHandle2IncompleteReactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(reaction) + ); + return handle; +} + +// Create, general +Handle2IncompleteReactions +IncompleteReactionsCreate( + ConstHandle2ConstReaction reaction +) { + ConstHandle2IncompleteReactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(reaction) + ); + return handle; +} + +// Assign +// Use this to assign 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); +} + +// Get, const +Handle2ConstReaction +IncompleteReactionsReactionGetConst(ConstHandle2ConstIncompleteReactions self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReactionGetConst", self, extract::reaction); +} + +// Get, non-const +Handle2Reaction +IncompleteReactionsReactionGet(ConstHandle2IncompleteReactions self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReactionGet", self, extract::reaction); +} + +// Set +void +IncompleteReactionsReactionSet(ConstHandle2IncompleteReactions self, ConstHandle2ConstReaction reaction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ReactionSet", self, extract::reaction, reaction); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/IncompleteReactions/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions.h b/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions.h new file mode 100644 index 000000000..3634250f1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions.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. +// +// 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_TEST_V2_0_TRANSPORT_INCOMPLETEREACTIONS +#define C_INTERFACE_TEST_V2_0_TRANSPORT_INCOMPLETEREACTIONS + +#include "GNDStk.h" +#include "v2.0/transport/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 +extern_c Handle2IncompleteReactions +IncompleteReactionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncompleteReactions +IncompleteReactionsCreateConst( + ConstHandle2ConstReaction reaction +); + +// +++ Create, general +extern_c Handle2IncompleteReactions +IncompleteReactionsCreate( + ConstHandle2ConstReaction reaction +); + +// +++ Assign +// +++ Use this to assign one handled 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); + +// --- Get, const +extern_c Handle2ConstReaction +IncompleteReactionsReactionGetConst(ConstHandle2ConstIncompleteReactions self); + +// +++ Get, non-const +extern_c Handle2Reaction +IncompleteReactionsReactionGet(ConstHandle2IncompleteReactions self); + +// +++ Set +extern_c void +IncompleteReactionsReactionSet(ConstHandle2IncompleteReactions self, ConstHandle2ConstReaction reaction); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/IncompleteReactions/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/IncompleteReactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Isotropic2d.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Isotropic2d.cpp new file mode 100644 index 000000000..b47379b1f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Isotropic2d.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Isotropic2d.hpp" +#include "Isotropic2d.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2Isotropic2d +Isotropic2dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIsotropic2d +Isotropic2dCreateConst() +{ + ConstHandle2Isotropic2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/transport/Isotropic2d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Isotropic2d.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Isotropic2d.h new file mode 100644 index 000000000..99c49034e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_ISOTROPIC2D +#define C_INTERFACE_TEST_V2_0_TRANSPORT_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 +extern_c Handle2Isotropic2d +Isotropic2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotropic2d +Isotropic2dCreateConst(); + +// +++ Create, general +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/transport/Isotropic2d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Isotropic2d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Isotropic2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Isotropic2d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Isotropic2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann.cpp new file mode 100644 index 000000000..ccd73dd4c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/KalbachMann.hpp" +#include "KalbachMann.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; + static auto a = [](auto &obj) { return &obj.a; }; +} + +using CPPF = transport::F; +using CPPR = transport::R; +using CPPA = transport::A; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstKalbachMann +KalbachMannDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2KalbachMann +KalbachMannDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstKalbachMann +KalbachMannCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstF f, + ConstHandle2ConstR r, + ConstHandle2ConstA a +) { + ConstHandle2KalbachMann handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(f), + detail::tocpp(r), + detail::tocpp(a) + ); + return handle; +} + +// Create, general +Handle2KalbachMann +KalbachMannCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstF f, + ConstHandle2ConstR r, + ConstHandle2ConstA a +) { + ConstHandle2KalbachMann handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(f), + detail::tocpp(r), + detail::tocpp(a) + ); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +KalbachMannLabelGet(ConstHandle2ConstKalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +KalbachMannLabelSet(ConstHandle2KalbachMann self, const XMLName 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 +XMLName +KalbachMannProductFrameGet(ConstHandle2ConstKalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +KalbachMannProductFrameSet(ConstHandle2KalbachMann self, const XMLName 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); +} + + +// ----------------------------------------------------------------------------- +// Child: a +// ----------------------------------------------------------------------------- + +// Has +int +KalbachMannAHas(ConstHandle2ConstKalbachMann self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AHas", self, extract::a); +} + +// Get, const +Handle2ConstA +KalbachMannAGetConst(ConstHandle2ConstKalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AGetConst", self, extract::a); +} + +// Get, non-const +Handle2A +KalbachMannAGet(ConstHandle2KalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AGet", self, extract::a); +} + +// Set +void +KalbachMannASet(ConstHandle2KalbachMann self, ConstHandle2ConstA a) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ASet", self, extract::a, a); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/KalbachMann/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann.h b/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann.h new file mode 100644 index 000000000..cdb4f1256 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann.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. +// +// 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_TEST_V2_0_TRANSPORT_KALBACHMANN +#define C_INTERFACE_TEST_V2_0_TRANSPORT_KALBACHMANN + +#include "GNDStk.h" +#include "v2.0/transport/F.h" +#include "v2.0/transport/R.h" +#include "v2.0/transport/A.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 +extern_c Handle2KalbachMann +KalbachMannDefault(); + +// --- Create, general, const +extern_c Handle2ConstKalbachMann +KalbachMannCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstF f, + ConstHandle2ConstR r, + ConstHandle2ConstA a +); + +// +++ Create, general +extern_c Handle2KalbachMann +KalbachMannCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstF f, + ConstHandle2ConstR r, + ConstHandle2ConstA a +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +KalbachMannLabelGet(ConstHandle2ConstKalbachMann self); + +// +++ Set +extern_c void +KalbachMannLabelSet(ConstHandle2KalbachMann self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KalbachMannProductFrameHas(ConstHandle2ConstKalbachMann self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +KalbachMannProductFrameGet(ConstHandle2ConstKalbachMann self); + +// +++ Set +extern_c void +KalbachMannProductFrameSet(ConstHandle2KalbachMann self, const XMLName 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); + + +// ----------------------------------------------------------------------------- +// Child: a +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KalbachMannAHas(ConstHandle2ConstKalbachMann self); + +// --- Get, const +extern_c Handle2ConstA +KalbachMannAGetConst(ConstHandle2ConstKalbachMann self); + +// +++ Get, non-const +extern_c Handle2A +KalbachMannAGet(ConstHandle2KalbachMann self); + +// +++ Set +extern_c void +KalbachMannASet(ConstHandle2KalbachMann self, ConstHandle2ConstA a); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/KalbachMann/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/KalbachMann/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d.cpp new file mode 100644 index 000000000..cdcfb4b93 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/MultiGroup3d.hpp" +#include "MultiGroup3d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MultiGroup3dClass; +using CPP = multigroup::MultiGroup3d; + +static const std::string CLASSNAME = "MultiGroup3d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto gridded3d = [](auto &obj) { return &obj.gridded3d; }; +} + +using CPPGridded3d = containers::Gridded3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultiGroup3d +MultiGroup3dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2MultiGroup3d +MultiGroup3dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMultiGroup3d +MultiGroup3dCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstGridded3d gridded3d +) { + ConstHandle2MultiGroup3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(gridded3d) + ); + return handle; +} + +// Create, general +Handle2MultiGroup3d +MultiGroup3dCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstGridded3d gridded3d +) { + ConstHandle2MultiGroup3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(gridded3d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MultiGroup3dAssign(ConstHandle2MultiGroup3d self, ConstHandle2ConstMultiGroup3d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MultiGroup3dDelete(ConstHandle2ConstMultiGroup3d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MultiGroup3dRead(ConstHandle2MultiGroup3d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MultiGroup3dWrite(ConstHandle2ConstMultiGroup3d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MultiGroup3dPrint(ConstHandle2ConstMultiGroup3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MultiGroup3dPrintXML(ConstHandle2ConstMultiGroup3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MultiGroup3dPrintJSON(ConstHandle2ConstMultiGroup3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +MultiGroup3dLabelHas(ConstHandle2ConstMultiGroup3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +MultiGroup3dLabelGet(ConstHandle2ConstMultiGroup3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MultiGroup3dLabelSet(ConstHandle2MultiGroup3d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +MultiGroup3dProductFrameHas(ConstHandle2ConstMultiGroup3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +XMLName +MultiGroup3dProductFrameGet(ConstHandle2ConstMultiGroup3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +MultiGroup3dProductFrameSet(ConstHandle2MultiGroup3d self, const XMLName productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded3d +// ----------------------------------------------------------------------------- + +// Has +int +MultiGroup3dGridded3dHas(ConstHandle2ConstMultiGroup3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded3dHas", self, extract::gridded3d); +} + +// Get, const +Handle2ConstGridded3d +MultiGroup3dGridded3dGetConst(ConstHandle2ConstMultiGroup3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded3dGetConst", self, extract::gridded3d); +} + +// Get, non-const +Handle2Gridded3d +MultiGroup3dGridded3dGet(ConstHandle2MultiGroup3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded3dGet", self, extract::gridded3d); +} + +// Set +void +MultiGroup3dGridded3dSet(ConstHandle2MultiGroup3d self, ConstHandle2ConstGridded3d gridded3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded3dSet", self, extract::gridded3d, gridded3d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/MultiGroup3d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d.h b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d.h new file mode 100644 index 000000000..a49b5fa02 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d.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. +// +// MultiGroup3d is the basic handle type in this file. Example: +// // Create a default MultiGroup3d object: +// MultiGroup3d handle = MultiGroup3dDefault(); +// Functions involving MultiGroup3d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TRANSPORT_MULTIGROUP3D +#define C_INTERFACE_TEST_V2_0_TRANSPORT_MULTIGROUP3D + +#include "GNDStk.h" +#include "v2.0/containers/Gridded3d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MultiGroup3dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ MultiGroup3d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MultiGroup3dClass *MultiGroup3d; + +// --- Const-aware handles. +typedef const struct MultiGroup3dClass *const ConstHandle2ConstMultiGroup3d; +typedef struct MultiGroup3dClass *const ConstHandle2MultiGroup3d; +typedef const struct MultiGroup3dClass * Handle2ConstMultiGroup3d; +typedef struct MultiGroup3dClass * Handle2MultiGroup3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMultiGroup3d +MultiGroup3dDefaultConst(); + +// +++ Create, default +extern_c Handle2MultiGroup3d +MultiGroup3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiGroup3d +MultiGroup3dCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstGridded3d gridded3d +); + +// +++ Create, general +extern_c Handle2MultiGroup3d +MultiGroup3dCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstGridded3d gridded3d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MultiGroup3dAssign(ConstHandle2MultiGroup3d self, ConstHandle2ConstMultiGroup3d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MultiGroup3dDelete(ConstHandle2ConstMultiGroup3d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MultiGroup3dRead(ConstHandle2MultiGroup3d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MultiGroup3dWrite(ConstHandle2ConstMultiGroup3d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MultiGroup3dPrint(ConstHandle2ConstMultiGroup3d self); + +// +++ Print to standard output, as XML +extern_c int +MultiGroup3dPrintXML(ConstHandle2ConstMultiGroup3d self); + +// +++ Print to standard output, as JSON +extern_c int +MultiGroup3dPrintJSON(ConstHandle2ConstMultiGroup3d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiGroup3dLabelHas(ConstHandle2ConstMultiGroup3d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MultiGroup3dLabelGet(ConstHandle2ConstMultiGroup3d self); + +// +++ Set +extern_c void +MultiGroup3dLabelSet(ConstHandle2MultiGroup3d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiGroup3dProductFrameHas(ConstHandle2ConstMultiGroup3d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MultiGroup3dProductFrameGet(ConstHandle2ConstMultiGroup3d self); + +// +++ Set +extern_c void +MultiGroup3dProductFrameSet(ConstHandle2MultiGroup3d self, const XMLName productFrame); + + +// ----------------------------------------------------------------------------- +// Child: gridded3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiGroup3dGridded3dHas(ConstHandle2ConstMultiGroup3d self); + +// --- Get, const +extern_c Handle2ConstGridded3d +MultiGroup3dGridded3dGetConst(ConstHandle2ConstMultiGroup3d self); + +// +++ Get, non-const +extern_c Handle2Gridded3d +MultiGroup3dGridded3dGet(ConstHandle2MultiGroup3d self); + +// +++ Set +extern_c void +MultiGroup3dGridded3dSet(ConstHandle2MultiGroup3d self, ConstHandle2ConstGridded3d gridded3d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/MultiGroup3d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiGroup3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity.cpp new file mode 100644 index 000000000..3c57c20e8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity.cpp @@ -0,0 +1,145 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Multiplicity.hpp" +#include "Multiplicity.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MultiplicityClass; +using CPP = multigroup::Multiplicity; + +static const std::string CLASSNAME = "Multiplicity"; + +namespace extract { +} + +using CPPXYs1d = containers::XYs1d; +using CPPConstant1d = containers::Constant1d; +using CPPPolynomial1d = containers::Polynomial1d; +using CPPBranching1d = transport::Branching1d; +using CPPReference = transport::Reference; +using CPPGridded1d = containers::Gridded1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultiplicity +MultiplicityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Multiplicity +MultiplicityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMultiplicity +MultiplicityCreateConst( +) { + ConstHandle2Multiplicity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2Multiplicity +MultiplicityCreate( +) { + ConstHandle2Multiplicity 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Multiplicity/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity.h new file mode 100644 index 000000000..adc646c1f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity.h @@ -0,0 +1,144 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TRANSPORT_MULTIPLICITY +#define C_INTERFACE_TEST_V2_0_TRANSPORT_MULTIPLICITY + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/Constant1d.h" +#include "v2.0/containers/Polynomial1d.h" +#include "v2.0/transport/Branching1d.h" +#include "v2.0/transport/Reference.h" +#include "v2.0/containers/Gridded1d.h" +#include "v2.0/containers/Regions1d.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 +extern_c Handle2Multiplicity +MultiplicityDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiplicity +MultiplicityCreateConst( +); + +// +++ Create, general +extern_c Handle2Multiplicity +MultiplicityCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Multiplicity/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Multiplicity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySum.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySum.cpp new file mode 100644 index 000000000..fb1c8dc8a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySum.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/MultiplicitySum.hpp" +#include "MultiplicitySum.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MultiplicitySumClass; +using CPP = multigroup::MultiplicitySum; + +static const std::string CLASSNAME = "MultiplicitySum"; + +namespace extract { + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto multiplicity = [](auto &obj) { return &obj.multiplicity; }; + static auto summands = [](auto &obj) { return &obj.summands; }; +} + +using CPPMultiplicity = transport::Multiplicity; +using CPPSummands = transport::Summands; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultiplicitySum +MultiplicitySumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2MultiplicitySum +MultiplicitySumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMultiplicitySum +MultiplicitySumCreateConst( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstSummands summands +) { + ConstHandle2MultiplicitySum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MT, + label, + detail::tocpp(multiplicity), + detail::tocpp(summands) + ); + return handle; +} + +// Create, general +Handle2MultiplicitySum +MultiplicitySumCreate( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstSummands summands +) { + ConstHandle2MultiplicitySum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MT, + label, + 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: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicitySumENDFMTHas(ConstHandle2ConstMultiplicitySum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +Integer32 +MultiplicitySumENDFMTGet(ConstHandle2ConstMultiplicitySum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +MultiplicitySumENDFMTSet(ConstHandle2MultiplicitySum self, const Integer32 ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicitySumLabelHas(ConstHandle2ConstMultiplicitySum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +MultiplicitySumLabelGet(ConstHandle2ConstMultiplicitySum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MultiplicitySumLabelSet(ConstHandle2MultiplicitySum self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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/transport/MultiplicitySum/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySum.h b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySum.h new file mode 100644 index 000000000..15c7522d9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_MULTIPLICITYSUM +#define C_INTERFACE_TEST_V2_0_TRANSPORT_MULTIPLICITYSUM + +#include "GNDStk.h" +#include "v2.0/transport/Multiplicity.h" +#include "v2.0/transport/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 +extern_c Handle2MultiplicitySum +MultiplicitySumDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiplicitySum +MultiplicitySumCreateConst( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstSummands summands +); + +// +++ Create, general +extern_c Handle2MultiplicitySum +MultiplicitySumCreate( + const Integer32 ENDF_MT, + const XMLName label, + 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: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicitySumENDFMTHas(ConstHandle2ConstMultiplicitySum self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +MultiplicitySumENDFMTGet(ConstHandle2ConstMultiplicitySum self); + +// +++ Set +extern_c void +MultiplicitySumENDFMTSet(ConstHandle2MultiplicitySum self, const Integer32 ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicitySumLabelHas(ConstHandle2ConstMultiplicitySum self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MultiplicitySumLabelGet(ConstHandle2ConstMultiplicitySum self); + +// +++ Set +extern_c void +MultiplicitySumLabelSet(ConstHandle2MultiplicitySum self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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/transport/MultiplicitySum/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySum/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySum/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums.cpp new file mode 100644 index 000000000..c63df43ac --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/MultiplicitySums.hpp" +#include "MultiplicitySums.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::MultiplicitySum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultiplicitySums +MultiplicitySumsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by ENDF_MT +int +MultiplicitySumsMultiplicitySumHasByENDFMT( + ConstHandle2ConstMultiplicitySums self, + const Integer32 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 Integer32 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 Integer32 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 Integer32 ENDF_MT, + ConstHandle2ConstMultiplicitySum multiplicitySum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumSetByENDFMT", + self, extract::multiplicitySum, meta::ENDF_MT, ENDF_MT, multiplicitySum); +} + +// Has, by label +int +MultiplicitySumsMultiplicitySumHasByLabel( + ConstHandle2ConstMultiplicitySums self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumHasByLabel", + self, extract::multiplicitySum, meta::label, label); +} + +// Get, by label, const +Handle2ConstMultiplicitySum +MultiplicitySumsMultiplicitySumGetByLabelConst( + ConstHandle2ConstMultiplicitySums self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumGetByLabelConst", + self, extract::multiplicitySum, meta::label, label); +} + +// Get, by label, non-const +Handle2MultiplicitySum +MultiplicitySumsMultiplicitySumGetByLabel( + ConstHandle2MultiplicitySums self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumGetByLabel", + self, extract::multiplicitySum, meta::label, label); +} + +// Set, by label +void +MultiplicitySumsMultiplicitySumSetByLabel( + ConstHandle2MultiplicitySums self, + const XMLName label, + ConstHandle2ConstMultiplicitySum multiplicitySum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumSetByLabel", + self, extract::multiplicitySum, meta::label, label, multiplicitySum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/MultiplicitySums/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums.h b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums.h new file mode 100644 index 000000000..e129269bb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TRANSPORT_MULTIPLICITYSUMS +#define C_INTERFACE_TEST_V2_0_TRANSPORT_MULTIPLICITYSUMS + +#include "GNDStk.h" +#include "v2.0/transport/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 +extern_c Handle2MultiplicitySums +MultiplicitySumsDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiplicitySums +MultiplicitySumsCreateConst( + ConstHandle2MultiplicitySum *const multiplicitySum, const size_t multiplicitySumSize +); + +// +++ Create, general +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 +); + +// +++ Has, by ENDF_MT +extern_c int +MultiplicitySumsMultiplicitySumHasByENDFMT( + ConstHandle2ConstMultiplicitySums self, + const Integer32 ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstMultiplicitySum +MultiplicitySumsMultiplicitySumGetByENDFMTConst( + ConstHandle2ConstMultiplicitySums self, + const Integer32 ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2MultiplicitySum +MultiplicitySumsMultiplicitySumGetByENDFMT( + ConstHandle2MultiplicitySums self, + const Integer32 ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +MultiplicitySumsMultiplicitySumSetByENDFMT( + ConstHandle2MultiplicitySums self, + const Integer32 ENDF_MT, + ConstHandle2ConstMultiplicitySum multiplicitySum +); + +// +++ Has, by label +extern_c int +MultiplicitySumsMultiplicitySumHasByLabel( + ConstHandle2ConstMultiplicitySums self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstMultiplicitySum +MultiplicitySumsMultiplicitySumGetByLabelConst( + ConstHandle2ConstMultiplicitySums self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2MultiplicitySum +MultiplicitySumsMultiplicitySumGetByLabel( + ConstHandle2MultiplicitySums self, + const XMLName label +); + +// +++ Set, by label +extern_c void +MultiplicitySumsMultiplicitySumSetByLabel( + ConstHandle2MultiplicitySums self, + const XMLName label, + ConstHandle2ConstMultiplicitySum multiplicitySum +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/MultiplicitySums/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/MultiplicitySums/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/NBodyPhaseSpace.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/NBodyPhaseSpace.cpp new file mode 100644 index 000000000..ef7e958c1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/NBodyPhaseSpace.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/NBodyPhaseSpace.hpp" +#include "NBodyPhaseSpace.h" + +using namespace njoy::GNDStk; +using namespace test::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 = tsl::Mass; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNBodyPhaseSpace +NBodyPhaseSpaceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2NBodyPhaseSpace +NBodyPhaseSpaceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNBodyPhaseSpace +NBodyPhaseSpaceCreateConst( + const Integer32 numberOfProducts, + ConstHandle2ConstMass mass +) { + ConstHandle2NBodyPhaseSpace handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + numberOfProducts, + detail::tocpp(mass) + ); + return handle; +} + +// Create, general +Handle2NBodyPhaseSpace +NBodyPhaseSpaceCreate( + const Integer32 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 +Integer32 +NBodyPhaseSpaceNumberOfProductsGet(ConstHandle2ConstNBodyPhaseSpace self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NumberOfProductsGet", self, extract::numberOfProducts); +} + +// Set +void +NBodyPhaseSpaceNumberOfProductsSet(ConstHandle2NBodyPhaseSpace self, const Integer32 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/transport/NBodyPhaseSpace/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/NBodyPhaseSpace.h b/standards/gnds-2.0/test/c/src/v2.0/transport/NBodyPhaseSpace.h new file mode 100644 index 000000000..aba31e3a7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_NBODYPHASESPACE +#define C_INTERFACE_TEST_V2_0_TRANSPORT_NBODYPHASESPACE + +#include "GNDStk.h" +#include "v2.0/tsl/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 +extern_c Handle2NBodyPhaseSpace +NBodyPhaseSpaceDefault(); + +// --- Create, general, const +extern_c Handle2ConstNBodyPhaseSpace +NBodyPhaseSpaceCreateConst( + const Integer32 numberOfProducts, + ConstHandle2ConstMass mass +); + +// +++ Create, general +extern_c Handle2NBodyPhaseSpace +NBodyPhaseSpaceCreate( + const Integer32 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 Integer32 +NBodyPhaseSpaceNumberOfProductsGet(ConstHandle2ConstNBodyPhaseSpace self); + +// +++ Set +extern_c void +NBodyPhaseSpaceNumberOfProductsSet(ConstHandle2NBodyPhaseSpace self, const Integer32 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/transport/NBodyPhaseSpace/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/NBodyPhaseSpace/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/NBodyPhaseSpace/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/NBodyPhaseSpace/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/NBodyPhaseSpace/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProduct.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProduct.cpp new file mode 100644 index 000000000..46a76ee16 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProduct.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/OrphanProduct.hpp" +#include "OrphanProduct.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = OrphanProductClass; +using CPP = multigroup::OrphanProduct; + +static const std::string CLASSNAME = "OrphanProduct"; + +namespace extract { + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; + static auto outputChannel = [](auto &obj) { return &obj.outputChannel; }; +} + +using CPPCrossSection = transport::CrossSection; +using CPPOutputChannel = transport::OutputChannel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstOrphanProduct +OrphanProductDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2OrphanProduct +OrphanProductDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstOrphanProduct +OrphanProductCreateConst( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2OrphanProduct handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MT, + label, + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Create, general +Handle2OrphanProduct +OrphanProductCreate( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2OrphanProduct handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MT, + label, + 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: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +OrphanProductENDFMTHas(ConstHandle2ConstOrphanProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +Integer32 +OrphanProductENDFMTGet(ConstHandle2ConstOrphanProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +OrphanProductENDFMTSet(ConstHandle2OrphanProduct self, const Integer32 ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +OrphanProductLabelHas(ConstHandle2ConstOrphanProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +OrphanProductLabelGet(ConstHandle2ConstOrphanProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +OrphanProductLabelSet(ConstHandle2OrphanProduct self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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/transport/OrphanProduct/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProduct.h b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProduct.h new file mode 100644 index 000000000..165eff141 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_ORPHANPRODUCT +#define C_INTERFACE_TEST_V2_0_TRANSPORT_ORPHANPRODUCT + +#include "GNDStk.h" +#include "v2.0/transport/CrossSection.h" +#include "v2.0/transport/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 +extern_c Handle2OrphanProduct +OrphanProductDefault(); + +// --- Create, general, const +extern_c Handle2ConstOrphanProduct +OrphanProductCreateConst( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Create, general +extern_c Handle2OrphanProduct +OrphanProductCreate( + const Integer32 ENDF_MT, + const XMLName label, + 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: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OrphanProductENDFMTHas(ConstHandle2ConstOrphanProduct self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +OrphanProductENDFMTGet(ConstHandle2ConstOrphanProduct self); + +// +++ Set +extern_c void +OrphanProductENDFMTSet(ConstHandle2OrphanProduct self, const Integer32 ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OrphanProductLabelHas(ConstHandle2ConstOrphanProduct self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +OrphanProductLabelGet(ConstHandle2ConstOrphanProduct self); + +// +++ Set +extern_c void +OrphanProductLabelSet(ConstHandle2OrphanProduct self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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/transport/OrphanProduct/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProduct/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProduct/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProduct/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProduct/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts.cpp new file mode 100644 index 000000000..3560038b0 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/OrphanProducts.hpp" +#include "OrphanProducts.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::OrphanProduct; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstOrphanProducts +OrphanProductsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by ENDF_MT +int +OrphanProductsOrphanProductHasByENDFMT( + ConstHandle2ConstOrphanProducts self, + const Integer32 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 Integer32 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 Integer32 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 Integer32 ENDF_MT, + ConstHandle2ConstOrphanProduct orphanProduct +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductSetByENDFMT", + self, extract::orphanProduct, meta::ENDF_MT, ENDF_MT, orphanProduct); +} + +// Has, by label +int +OrphanProductsOrphanProductHasByLabel( + ConstHandle2ConstOrphanProducts self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductHasByLabel", + self, extract::orphanProduct, meta::label, label); +} + +// Get, by label, const +Handle2ConstOrphanProduct +OrphanProductsOrphanProductGetByLabelConst( + ConstHandle2ConstOrphanProducts self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductGetByLabelConst", + self, extract::orphanProduct, meta::label, label); +} + +// Get, by label, non-const +Handle2OrphanProduct +OrphanProductsOrphanProductGetByLabel( + ConstHandle2OrphanProducts self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductGetByLabel", + self, extract::orphanProduct, meta::label, label); +} + +// Set, by label +void +OrphanProductsOrphanProductSetByLabel( + ConstHandle2OrphanProducts self, + const XMLName label, + ConstHandle2ConstOrphanProduct orphanProduct +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductSetByLabel", + self, extract::orphanProduct, meta::label, label, orphanProduct); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/OrphanProducts/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts.h b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts.h new file mode 100644 index 000000000..5cb0b9eab --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TRANSPORT_ORPHANPRODUCTS +#define C_INTERFACE_TEST_V2_0_TRANSPORT_ORPHANPRODUCTS + +#include "GNDStk.h" +#include "v2.0/transport/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 +extern_c Handle2OrphanProducts +OrphanProductsDefault(); + +// --- Create, general, const +extern_c Handle2ConstOrphanProducts +OrphanProductsCreateConst( + ConstHandle2OrphanProduct *const orphanProduct, const size_t orphanProductSize +); + +// +++ Create, general +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 +); + +// +++ Has, by ENDF_MT +extern_c int +OrphanProductsOrphanProductHasByENDFMT( + ConstHandle2ConstOrphanProducts self, + const Integer32 ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstOrphanProduct +OrphanProductsOrphanProductGetByENDFMTConst( + ConstHandle2ConstOrphanProducts self, + const Integer32 ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2OrphanProduct +OrphanProductsOrphanProductGetByENDFMT( + ConstHandle2OrphanProducts self, + const Integer32 ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +OrphanProductsOrphanProductSetByENDFMT( + ConstHandle2OrphanProducts self, + const Integer32 ENDF_MT, + ConstHandle2ConstOrphanProduct orphanProduct +); + +// +++ Has, by label +extern_c int +OrphanProductsOrphanProductHasByLabel( + ConstHandle2ConstOrphanProducts self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstOrphanProduct +OrphanProductsOrphanProductGetByLabelConst( + ConstHandle2ConstOrphanProducts self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2OrphanProduct +OrphanProductsOrphanProductGetByLabel( + ConstHandle2OrphanProducts self, + const XMLName label +); + +// +++ Set, by label +extern_c void +OrphanProductsOrphanProductSetByLabel( + ConstHandle2OrphanProducts self, + const XMLName label, + ConstHandle2ConstOrphanProduct orphanProduct +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/OrphanProducts/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/OrphanProducts/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OutputChannel.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/OutputChannel.cpp new file mode 100644 index 000000000..339a583b1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/OutputChannel.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/OutputChannel.hpp" +#include "OutputChannel.h" + +using namespace njoy::GNDStk; +using namespace test::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 = common::Q; +using CPPProducts = common::Products; +using CPPFissionFragmentData = fissionFragmentData::FissionFragmentData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstOutputChannel +OutputChannelDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2OutputChannel +OutputChannelDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstOutputChannel +OutputChannelCreateConst( + const XMLName genre, + const XMLName 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 +Handle2OutputChannel +OutputChannelCreate( + const XMLName genre, + const XMLName 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 +XMLName +OutputChannelGenreGet(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GenreGet", self, extract::genre); +} + +// Set +void +OutputChannelGenreSet(ConstHandle2OutputChannel self, const XMLName 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 +XMLName +OutputChannelProcessGet(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProcessGet", self, extract::process); +} + +// Set +void +OutputChannelProcessSet(ConstHandle2OutputChannel self, const XMLName 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/transport/OutputChannel/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OutputChannel.h b/standards/gnds-2.0/test/c/src/v2.0/transport/OutputChannel.h new file mode 100644 index 000000000..7cd3a796d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_OUTPUTCHANNEL +#define C_INTERFACE_TEST_V2_0_TRANSPORT_OUTPUTCHANNEL + +#include "GNDStk.h" +#include "v2.0/common/Q.h" +#include "v2.0/common/Products.h" +#include "v2.0/fissionFragmentData/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 +extern_c Handle2OutputChannel +OutputChannelDefault(); + +// --- Create, general, const +extern_c Handle2ConstOutputChannel +OutputChannelCreateConst( + const XMLName genre, + const XMLName process, + ConstHandle2ConstQ Q, + ConstHandle2ConstProducts products, + ConstHandle2ConstFissionFragmentData fissionFragmentData +); + +// +++ Create, general +extern_c Handle2OutputChannel +OutputChannelCreate( + const XMLName genre, + const XMLName 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 XMLName +OutputChannelGenreGet(ConstHandle2ConstOutputChannel self); + +// +++ Set +extern_c void +OutputChannelGenreSet(ConstHandle2OutputChannel self, const XMLName genre); + + +// ----------------------------------------------------------------------------- +// Metadatum: process +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelProcessHas(ConstHandle2ConstOutputChannel self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +OutputChannelProcessGet(ConstHandle2ConstOutputChannel self); + +// +++ Set +extern_c void +OutputChannelProcessSet(ConstHandle2OutputChannel self, const XMLName 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/transport/OutputChannel/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OutputChannel/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/OutputChannel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/OutputChannel/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/OutputChannel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/PhotonEmissionProbabilities.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/PhotonEmissionProbabilities.cpp new file mode 100644 index 000000000..5e60a952a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/PhotonEmissionProbabilities.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/PhotonEmissionProbabilities.hpp" +#include "PhotonEmissionProbabilities.h" + +using namespace njoy::GNDStk; +using namespace test::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 = pops::Shell; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/transport/PhotonEmissionProbabilities/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/PhotonEmissionProbabilities.h b/standards/gnds-2.0/test/c/src/v2.0/transport/PhotonEmissionProbabilities.h new file mode 100644 index 000000000..c7e70d9c1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_PHOTONEMISSIONPROBABILITIES +#define C_INTERFACE_TEST_V2_0_TRANSPORT_PHOTONEMISSIONPROBABILITIES + +#include "GNDStk.h" +#include "v2.0/pops/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 +extern_c Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreateConst( + ConstHandle2ConstShell shell +); + +// +++ Create, general +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/transport/PhotonEmissionProbabilities/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/PhotonEmissionProbabilities/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/PhotonEmissionProbabilities/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/PhotonEmissionProbabilities/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/PhotonEmissionProbabilities/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma.cpp new file mode 100644 index 000000000..b14632d44 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/PrimaryGamma.hpp" +#include "PrimaryGamma.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = PrimaryGammaClass; +using CPP = multigroup::PrimaryGamma; + +static const std::string CLASSNAME = "PrimaryGamma"; + +namespace extract { + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto finalState = [](auto &obj) { return &obj.finalState; }; + static auto axes = [](auto &obj) { return &obj.axes; }; +} + +using CPPAxes = containers::Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPrimaryGamma +PrimaryGammaDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2PrimaryGamma +PrimaryGammaDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPrimaryGamma +PrimaryGammaCreateConst( + const Float64 domainMax, + const Float64 domainMin, + const Float64 value, + const XMLName finalState, + ConstHandle2ConstAxes axes +) { + ConstHandle2PrimaryGamma handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + domainMax, + domainMin, + value, + finalState, + detail::tocpp(axes) + ); + return handle; +} + +// Create, general +Handle2PrimaryGamma +PrimaryGammaCreate( + const Float64 domainMax, + const Float64 domainMin, + const Float64 value, + const XMLName finalState, + ConstHandle2ConstAxes axes +) { + ConstHandle2PrimaryGamma handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + domainMax, + domainMin, + value, + finalState, + 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: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +PrimaryGammaDomainMaxHas(ConstHandle2ConstPrimaryGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +Float64 +PrimaryGammaDomainMaxGet(ConstHandle2ConstPrimaryGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +PrimaryGammaDomainMaxSet(ConstHandle2PrimaryGamma self, const Float64 domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +PrimaryGammaDomainMinHas(ConstHandle2ConstPrimaryGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +Float64 +PrimaryGammaDomainMinGet(ConstHandle2ConstPrimaryGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +PrimaryGammaDomainMinSet(ConstHandle2PrimaryGamma self, const Float64 domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +PrimaryGammaValueHas(ConstHandle2ConstPrimaryGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +PrimaryGammaValueGet(ConstHandle2ConstPrimaryGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +PrimaryGammaValueSet(ConstHandle2PrimaryGamma self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: finalState +// ----------------------------------------------------------------------------- + +// Has +int +PrimaryGammaFinalStateHas(ConstHandle2ConstPrimaryGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FinalStateHas", self, extract::finalState); +} + +// Get +// Returns by value +XMLName +PrimaryGammaFinalStateGet(ConstHandle2ConstPrimaryGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FinalStateGet", self, extract::finalState); +} + +// Set +void +PrimaryGammaFinalStateSet(ConstHandle2PrimaryGamma self, const XMLName finalState) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FinalStateSet", self, extract::finalState, finalState); +} + + +// ----------------------------------------------------------------------------- +// 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/transport/PrimaryGamma/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma.h b/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma.h new file mode 100644 index 000000000..390ffeb5c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma.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. +// +// 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_TEST_V2_0_TRANSPORT_PRIMARYGAMMA +#define C_INTERFACE_TEST_V2_0_TRANSPORT_PRIMARYGAMMA + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2PrimaryGamma +PrimaryGammaDefault(); + +// --- Create, general, const +extern_c Handle2ConstPrimaryGamma +PrimaryGammaCreateConst( + const Float64 domainMax, + const Float64 domainMin, + const Float64 value, + const XMLName finalState, + ConstHandle2ConstAxes axes +); + +// +++ Create, general +extern_c Handle2PrimaryGamma +PrimaryGammaCreate( + const Float64 domainMax, + const Float64 domainMin, + const Float64 value, + const XMLName finalState, + 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: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PrimaryGammaDomainMaxHas(ConstHandle2ConstPrimaryGamma self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +PrimaryGammaDomainMaxGet(ConstHandle2ConstPrimaryGamma self); + +// +++ Set +extern_c void +PrimaryGammaDomainMaxSet(ConstHandle2PrimaryGamma self, const Float64 domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PrimaryGammaDomainMinHas(ConstHandle2ConstPrimaryGamma self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +PrimaryGammaDomainMinGet(ConstHandle2ConstPrimaryGamma self); + +// +++ Set +extern_c void +PrimaryGammaDomainMinSet(ConstHandle2PrimaryGamma self, const Float64 domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PrimaryGammaValueHas(ConstHandle2ConstPrimaryGamma self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +PrimaryGammaValueGet(ConstHandle2ConstPrimaryGamma self); + +// +++ Set +extern_c void +PrimaryGammaValueSet(ConstHandle2PrimaryGamma self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Metadatum: finalState +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PrimaryGammaFinalStateHas(ConstHandle2ConstPrimaryGamma self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +PrimaryGammaFinalStateGet(ConstHandle2ConstPrimaryGamma self); + +// +++ Set +extern_c void +PrimaryGammaFinalStateSet(ConstHandle2PrimaryGamma self, const XMLName finalState); + + +// ----------------------------------------------------------------------------- +// 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/transport/PrimaryGamma/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/PrimaryGamma/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Production.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Production.cpp new file mode 100644 index 000000000..66f1f8fad --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Production.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Production.hpp" +#include "Production.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ProductionClass; +using CPP = multigroup::Production; + +static const std::string CLASSNAME = "Production"; + +namespace extract { + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; + static auto outputChannel = [](auto &obj) { return &obj.outputChannel; }; +} + +using CPPCrossSection = transport::CrossSection; +using CPPOutputChannel = transport::OutputChannel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProduction +ProductionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Production +ProductionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProduction +ProductionCreateConst( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2Production handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MT, + label, + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Create, general +Handle2Production +ProductionCreate( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2Production handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MT, + label, + 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: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +ProductionENDFMTHas(ConstHandle2ConstProduction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +Integer32 +ProductionENDFMTGet(ConstHandle2ConstProduction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +ProductionENDFMTSet(ConstHandle2Production self, const Integer32 ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ProductionLabelHas(ConstHandle2ConstProduction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ProductionLabelGet(ConstHandle2ConstProduction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ProductionLabelSet(ConstHandle2Production self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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/transport/Production/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Production.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Production.h new file mode 100644 index 000000000..ebe0c684b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_PRODUCTION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_PRODUCTION + +#include "GNDStk.h" +#include "v2.0/transport/CrossSection.h" +#include "v2.0/transport/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 +extern_c Handle2Production +ProductionDefault(); + +// --- Create, general, const +extern_c Handle2ConstProduction +ProductionCreateConst( + const Integer32 ENDF_MT, + const XMLName label, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Create, general +extern_c Handle2Production +ProductionCreate( + const Integer32 ENDF_MT, + const XMLName label, + 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: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductionENDFMTHas(ConstHandle2ConstProduction self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ProductionENDFMTGet(ConstHandle2ConstProduction self); + +// +++ Set +extern_c void +ProductionENDFMTSet(ConstHandle2Production self, const Integer32 ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductionLabelHas(ConstHandle2ConstProduction self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ProductionLabelGet(ConstHandle2ConstProduction self); + +// +++ Set +extern_c void +ProductionLabelSet(ConstHandle2Production self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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/transport/Production/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Production/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Production/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Production/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Production/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Productions.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Productions.cpp new file mode 100644 index 000000000..f02025f2f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Productions.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Productions.hpp" +#include "Productions.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::Production; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProductions +ProductionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Productions +ProductionsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProductions +ProductionsCreateConst( + ConstHandle2ConstProduction production +) { + ConstHandle2Productions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(production) + ); + return handle; +} + +// Create, general +Handle2Productions +ProductionsCreate( + ConstHandle2ConstProduction production +) { + ConstHandle2Productions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(production) + ); + return handle; +} + +// Assign +// Use this to assign 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); +} + +// Get, const +Handle2ConstProduction +ProductionsProductionGetConst(ConstHandle2ConstProductions self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductionGetConst", self, extract::production); +} + +// Get, non-const +Handle2Production +ProductionsProductionGet(ConstHandle2Productions self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductionGet", self, extract::production); +} + +// Set +void +ProductionsProductionSet(ConstHandle2Productions self, ConstHandle2ConstProduction production) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductionSet", self, extract::production, production); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Productions/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Productions.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Productions.h new file mode 100644 index 000000000..79ad25b6c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Productions.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. +// +// 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_TEST_V2_0_TRANSPORT_PRODUCTIONS +#define C_INTERFACE_TEST_V2_0_TRANSPORT_PRODUCTIONS + +#include "GNDStk.h" +#include "v2.0/transport/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 +extern_c Handle2Productions +ProductionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProductions +ProductionsCreateConst( + ConstHandle2ConstProduction production +); + +// +++ Create, general +extern_c Handle2Productions +ProductionsCreate( + ConstHandle2ConstProduction production +); + +// +++ Assign +// +++ Use this to assign one handled 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); + +// --- Get, const +extern_c Handle2ConstProduction +ProductionsProductionGetConst(ConstHandle2ConstProductions self); + +// +++ Get, non-const +extern_c Handle2Production +ProductionsProductionGet(ConstHandle2Productions self); + +// +++ Set +extern_c void +ProductionsProductionSet(ConstHandle2Productions self, ConstHandle2ConstProduction production); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Productions/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Productions/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Productions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Productions/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Productions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/R.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/R.cpp new file mode 100644 index 000000000..5fec2959c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/R.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/R.hpp" +#include "R.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = RClass; +using CPP = multigroup::R; + +static const std::string CLASSNAME = "R"; + +namespace extract { +} + +using CPPXYs2d = containers::XYs2d; +using CPPRegions2d = containers::Regions2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstR +RDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2R +RDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstR +RCreateConst( +) { + ConstHandle2R handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2R +RCreate( +) { + ConstHandle2R 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/R/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/R.h b/standards/gnds-2.0/test/c/src/v2.0/transport/R.h new file mode 100644 index 000000000..072397e33 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/R.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. +// +// 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_TEST_V2_0_TRANSPORT_R +#define C_INTERFACE_TEST_V2_0_TRANSPORT_R + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Regions2d.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 +extern_c Handle2R +RDefault(); + +// --- Create, general, const +extern_c Handle2ConstR +RCreateConst( +); + +// +++ Create, general +extern_c Handle2R +RCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/R/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/R/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/R/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/R/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/R/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reaction.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Reaction.cpp new file mode 100644 index 000000000..d99d86cb1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Reaction.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Reaction.hpp" +#include "Reaction.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +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 doubleDifferentialCrossSection = [](auto &obj) { return &obj.doubleDifferentialCrossSection; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; + static auto outputChannel = [](auto &obj) { return &obj.outputChannel; }; +} + +using CPPDoubleDifferentialCrossSection = transport::DoubleDifferentialCrossSection; +using CPPCrossSection = transport::CrossSection; +using CPPOutputChannel = transport::OutputChannel; + + +// ----------------------------------------------------------------------------- +// 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 Integer32 ENDF_MT, + const XMLName fissionGenre, + const XMLName label, + ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2Reaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MT, + fissionGenre, + label, + detail::tocpp(doubleDifferentialCrossSection), + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Create, general +Handle2Reaction +ReactionCreate( + const Integer32 ENDF_MT, + const XMLName fissionGenre, + const XMLName label, + ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2Reaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MT, + fissionGenre, + label, + detail::tocpp(doubleDifferentialCrossSection), + 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 +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 +Integer32 +ReactionENDFMTGet(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +ReactionENDFMTSet(ConstHandle2Reaction self, const Integer32 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 +XMLName +ReactionFissionGenreGet(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionGenreGet", self, extract::fissionGenre); +} + +// Set +void +ReactionFissionGenreSet(ConstHandle2Reaction self, const XMLName 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 +XMLName +ReactionLabelGet(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ReactionLabelSet(ConstHandle2Reaction self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Reaction/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reaction.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Reaction.h new file mode 100644 index 000000000..b92feb7a2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_REACTION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_REACTION + +#include "GNDStk.h" +#include "v2.0/transport/DoubleDifferentialCrossSection.h" +#include "v2.0/transport/CrossSection.h" +#include "v2.0/transport/OutputChannel.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 Integer32 ENDF_MT, + const XMLName fissionGenre, + const XMLName label, + ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Create, general +extern_c Handle2Reaction +ReactionCreate( + const Integer32 ENDF_MT, + const XMLName fissionGenre, + const XMLName label, + ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection, + 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 +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 Integer32 +ReactionENDFMTGet(ConstHandle2ConstReaction self); + +// +++ Set +extern_c void +ReactionENDFMTSet(ConstHandle2Reaction self, const Integer32 ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Metadatum: fissionGenre +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionFissionGenreHas(ConstHandle2ConstReaction self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ReactionFissionGenreGet(ConstHandle2ConstReaction self); + +// +++ Set +extern_c void +ReactionFissionGenreSet(ConstHandle2Reaction self, const XMLName fissionGenre); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionLabelHas(ConstHandle2ConstReaction self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ReactionLabelGet(ConstHandle2ConstReaction self); + +// +++ Set +extern_c void +ReactionLabelSet(ConstHandle2Reaction self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Reaction/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reaction/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Reaction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reaction/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Reaction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ReactionSuite.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/ReactionSuite.cpp new file mode 100644 index 000000000..f4a2763d1 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/ReactionSuite.cpp @@ -0,0 +1,821 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/ReactionSuite.hpp" +#include "ReactionSuite.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +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 externalFiles = [](auto &obj) { return &obj.externalFiles; }; + static auto styles = [](auto &obj) { return &obj.styles; }; + static auto PoPs_database = [](auto &obj) { return &obj.PoPs_database; }; + static auto resonances = [](auto &obj) { return &obj.resonances; }; + static auto reactions = [](auto &obj) { return &obj.reactions; }; + static auto orphanProducts = [](auto &obj) { return &obj.orphanProducts; }; + static auto sums = [](auto &obj) { return &obj.sums; }; + static auto fissionComponents = [](auto &obj) { return &obj.fissionComponents; }; + static auto productions = [](auto &obj) { return &obj.productions; }; + static auto incompleteReactions = [](auto &obj) { return &obj.incompleteReactions; }; + static auto applicationData = [](auto &obj) { return &obj.applicationData; }; +} + +using CPPExternalFiles = common::ExternalFiles; +using CPPStyles = styles::Styles; +using CPPPoPs_database = pops::PoPs_database; +using CPPResonances = resonances::Resonances; +using CPPReactions = transport::Reactions; +using CPPOrphanProducts = transport::OrphanProducts; +using CPPSums = transport::Sums; +using CPPFissionComponents = fissionTransport::FissionComponents; +using CPPProductions = transport::Productions; +using CPPIncompleteReactions = transport::IncompleteReactions; +using CPPApplicationData = appData::ApplicationData; + + +// ----------------------------------------------------------------------------- +// 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 XMLName evaluation, + const XMLName format, + const XMLName projectile, + const enums::Frame projectileFrame, + const XMLName target, + const enums::Interaction interaction, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstReactions reactions, + ConstHandle2ConstOrphanProducts orphanProducts, + ConstHandle2ConstSums sums, + ConstHandle2ConstFissionComponents fissionComponents, + ConstHandle2ConstProductions productions, + ConstHandle2ConstIncompleteReactions incompleteReactions, + ConstHandle2ConstApplicationData applicationData +) { + ConstHandle2ReactionSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + evaluation, + format, + projectile, + projectileFrame, + target, + interaction, + detail::tocpp(externalFiles), + detail::tocpp(styles), + detail::tocpp(PoPs_database), + detail::tocpp(resonances), + detail::tocpp(reactions), + detail::tocpp(orphanProducts), + detail::tocpp(sums), + detail::tocpp(fissionComponents), + detail::tocpp(productions), + detail::tocpp(incompleteReactions), + detail::tocpp(applicationData) + ); + return handle; +} + +// Create, general +Handle2ReactionSuite +ReactionSuiteCreate( + const XMLName evaluation, + const XMLName format, + const XMLName projectile, + const enums::Frame projectileFrame, + const XMLName target, + const enums::Interaction interaction, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstReactions reactions, + ConstHandle2ConstOrphanProducts orphanProducts, + ConstHandle2ConstSums sums, + ConstHandle2ConstFissionComponents fissionComponents, + ConstHandle2ConstProductions productions, + ConstHandle2ConstIncompleteReactions incompleteReactions, + ConstHandle2ConstApplicationData applicationData +) { + ConstHandle2ReactionSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + evaluation, + format, + projectile, + projectileFrame, + target, + interaction, + detail::tocpp(externalFiles), + detail::tocpp(styles), + detail::tocpp(PoPs_database), + detail::tocpp(resonances), + detail::tocpp(reactions), + detail::tocpp(orphanProducts), + detail::tocpp(sums), + detail::tocpp(fissionComponents), + detail::tocpp(productions), + detail::tocpp(incompleteReactions), + detail::tocpp(applicationData) + ); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +ReactionSuiteEvaluationGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaluationGet", self, extract::evaluation); +} + +// Set +void +ReactionSuiteEvaluationSet(ConstHandle2ReactionSuite self, const XMLName 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 +XMLName +ReactionSuiteFormatGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormatGet", self, extract::format); +} + +// Set +void +ReactionSuiteFormatSet(ConstHandle2ReactionSuite self, const XMLName 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 +XMLName +ReactionSuiteProjectileGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileGet", self, extract::projectile); +} + +// Set +void +ReactionSuiteProjectileSet(ConstHandle2ReactionSuite self, const XMLName 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 +XMLName +ReactionSuiteTargetGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TargetGet", self, extract::target); +} + +// Set +void +ReactionSuiteTargetSet(ConstHandle2ReactionSuite self, const XMLName 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: 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: 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_database +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuitePoPs_databaseHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PoPs_databaseHas", self, extract::PoPs_database); +} + +// Get, const +Handle2ConstPoPs_database +ReactionSuitePoPs_databaseGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPs_databaseGetConst", self, extract::PoPs_database); +} + +// Get, non-const +Handle2PoPs_database +ReactionSuitePoPs_databaseGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPs_databaseGet", self, extract::PoPs_database); +} + +// Set +void +ReactionSuitePoPs_databaseSet(ConstHandle2ReactionSuite self, ConstHandle2ConstPoPs_database PoPs_database) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PoPs_databaseSet", self, extract::PoPs_database, PoPs_database); +} + + +// ----------------------------------------------------------------------------- +// 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: 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: 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: 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: 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: 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: 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); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/ReactionSuite/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ReactionSuite.h b/standards/gnds-2.0/test/c/src/v2.0/transport/ReactionSuite.h new file mode 100644 index 000000000..98a45839d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_REACTIONSUITE +#define C_INTERFACE_TEST_V2_0_TRANSPORT_REACTIONSUITE + +#include "GNDStk.h" +#include "v2.0/common/ExternalFiles.h" +#include "v2.0/styles/Styles.h" +#include "v2.0/pops/PoPs_database.h" +#include "v2.0/resonances/Resonances.h" +#include "v2.0/transport/Reactions.h" +#include "v2.0/transport/OrphanProducts.h" +#include "v2.0/transport/Sums.h" +#include "v2.0/fissionTransport/FissionComponents.h" +#include "v2.0/transport/Productions.h" +#include "v2.0/transport/IncompleteReactions.h" +#include "v2.0/appData/ApplicationData.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 XMLName evaluation, + const XMLName format, + const XMLName projectile, + const enums::Frame projectileFrame, + const XMLName target, + const enums::Interaction interaction, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstReactions reactions, + ConstHandle2ConstOrphanProducts orphanProducts, + ConstHandle2ConstSums sums, + ConstHandle2ConstFissionComponents fissionComponents, + ConstHandle2ConstProductions productions, + ConstHandle2ConstIncompleteReactions incompleteReactions, + ConstHandle2ConstApplicationData applicationData +); + +// +++ Create, general +extern_c Handle2ReactionSuite +ReactionSuiteCreate( + const XMLName evaluation, + const XMLName format, + const XMLName projectile, + const enums::Frame projectileFrame, + const XMLName target, + const enums::Interaction interaction, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstPoPs_database PoPs_database, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstReactions reactions, + ConstHandle2ConstOrphanProducts orphanProducts, + ConstHandle2ConstSums sums, + ConstHandle2ConstFissionComponents fissionComponents, + ConstHandle2ConstProductions productions, + ConstHandle2ConstIncompleteReactions incompleteReactions, + ConstHandle2ConstApplicationData applicationData +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +ReactionSuiteEvaluationGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteEvaluationSet(ConstHandle2ReactionSuite self, const XMLName evaluation); + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteFormatHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ReactionSuiteFormatGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteFormatSet(ConstHandle2ReactionSuite self, const XMLName format); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteProjectileHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ReactionSuiteProjectileGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteProjectileSet(ConstHandle2ReactionSuite self, const XMLName 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 XMLName +ReactionSuiteTargetGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteTargetSet(ConstHandle2ReactionSuite self, const XMLName 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: 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: 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_database +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuitePoPs_databaseHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstPoPs_database +ReactionSuitePoPs_databaseGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2PoPs_database +ReactionSuitePoPs_databaseGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuitePoPs_databaseSet(ConstHandle2ReactionSuite self, ConstHandle2ConstPoPs_database PoPs_database); + + +// ----------------------------------------------------------------------------- +// 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: 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: 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: 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: 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: 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: 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); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/ReactionSuite/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ReactionSuite/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/ReactionSuite/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ReactionSuite/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/ReactionSuite/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reactions.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Reactions.cpp new file mode 100644 index 000000000..8dab1eb2c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Reactions.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Reactions.hpp" +#include "Reactions.h" + +using namespace njoy::GNDStk; +using namespace test::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 = 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 Integer32 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 Integer32 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 Integer32 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 Integer32 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 XMLName fissionGenre +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, const +Handle2ConstReaction +ReactionsReactionGetByFissionGenreConst( + ConstHandle2ConstReactions self, + const XMLName fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByFissionGenreConst", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, non-const +Handle2Reaction +ReactionsReactionGetByFissionGenre( + ConstHandle2Reactions self, + const XMLName fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Set, by fissionGenre +void +ReactionsReactionSetByFissionGenre( + ConstHandle2Reactions self, + const XMLName fissionGenre, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre, reaction); +} + +// Has, by label +int +ReactionsReactionHasByLabel( + ConstHandle2ConstReactions self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByLabel", + self, extract::reaction, meta::label, label); +} + +// Get, by label, const +Handle2ConstReaction +ReactionsReactionGetByLabelConst( + ConstHandle2ConstReactions self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByLabelConst", + self, extract::reaction, meta::label, label); +} + +// Get, by label, non-const +Handle2Reaction +ReactionsReactionGetByLabel( + ConstHandle2Reactions self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByLabel", + self, extract::reaction, meta::label, label); +} + +// Set, by label +void +ReactionsReactionSetByLabel( + ConstHandle2Reactions self, + const XMLName label, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByLabel", + self, extract::reaction, meta::label, label, reaction); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Reactions/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reactions.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Reactions.h new file mode 100644 index 000000000..e01a09f54 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/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_TEST_V2_0_TRANSPORT_REACTIONS +#define C_INTERFACE_TEST_V2_0_TRANSPORT_REACTIONS + +#include "GNDStk.h" +#include "v2.0/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 Integer32 ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstReaction +ReactionsReactionGetByENDFMTConst( + ConstHandle2ConstReactions self, + const Integer32 ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2Reaction +ReactionsReactionGetByENDFMT( + ConstHandle2Reactions self, + const Integer32 ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +ReactionsReactionSetByENDFMT( + ConstHandle2Reactions self, + const Integer32 ENDF_MT, + ConstHandle2ConstReaction reaction +); + +// +++ Has, by fissionGenre +extern_c int +ReactionsReactionHasByFissionGenre( + ConstHandle2ConstReactions self, + const XMLName fissionGenre +); + +// --- Get, by fissionGenre, const +extern_c Handle2ConstReaction +ReactionsReactionGetByFissionGenreConst( + ConstHandle2ConstReactions self, + const XMLName fissionGenre +); + +// +++ Get, by fissionGenre, non-const +extern_c Handle2Reaction +ReactionsReactionGetByFissionGenre( + ConstHandle2Reactions self, + const XMLName fissionGenre +); + +// +++ Set, by fissionGenre +extern_c void +ReactionsReactionSetByFissionGenre( + ConstHandle2Reactions self, + const XMLName fissionGenre, + ConstHandle2ConstReaction reaction +); + +// +++ Has, by label +extern_c int +ReactionsReactionHasByLabel( + ConstHandle2ConstReactions self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstReaction +ReactionsReactionGetByLabelConst( + ConstHandle2ConstReactions self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2Reaction +ReactionsReactionGetByLabel( + ConstHandle2Reactions self, + const XMLName label +); + +// +++ Set, by label +extern_c void +ReactionsReactionSetByLabel( + ConstHandle2Reactions self, + const XMLName label, + ConstHandle2ConstReaction reaction +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Reactions/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reactions/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Reactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reactions/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Reactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Recoil.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Recoil.cpp new file mode 100644 index 000000000..734d91525 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Recoil.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Recoil.hpp" +#include "Recoil.h" + +using namespace njoy::GNDStk; +using namespace test::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 +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 +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/transport/Recoil/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Recoil.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Recoil.h new file mode 100644 index 000000000..41f04c764 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_RECOIL +#define C_INTERFACE_TEST_V2_0_TRANSPORT_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 +extern_c Handle2Recoil +RecoilDefault(); + +// --- Create, general, const +extern_c Handle2ConstRecoil +RecoilCreateConst( + const char *const href +); + +// +++ Create, general +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/transport/Recoil/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Recoil/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Recoil/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Recoil/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Recoil/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reference.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Reference.cpp new file mode 100644 index 000000000..ef792035e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Reference.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Reference.hpp" +#include "Reference.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ReferenceClass; +using CPP = multigroup::Reference; + +static const std::string CLASSNAME = "Reference"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstReference +ReferenceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Reference +ReferenceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstReference +ReferenceCreateConst( + const char *const href, + const XMLName label +) { + ConstHandle2Reference handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href, + label + ); + return handle; +} + +// Create, general +Handle2Reference +ReferenceCreate( + const char *const href, + const XMLName label +) { + ConstHandle2Reference handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href, + 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 +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: 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); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ReferenceLabelHas(ConstHandle2ConstReference self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ReferenceLabelGet(ConstHandle2ConstReference self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ReferenceLabelSet(ConstHandle2Reference self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Reference/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reference.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Reference.h new file mode 100644 index 000000000..25908eca9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_REFERENCE +#define C_INTERFACE_TEST_V2_0_TRANSPORT_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 +extern_c Handle2Reference +ReferenceDefault(); + +// --- Create, general, const +extern_c Handle2ConstReference +ReferenceCreateConst( + const char *const href, + const XMLName label +); + +// +++ Create, general +extern_c Handle2Reference +ReferenceCreate( + const char *const href, + const XMLName 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 +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: 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReferenceLabelHas(ConstHandle2ConstReference self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ReferenceLabelGet(ConstHandle2ConstReference self); + +// +++ Set +extern_c void +ReferenceLabelSet(ConstHandle2Reference self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Reference/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reference/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Reference/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Reference/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Reference/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion.cpp new file mode 100644 index 000000000..da077fffe --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/ResolvedRegion.hpp" +#include "ResolvedRegion.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ResolvedRegionClass; +using CPP = multigroup::ResolvedRegion; + +static const std::string CLASSNAME = "ResolvedRegion"; + +namespace extract { +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResolvedRegion +ResolvedRegionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ResolvedRegion +ResolvedRegionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResolvedRegion +ResolvedRegionCreateConst( +) { + ConstHandle2ResolvedRegion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2ResolvedRegion +ResolvedRegionCreate( +) { + ConstHandle2ResolvedRegion 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/ResolvedRegion/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion.h b/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion.h new file mode 100644 index 000000000..2d5a6346c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion.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. +// +// 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_TEST_V2_0_TRANSPORT_RESOLVEDREGION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_RESOLVEDREGION + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/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 +extern_c Handle2ResolvedRegion +ResolvedRegionDefault(); + +// --- Create, general, const +extern_c Handle2ConstResolvedRegion +ResolvedRegionCreateConst( +); + +// +++ Create, general +extern_c Handle2ResolvedRegion +ResolvedRegionCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/ResolvedRegion/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/ResolvedRegion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink.cpp new file mode 100644 index 000000000..507a3bddb --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/ResonancesLink.hpp" +#include "ResonancesLink.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = ResonancesLinkClass; +using CPP = multigroup::ResonancesLink; + +static const std::string CLASSNAME = "ResonancesLink"; + +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 +Handle2ConstResonancesLink +ResonancesLinkDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ResonancesLink +ResonancesLinkDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResonancesLink +ResonancesLinkCreateConst( + const XMLName label, + const char *const href +) { + ConstHandle2ResonancesLink handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href + ); + return handle; +} + +// Create, general +Handle2ResonancesLink +ResonancesLinkCreate( + const XMLName label, + const char *const href +) { + ConstHandle2ResonancesLink 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 +ResonancesLinkAssign(ConstHandle2ResonancesLink self, ConstHandle2ConstResonancesLink from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ResonancesLinkDelete(ConstHandle2ConstResonancesLink self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ResonancesLinkRead(ConstHandle2ResonancesLink self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ResonancesLinkWrite(ConstHandle2ConstResonancesLink self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ResonancesLinkPrint(ConstHandle2ConstResonancesLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ResonancesLinkPrintXML(ConstHandle2ConstResonancesLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ResonancesLinkPrintJSON(ConstHandle2ConstResonancesLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesLinkLabelHas(ConstHandle2ConstResonancesLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +ResonancesLinkLabelGet(ConstHandle2ConstResonancesLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ResonancesLinkLabelSet(ConstHandle2ResonancesLink self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesLinkHrefHas(ConstHandle2ConstResonancesLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +ResonancesLinkHrefGet(ConstHandle2ConstResonancesLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ResonancesLinkHrefSet(ConstHandle2ResonancesLink self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/ResonancesLink/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink.h b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink.h new file mode 100644 index 000000000..52da44411 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink.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. +// +// ResonancesLink is the basic handle type in this file. Example: +// // Create a default ResonancesLink object: +// ResonancesLink handle = ResonancesLinkDefault(); +// Functions involving ResonancesLink are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TRANSPORT_RESONANCESLINK +#define C_INTERFACE_TEST_V2_0_TRANSPORT_RESONANCESLINK + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ResonancesLinkClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ResonancesLink +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ResonancesLinkClass *ResonancesLink; + +// --- Const-aware handles. +typedef const struct ResonancesLinkClass *const ConstHandle2ConstResonancesLink; +typedef struct ResonancesLinkClass *const ConstHandle2ResonancesLink; +typedef const struct ResonancesLinkClass * Handle2ConstResonancesLink; +typedef struct ResonancesLinkClass * Handle2ResonancesLink; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstResonancesLink +ResonancesLinkDefaultConst(); + +// +++ Create, default +extern_c Handle2ResonancesLink +ResonancesLinkDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonancesLink +ResonancesLinkCreateConst( + const XMLName label, + const char *const href +); + +// +++ Create, general +extern_c Handle2ResonancesLink +ResonancesLinkCreate( + const XMLName 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 +ResonancesLinkAssign(ConstHandle2ResonancesLink self, ConstHandle2ConstResonancesLink from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ResonancesLinkDelete(ConstHandle2ConstResonancesLink self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ResonancesLinkRead(ConstHandle2ResonancesLink self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ResonancesLinkWrite(ConstHandle2ConstResonancesLink self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ResonancesLinkPrint(ConstHandle2ConstResonancesLink self); + +// +++ Print to standard output, as XML +extern_c int +ResonancesLinkPrintXML(ConstHandle2ConstResonancesLink self); + +// +++ Print to standard output, as JSON +extern_c int +ResonancesLinkPrintJSON(ConstHandle2ConstResonancesLink self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesLinkLabelHas(ConstHandle2ConstResonancesLink self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ResonancesLinkLabelGet(ConstHandle2ConstResonancesLink self); + +// +++ Set +extern_c void +ResonancesLinkLabelSet(ConstHandle2ResonancesLink self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesLinkHrefHas(ConstHandle2ConstResonancesLink self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ResonancesLinkHrefGet(ConstHandle2ConstResonancesLink self); + +// +++ Set +extern_c void +ResonancesLinkHrefSet(ConstHandle2ResonancesLink self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/ResonancesLink/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesLink/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesWithBackground.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesWithBackground.cpp new file mode 100644 index 000000000..b205ac4ac --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesWithBackground.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/ResonancesWithBackground.hpp" +#include "ResonancesWithBackground.h" + +using namespace njoy::GNDStk; +using namespace test::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 resonancesLink = [](auto &obj) { return &obj.resonancesLink; }; + static auto background = [](auto &obj) { return &obj.background; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPResonancesLink = transport::ResonancesLink; +using CPPBackground = transport::Background; +using CPPUncertainty = containers::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonancesWithBackground +ResonancesWithBackgroundDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ResonancesWithBackground +ResonancesWithBackgroundDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResonancesWithBackground +ResonancesWithBackgroundCreateConst( + const XMLName label, + ConstHandle2ConstResonancesLink resonancesLink, + ConstHandle2ConstBackground background, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2ResonancesWithBackground handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(resonancesLink), + detail::tocpp(background), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general +Handle2ResonancesWithBackground +ResonancesWithBackgroundCreate( + const XMLName label, + ConstHandle2ConstResonancesLink resonancesLink, + ConstHandle2ConstBackground background, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2ResonancesWithBackground handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(resonancesLink), + 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 +XMLName +ResonancesWithBackgroundLabelGet(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ResonancesWithBackgroundLabelSet(ConstHandle2ResonancesWithBackground self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: resonancesLink +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesWithBackgroundResonancesLinkHas(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonancesLinkHas", self, extract::resonancesLink); +} + +// Get, const +Handle2ConstResonancesLink +ResonancesWithBackgroundResonancesLinkGetConst(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonancesLinkGetConst", self, extract::resonancesLink); +} + +// Get, non-const +Handle2ResonancesLink +ResonancesWithBackgroundResonancesLinkGet(ConstHandle2ResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonancesLinkGet", self, extract::resonancesLink); +} + +// Set +void +ResonancesWithBackgroundResonancesLinkSet(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstResonancesLink resonancesLink) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonancesLinkSet", self, extract::resonancesLink, resonancesLink); +} + + +// ----------------------------------------------------------------------------- +// 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/transport/ResonancesWithBackground/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesWithBackground.h b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesWithBackground.h new file mode 100644 index 000000000..8b4d3fbb6 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_RESONANCESWITHBACKGROUND +#define C_INTERFACE_TEST_V2_0_TRANSPORT_RESONANCESWITHBACKGROUND + +#include "GNDStk.h" +#include "v2.0/transport/ResonancesLink.h" +#include "v2.0/transport/Background.h" +#include "v2.0/containers/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 +extern_c Handle2ResonancesWithBackground +ResonancesWithBackgroundDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonancesWithBackground +ResonancesWithBackgroundCreateConst( + const XMLName label, + ConstHandle2ConstResonancesLink resonancesLink, + ConstHandle2ConstBackground background, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general +extern_c Handle2ResonancesWithBackground +ResonancesWithBackgroundCreate( + const XMLName label, + ConstHandle2ConstResonancesLink resonancesLink, + 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 XMLName +ResonancesWithBackgroundLabelGet(ConstHandle2ConstResonancesWithBackground self); + +// +++ Set +extern_c void +ResonancesWithBackgroundLabelSet(ConstHandle2ResonancesWithBackground self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: resonancesLink +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesWithBackgroundResonancesLinkHas(ConstHandle2ConstResonancesWithBackground self); + +// --- Get, const +extern_c Handle2ConstResonancesLink +ResonancesWithBackgroundResonancesLinkGetConst(ConstHandle2ConstResonancesWithBackground self); + +// +++ Get, non-const +extern_c Handle2ResonancesLink +ResonancesWithBackgroundResonancesLinkGet(ConstHandle2ResonancesWithBackground self); + +// +++ Set +extern_c void +ResonancesWithBackgroundResonancesLinkSet(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstResonancesLink resonancesLink); + + +// ----------------------------------------------------------------------------- +// 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/transport/ResonancesWithBackground/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesWithBackground/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesWithBackground/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesWithBackground/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/ResonancesWithBackground/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Summands.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Summands.cpp new file mode 100644 index 000000000..39068801d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Summands.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Summands.hpp" +#include "Summands.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::Add; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSummands +SummandsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// 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/transport/Summands/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Summands.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Summands.h new file mode 100644 index 000000000..c08ee70f3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Summands.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TRANSPORT_SUMMANDS +#define C_INTERFACE_TEST_V2_0_TRANSPORT_SUMMANDS + +#include "GNDStk.h" +#include "v2.0/transport/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 +extern_c Handle2Summands +SummandsDefault(); + +// --- Create, general, const +extern_c Handle2ConstSummands +SummandsCreateConst( + ConstHandle2Add *const add, const size_t addSize +); + +// +++ Create, general +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 +); + +// +++ 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/transport/Summands/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Summands/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Summands/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Summands/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Summands/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Sums.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Sums.cpp new file mode 100644 index 000000000..6ee992921 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Sums.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Sums.hpp" +#include "Sums.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::CrossSectionSums; +using CPPMultiplicitySums = transport::MultiplicitySums; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSums +SumsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/transport/Sums/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Sums.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Sums.h new file mode 100644 index 000000000..37ef8483a --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_SUMS +#define C_INTERFACE_TEST_V2_0_TRANSPORT_SUMS + +#include "GNDStk.h" +#include "v2.0/transport/CrossSectionSums.h" +#include "v2.0/transport/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 +extern_c Handle2Sums +SumsDefault(); + +// --- Create, general, const +extern_c Handle2ConstSums +SumsCreateConst( + ConstHandle2ConstCrossSectionSums crossSectionSums, + ConstHandle2ConstMultiplicitySums multiplicitySums +); + +// +++ Create, general +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/transport/Sums/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Sums/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Sums/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Sums/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Sums/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Theta.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Theta.cpp new file mode 100644 index 000000000..3962815f7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Theta.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Theta.hpp" +#include "Theta.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTheta +ThetaDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/transport/Theta/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Theta.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Theta.h new file mode 100644 index 000000000..527ef9ecd --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_THETA +#define C_INTERFACE_TEST_V2_0_TRANSPORT_THETA + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/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 +extern_c Handle2Theta +ThetaDefault(); + +// --- Create, general, const +extern_c Handle2ConstTheta +ThetaCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general +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/transport/Theta/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Theta/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Theta/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Theta/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Theta/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/U.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/U.cpp new file mode 100644 index 000000000..19b18350e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/U.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/U.hpp" +#include "U.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = UClass; +using CPP = multigroup::U; + +static const std::string CLASSNAME = "U"; + +namespace extract { + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstU +UDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2U +UDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstU +UCreateConst( + const XMLName unit, + const Float64 value +) { + ConstHandle2U handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + unit, + value + ); + return handle; +} + +// Create, general +Handle2U +UCreate( + const XMLName unit, + const Float64 value +) { + ConstHandle2U handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + unit, + 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 +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: unit +// ----------------------------------------------------------------------------- + +// Has +int +UUnitHas(ConstHandle2ConstU self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +UUnitGet(ConstHandle2ConstU self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +UUnitSet(ConstHandle2U self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +UValueHas(ConstHandle2ConstU self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +UValueGet(ConstHandle2ConstU self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +UValueSet(ConstHandle2U self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/U/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/U.h b/standards/gnds-2.0/test/c/src/v2.0/transport/U.h new file mode 100644 index 000000000..ca55f654d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_U +#define C_INTERFACE_TEST_V2_0_TRANSPORT_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 +extern_c Handle2U +UDefault(); + +// --- Create, general, const +extern_c Handle2ConstU +UCreateConst( + const XMLName unit, + const Float64 value +); + +// +++ Create, general +extern_c Handle2U +UCreate( + const XMLName unit, + const Float64 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 +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: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UUnitHas(ConstHandle2ConstU self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +UUnitGet(ConstHandle2ConstU self); + +// +++ Set +extern_c void +UUnitSet(ConstHandle2U self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UValueHas(ConstHandle2ConstU self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +UValueGet(ConstHandle2ConstU self); + +// +++ Set +extern_c void +UValueSet(ConstHandle2U self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/U/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/U/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/U/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/U/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/U/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d.cpp new file mode 100644 index 000000000..6dbff7801 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d.cpp @@ -0,0 +1,175 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/URR_probabilityTables1d.hpp" +#include "URR_probabilityTables1d.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = URR_probabilityTables1dClass; +using CPP = multigroup::URR_probabilityTables1d; + +static const std::string CLASSNAME = "URR_probabilityTables1d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; +} + +using CPPXYs2d = containers::XYs2d; +using CPPRegions2d = containers::Regions2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstURR_probabilityTables1d +URR_probabilityTables1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2URR_probabilityTables1d +URR_probabilityTables1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstURR_probabilityTables1d +URR_probabilityTables1dCreateConst( + const XMLName label, +) { + ConstHandle2URR_probabilityTables1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label + ); + return handle; +} + +// Create, general +Handle2URR_probabilityTables1d +URR_probabilityTables1dCreate( + const XMLName label, +) { + ConstHandle2URR_probabilityTables1d 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 +URR_probabilityTables1dAssign(ConstHandle2URR_probabilityTables1d self, ConstHandle2ConstURR_probabilityTables1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +URR_probabilityTables1dDelete(ConstHandle2ConstURR_probabilityTables1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +URR_probabilityTables1dRead(ConstHandle2URR_probabilityTables1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +URR_probabilityTables1dWrite(ConstHandle2ConstURR_probabilityTables1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +URR_probabilityTables1dPrint(ConstHandle2ConstURR_probabilityTables1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +URR_probabilityTables1dPrintXML(ConstHandle2ConstURR_probabilityTables1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +URR_probabilityTables1dPrintJSON(ConstHandle2ConstURR_probabilityTables1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +URR_probabilityTables1dLabelHas(ConstHandle2ConstURR_probabilityTables1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +URR_probabilityTables1dLabelGet(ConstHandle2ConstURR_probabilityTables1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +URR_probabilityTables1dLabelSet(ConstHandle2URR_probabilityTables1d self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/URR_probabilityTables1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d.h b/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d.h new file mode 100644 index 000000000..e290bd149 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d.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. +// +// URR_probabilityTables1d is the basic handle type in this file. Example: +// // Create a default URR_probabilityTables1d object: +// URR_probabilityTables1d handle = URR_probabilityTables1dDefault(); +// Functions involving URR_probabilityTables1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TRANSPORT_URR_PROBABILITYTABLES1D +#define C_INTERFACE_TEST_V2_0_TRANSPORT_URR_PROBABILITYTABLES1D + +#include "GNDStk.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/containers/Regions2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct URR_probabilityTables1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ URR_probabilityTables1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct URR_probabilityTables1dClass *URR_probabilityTables1d; + +// --- Const-aware handles. +typedef const struct URR_probabilityTables1dClass *const ConstHandle2ConstURR_probabilityTables1d; +typedef struct URR_probabilityTables1dClass *const ConstHandle2URR_probabilityTables1d; +typedef const struct URR_probabilityTables1dClass * Handle2ConstURR_probabilityTables1d; +typedef struct URR_probabilityTables1dClass * Handle2URR_probabilityTables1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstURR_probabilityTables1d +URR_probabilityTables1dDefaultConst(); + +// +++ Create, default +extern_c Handle2URR_probabilityTables1d +URR_probabilityTables1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstURR_probabilityTables1d +URR_probabilityTables1dCreateConst( + const XMLName label, +); + +// +++ Create, general +extern_c Handle2URR_probabilityTables1d +URR_probabilityTables1dCreate( + const XMLName 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 +URR_probabilityTables1dAssign(ConstHandle2URR_probabilityTables1d self, ConstHandle2ConstURR_probabilityTables1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +URR_probabilityTables1dDelete(ConstHandle2ConstURR_probabilityTables1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +URR_probabilityTables1dRead(ConstHandle2URR_probabilityTables1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +URR_probabilityTables1dWrite(ConstHandle2ConstURR_probabilityTables1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +URR_probabilityTables1dPrint(ConstHandle2ConstURR_probabilityTables1d self); + +// +++ Print to standard output, as XML +extern_c int +URR_probabilityTables1dPrintXML(ConstHandle2ConstURR_probabilityTables1d self); + +// +++ Print to standard output, as JSON +extern_c int +URR_probabilityTables1dPrintJSON(ConstHandle2ConstURR_probabilityTables1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +URR_probabilityTables1dLabelHas(ConstHandle2ConstURR_probabilityTables1d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +URR_probabilityTables1dLabelGet(ConstHandle2ConstURR_probabilityTables1d self); + +// +++ Set +extern_c void +URR_probabilityTables1dLabelSet(ConstHandle2URR_probabilityTables1d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/URR_probabilityTables1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/URR_probabilityTables1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Uncorrelated.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Uncorrelated.cpp new file mode 100644 index 000000000..bf3e23697 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Uncorrelated.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Uncorrelated.hpp" +#include "Uncorrelated.h" + +using namespace njoy::GNDStk; +using namespace test::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_uncorrelated = [](auto &obj) { return &obj.angular_uncorrelated; }; + static auto energy_uncorrelated = [](auto &obj) { return &obj.energy_uncorrelated; }; +} + +using CPPAngular_uncorrelated = transport::Angular_uncorrelated; +using CPPEnergy_uncorrelated = transport::Energy_uncorrelated; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUncorrelated +UncorrelatedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Uncorrelated +UncorrelatedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUncorrelated +UncorrelatedCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstAngular_uncorrelated angular_uncorrelated, + ConstHandle2ConstEnergy_uncorrelated energy_uncorrelated +) { + ConstHandle2Uncorrelated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(angular_uncorrelated), + detail::tocpp(energy_uncorrelated) + ); + return handle; +} + +// Create, general +Handle2Uncorrelated +UncorrelatedCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstAngular_uncorrelated angular_uncorrelated, + ConstHandle2ConstEnergy_uncorrelated energy_uncorrelated +) { + ConstHandle2Uncorrelated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(angular_uncorrelated), + detail::tocpp(energy_uncorrelated) + ); + return handle; +} + +// Assign +// Use this to assign 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 +XMLName +UncorrelatedLabelGet(ConstHandle2ConstUncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +UncorrelatedLabelSet(ConstHandle2Uncorrelated self, const XMLName 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 +XMLName +UncorrelatedProductFrameGet(ConstHandle2ConstUncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +UncorrelatedProductFrameSet(ConstHandle2Uncorrelated self, const XMLName productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: angular_uncorrelated +// ----------------------------------------------------------------------------- + +// Has +int +UncorrelatedAngular_uncorrelatedHas(ConstHandle2ConstUncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Angular_uncorrelatedHas", self, extract::angular_uncorrelated); +} + +// Get, const +Handle2ConstAngular_uncorrelated +UncorrelatedAngular_uncorrelatedGetConst(ConstHandle2ConstUncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Angular_uncorrelatedGetConst", self, extract::angular_uncorrelated); +} + +// Get, non-const +Handle2Angular_uncorrelated +UncorrelatedAngular_uncorrelatedGet(ConstHandle2Uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Angular_uncorrelatedGet", self, extract::angular_uncorrelated); +} + +// Set +void +UncorrelatedAngular_uncorrelatedSet(ConstHandle2Uncorrelated self, ConstHandle2ConstAngular_uncorrelated angular_uncorrelated) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Angular_uncorrelatedSet", self, extract::angular_uncorrelated, angular_uncorrelated); +} + + +// ----------------------------------------------------------------------------- +// Child: energy_uncorrelated +// ----------------------------------------------------------------------------- + +// Has +int +UncorrelatedEnergy_uncorrelatedHas(ConstHandle2ConstUncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Energy_uncorrelatedHas", self, extract::energy_uncorrelated); +} + +// Get, const +Handle2ConstEnergy_uncorrelated +UncorrelatedEnergy_uncorrelatedGetConst(ConstHandle2ConstUncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Energy_uncorrelatedGetConst", self, extract::energy_uncorrelated); +} + +// Get, non-const +Handle2Energy_uncorrelated +UncorrelatedEnergy_uncorrelatedGet(ConstHandle2Uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Energy_uncorrelatedGet", self, extract::energy_uncorrelated); +} + +// Set +void +UncorrelatedEnergy_uncorrelatedSet(ConstHandle2Uncorrelated self, ConstHandle2ConstEnergy_uncorrelated energy_uncorrelated) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Energy_uncorrelatedSet", self, extract::energy_uncorrelated, energy_uncorrelated); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Uncorrelated/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Uncorrelated.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Uncorrelated.h new file mode 100644 index 000000000..1b53bcc8c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_UNCORRELATED +#define C_INTERFACE_TEST_V2_0_TRANSPORT_UNCORRELATED + +#include "GNDStk.h" +#include "v2.0/transport/Angular_uncorrelated.h" +#include "v2.0/transport/Energy_uncorrelated.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 +extern_c Handle2Uncorrelated +UncorrelatedDefault(); + +// --- Create, general, const +extern_c Handle2ConstUncorrelated +UncorrelatedCreateConst( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstAngular_uncorrelated angular_uncorrelated, + ConstHandle2ConstEnergy_uncorrelated energy_uncorrelated +); + +// +++ Create, general +extern_c Handle2Uncorrelated +UncorrelatedCreate( + const XMLName label, + const XMLName productFrame, + ConstHandle2ConstAngular_uncorrelated angular_uncorrelated, + ConstHandle2ConstEnergy_uncorrelated energy_uncorrelated +); + +// +++ Assign +// +++ Use this to assign one handled 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 XMLName +UncorrelatedLabelGet(ConstHandle2ConstUncorrelated self); + +// +++ Set +extern_c void +UncorrelatedLabelSet(ConstHandle2Uncorrelated self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncorrelatedProductFrameHas(ConstHandle2ConstUncorrelated self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +UncorrelatedProductFrameGet(ConstHandle2ConstUncorrelated self); + +// +++ Set +extern_c void +UncorrelatedProductFrameSet(ConstHandle2Uncorrelated self, const XMLName productFrame); + + +// ----------------------------------------------------------------------------- +// Child: angular_uncorrelated +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncorrelatedAngular_uncorrelatedHas(ConstHandle2ConstUncorrelated self); + +// --- Get, const +extern_c Handle2ConstAngular_uncorrelated +UncorrelatedAngular_uncorrelatedGetConst(ConstHandle2ConstUncorrelated self); + +// +++ Get, non-const +extern_c Handle2Angular_uncorrelated +UncorrelatedAngular_uncorrelatedGet(ConstHandle2Uncorrelated self); + +// +++ Set +extern_c void +UncorrelatedAngular_uncorrelatedSet(ConstHandle2Uncorrelated self, ConstHandle2ConstAngular_uncorrelated angular_uncorrelated); + + +// ----------------------------------------------------------------------------- +// Child: energy_uncorrelated +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncorrelatedEnergy_uncorrelatedHas(ConstHandle2ConstUncorrelated self); + +// --- Get, const +extern_c Handle2ConstEnergy_uncorrelated +UncorrelatedEnergy_uncorrelatedGetConst(ConstHandle2ConstUncorrelated self); + +// +++ Get, non-const +extern_c Handle2Energy_uncorrelated +UncorrelatedEnergy_uncorrelatedGet(ConstHandle2Uncorrelated self); + +// +++ Set +extern_c void +UncorrelatedEnergy_uncorrelatedSet(ConstHandle2Uncorrelated self, ConstHandle2ConstEnergy_uncorrelated energy_uncorrelated); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Uncorrelated/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Uncorrelated/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Uncorrelated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Uncorrelated/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Uncorrelated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion.cpp new file mode 100644 index 000000000..558310b1c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/UnresolvedRegion.hpp" +#include "UnresolvedRegion.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = UnresolvedRegionClass; +using CPP = multigroup::UnresolvedRegion; + +static const std::string CLASSNAME = "UnresolvedRegion"; + +namespace extract { +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUnresolvedRegion +UnresolvedRegionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2UnresolvedRegion +UnresolvedRegionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnresolvedRegion +UnresolvedRegionCreateConst( +) { + ConstHandle2UnresolvedRegion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2UnresolvedRegion +UnresolvedRegionCreate( +) { + ConstHandle2UnresolvedRegion 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 +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"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/UnresolvedRegion/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion.h b/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion.h new file mode 100644 index 000000000..ee8b62b1d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion.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. +// +// 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_TEST_V2_0_TRANSPORT_UNRESOLVEDREGION +#define C_INTERFACE_TEST_V2_0_TRANSPORT_UNRESOLVEDREGION + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/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 +extern_c Handle2UnresolvedRegion +UnresolvedRegionDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnresolvedRegion +UnresolvedRegionCreateConst( +); + +// +++ Create, general +extern_c Handle2UnresolvedRegion +UnresolvedRegionCreate( +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/UnresolvedRegion/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/UnresolvedRegion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Unspecified.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Unspecified.cpp new file mode 100644 index 000000000..26a68a0a7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Unspecified.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Unspecified.hpp" +#include "Unspecified.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2Unspecified +UnspecifiedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnspecified +UnspecifiedCreateConst( + const XMLName label, + const XMLName productFrame +) { + ConstHandle2Unspecified handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame + ); + return handle; +} + +// Create, general +Handle2Unspecified +UnspecifiedCreate( + const XMLName label, + const XMLName 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 +XMLName +UnspecifiedLabelGet(ConstHandle2ConstUnspecified self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +UnspecifiedLabelSet(ConstHandle2Unspecified self, const XMLName 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 +XMLName +UnspecifiedProductFrameGet(ConstHandle2ConstUnspecified self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +UnspecifiedProductFrameSet(ConstHandle2Unspecified self, const XMLName productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Unspecified/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Unspecified.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Unspecified.h new file mode 100644 index 000000000..511d8e852 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/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_TEST_V2_0_TRANSPORT_UNSPECIFIED +#define C_INTERFACE_TEST_V2_0_TRANSPORT_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 +extern_c Handle2Unspecified +UnspecifiedDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnspecified +UnspecifiedCreateConst( + const XMLName label, + const XMLName productFrame +); + +// +++ Create, general +extern_c Handle2Unspecified +UnspecifiedCreate( + const XMLName label, + const XMLName 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 XMLName +UnspecifiedLabelGet(ConstHandle2ConstUnspecified self); + +// +++ Set +extern_c void +UnspecifiedLabelSet(ConstHandle2Unspecified self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnspecifiedProductFrameHas(ConstHandle2ConstUnspecified self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +UnspecifiedProductFrameGet(ConstHandle2ConstUnspecified self); + +// +++ Set +extern_c void +UnspecifiedProductFrameSet(ConstHandle2Unspecified self, const XMLName productFrame); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Unspecified/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Unspecified/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Unspecified/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Unspecified/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Unspecified/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted.cpp new file mode 100644 index 000000000..c6c87eeba --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted.cpp @@ -0,0 +1,439 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/Weighted.hpp" +#include "Weighted.h" + +using namespace njoy::GNDStk; +using namespace test::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 XYs2d = [](auto &obj) { return &obj.XYs2d; }; + static auto evaporation = [](auto &obj) { return &obj.evaporation; }; + static auto generalEvaporation = [](auto &obj) { return &obj.generalEvaporation; }; + static auto simpleMaxwellianFission = [](auto &obj) { return &obj.simpleMaxwellianFission; }; + static auto Watt = [](auto &obj) { return &obj.Watt; }; + static auto MadlandNix = [](auto &obj) { return &obj.MadlandNix; }; +} + +using CPPXYs1d = containers::XYs1d; +using CPPXYs2d = containers::XYs2d; +using CPPEvaporation = transport::Evaporation; +using CPPGeneralEvaporation = transport::GeneralEvaporation; +using CPPSimpleMaxwellianFission = fissionTransport::SimpleMaxwellianFission; +using CPPWatt = fissionTransport::Watt; +using CPPMadlandNix = fissionTransport::MadlandNix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstWeighted +WeightedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Weighted +WeightedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstWeighted +WeightedCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstWatt Watt, + ConstHandle2ConstMadlandNix MadlandNix +) { + ConstHandle2Weighted handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(XYs2d), + detail::tocpp(evaporation), + detail::tocpp(generalEvaporation), + detail::tocpp(simpleMaxwellianFission), + detail::tocpp(Watt), + detail::tocpp(MadlandNix) + ); + return handle; +} + +// Create, general +Handle2Weighted +WeightedCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstWatt Watt, + ConstHandle2ConstMadlandNix MadlandNix +) { + ConstHandle2Weighted handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(XYs2d), + detail::tocpp(evaporation), + detail::tocpp(generalEvaporation), + detail::tocpp(simpleMaxwellianFission), + detail::tocpp(Watt), + 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 +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: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +WeightedXYs2dHas(ConstHandle2ConstWeighted self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +WeightedXYs2dGetConst(ConstHandle2ConstWeighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +WeightedXYs2dGet(ConstHandle2Weighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +WeightedXYs2dSet(ConstHandle2Weighted self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Child: generalEvaporation +// ----------------------------------------------------------------------------- + +// Has +int +WeightedGeneralEvaporationHas(ConstHandle2ConstWeighted self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GeneralEvaporationHas", self, extract::generalEvaporation); +} + +// Get, const +Handle2ConstGeneralEvaporation +WeightedGeneralEvaporationGetConst(ConstHandle2ConstWeighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GeneralEvaporationGetConst", self, extract::generalEvaporation); +} + +// Get, non-const +Handle2GeneralEvaporation +WeightedGeneralEvaporationGet(ConstHandle2Weighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GeneralEvaporationGet", self, extract::generalEvaporation); +} + +// Set +void +WeightedGeneralEvaporationSet(ConstHandle2Weighted self, ConstHandle2ConstGeneralEvaporation generalEvaporation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GeneralEvaporationSet", self, extract::generalEvaporation, generalEvaporation); +} + + +// ----------------------------------------------------------------------------- +// Child: simpleMaxwellianFission +// ----------------------------------------------------------------------------- + +// Has +int +WeightedSimpleMaxwellianFissionHas(ConstHandle2ConstWeighted self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionHas", self, extract::simpleMaxwellianFission); +} + +// Get, const +Handle2ConstSimpleMaxwellianFission +WeightedSimpleMaxwellianFissionGetConst(ConstHandle2ConstWeighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionGetConst", self, extract::simpleMaxwellianFission); +} + +// Get, non-const +Handle2SimpleMaxwellianFission +WeightedSimpleMaxwellianFissionGet(ConstHandle2Weighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionGet", self, extract::simpleMaxwellianFission); +} + +// Set +void +WeightedSimpleMaxwellianFissionSet(ConstHandle2Weighted self, ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionSet", self, extract::simpleMaxwellianFission, simpleMaxwellianFission); +} + + +// ----------------------------------------------------------------------------- +// Child: Watt +// ----------------------------------------------------------------------------- + +// Has +int +WeightedWattHas(ConstHandle2ConstWeighted self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"WattHas", self, extract::Watt); +} + +// Get, const +Handle2ConstWatt +WeightedWattGetConst(ConstHandle2ConstWeighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WattGetConst", self, extract::Watt); +} + +// Get, non-const +Handle2Watt +WeightedWattGet(ConstHandle2Weighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WattGet", self, extract::Watt); +} + +// Set +void +WeightedWattSet(ConstHandle2Weighted self, ConstHandle2ConstWatt Watt) +{ + detail::setField + (CLASSNAME, CLASSNAME+"WattSet", self, extract::Watt, Watt); +} + + +// ----------------------------------------------------------------------------- +// Child: MadlandNix +// ----------------------------------------------------------------------------- + +// Has +int +WeightedMadlandNixHas(ConstHandle2ConstWeighted self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MadlandNixHas", self, extract::MadlandNix); +} + +// Get, const +Handle2ConstMadlandNix +WeightedMadlandNixGetConst(ConstHandle2ConstWeighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MadlandNixGetConst", self, extract::MadlandNix); +} + +// Get, non-const +Handle2MadlandNix +WeightedMadlandNixGet(ConstHandle2Weighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MadlandNixGet", self, extract::MadlandNix); +} + +// Set +void +WeightedMadlandNixSet(ConstHandle2Weighted self, ConstHandle2ConstMadlandNix MadlandNix) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MadlandNixSet", self, extract::MadlandNix, MadlandNix); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Weighted/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted.h new file mode 100644 index 000000000..e46a96d4b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted.h @@ -0,0 +1,305 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TRANSPORT_WEIGHTED +#define C_INTERFACE_TEST_V2_0_TRANSPORT_WEIGHTED + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" +#include "v2.0/containers/XYs2d.h" +#include "v2.0/transport/Evaporation.h" +#include "v2.0/transport/GeneralEvaporation.h" +#include "v2.0/fissionTransport/SimpleMaxwellianFission.h" +#include "v2.0/fissionTransport/Watt.h" +#include "v2.0/fissionTransport/MadlandNix.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 +extern_c Handle2Weighted +WeightedDefault(); + +// --- Create, general, const +extern_c Handle2ConstWeighted +WeightedCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstWatt Watt, + ConstHandle2ConstMadlandNix MadlandNix +); + +// +++ Create, general +extern_c Handle2Weighted +WeightedCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstWatt Watt, + 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 +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: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WeightedXYs2dHas(ConstHandle2ConstWeighted self); + +// --- Get, const +extern_c Handle2ConstXYs2d +WeightedXYs2dGetConst(ConstHandle2ConstWeighted self); + +// +++ Get, non-const +extern_c Handle2XYs2d +WeightedXYs2dGet(ConstHandle2Weighted self); + +// +++ Set +extern_c void +WeightedXYs2dSet(ConstHandle2Weighted self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Child: generalEvaporation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WeightedGeneralEvaporationHas(ConstHandle2ConstWeighted self); + +// --- Get, const +extern_c Handle2ConstGeneralEvaporation +WeightedGeneralEvaporationGetConst(ConstHandle2ConstWeighted self); + +// +++ Get, non-const +extern_c Handle2GeneralEvaporation +WeightedGeneralEvaporationGet(ConstHandle2Weighted self); + +// +++ Set +extern_c void +WeightedGeneralEvaporationSet(ConstHandle2Weighted self, ConstHandle2ConstGeneralEvaporation generalEvaporation); + + +// ----------------------------------------------------------------------------- +// Child: simpleMaxwellianFission +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WeightedSimpleMaxwellianFissionHas(ConstHandle2ConstWeighted self); + +// --- Get, const +extern_c Handle2ConstSimpleMaxwellianFission +WeightedSimpleMaxwellianFissionGetConst(ConstHandle2ConstWeighted self); + +// +++ Get, non-const +extern_c Handle2SimpleMaxwellianFission +WeightedSimpleMaxwellianFissionGet(ConstHandle2Weighted self); + +// +++ Set +extern_c void +WeightedSimpleMaxwellianFissionSet(ConstHandle2Weighted self, ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission); + + +// ----------------------------------------------------------------------------- +// Child: Watt +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WeightedWattHas(ConstHandle2ConstWeighted self); + +// --- Get, const +extern_c Handle2ConstWatt +WeightedWattGetConst(ConstHandle2ConstWeighted self); + +// +++ Get, non-const +extern_c Handle2Watt +WeightedWattGet(ConstHandle2Weighted self); + +// +++ Set +extern_c void +WeightedWattSet(ConstHandle2Weighted self, ConstHandle2ConstWatt Watt); + + +// ----------------------------------------------------------------------------- +// Child: MadlandNix +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WeightedMadlandNixHas(ConstHandle2ConstWeighted self); + +// --- Get, const +extern_c Handle2ConstMadlandNix +WeightedMadlandNixGetConst(ConstHandle2ConstWeighted self); + +// +++ Get, non-const +extern_c Handle2MadlandNix +WeightedMadlandNixGet(ConstHandle2Weighted self); + +// +++ Set +extern_c void +WeightedMadlandNixSet(ConstHandle2Weighted self, ConstHandle2ConstMadlandNix MadlandNix); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/Weighted/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/Weighted/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals.cpp new file mode 100644 index 000000000..a96afa60d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/transport/WeightedFunctionals.hpp" +#include "WeightedFunctionals.h" + +using namespace njoy::GNDStk; +using namespace test::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 = transport::Weighted; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstWeightedFunctionals +WeightedFunctionalsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2WeightedFunctionals +WeightedFunctionalsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstWeightedFunctionals +WeightedFunctionalsCreateConst( + ConstHandle2ConstWeighted weighted +) { + ConstHandle2WeightedFunctionals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(weighted) + ); + return handle; +} + +// Create, general +Handle2WeightedFunctionals +WeightedFunctionalsCreate( + ConstHandle2ConstWeighted weighted +) { + ConstHandle2WeightedFunctionals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(weighted) + ); + return handle; +} + +// Assign +// Use this to assign 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); +} + +// Get, const +Handle2ConstWeighted +WeightedFunctionalsWeightedGetConst(ConstHandle2ConstWeightedFunctionals self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WeightedGetConst", self, extract::weighted); +} + +// Get, non-const +Handle2Weighted +WeightedFunctionalsWeightedGet(ConstHandle2WeightedFunctionals self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WeightedGet", self, extract::weighted); +} + +// Set +void +WeightedFunctionalsWeightedSet(ConstHandle2WeightedFunctionals self, ConstHandle2ConstWeighted weighted) +{ + detail::setField + (CLASSNAME, CLASSNAME+"WeightedSet", self, extract::weighted, weighted); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/WeightedFunctionals/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals.h b/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals.h new file mode 100644 index 000000000..e868aa49b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals.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. +// +// 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_TEST_V2_0_TRANSPORT_WEIGHTEDFUNCTIONALS +#define C_INTERFACE_TEST_V2_0_TRANSPORT_WEIGHTEDFUNCTIONALS + +#include "GNDStk.h" +#include "v2.0/transport/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 +extern_c Handle2WeightedFunctionals +WeightedFunctionalsDefault(); + +// --- Create, general, const +extern_c Handle2ConstWeightedFunctionals +WeightedFunctionalsCreateConst( + ConstHandle2ConstWeighted weighted +); + +// +++ Create, general +extern_c Handle2WeightedFunctionals +WeightedFunctionalsCreate( + ConstHandle2ConstWeighted weighted +); + +// +++ Assign +// +++ Use this to assign one handled 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); + +// --- Get, const +extern_c Handle2ConstWeighted +WeightedFunctionalsWeightedGetConst(ConstHandle2ConstWeightedFunctionals self); + +// +++ Get, non-const +extern_c Handle2Weighted +WeightedFunctionalsWeightedGet(ConstHandle2WeightedFunctionals self); + +// +++ Set +extern_c void +WeightedFunctionalsWeightedSet(ConstHandle2WeightedFunctionals self, ConstHandle2ConstWeighted weighted); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/transport/WeightedFunctionals/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/transport/WeightedFunctionals/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BoundAtomCrossSection.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/BoundAtomCrossSection.cpp new file mode 100644 index 000000000..4dd97176e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/BoundAtomCrossSection.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/BoundAtomCrossSection.hpp" +#include "BoundAtomCrossSection.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BoundAtomCrossSectionClass; +using CPP = multigroup::BoundAtomCrossSection; + +static const std::string CLASSNAME = "BoundAtomCrossSection"; + +namespace extract { + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBoundAtomCrossSection +BoundAtomCrossSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2BoundAtomCrossSection +BoundAtomCrossSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBoundAtomCrossSection +BoundAtomCrossSectionCreateConst( + const XMLName unit, + const Float64 value +) { + ConstHandle2BoundAtomCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + unit, + value + ); + return handle; +} + +// Create, general +Handle2BoundAtomCrossSection +BoundAtomCrossSectionCreate( + const XMLName unit, + const Float64 value +) { + ConstHandle2BoundAtomCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + unit, + 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 +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: unit +// ----------------------------------------------------------------------------- + +// Has +int +BoundAtomCrossSectionUnitHas(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +BoundAtomCrossSectionUnitGet(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +BoundAtomCrossSectionUnitSet(ConstHandle2BoundAtomCrossSection self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +BoundAtomCrossSectionValueHas(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +BoundAtomCrossSectionValueGet(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +BoundAtomCrossSectionValueSet(ConstHandle2BoundAtomCrossSection self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/BoundAtomCrossSection/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BoundAtomCrossSection.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/BoundAtomCrossSection.h new file mode 100644 index 000000000..d32c39872 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_BOUNDATOMCROSSSECTION +#define C_INTERFACE_TEST_V2_0_TSL_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 +extern_c Handle2BoundAtomCrossSection +BoundAtomCrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstBoundAtomCrossSection +BoundAtomCrossSectionCreateConst( + const XMLName unit, + const Float64 value +); + +// +++ Create, general +extern_c Handle2BoundAtomCrossSection +BoundAtomCrossSectionCreate( + const XMLName unit, + const Float64 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 +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: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BoundAtomCrossSectionUnitHas(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BoundAtomCrossSectionUnitGet(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Set +extern_c void +BoundAtomCrossSectionUnitSet(ConstHandle2BoundAtomCrossSection self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BoundAtomCrossSectionValueHas(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +BoundAtomCrossSectionValueGet(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Set +extern_c void +BoundAtomCrossSectionValueSet(ConstHandle2BoundAtomCrossSection self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/BoundAtomCrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BoundAtomCrossSection/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/BoundAtomCrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BoundAtomCrossSection/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/BoundAtomCrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge.cpp new file mode 100644 index 000000000..8d5810039 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/BraggEdge.hpp" +#include "BraggEdge.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BraggEdgeClass; +using CPP = multigroup::BraggEdge; + +static const std::string CLASSNAME = "BraggEdge"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto BraggEnergy = [](auto &obj) { return &obj.BraggEnergy; }; + static auto structureFactor = [](auto &obj) { return &obj.structureFactor; }; +} + +using CPPBraggEnergy = tsl::BraggEnergy; +using CPPStructureFactor = tsl::StructureFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBraggEdge +BraggEdgeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2BraggEdge +BraggEdgeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBraggEdge +BraggEdgeCreateConst( + const XMLName label, + ConstHandle2ConstBraggEnergy BraggEnergy, + ConstHandle2ConstStructureFactor structureFactor +) { + ConstHandle2BraggEdge handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(BraggEnergy), + detail::tocpp(structureFactor) + ); + return handle; +} + +// Create, general +Handle2BraggEdge +BraggEdgeCreate( + const XMLName label, + ConstHandle2ConstBraggEnergy BraggEnergy, + ConstHandle2ConstStructureFactor structureFactor +) { + ConstHandle2BraggEdge handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(BraggEnergy), + detail::tocpp(structureFactor) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BraggEdgeAssign(ConstHandle2BraggEdge self, ConstHandle2ConstBraggEdge from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BraggEdgeDelete(ConstHandle2ConstBraggEdge self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BraggEdgeRead(ConstHandle2BraggEdge self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BraggEdgeWrite(ConstHandle2ConstBraggEdge self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BraggEdgePrint(ConstHandle2ConstBraggEdge self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BraggEdgePrintXML(ConstHandle2ConstBraggEdge self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BraggEdgePrintJSON(ConstHandle2ConstBraggEdge self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +BraggEdgeLabelHas(ConstHandle2ConstBraggEdge self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +XMLName +BraggEdgeLabelGet(ConstHandle2ConstBraggEdge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +BraggEdgeLabelSet(ConstHandle2BraggEdge self, const XMLName label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: BraggEnergy +// ----------------------------------------------------------------------------- + +// Has +int +BraggEdgeBraggEnergyHas(ConstHandle2ConstBraggEdge self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BraggEnergyHas", self, extract::BraggEnergy); +} + +// Get, const +Handle2ConstBraggEnergy +BraggEdgeBraggEnergyGetConst(ConstHandle2ConstBraggEdge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BraggEnergyGetConst", self, extract::BraggEnergy); +} + +// Get, non-const +Handle2BraggEnergy +BraggEdgeBraggEnergyGet(ConstHandle2BraggEdge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BraggEnergyGet", self, extract::BraggEnergy); +} + +// Set +void +BraggEdgeBraggEnergySet(ConstHandle2BraggEdge self, ConstHandle2ConstBraggEnergy BraggEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BraggEnergySet", self, extract::BraggEnergy, BraggEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: structureFactor +// ----------------------------------------------------------------------------- + +// Has +int +BraggEdgeStructureFactorHas(ConstHandle2ConstBraggEdge self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StructureFactorHas", self, extract::structureFactor); +} + +// Get, const +Handle2ConstStructureFactor +BraggEdgeStructureFactorGetConst(ConstHandle2ConstBraggEdge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StructureFactorGetConst", self, extract::structureFactor); +} + +// Get, non-const +Handle2StructureFactor +BraggEdgeStructureFactorGet(ConstHandle2BraggEdge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StructureFactorGet", self, extract::structureFactor); +} + +// Set +void +BraggEdgeStructureFactorSet(ConstHandle2BraggEdge self, ConstHandle2ConstStructureFactor structureFactor) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StructureFactorSet", self, extract::structureFactor, structureFactor); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/BraggEdge/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge.h new file mode 100644 index 000000000..6bfc0714e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge.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. +// +// BraggEdge is the basic handle type in this file. Example: +// // Create a default BraggEdge object: +// BraggEdge handle = BraggEdgeDefault(); +// Functions involving BraggEdge are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TSL_BRAGGEDGE +#define C_INTERFACE_TEST_V2_0_TSL_BRAGGEDGE + +#include "GNDStk.h" +#include "v2.0/tsl/BraggEnergy.h" +#include "v2.0/tsl/StructureFactor.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BraggEdgeClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ BraggEdge +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BraggEdgeClass *BraggEdge; + +// --- Const-aware handles. +typedef const struct BraggEdgeClass *const ConstHandle2ConstBraggEdge; +typedef struct BraggEdgeClass *const ConstHandle2BraggEdge; +typedef const struct BraggEdgeClass * Handle2ConstBraggEdge; +typedef struct BraggEdgeClass * Handle2BraggEdge; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBraggEdge +BraggEdgeDefaultConst(); + +// +++ Create, default +extern_c Handle2BraggEdge +BraggEdgeDefault(); + +// --- Create, general, const +extern_c Handle2ConstBraggEdge +BraggEdgeCreateConst( + const XMLName label, + ConstHandle2ConstBraggEnergy BraggEnergy, + ConstHandle2ConstStructureFactor structureFactor +); + +// +++ Create, general +extern_c Handle2BraggEdge +BraggEdgeCreate( + const XMLName label, + ConstHandle2ConstBraggEnergy BraggEnergy, + ConstHandle2ConstStructureFactor structureFactor +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BraggEdgeAssign(ConstHandle2BraggEdge self, ConstHandle2ConstBraggEdge from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BraggEdgeDelete(ConstHandle2ConstBraggEdge self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BraggEdgeRead(ConstHandle2BraggEdge self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BraggEdgeWrite(ConstHandle2ConstBraggEdge self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BraggEdgePrint(ConstHandle2ConstBraggEdge self); + +// +++ Print to standard output, as XML +extern_c int +BraggEdgePrintXML(ConstHandle2ConstBraggEdge self); + +// +++ Print to standard output, as JSON +extern_c int +BraggEdgePrintJSON(ConstHandle2ConstBraggEdge self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BraggEdgeLabelHas(ConstHandle2ConstBraggEdge self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +BraggEdgeLabelGet(ConstHandle2ConstBraggEdge self); + +// +++ Set +extern_c void +BraggEdgeLabelSet(ConstHandle2BraggEdge self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Child: BraggEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BraggEdgeBraggEnergyHas(ConstHandle2ConstBraggEdge self); + +// --- Get, const +extern_c Handle2ConstBraggEnergy +BraggEdgeBraggEnergyGetConst(ConstHandle2ConstBraggEdge self); + +// +++ Get, non-const +extern_c Handle2BraggEnergy +BraggEdgeBraggEnergyGet(ConstHandle2BraggEdge self); + +// +++ Set +extern_c void +BraggEdgeBraggEnergySet(ConstHandle2BraggEdge self, ConstHandle2ConstBraggEnergy BraggEnergy); + + +// ----------------------------------------------------------------------------- +// Child: structureFactor +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BraggEdgeStructureFactorHas(ConstHandle2ConstBraggEdge self); + +// --- Get, const +extern_c Handle2ConstStructureFactor +BraggEdgeStructureFactorGetConst(ConstHandle2ConstBraggEdge self); + +// +++ Get, non-const +extern_c Handle2StructureFactor +BraggEdgeStructureFactorGet(ConstHandle2BraggEdge self); + +// +++ Set +extern_c void +BraggEdgeStructureFactorSet(ConstHandle2BraggEdge self, ConstHandle2ConstStructureFactor structureFactor); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/BraggEdge/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdge/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges.cpp new file mode 100644 index 000000000..ea16646ea --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/BraggEdges.hpp" +#include "BraggEdges.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BraggEdgesClass; +using CPP = multigroup::BraggEdges; + +static const std::string CLASSNAME = "BraggEdges"; + +namespace extract { + static auto BraggEdge = [](auto &obj) { return &obj.BraggEdge; }; +} + +using CPPBraggEdge = tsl::BraggEdge; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBraggEdges +BraggEdgesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2BraggEdges +BraggEdgesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBraggEdges +BraggEdgesCreateConst( + ConstHandle2BraggEdge *const BraggEdge, const size_t BraggEdgeSize +) { + ConstHandle2BraggEdges handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t BraggEdgeN = 0; BraggEdgeN < BraggEdgeSize; ++BraggEdgeN) + BraggEdgesBraggEdgeAdd(handle, BraggEdge[BraggEdgeN]); + return handle; +} + +// Create, general +Handle2BraggEdges +BraggEdgesCreate( + ConstHandle2BraggEdge *const BraggEdge, const size_t BraggEdgeSize +) { + ConstHandle2BraggEdges handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t BraggEdgeN = 0; BraggEdgeN < BraggEdgeSize; ++BraggEdgeN) + BraggEdgesBraggEdgeAdd(handle, BraggEdge[BraggEdgeN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BraggEdgesAssign(ConstHandle2BraggEdges self, ConstHandle2ConstBraggEdges from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BraggEdgesDelete(ConstHandle2ConstBraggEdges self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BraggEdgesRead(ConstHandle2BraggEdges self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BraggEdgesWrite(ConstHandle2ConstBraggEdges self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BraggEdgesPrint(ConstHandle2ConstBraggEdges self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BraggEdgesPrintXML(ConstHandle2ConstBraggEdges self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BraggEdgesPrintJSON(ConstHandle2ConstBraggEdges self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: BraggEdge +// ----------------------------------------------------------------------------- + +// Has +int +BraggEdgesBraggEdgeHas(ConstHandle2ConstBraggEdges self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BraggEdgeHas", self, extract::BraggEdge); +} + +// Clear +void +BraggEdgesBraggEdgeClear(ConstHandle2BraggEdges self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"BraggEdgeClear", self, extract::BraggEdge); +} + +// Size +size_t +BraggEdgesBraggEdgeSize(ConstHandle2ConstBraggEdges self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"BraggEdgeSize", self, extract::BraggEdge); +} + +// Add +void +BraggEdgesBraggEdgeAdd(ConstHandle2BraggEdges self, ConstHandle2ConstBraggEdge BraggEdge) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"BraggEdgeAdd", self, extract::BraggEdge, BraggEdge); +} + +// Get, by index \in [0,size), const +Handle2ConstBraggEdge +BraggEdgesBraggEdgeGetConst(ConstHandle2ConstBraggEdges self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"BraggEdgeGetConst", self, extract::BraggEdge, index_); +} + +// Get, by index \in [0,size), non-const +Handle2BraggEdge +BraggEdgesBraggEdgeGet(ConstHandle2BraggEdges self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"BraggEdgeGet", self, extract::BraggEdge, index_); +} + +// Set, by index \in [0,size) +void +BraggEdgesBraggEdgeSet( + ConstHandle2BraggEdges self, + const size_t index_, + ConstHandle2ConstBraggEdge BraggEdge +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"BraggEdgeSet", self, extract::BraggEdge, index_, BraggEdge); +} + +// Has, by label +int +BraggEdgesBraggEdgeHasByLabel( + ConstHandle2ConstBraggEdges self, + const XMLName label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"BraggEdgeHasByLabel", + self, extract::BraggEdge, meta::label, label); +} + +// Get, by label, const +Handle2ConstBraggEdge +BraggEdgesBraggEdgeGetByLabelConst( + ConstHandle2ConstBraggEdges self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BraggEdgeGetByLabelConst", + self, extract::BraggEdge, meta::label, label); +} + +// Get, by label, non-const +Handle2BraggEdge +BraggEdgesBraggEdgeGetByLabel( + ConstHandle2BraggEdges self, + const XMLName label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BraggEdgeGetByLabel", + self, extract::BraggEdge, meta::label, label); +} + +// Set, by label +void +BraggEdgesBraggEdgeSetByLabel( + ConstHandle2BraggEdges self, + const XMLName label, + ConstHandle2ConstBraggEdge BraggEdge +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"BraggEdgeSetByLabel", + self, extract::BraggEdge, meta::label, label, BraggEdge); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/BraggEdges/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges.h new file mode 100644 index 000000000..6e1ada916 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// BraggEdges is the basic handle type in this file. Example: +// // Create a default BraggEdges object: +// BraggEdges handle = BraggEdgesDefault(); +// Functions involving BraggEdges are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TSL_BRAGGEDGES +#define C_INTERFACE_TEST_V2_0_TSL_BRAGGEDGES + +#include "GNDStk.h" +#include "v2.0/tsl/BraggEdge.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BraggEdgesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ BraggEdges +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BraggEdgesClass *BraggEdges; + +// --- Const-aware handles. +typedef const struct BraggEdgesClass *const ConstHandle2ConstBraggEdges; +typedef struct BraggEdgesClass *const ConstHandle2BraggEdges; +typedef const struct BraggEdgesClass * Handle2ConstBraggEdges; +typedef struct BraggEdgesClass * Handle2BraggEdges; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBraggEdges +BraggEdgesDefaultConst(); + +// +++ Create, default +extern_c Handle2BraggEdges +BraggEdgesDefault(); + +// --- Create, general, const +extern_c Handle2ConstBraggEdges +BraggEdgesCreateConst( + ConstHandle2BraggEdge *const BraggEdge, const size_t BraggEdgeSize +); + +// +++ Create, general +extern_c Handle2BraggEdges +BraggEdgesCreate( + ConstHandle2BraggEdge *const BraggEdge, const size_t BraggEdgeSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BraggEdgesAssign(ConstHandle2BraggEdges self, ConstHandle2ConstBraggEdges from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BraggEdgesDelete(ConstHandle2ConstBraggEdges self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BraggEdgesRead(ConstHandle2BraggEdges self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BraggEdgesWrite(ConstHandle2ConstBraggEdges self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BraggEdgesPrint(ConstHandle2ConstBraggEdges self); + +// +++ Print to standard output, as XML +extern_c int +BraggEdgesPrintXML(ConstHandle2ConstBraggEdges self); + +// +++ Print to standard output, as JSON +extern_c int +BraggEdgesPrintJSON(ConstHandle2ConstBraggEdges self); + + +// ----------------------------------------------------------------------------- +// Child: BraggEdge +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BraggEdgesBraggEdgeHas(ConstHandle2ConstBraggEdges self); + +// +++ Clear +extern_c void +BraggEdgesBraggEdgeClear(ConstHandle2BraggEdges self); + +// +++ Size +extern_c size_t +BraggEdgesBraggEdgeSize(ConstHandle2ConstBraggEdges self); + +// +++ Add +extern_c void +BraggEdgesBraggEdgeAdd(ConstHandle2BraggEdges self, ConstHandle2ConstBraggEdge BraggEdge); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstBraggEdge +BraggEdgesBraggEdgeGetConst(ConstHandle2ConstBraggEdges self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2BraggEdge +BraggEdgesBraggEdgeGet(ConstHandle2BraggEdges self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +BraggEdgesBraggEdgeSet( + ConstHandle2BraggEdges self, + const size_t index_, + ConstHandle2ConstBraggEdge BraggEdge +); + +// +++ Has, by label +extern_c int +BraggEdgesBraggEdgeHasByLabel( + ConstHandle2ConstBraggEdges self, + const XMLName label +); + +// --- Get, by label, const +extern_c Handle2ConstBraggEdge +BraggEdgesBraggEdgeGetByLabelConst( + ConstHandle2ConstBraggEdges self, + const XMLName label +); + +// +++ Get, by label, non-const +extern_c Handle2BraggEdge +BraggEdgesBraggEdgeGetByLabel( + ConstHandle2BraggEdges self, + const XMLName label +); + +// +++ Set, by label +extern_c void +BraggEdgesBraggEdgeSetByLabel( + ConstHandle2BraggEdges self, + const XMLName label, + ConstHandle2ConstBraggEdge BraggEdge +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/BraggEdges/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEdges/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy.cpp new file mode 100644 index 000000000..0631d4524 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/BraggEnergy.hpp" +#include "BraggEnergy.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = BraggEnergyClass; +using CPP = multigroup::BraggEnergy; + +static const std::string CLASSNAME = "BraggEnergy"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = containers::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBraggEnergy +BraggEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2BraggEnergy +BraggEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBraggEnergy +BraggEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2BraggEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general +Handle2BraggEnergy +BraggEnergyCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2BraggEnergy 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 +BraggEnergyAssign(ConstHandle2BraggEnergy self, ConstHandle2ConstBraggEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BraggEnergyDelete(ConstHandle2ConstBraggEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BraggEnergyRead(ConstHandle2BraggEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BraggEnergyWrite(ConstHandle2ConstBraggEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BraggEnergyPrint(ConstHandle2ConstBraggEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BraggEnergyPrintXML(ConstHandle2ConstBraggEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BraggEnergyPrintJSON(ConstHandle2ConstBraggEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +BraggEnergyXYs1dHas(ConstHandle2ConstBraggEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +BraggEnergyXYs1dGetConst(ConstHandle2ConstBraggEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +BraggEnergyXYs1dGet(ConstHandle2BraggEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +BraggEnergyXYs1dSet(ConstHandle2BraggEnergy self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/BraggEnergy/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy.h new file mode 100644 index 000000000..d64ca2cb9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy.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. +// +// BraggEnergy is the basic handle type in this file. Example: +// // Create a default BraggEnergy object: +// BraggEnergy handle = BraggEnergyDefault(); +// Functions involving BraggEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TSL_BRAGGENERGY +#define C_INTERFACE_TEST_V2_0_TSL_BRAGGENERGY + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BraggEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ BraggEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BraggEnergyClass *BraggEnergy; + +// --- Const-aware handles. +typedef const struct BraggEnergyClass *const ConstHandle2ConstBraggEnergy; +typedef struct BraggEnergyClass *const ConstHandle2BraggEnergy; +typedef const struct BraggEnergyClass * Handle2ConstBraggEnergy; +typedef struct BraggEnergyClass * Handle2BraggEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBraggEnergy +BraggEnergyDefaultConst(); + +// +++ Create, default +extern_c Handle2BraggEnergy +BraggEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBraggEnergy +BraggEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +extern_c Handle2BraggEnergy +BraggEnergyCreate( + 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 +BraggEnergyAssign(ConstHandle2BraggEnergy self, ConstHandle2ConstBraggEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BraggEnergyDelete(ConstHandle2ConstBraggEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BraggEnergyRead(ConstHandle2BraggEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BraggEnergyWrite(ConstHandle2ConstBraggEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BraggEnergyPrint(ConstHandle2ConstBraggEnergy self); + +// +++ Print to standard output, as XML +extern_c int +BraggEnergyPrintXML(ConstHandle2ConstBraggEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +BraggEnergyPrintJSON(ConstHandle2ConstBraggEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BraggEnergyXYs1dHas(ConstHandle2ConstBraggEnergy self); + +// --- Get, const +extern_c Handle2ConstXYs1d +BraggEnergyXYs1dGetConst(ConstHandle2ConstBraggEnergy self); + +// +++ Get, non-const +extern_c Handle2XYs1d +BraggEnergyXYs1dGet(ConstHandle2BraggEnergy self); + +// +++ Set +extern_c void +BraggEnergyXYs1dSet(ConstHandle2BraggEnergy self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/BraggEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/BraggEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection.cpp new file mode 100644 index 000000000..416c8d1d7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/CoherentAtomCrossSection.hpp" +#include "CoherentAtomCrossSection.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = CoherentAtomCrossSectionClass; +using CPP = multigroup::CoherentAtomCrossSection; + +static const std::string CLASSNAME = "CoherentAtomCrossSection"; + +namespace extract { + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCoherentAtomCrossSection +CoherentAtomCrossSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CoherentAtomCrossSection +CoherentAtomCrossSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCoherentAtomCrossSection +CoherentAtomCrossSectionCreateConst( + const XMLName unit, + const Float64 value +) { + ConstHandle2CoherentAtomCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + unit, + value + ); + return handle; +} + +// Create, general +Handle2CoherentAtomCrossSection +CoherentAtomCrossSectionCreate( + const XMLName unit, + const Float64 value +) { + ConstHandle2CoherentAtomCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + unit, + 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 +CoherentAtomCrossSectionAssign(ConstHandle2CoherentAtomCrossSection self, ConstHandle2ConstCoherentAtomCrossSection from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CoherentAtomCrossSectionDelete(ConstHandle2ConstCoherentAtomCrossSection self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CoherentAtomCrossSectionRead(ConstHandle2CoherentAtomCrossSection self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CoherentAtomCrossSectionWrite(ConstHandle2ConstCoherentAtomCrossSection self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CoherentAtomCrossSectionPrint(ConstHandle2ConstCoherentAtomCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CoherentAtomCrossSectionPrintXML(ConstHandle2ConstCoherentAtomCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CoherentAtomCrossSectionPrintJSON(ConstHandle2ConstCoherentAtomCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +CoherentAtomCrossSectionUnitHas(ConstHandle2ConstCoherentAtomCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +CoherentAtomCrossSectionUnitGet(ConstHandle2ConstCoherentAtomCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +CoherentAtomCrossSectionUnitSet(ConstHandle2CoherentAtomCrossSection self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +CoherentAtomCrossSectionValueHas(ConstHandle2ConstCoherentAtomCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +CoherentAtomCrossSectionValueGet(ConstHandle2ConstCoherentAtomCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +CoherentAtomCrossSectionValueSet(ConstHandle2CoherentAtomCrossSection self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/CoherentAtomCrossSection/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection.h new file mode 100644 index 000000000..56b680f51 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection.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. +// +// CoherentAtomCrossSection is the basic handle type in this file. Example: +// // Create a default CoherentAtomCrossSection object: +// CoherentAtomCrossSection handle = CoherentAtomCrossSectionDefault(); +// Functions involving CoherentAtomCrossSection are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TSL_COHERENTATOMCROSSSECTION +#define C_INTERFACE_TEST_V2_0_TSL_COHERENTATOMCROSSSECTION + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CoherentAtomCrossSectionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CoherentAtomCrossSection +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CoherentAtomCrossSectionClass *CoherentAtomCrossSection; + +// --- Const-aware handles. +typedef const struct CoherentAtomCrossSectionClass *const ConstHandle2ConstCoherentAtomCrossSection; +typedef struct CoherentAtomCrossSectionClass *const ConstHandle2CoherentAtomCrossSection; +typedef const struct CoherentAtomCrossSectionClass * Handle2ConstCoherentAtomCrossSection; +typedef struct CoherentAtomCrossSectionClass * Handle2CoherentAtomCrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCoherentAtomCrossSection +CoherentAtomCrossSectionDefaultConst(); + +// +++ Create, default +extern_c Handle2CoherentAtomCrossSection +CoherentAtomCrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstCoherentAtomCrossSection +CoherentAtomCrossSectionCreateConst( + const XMLName unit, + const Float64 value +); + +// +++ Create, general +extern_c Handle2CoherentAtomCrossSection +CoherentAtomCrossSectionCreate( + const XMLName unit, + const Float64 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 +CoherentAtomCrossSectionAssign(ConstHandle2CoherentAtomCrossSection self, ConstHandle2ConstCoherentAtomCrossSection from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CoherentAtomCrossSectionDelete(ConstHandle2ConstCoherentAtomCrossSection self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CoherentAtomCrossSectionRead(ConstHandle2CoherentAtomCrossSection self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CoherentAtomCrossSectionWrite(ConstHandle2ConstCoherentAtomCrossSection self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CoherentAtomCrossSectionPrint(ConstHandle2ConstCoherentAtomCrossSection self); + +// +++ Print to standard output, as XML +extern_c int +CoherentAtomCrossSectionPrintXML(ConstHandle2ConstCoherentAtomCrossSection self); + +// +++ Print to standard output, as JSON +extern_c int +CoherentAtomCrossSectionPrintJSON(ConstHandle2ConstCoherentAtomCrossSection self); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentAtomCrossSectionUnitHas(ConstHandle2ConstCoherentAtomCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +CoherentAtomCrossSectionUnitGet(ConstHandle2ConstCoherentAtomCrossSection self); + +// +++ Set +extern_c void +CoherentAtomCrossSectionUnitSet(ConstHandle2CoherentAtomCrossSection self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentAtomCrossSectionValueHas(ConstHandle2ConstCoherentAtomCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +CoherentAtomCrossSectionValueGet(ConstHandle2ConstCoherentAtomCrossSection self); + +// +++ Set +extern_c void +CoherentAtomCrossSectionValueSet(ConstHandle2CoherentAtomCrossSection self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/CoherentAtomCrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/CoherentAtomCrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/DebyeWallerIntegral.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/DebyeWallerIntegral.cpp new file mode 100644 index 000000000..121b17e60 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/DebyeWallerIntegral.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/DebyeWallerIntegral.hpp" +#include "DebyeWallerIntegral.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDebyeWallerIntegral +DebyeWallerIntegralDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/tsl/DebyeWallerIntegral/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/DebyeWallerIntegral.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/DebyeWallerIntegral.h new file mode 100644 index 000000000..6d2218e72 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_DEBYEWALLERINTEGRAL +#define C_INTERFACE_TEST_V2_0_TSL_DEBYEWALLERINTEGRAL + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2DebyeWallerIntegral +DebyeWallerIntegralDefault(); + +// --- Create, general, const +extern_c Handle2ConstDebyeWallerIntegral +DebyeWallerIntegralCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/tsl/DebyeWallerIntegral/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/DebyeWallerIntegral/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/DebyeWallerIntegral/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/DebyeWallerIntegral/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/DebyeWallerIntegral/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel.cpp new file mode 100644 index 000000000..d90415fe9 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/DistinctScatteringKernel.hpp" +#include "DistinctScatteringKernel.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = DistinctScatteringKernelClass; +using CPP = multigroup::DistinctScatteringKernel; + +static const std::string CLASSNAME = "DistinctScatteringKernel"; + +namespace extract { + static auto gridded3d = [](auto &obj) { return &obj.gridded3d; }; +} + +using CPPGridded3d = containers::Gridded3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDistinctScatteringKernel +DistinctScatteringKernelDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2DistinctScatteringKernel +DistinctScatteringKernelDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDistinctScatteringKernel +DistinctScatteringKernelCreateConst( + ConstHandle2ConstGridded3d gridded3d +) { + ConstHandle2DistinctScatteringKernel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(gridded3d) + ); + return handle; +} + +// Create, general +Handle2DistinctScatteringKernel +DistinctScatteringKernelCreate( + ConstHandle2ConstGridded3d gridded3d +) { + ConstHandle2DistinctScatteringKernel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(gridded3d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DistinctScatteringKernelAssign(ConstHandle2DistinctScatteringKernel self, ConstHandle2ConstDistinctScatteringKernel from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DistinctScatteringKernelDelete(ConstHandle2ConstDistinctScatteringKernel self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DistinctScatteringKernelRead(ConstHandle2DistinctScatteringKernel self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DistinctScatteringKernelWrite(ConstHandle2ConstDistinctScatteringKernel self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DistinctScatteringKernelPrint(ConstHandle2ConstDistinctScatteringKernel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DistinctScatteringKernelPrintXML(ConstHandle2ConstDistinctScatteringKernel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DistinctScatteringKernelPrintJSON(ConstHandle2ConstDistinctScatteringKernel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded3d +// ----------------------------------------------------------------------------- + +// Has +int +DistinctScatteringKernelGridded3dHas(ConstHandle2ConstDistinctScatteringKernel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded3dHas", self, extract::gridded3d); +} + +// Get, const +Handle2ConstGridded3d +DistinctScatteringKernelGridded3dGetConst(ConstHandle2ConstDistinctScatteringKernel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded3dGetConst", self, extract::gridded3d); +} + +// Get, non-const +Handle2Gridded3d +DistinctScatteringKernelGridded3dGet(ConstHandle2DistinctScatteringKernel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded3dGet", self, extract::gridded3d); +} + +// Set +void +DistinctScatteringKernelGridded3dSet(ConstHandle2DistinctScatteringKernel self, ConstHandle2ConstGridded3d gridded3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded3dSet", self, extract::gridded3d, gridded3d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/DistinctScatteringKernel/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel.h new file mode 100644 index 000000000..f94783771 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel.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. +// +// DistinctScatteringKernel is the basic handle type in this file. Example: +// // Create a default DistinctScatteringKernel object: +// DistinctScatteringKernel handle = DistinctScatteringKernelDefault(); +// Functions involving DistinctScatteringKernel are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TSL_DISTINCTSCATTERINGKERNEL +#define C_INTERFACE_TEST_V2_0_TSL_DISTINCTSCATTERINGKERNEL + +#include "GNDStk.h" +#include "v2.0/containers/Gridded3d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DistinctScatteringKernelClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DistinctScatteringKernel +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DistinctScatteringKernelClass *DistinctScatteringKernel; + +// --- Const-aware handles. +typedef const struct DistinctScatteringKernelClass *const ConstHandle2ConstDistinctScatteringKernel; +typedef struct DistinctScatteringKernelClass *const ConstHandle2DistinctScatteringKernel; +typedef const struct DistinctScatteringKernelClass * Handle2ConstDistinctScatteringKernel; +typedef struct DistinctScatteringKernelClass * Handle2DistinctScatteringKernel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDistinctScatteringKernel +DistinctScatteringKernelDefaultConst(); + +// +++ Create, default +extern_c Handle2DistinctScatteringKernel +DistinctScatteringKernelDefault(); + +// --- Create, general, const +extern_c Handle2ConstDistinctScatteringKernel +DistinctScatteringKernelCreateConst( + ConstHandle2ConstGridded3d gridded3d +); + +// +++ Create, general +extern_c Handle2DistinctScatteringKernel +DistinctScatteringKernelCreate( + ConstHandle2ConstGridded3d gridded3d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DistinctScatteringKernelAssign(ConstHandle2DistinctScatteringKernel self, ConstHandle2ConstDistinctScatteringKernel from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DistinctScatteringKernelDelete(ConstHandle2ConstDistinctScatteringKernel self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DistinctScatteringKernelRead(ConstHandle2DistinctScatteringKernel self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DistinctScatteringKernelWrite(ConstHandle2ConstDistinctScatteringKernel self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DistinctScatteringKernelPrint(ConstHandle2ConstDistinctScatteringKernel self); + +// +++ Print to standard output, as XML +extern_c int +DistinctScatteringKernelPrintXML(ConstHandle2ConstDistinctScatteringKernel self); + +// +++ Print to standard output, as JSON +extern_c int +DistinctScatteringKernelPrintJSON(ConstHandle2ConstDistinctScatteringKernel self); + + +// ----------------------------------------------------------------------------- +// Child: gridded3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistinctScatteringKernelGridded3dHas(ConstHandle2ConstDistinctScatteringKernel self); + +// --- Get, const +extern_c Handle2ConstGridded3d +DistinctScatteringKernelGridded3dGetConst(ConstHandle2ConstDistinctScatteringKernel self); + +// +++ Get, non-const +extern_c Handle2Gridded3d +DistinctScatteringKernelGridded3dGet(ConstHandle2DistinctScatteringKernel self); + +// +++ Set +extern_c void +DistinctScatteringKernelGridded3dSet(ConstHandle2DistinctScatteringKernel self, ConstHandle2ConstGridded3d gridded3d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/DistinctScatteringKernel/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/DistinctScatteringKernel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/E_critical.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_critical.cpp new file mode 100644 index 000000000..20d1a261c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_critical.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/E_critical.hpp" +#include "E_critical.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = E_criticalClass; +using CPP = multigroup::E_critical; + +static const std::string CLASSNAME = "E_critical"; + +namespace extract { + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstE_critical +E_criticalDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2E_critical +E_criticalDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstE_critical +E_criticalCreateConst( + const XMLName unit, + const Float64 value +) { + ConstHandle2E_critical handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + unit, + value + ); + return handle; +} + +// Create, general +Handle2E_critical +E_criticalCreate( + const XMLName unit, + const Float64 value +) { + ConstHandle2E_critical handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + unit, + 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 +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: unit +// ----------------------------------------------------------------------------- + +// Has +int +E_criticalUnitHas(ConstHandle2ConstE_critical self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +E_criticalUnitGet(ConstHandle2ConstE_critical self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +E_criticalUnitSet(ConstHandle2E_critical self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +E_criticalValueHas(ConstHandle2ConstE_critical self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +E_criticalValueGet(ConstHandle2ConstE_critical self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +E_criticalValueSet(ConstHandle2E_critical self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/E_critical/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/E_critical.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_critical.h new file mode 100644 index 000000000..8633528b7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_E_CRITICAL +#define C_INTERFACE_TEST_V2_0_TSL_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 +extern_c Handle2E_critical +E_criticalDefault(); + +// --- Create, general, const +extern_c Handle2ConstE_critical +E_criticalCreateConst( + const XMLName unit, + const Float64 value +); + +// +++ Create, general +extern_c Handle2E_critical +E_criticalCreate( + const XMLName unit, + const Float64 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 +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: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +E_criticalUnitHas(ConstHandle2ConstE_critical self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +E_criticalUnitGet(ConstHandle2ConstE_critical self); + +// +++ Set +extern_c void +E_criticalUnitSet(ConstHandle2E_critical self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +E_criticalValueHas(ConstHandle2ConstE_critical self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +E_criticalValueGet(ConstHandle2ConstE_critical self); + +// +++ Set +extern_c void +E_criticalValueSet(ConstHandle2E_critical self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/E_critical/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/E_critical/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_critical/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/E_critical/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_critical/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/E_max.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_max.cpp new file mode 100644 index 000000000..5c8d052c5 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_max.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/E_max.hpp" +#include "E_max.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = E_maxClass; +using CPP = multigroup::E_max; + +static const std::string CLASSNAME = "E_max"; + +namespace extract { + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstE_max +E_maxDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2E_max +E_maxDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstE_max +E_maxCreateConst( + const XMLName unit, + const Float64 value +) { + ConstHandle2E_max handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + unit, + value + ); + return handle; +} + +// Create, general +Handle2E_max +E_maxCreate( + const XMLName unit, + const Float64 value +) { + ConstHandle2E_max handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + unit, + 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 +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: unit +// ----------------------------------------------------------------------------- + +// Has +int +E_maxUnitHas(ConstHandle2ConstE_max self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +E_maxUnitGet(ConstHandle2ConstE_max self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +E_maxUnitSet(ConstHandle2E_max self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +E_maxValueHas(ConstHandle2ConstE_max self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +E_maxValueGet(ConstHandle2ConstE_max self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +E_maxValueSet(ConstHandle2E_max self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/E_max/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/E_max.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_max.h new file mode 100644 index 000000000..d5d6c3145 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_E_MAX +#define C_INTERFACE_TEST_V2_0_TSL_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 +extern_c Handle2E_max +E_maxDefault(); + +// --- Create, general, const +extern_c Handle2ConstE_max +E_maxCreateConst( + const XMLName unit, + const Float64 value +); + +// +++ Create, general +extern_c Handle2E_max +E_maxCreate( + const XMLName unit, + const Float64 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 +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: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +E_maxUnitHas(ConstHandle2ConstE_max self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +E_maxUnitGet(ConstHandle2ConstE_max self); + +// +++ Set +extern_c void +E_maxUnitSet(ConstHandle2E_max self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +E_maxValueHas(ConstHandle2ConstE_max self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +E_maxValueGet(ConstHandle2ConstE_max self); + +// +++ Set +extern_c void +E_maxValueSet(ConstHandle2E_max self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/E_max/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/E_max/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_max/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/E_max/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/E_max/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/FreeGasApproximation.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/FreeGasApproximation.cpp new file mode 100644 index 000000000..3bc56429c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/FreeGasApproximation.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/FreeGasApproximation.hpp" +#include "FreeGasApproximation.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2FreeGasApproximation +FreeGasApproximationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFreeGasApproximation +FreeGasApproximationCreateConst() +{ + ConstHandle2FreeGasApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/tsl/FreeGasApproximation/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/FreeGasApproximation.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/FreeGasApproximation.h new file mode 100644 index 000000000..c26f09bc3 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_FREEGASAPPROXIMATION +#define C_INTERFACE_TEST_V2_0_TSL_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 +extern_c Handle2FreeGasApproximation +FreeGasApproximationDefault(); + +// --- Create, general, const +extern_c Handle2ConstFreeGasApproximation +FreeGasApproximationCreateConst(); + +// +++ Create, general +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/tsl/FreeGasApproximation/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/FreeGasApproximation/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/FreeGasApproximation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/FreeGasApproximation/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/FreeGasApproximation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation.cpp new file mode 100644 index 000000000..84ce0c312 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/GaussianApproximation.hpp" +#include "GaussianApproximation.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = GaussianApproximationClass; +using CPP = multigroup::GaussianApproximation; + +static const std::string CLASSNAME = "GaussianApproximation"; + +namespace extract { + static auto phononSpectrum = [](auto &obj) { return &obj.phononSpectrum; }; +} + +using CPPPhononSpectrum = tsl::PhononSpectrum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGaussianApproximation +GaussianApproximationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2GaussianApproximation +GaussianApproximationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGaussianApproximation +GaussianApproximationCreateConst( + ConstHandle2ConstPhononSpectrum phononSpectrum +) { + ConstHandle2GaussianApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(phononSpectrum) + ); + return handle; +} + +// Create, general +Handle2GaussianApproximation +GaussianApproximationCreate( + ConstHandle2ConstPhononSpectrum phononSpectrum +) { + ConstHandle2GaussianApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(phononSpectrum) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +GaussianApproximationAssign(ConstHandle2GaussianApproximation self, ConstHandle2ConstGaussianApproximation from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +GaussianApproximationDelete(ConstHandle2ConstGaussianApproximation self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +GaussianApproximationRead(ConstHandle2GaussianApproximation self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +GaussianApproximationWrite(ConstHandle2ConstGaussianApproximation self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +GaussianApproximationPrint(ConstHandle2ConstGaussianApproximation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +GaussianApproximationPrintXML(ConstHandle2ConstGaussianApproximation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +GaussianApproximationPrintJSON(ConstHandle2ConstGaussianApproximation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: phononSpectrum +// ----------------------------------------------------------------------------- + +// Has +int +GaussianApproximationPhononSpectrumHas(ConstHandle2ConstGaussianApproximation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PhononSpectrumHas", self, extract::phononSpectrum); +} + +// Get, const +Handle2ConstPhononSpectrum +GaussianApproximationPhononSpectrumGetConst(ConstHandle2ConstGaussianApproximation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PhononSpectrumGetConst", self, extract::phononSpectrum); +} + +// Get, non-const +Handle2PhononSpectrum +GaussianApproximationPhononSpectrumGet(ConstHandle2GaussianApproximation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PhononSpectrumGet", self, extract::phononSpectrum); +} + +// Set +void +GaussianApproximationPhononSpectrumSet(ConstHandle2GaussianApproximation self, ConstHandle2ConstPhononSpectrum phononSpectrum) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PhononSpectrumSet", self, extract::phononSpectrum, phononSpectrum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/GaussianApproximation/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation.h new file mode 100644 index 000000000..49ce12e23 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation.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. +// +// GaussianApproximation is the basic handle type in this file. Example: +// // Create a default GaussianApproximation object: +// GaussianApproximation handle = GaussianApproximationDefault(); +// Functions involving GaussianApproximation are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TSL_GAUSSIANAPPROXIMATION +#define C_INTERFACE_TEST_V2_0_TSL_GAUSSIANAPPROXIMATION + +#include "GNDStk.h" +#include "v2.0/tsl/PhononSpectrum.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct GaussianApproximationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ GaussianApproximation +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct GaussianApproximationClass *GaussianApproximation; + +// --- Const-aware handles. +typedef const struct GaussianApproximationClass *const ConstHandle2ConstGaussianApproximation; +typedef struct GaussianApproximationClass *const ConstHandle2GaussianApproximation; +typedef const struct GaussianApproximationClass * Handle2ConstGaussianApproximation; +typedef struct GaussianApproximationClass * Handle2GaussianApproximation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGaussianApproximation +GaussianApproximationDefaultConst(); + +// +++ Create, default +extern_c Handle2GaussianApproximation +GaussianApproximationDefault(); + +// --- Create, general, const +extern_c Handle2ConstGaussianApproximation +GaussianApproximationCreateConst( + ConstHandle2ConstPhononSpectrum phononSpectrum +); + +// +++ Create, general +extern_c Handle2GaussianApproximation +GaussianApproximationCreate( + ConstHandle2ConstPhononSpectrum phononSpectrum +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +GaussianApproximationAssign(ConstHandle2GaussianApproximation self, ConstHandle2ConstGaussianApproximation from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +GaussianApproximationDelete(ConstHandle2ConstGaussianApproximation self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +GaussianApproximationRead(ConstHandle2GaussianApproximation self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +GaussianApproximationWrite(ConstHandle2ConstGaussianApproximation self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +GaussianApproximationPrint(ConstHandle2ConstGaussianApproximation self); + +// +++ Print to standard output, as XML +extern_c int +GaussianApproximationPrintXML(ConstHandle2ConstGaussianApproximation self); + +// +++ Print to standard output, as JSON +extern_c int +GaussianApproximationPrintJSON(ConstHandle2ConstGaussianApproximation self); + + +// ----------------------------------------------------------------------------- +// Child: phononSpectrum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GaussianApproximationPhononSpectrumHas(ConstHandle2ConstGaussianApproximation self); + +// --- Get, const +extern_c Handle2ConstPhononSpectrum +GaussianApproximationPhononSpectrumGetConst(ConstHandle2ConstGaussianApproximation self); + +// +++ Get, non-const +extern_c Handle2PhononSpectrum +GaussianApproximationPhononSpectrumGet(ConstHandle2GaussianApproximation self); + +// +++ Set +extern_c void +GaussianApproximationPhononSpectrumSet(ConstHandle2GaussianApproximation self, ConstHandle2ConstPhononSpectrum phononSpectrum); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/GaussianApproximation/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/GaussianApproximation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass.cpp new file mode 100644 index 000000000..3915b99ac --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/Mass.hpp" +#include "Mass.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = MassClass; +using CPP = multigroup::Mass; + +static const std::string CLASSNAME = "Mass"; + +namespace extract { + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMass +MassDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Mass +MassDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMass +MassCreateConst( + const XMLName unit, + const Float64 value +) { + ConstHandle2Mass handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + unit, + value + ); + return handle; +} + +// Create, general +Handle2Mass +MassCreate( + const XMLName unit, + const Float64 value +) { + ConstHandle2Mass handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + unit, + 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 +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: unit +// ----------------------------------------------------------------------------- + +// Has +int +MassUnitHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +XMLName +MassUnitGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +MassUnitSet(ConstHandle2Mass self, const XMLName unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +MassValueHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +Float64 +MassValueGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +MassValueSet(ConstHandle2Mass self, const Float64 value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/Mass/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass.h new file mode 100644 index 000000000..2cd4aa299 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass.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. +// +// 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_TEST_V2_0_TSL_MASS +#define C_INTERFACE_TEST_V2_0_TSL_MASS + +#include "GNDStk.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 +extern_c Handle2Mass +MassDefault(); + +// --- Create, general, const +extern_c Handle2ConstMass +MassCreateConst( + const XMLName unit, + const Float64 value +); + +// +++ Create, general +extern_c Handle2Mass +MassCreate( + const XMLName unit, + const Float64 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 +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: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassUnitHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +MassUnitGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassUnitSet(ConstHandle2Mass self, const XMLName unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassValueHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c Float64 +MassValueGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassValueSet(ConstHandle2Mass self, const Float64 value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/Mass/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/Mass/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum.cpp new file mode 100644 index 000000000..8a02f24b2 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/PhononSpectrum.hpp" +#include "PhononSpectrum.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = PhononSpectrumClass; +using CPP = multigroup::PhononSpectrum; + +static const std::string CLASSNAME = "PhononSpectrum"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = containers::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPhononSpectrum +PhononSpectrumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2PhononSpectrum +PhononSpectrumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPhononSpectrum +PhononSpectrumCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2PhononSpectrum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general +Handle2PhononSpectrum +PhononSpectrumCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2PhononSpectrum 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 +PhononSpectrumAssign(ConstHandle2PhononSpectrum self, ConstHandle2ConstPhononSpectrum from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PhononSpectrumDelete(ConstHandle2ConstPhononSpectrum self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PhononSpectrumRead(ConstHandle2PhononSpectrum self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PhononSpectrumWrite(ConstHandle2ConstPhononSpectrum self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PhononSpectrumPrint(ConstHandle2ConstPhononSpectrum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PhononSpectrumPrintXML(ConstHandle2ConstPhononSpectrum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PhononSpectrumPrintJSON(ConstHandle2ConstPhononSpectrum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +PhononSpectrumXYs1dHas(ConstHandle2ConstPhononSpectrum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +PhononSpectrumXYs1dGetConst(ConstHandle2ConstPhononSpectrum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +PhononSpectrumXYs1dGet(ConstHandle2PhononSpectrum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +PhononSpectrumXYs1dSet(ConstHandle2PhononSpectrum self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/PhononSpectrum/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum.h new file mode 100644 index 000000000..db4738da4 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum.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. +// +// PhononSpectrum is the basic handle type in this file. Example: +// // Create a default PhononSpectrum object: +// PhononSpectrum handle = PhononSpectrumDefault(); +// Functions involving PhononSpectrum are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TSL_PHONONSPECTRUM +#define C_INTERFACE_TEST_V2_0_TSL_PHONONSPECTRUM + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PhononSpectrumClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ PhononSpectrum +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PhononSpectrumClass *PhononSpectrum; + +// --- Const-aware handles. +typedef const struct PhononSpectrumClass *const ConstHandle2ConstPhononSpectrum; +typedef struct PhononSpectrumClass *const ConstHandle2PhononSpectrum; +typedef const struct PhononSpectrumClass * Handle2ConstPhononSpectrum; +typedef struct PhononSpectrumClass * Handle2PhononSpectrum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPhononSpectrum +PhononSpectrumDefaultConst(); + +// +++ Create, default +extern_c Handle2PhononSpectrum +PhononSpectrumDefault(); + +// --- Create, general, const +extern_c Handle2ConstPhononSpectrum +PhononSpectrumCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +extern_c Handle2PhononSpectrum +PhononSpectrumCreate( + 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 +PhononSpectrumAssign(ConstHandle2PhononSpectrum self, ConstHandle2ConstPhononSpectrum from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PhononSpectrumDelete(ConstHandle2ConstPhononSpectrum self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PhononSpectrumRead(ConstHandle2PhononSpectrum self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PhononSpectrumWrite(ConstHandle2ConstPhononSpectrum self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PhononSpectrumPrint(ConstHandle2ConstPhononSpectrum self); + +// +++ Print to standard output, as XML +extern_c int +PhononSpectrumPrintXML(ConstHandle2ConstPhononSpectrum self); + +// +++ Print to standard output, as JSON +extern_c int +PhononSpectrumPrintJSON(ConstHandle2ConstPhononSpectrum self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PhononSpectrumXYs1dHas(ConstHandle2ConstPhononSpectrum self); + +// --- Get, const +extern_c Handle2ConstXYs1d +PhononSpectrumXYs1dGetConst(ConstHandle2ConstPhononSpectrum self); + +// +++ Get, non-const +extern_c Handle2XYs1d +PhononSpectrumXYs1dGet(ConstHandle2PhononSpectrum self); + +// +++ Set +extern_c void +PhononSpectrumXYs1dSet(ConstHandle2PhononSpectrum self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/PhononSpectrum/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/PhononSpectrum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/SCTApproximation.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/SCTApproximation.cpp new file mode 100644 index 000000000..c9522132f --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/SCTApproximation.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/SCTApproximation.hpp" +#include "SCTApproximation.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2SCTApproximation +SCTApproximationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSCTApproximation +SCTApproximationCreateConst() +{ + ConstHandle2SCTApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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/tsl/SCTApproximation/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/SCTApproximation.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/SCTApproximation.h new file mode 100644 index 000000000..e85c2d660 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_SCTAPPROXIMATION +#define C_INTERFACE_TEST_V2_0_TSL_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 +extern_c Handle2SCTApproximation +SCTApproximationDefault(); + +// --- Create, general, const +extern_c Handle2ConstSCTApproximation +SCTApproximationCreateConst(); + +// +++ Create, general +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/tsl/SCTApproximation/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/SCTApproximation/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/SCTApproximation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/SCTApproximation/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/SCTApproximation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/S_table.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/S_table.cpp new file mode 100644 index 000000000..6516449ea --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/S_table.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/S_table.hpp" +#include "S_table.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::Gridded2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstS_table +S_tableDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/tsl/S_table/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/S_table.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/S_table.h new file mode 100644 index 000000000..97affd3f8 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_S_TABLE +#define C_INTERFACE_TEST_V2_0_TSL_S_TABLE + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2S_table +S_tableDefault(); + +// --- Create, general, const +extern_c Handle2ConstS_table +S_tableCreateConst( + ConstHandle2ConstGridded2d gridded2d +); + +// +++ Create, general +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/tsl/S_table/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/S_table/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/S_table/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/S_table/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/S_table/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom.cpp new file mode 100644 index 000000000..6615d2e84 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom.cpp @@ -0,0 +1,587 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/ScatteringAtom.hpp" +#include "ScatteringAtom.h" + +using namespace njoy::GNDStk; +using namespace test::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 primaryScatterer = [](auto &obj) { return &obj.primaryScatterer; }; + static auto numberPerMolecule = [](auto &obj) { return &obj.numberPerMolecule; }; + 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 coherentAtomCrossSection = [](auto &obj) { return &obj.coherentAtomCrossSection; }; + static auto distinctScatteringKernel = [](auto &obj) { return &obj.distinctScatteringKernel; }; + static auto selfScatteringKernel = [](auto &obj) { return &obj.selfScatteringKernel; }; + static auto T_effective = [](auto &obj) { return &obj.T_effective; }; +} + +using CPPMass = tsl::Mass; +using CPPE_critical = tsl::E_critical; +using CPPE_max = tsl::E_max; +using CPPBoundAtomCrossSection = tsl::BoundAtomCrossSection; +using CPPCoherentAtomCrossSection = tsl::CoherentAtomCrossSection; +using CPPDistinctScatteringKernel = tsl::DistinctScatteringKernel; +using CPPSelfScatteringKernel = tsl::SelfScatteringKernel; +using CPPT_effective = tsl::T_effective; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstScatteringAtom +ScatteringAtomDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ScatteringAtom +ScatteringAtomDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstScatteringAtom +ScatteringAtomCreateConst( + const XMLName pid, + const bool primaryScatterer, + const Integer32 numberPerMolecule, + ConstHandle2ConstMass mass, + ConstHandle2ConstE_critical e_critical, + ConstHandle2ConstE_max e_max, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstCoherentAtomCrossSection coherentAtomCrossSection, + ConstHandle2ConstDistinctScatteringKernel distinctScatteringKernel, + ConstHandle2ConstSelfScatteringKernel selfScatteringKernel, + ConstHandle2ConstT_effective T_effective +) { + ConstHandle2ScatteringAtom handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + pid, + primaryScatterer, + numberPerMolecule, + detail::tocpp(mass), + detail::tocpp(e_critical), + detail::tocpp(e_max), + detail::tocpp(boundAtomCrossSection), + detail::tocpp(coherentAtomCrossSection), + detail::tocpp(distinctScatteringKernel), + detail::tocpp(selfScatteringKernel), + detail::tocpp(T_effective) + ); + return handle; +} + +// Create, general +Handle2ScatteringAtom +ScatteringAtomCreate( + const XMLName pid, + const bool primaryScatterer, + const Integer32 numberPerMolecule, + ConstHandle2ConstMass mass, + ConstHandle2ConstE_critical e_critical, + ConstHandle2ConstE_max e_max, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstCoherentAtomCrossSection coherentAtomCrossSection, + ConstHandle2ConstDistinctScatteringKernel distinctScatteringKernel, + ConstHandle2ConstSelfScatteringKernel selfScatteringKernel, + ConstHandle2ConstT_effective T_effective +) { + ConstHandle2ScatteringAtom handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + pid, + primaryScatterer, + numberPerMolecule, + detail::tocpp(mass), + detail::tocpp(e_critical), + detail::tocpp(e_max), + detail::tocpp(boundAtomCrossSection), + detail::tocpp(coherentAtomCrossSection), + detail::tocpp(distinctScatteringKernel), + 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 +XMLName +ScatteringAtomPidGet(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ScatteringAtomPidSet(ConstHandle2ScatteringAtom self, const XMLName pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: numberPerMolecule +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomNumberPerMoleculeHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NumberPerMoleculeHas", self, extract::numberPerMolecule); +} + +// Get +// Returns by value +Integer32 +ScatteringAtomNumberPerMoleculeGet(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NumberPerMoleculeGet", self, extract::numberPerMolecule); +} + +// Set +void +ScatteringAtomNumberPerMoleculeSet(ConstHandle2ScatteringAtom self, const Integer32 numberPerMolecule) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NumberPerMoleculeSet", self, extract::numberPerMolecule, numberPerMolecule); +} + + +// ----------------------------------------------------------------------------- +// 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: coherentAtomCrossSection +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomCoherentAtomCrossSectionHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CoherentAtomCrossSectionHas", self, extract::coherentAtomCrossSection); +} + +// Get, const +Handle2ConstCoherentAtomCrossSection +ScatteringAtomCoherentAtomCrossSectionGetConst(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoherentAtomCrossSectionGetConst", self, extract::coherentAtomCrossSection); +} + +// Get, non-const +Handle2CoherentAtomCrossSection +ScatteringAtomCoherentAtomCrossSectionGet(ConstHandle2ScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoherentAtomCrossSectionGet", self, extract::coherentAtomCrossSection); +} + +// Set +void +ScatteringAtomCoherentAtomCrossSectionSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstCoherentAtomCrossSection coherentAtomCrossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CoherentAtomCrossSectionSet", self, extract::coherentAtomCrossSection, coherentAtomCrossSection); +} + + +// ----------------------------------------------------------------------------- +// Child: distinctScatteringKernel +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomDistinctScatteringKernelHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DistinctScatteringKernelHas", self, extract::distinctScatteringKernel); +} + +// Get, const +Handle2ConstDistinctScatteringKernel +ScatteringAtomDistinctScatteringKernelGetConst(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DistinctScatteringKernelGetConst", self, extract::distinctScatteringKernel); +} + +// Get, non-const +Handle2DistinctScatteringKernel +ScatteringAtomDistinctScatteringKernelGet(ConstHandle2ScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DistinctScatteringKernelGet", self, extract::distinctScatteringKernel); +} + +// Set +void +ScatteringAtomDistinctScatteringKernelSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstDistinctScatteringKernel distinctScatteringKernel) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DistinctScatteringKernelSet", self, extract::distinctScatteringKernel, distinctScatteringKernel); +} + + +// ----------------------------------------------------------------------------- +// 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/tsl/ScatteringAtom/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom.h new file mode 100644 index 000000000..518527a89 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom.h @@ -0,0 +1,389 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TSL_SCATTERINGATOM +#define C_INTERFACE_TEST_V2_0_TSL_SCATTERINGATOM + +#include "GNDStk.h" +#include "v2.0/tsl/Mass.h" +#include "v2.0/tsl/E_critical.h" +#include "v2.0/tsl/E_max.h" +#include "v2.0/tsl/BoundAtomCrossSection.h" +#include "v2.0/tsl/CoherentAtomCrossSection.h" +#include "v2.0/tsl/DistinctScatteringKernel.h" +#include "v2.0/tsl/SelfScatteringKernel.h" +#include "v2.0/tsl/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 +extern_c Handle2ScatteringAtom +ScatteringAtomDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringAtom +ScatteringAtomCreateConst( + const XMLName pid, + const bool primaryScatterer, + const Integer32 numberPerMolecule, + ConstHandle2ConstMass mass, + ConstHandle2ConstE_critical e_critical, + ConstHandle2ConstE_max e_max, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstCoherentAtomCrossSection coherentAtomCrossSection, + ConstHandle2ConstDistinctScatteringKernel distinctScatteringKernel, + ConstHandle2ConstSelfScatteringKernel selfScatteringKernel, + ConstHandle2ConstT_effective T_effective +); + +// +++ Create, general +extern_c Handle2ScatteringAtom +ScatteringAtomCreate( + const XMLName pid, + const bool primaryScatterer, + const Integer32 numberPerMolecule, + ConstHandle2ConstMass mass, + ConstHandle2ConstE_critical e_critical, + ConstHandle2ConstE_max e_max, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstCoherentAtomCrossSection coherentAtomCrossSection, + ConstHandle2ConstDistinctScatteringKernel distinctScatteringKernel, + 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 XMLName +ScatteringAtomPidGet(ConstHandle2ConstScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomPidSet(ConstHandle2ScatteringAtom self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: numberPerMolecule +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomNumberPerMoleculeHas(ConstHandle2ConstScatteringAtom self); + +// +++ Get +// +++ Returns by value +extern_c Integer32 +ScatteringAtomNumberPerMoleculeGet(ConstHandle2ConstScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomNumberPerMoleculeSet(ConstHandle2ScatteringAtom self, const Integer32 numberPerMolecule); + + +// ----------------------------------------------------------------------------- +// 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: coherentAtomCrossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomCoherentAtomCrossSectionHas(ConstHandle2ConstScatteringAtom self); + +// --- Get, const +extern_c Handle2ConstCoherentAtomCrossSection +ScatteringAtomCoherentAtomCrossSectionGetConst(ConstHandle2ConstScatteringAtom self); + +// +++ Get, non-const +extern_c Handle2CoherentAtomCrossSection +ScatteringAtomCoherentAtomCrossSectionGet(ConstHandle2ScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomCoherentAtomCrossSectionSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstCoherentAtomCrossSection coherentAtomCrossSection); + + +// ----------------------------------------------------------------------------- +// Child: distinctScatteringKernel +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomDistinctScatteringKernelHas(ConstHandle2ConstScatteringAtom self); + +// --- Get, const +extern_c Handle2ConstDistinctScatteringKernel +ScatteringAtomDistinctScatteringKernelGetConst(ConstHandle2ConstScatteringAtom self); + +// +++ Get, non-const +extern_c Handle2DistinctScatteringKernel +ScatteringAtomDistinctScatteringKernelGet(ConstHandle2ScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomDistinctScatteringKernelSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstDistinctScatteringKernel distinctScatteringKernel); + + +// ----------------------------------------------------------------------------- +// 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/tsl/ScatteringAtom/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtom/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms.cpp new file mode 100644 index 000000000..a914e7e14 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/ScatteringAtoms.hpp" +#include "ScatteringAtoms.h" + +using namespace njoy::GNDStk; +using namespace test::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 = tsl::ScatteringAtom; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstScatteringAtoms +ScatteringAtomsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// Has, by pid +int +ScatteringAtomsScatteringAtomHasByPid( + ConstHandle2ConstScatteringAtoms self, + const XMLName pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomHasByPid", + self, extract::scatteringAtom, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByPidConst( + ConstHandle2ConstScatteringAtoms self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByPidConst", + self, extract::scatteringAtom, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByPid( + ConstHandle2ScatteringAtoms self, + const XMLName pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByPid", + self, extract::scatteringAtom, meta::pid, pid); +} + +// Set, by pid +void +ScatteringAtomsScatteringAtomSetByPid( + ConstHandle2ScatteringAtoms self, + const XMLName pid, + ConstHandle2ConstScatteringAtom scatteringAtom +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomSetByPid", + self, extract::scatteringAtom, meta::pid, pid, scatteringAtom); +} + +// 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); +} + +// Has, by numberPerMolecule +int +ScatteringAtomsScatteringAtomHasByNumberPerMolecule( + ConstHandle2ConstScatteringAtoms self, + const Integer32 numberPerMolecule +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomHasByNumberPerMolecule", + self, extract::scatteringAtom, meta::numberPerMolecule, numberPerMolecule); +} + +// Get, by numberPerMolecule, const +Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByNumberPerMoleculeConst( + ConstHandle2ConstScatteringAtoms self, + const Integer32 numberPerMolecule +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByNumberPerMoleculeConst", + self, extract::scatteringAtom, meta::numberPerMolecule, numberPerMolecule); +} + +// Get, by numberPerMolecule, non-const +Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByNumberPerMolecule( + ConstHandle2ScatteringAtoms self, + const Integer32 numberPerMolecule +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByNumberPerMolecule", + self, extract::scatteringAtom, meta::numberPerMolecule, numberPerMolecule); +} + +// Set, by numberPerMolecule +void +ScatteringAtomsScatteringAtomSetByNumberPerMolecule( + ConstHandle2ScatteringAtoms self, + const Integer32 numberPerMolecule, + ConstHandle2ConstScatteringAtom scatteringAtom +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomSetByNumberPerMolecule", + self, extract::scatteringAtom, meta::numberPerMolecule, numberPerMolecule, scatteringAtom); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/ScatteringAtoms/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms.h new file mode 100644 index 000000000..9bd9fa127 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms.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. +// +// 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_TEST_V2_0_TSL_SCATTERINGATOMS +#define C_INTERFACE_TEST_V2_0_TSL_SCATTERINGATOMS + +#include "GNDStk.h" +#include "v2.0/tsl/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 +extern_c Handle2ScatteringAtoms +ScatteringAtomsDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringAtoms +ScatteringAtomsCreateConst( + ConstHandle2ScatteringAtom *const scatteringAtom, const size_t scatteringAtomSize +); + +// +++ Create, general +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 +); + +// +++ Has, by pid +extern_c int +ScatteringAtomsScatteringAtomHasByPid( + ConstHandle2ConstScatteringAtoms self, + const XMLName pid +); + +// --- Get, by pid, const +extern_c Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByPidConst( + ConstHandle2ConstScatteringAtoms self, + const XMLName pid +); + +// +++ Get, by pid, non-const +extern_c Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByPid( + ConstHandle2ScatteringAtoms self, + const XMLName pid +); + +// +++ Set, by pid +extern_c void +ScatteringAtomsScatteringAtomSetByPid( + ConstHandle2ScatteringAtoms self, + const XMLName pid, + ConstHandle2ConstScatteringAtom scatteringAtom +); + +// +++ 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 +); + +// +++ Has, by numberPerMolecule +extern_c int +ScatteringAtomsScatteringAtomHasByNumberPerMolecule( + ConstHandle2ConstScatteringAtoms self, + const Integer32 numberPerMolecule +); + +// --- Get, by numberPerMolecule, const +extern_c Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByNumberPerMoleculeConst( + ConstHandle2ConstScatteringAtoms self, + const Integer32 numberPerMolecule +); + +// +++ Get, by numberPerMolecule, non-const +extern_c Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByNumberPerMolecule( + ConstHandle2ScatteringAtoms self, + const Integer32 numberPerMolecule +); + +// +++ Set, by numberPerMolecule +extern_c void +ScatteringAtomsScatteringAtomSetByNumberPerMolecule( + ConstHandle2ScatteringAtoms self, + const Integer32 numberPerMolecule, + ConstHandle2ConstScatteringAtom scatteringAtom +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/ScatteringAtoms/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ScatteringAtoms/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel.cpp new file mode 100644 index 000000000..0651b54bc --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel.cpp @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/SelfScatteringKernel.hpp" +#include "SelfScatteringKernel.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; +} + +using CPPGridded3d = containers::Gridded3d; +using CPPGaussianApproximation = tsl::GaussianApproximation; +using CPPSCTApproximation = tsl::SCTApproximation; +using CPPFreeGasApproximation = tsl::FreeGasApproximation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSelfScatteringKernel +SelfScatteringKernelDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2SelfScatteringKernel +SelfScatteringKernelDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSelfScatteringKernel +SelfScatteringKernelCreateConst( + const bool symmetric, +) { + ConstHandle2SelfScatteringKernel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + symmetric + ); + return handle; +} + +// Create, general +Handle2SelfScatteringKernel +SelfScatteringKernelCreate( + const bool symmetric, +) { + ConstHandle2SelfScatteringKernel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + symmetric + ); + return handle; +} + +// Assign +// Use this to assign 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/SelfScatteringKernel/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel.h new file mode 100644 index 000000000..9aa829562 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel.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. +// +// 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_TEST_V2_0_TSL_SELFSCATTERINGKERNEL +#define C_INTERFACE_TEST_V2_0_TSL_SELFSCATTERINGKERNEL + +#include "GNDStk.h" +#include "v2.0/containers/Gridded3d.h" +#include "v2.0/tsl/GaussianApproximation.h" +#include "v2.0/tsl/SCTApproximation.h" +#include "v2.0/tsl/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 +extern_c Handle2SelfScatteringKernel +SelfScatteringKernelDefault(); + +// --- Create, general, const +extern_c Handle2ConstSelfScatteringKernel +SelfScatteringKernelCreateConst( + const bool symmetric, +); + +// +++ Create, general +extern_c Handle2SelfScatteringKernel +SelfScatteringKernelCreate( + const bool symmetric, +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/SelfScatteringKernel/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/SelfScatteringKernel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor.cpp new file mode 100644 index 000000000..b75024904 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/StructureFactor.hpp" +#include "StructureFactor.h" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +using C = StructureFactorClass; +using CPP = multigroup::StructureFactor; + +static const std::string CLASSNAME = "StructureFactor"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = containers::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstStructureFactor +StructureFactorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2StructureFactor +StructureFactorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstStructureFactor +StructureFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2StructureFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general +Handle2StructureFactor +StructureFactorCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2StructureFactor 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 +StructureFactorAssign(ConstHandle2StructureFactor self, ConstHandle2ConstStructureFactor from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +StructureFactorDelete(ConstHandle2ConstStructureFactor self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +StructureFactorRead(ConstHandle2StructureFactor self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +StructureFactorWrite(ConstHandle2ConstStructureFactor self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +StructureFactorPrint(ConstHandle2ConstStructureFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +StructureFactorPrintXML(ConstHandle2ConstStructureFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +StructureFactorPrintJSON(ConstHandle2ConstStructureFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +StructureFactorXYs1dHas(ConstHandle2ConstStructureFactor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +StructureFactorXYs1dGetConst(ConstHandle2ConstStructureFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +StructureFactorXYs1dGet(ConstHandle2StructureFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +StructureFactorXYs1dSet(ConstHandle2StructureFactor self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/StructureFactor/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor.h new file mode 100644 index 000000000..79ed8b14e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor.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. +// +// StructureFactor is the basic handle type in this file. Example: +// // Create a default StructureFactor object: +// StructureFactor handle = StructureFactorDefault(); +// Functions involving StructureFactor are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_TEST_V2_0_TSL_STRUCTUREFACTOR +#define C_INTERFACE_TEST_V2_0_TSL_STRUCTUREFACTOR + +#include "GNDStk.h" +#include "v2.0/containers/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct StructureFactorClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ StructureFactor +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct StructureFactorClass *StructureFactor; + +// --- Const-aware handles. +typedef const struct StructureFactorClass *const ConstHandle2ConstStructureFactor; +typedef struct StructureFactorClass *const ConstHandle2StructureFactor; +typedef const struct StructureFactorClass * Handle2ConstStructureFactor; +typedef struct StructureFactorClass * Handle2StructureFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstStructureFactor +StructureFactorDefaultConst(); + +// +++ Create, default +extern_c Handle2StructureFactor +StructureFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstStructureFactor +StructureFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +extern_c Handle2StructureFactor +StructureFactorCreate( + 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 +StructureFactorAssign(ConstHandle2StructureFactor self, ConstHandle2ConstStructureFactor from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +StructureFactorDelete(ConstHandle2ConstStructureFactor self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +StructureFactorRead(ConstHandle2StructureFactor self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +StructureFactorWrite(ConstHandle2ConstStructureFactor self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +StructureFactorPrint(ConstHandle2ConstStructureFactor self); + +// +++ Print to standard output, as XML +extern_c int +StructureFactorPrintXML(ConstHandle2ConstStructureFactor self); + +// +++ Print to standard output, as JSON +extern_c int +StructureFactorPrintJSON(ConstHandle2ConstStructureFactor self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StructureFactorXYs1dHas(ConstHandle2ConstStructureFactor self); + +// --- Get, const +extern_c Handle2ConstXYs1d +StructureFactorXYs1dGetConst(ConstHandle2ConstStructureFactor self); + +// +++ Get, non-const +extern_c Handle2XYs1d +StructureFactorXYs1dGet(ConstHandle2StructureFactor self); + +// +++ Set +extern_c void +StructureFactorXYs1dSet(ConstHandle2StructureFactor self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/StructureFactor/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/StructureFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/T_effective.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/T_effective.cpp new file mode 100644 index 000000000..c87186b8d --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/T_effective.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/T_effective.hpp" +#include "T_effective.h" + +using namespace njoy::GNDStk; +using namespace test::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 = containers::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstT_effective +T_effectiveDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/tsl/T_effective/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/T_effective.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/T_effective.h new file mode 100644 index 000000000..d512c8253 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_T_EFFECTIVE +#define C_INTERFACE_TEST_V2_0_TSL_T_EFFECTIVE + +#include "GNDStk.h" +#include "v2.0/containers/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 +extern_c Handle2T_effective +T_effectiveDefault(); + +// --- Create, general, const +extern_c Handle2ConstT_effective +T_effectiveCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general +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/tsl/T_effective/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/T_effective/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/T_effective/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/T_effective/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/T_effective/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw.cpp new file mode 100644 index 000000000..eff5dc0bd --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw.hpp" +#include "ThermalNeutronScatteringLaw.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2ThermalNeutronScatteringLaw +ThermalNeutronScatteringLawDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw +ThermalNeutronScatteringLawCreateConst( + const XMLName label, + const XMLName href +) { + ConstHandle2ThermalNeutronScatteringLaw handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href + ); + return handle; +} + +// Create, general +Handle2ThermalNeutronScatteringLaw +ThermalNeutronScatteringLawCreate( + const XMLName label, + const XMLName 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 +XMLName +ThermalNeutronScatteringLawLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLawLabelSet(ConstHandle2ThermalNeutronScatteringLaw self, const XMLName 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 +XMLName +ThermalNeutronScatteringLawHrefGet(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ThermalNeutronScatteringLawHrefSet(ConstHandle2ThermalNeutronScatteringLaw self, const XMLName href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw.h new file mode 100644 index 000000000..894caee8b --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW +#define C_INTERFACE_TEST_V2_0_TSL_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 +extern_c Handle2ThermalNeutronScatteringLaw +ThermalNeutronScatteringLawDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw +ThermalNeutronScatteringLawCreateConst( + const XMLName label, + const XMLName href +); + +// +++ Create, general +extern_c Handle2ThermalNeutronScatteringLaw +ThermalNeutronScatteringLawCreate( + const XMLName label, + const XMLName 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 XMLName +ThermalNeutronScatteringLawLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLawLabelSet(ConstHandle2ThermalNeutronScatteringLaw self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLawHrefHas(ConstHandle2ConstThermalNeutronScatteringLaw self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ThermalNeutronScatteringLawHrefGet(ConstHandle2ConstThermalNeutronScatteringLaw self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLawHrefSet(ConstHandle2ThermalNeutronScatteringLaw self, const XMLName href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.cpp new file mode 100644 index 000000000..281e16cef --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw1d.hpp" +#include "ThermalNeutronScatteringLaw1d.h" + +using namespace njoy::GNDStk; +using namespace test::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 +Handle2ThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dCreateConst( + const XMLName label, + const XMLName href +) { + ConstHandle2ThermalNeutronScatteringLaw1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href + ); + return handle; +} + +// Create, general +Handle2ThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dCreate( + const XMLName label, + const XMLName 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 +XMLName +ThermalNeutronScatteringLaw1dLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLaw1dLabelSet(ConstHandle2ThermalNeutronScatteringLaw1d self, const XMLName 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 +XMLName +ThermalNeutronScatteringLaw1dHrefGet(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ThermalNeutronScatteringLaw1dHrefSet(ConstHandle2ThermalNeutronScatteringLaw1d self, const XMLName href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.h new file mode 100644 index 000000000..bc9de313e --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW1D +#define C_INTERFACE_TEST_V2_0_TSL_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 +extern_c Handle2ThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dCreateConst( + const XMLName label, + const XMLName href +); + +// +++ Create, general +extern_c Handle2ThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dCreate( + const XMLName label, + const XMLName 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 XMLName +ThermalNeutronScatteringLaw1dLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw1dLabelSet(ConstHandle2ThermalNeutronScatteringLaw1d self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw1dHrefHas(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ThermalNeutronScatteringLaw1dHrefGet(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw1dHrefSet(ConstHandle2ThermalNeutronScatteringLaw1d self, const XMLName href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.cpp new file mode 100644 index 000000000..6eda2883c --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.cpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "ThermalNeutronScatteringLaw_coherentElastic.h" + +using namespace njoy::GNDStk; +using namespace test::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; }; +} + +using CPPS_table = tsl::S_table; +using CPPBraggEdges = tsl::BraggEdges; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticCreateConst( + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, +) { + ConstHandle2ThermalNeutronScatteringLaw_coherentElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + productFrame + ); + return handle; +} + +// Create, general +Handle2ThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticCreate( + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, +) { + ConstHandle2ThermalNeutronScatteringLaw_coherentElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + pid, + 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 +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 +XMLName +ThermalNeutronScatteringLaw_coherentElasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLaw_coherentElasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const XMLName 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 +XMLName +ThermalNeutronScatteringLaw_coherentElasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ThermalNeutronScatteringLaw_coherentElasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const XMLName 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 +enums::Frame +ThermalNeutronScatteringLaw_coherentElasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +ThermalNeutronScatteringLaw_coherentElasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const enums::Frame productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.h new file mode 100644 index 000000000..d150a4934 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.h @@ -0,0 +1,199 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC +#define C_INTERFACE_TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC + +#include "GNDStk.h" +#include "v2.0/tsl/S_table.h" +#include "v2.0/tsl/BraggEdges.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 +extern_c Handle2ThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticCreateConst( + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, +); + +// +++ Create, general +extern_c Handle2ThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticCreate( + const XMLName label, + const XMLName pid, + const enums::Frame 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 +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 XMLName +ThermalNeutronScatteringLaw_coherentElasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_coherentElasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_coherentElasticPidHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ThermalNeutronScatteringLaw_coherentElasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_coherentElasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_coherentElasticProductFrameHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c enums::Frame +ThermalNeutronScatteringLaw_coherentElasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_coherentElasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const enums::Frame productFrame); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.cpp new file mode 100644 index 000000000..8f4b710a7 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "ThermalNeutronScatteringLaw_incoherentElastic.h" + +using namespace njoy::GNDStk; +using namespace test::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 = tsl::BoundAtomCrossSection; +using CPPDebyeWallerIntegral = tsl::DebyeWallerIntegral; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticCreateConst( + const XMLName label, + const XMLName pid, + const enums::Frame 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 +Handle2ThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticCreate( + const XMLName label, + const XMLName pid, + const enums::Frame 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 +XMLName +ThermalNeutronScatteringLaw_incoherentElasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentElasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const XMLName 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 +XMLName +ThermalNeutronScatteringLaw_incoherentElasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentElasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const XMLName 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 +enums::Frame +ThermalNeutronScatteringLaw_incoherentElasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentElasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const enums::Frame 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/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.h new file mode 100644 index 000000000..3b35b5027 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/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_TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC +#define C_INTERFACE_TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC + +#include "GNDStk.h" +#include "v2.0/tsl/BoundAtomCrossSection.h" +#include "v2.0/tsl/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 +extern_c Handle2ThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticCreateConst( + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstDebyeWallerIntegral DebyeWallerIntegral +); + +// +++ Create, general +extern_c Handle2ThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticCreate( + const XMLName label, + const XMLName pid, + const enums::Frame 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 XMLName +ThermalNeutronScatteringLaw_incoherentElasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticPidHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ThermalNeutronScatteringLaw_incoherentElasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticProductFrameHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c enums::Frame +ThermalNeutronScatteringLaw_incoherentElasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const enums::Frame 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/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.cpp new file mode 100644 index 000000000..efb237164 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.cpp @@ -0,0 +1,391 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" +#include "ThermalNeutronScatteringLaw_incoherentInelastic.h" + +using namespace njoy::GNDStk; +using namespace test::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 calculatedAtThermal = [](auto &obj) { return &obj.calculatedAtThermal; }; + static auto incoherentApproximation = [](auto &obj) { return &obj.incoherentApproximation; }; + static auto primaryScatterer = [](auto &obj) { return &obj.primaryScatterer; }; + static auto scatteringAtoms = [](auto &obj) { return &obj.scatteringAtoms; }; +} + +using CPPScatteringAtoms = tsl::ScatteringAtoms; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticCreateConst( + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + const bool calculatedAtThermal, + const bool incoherentApproximation, + const XMLName primaryScatterer, + ConstHandle2ConstScatteringAtoms scatteringAtoms +) { + ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + productFrame, + calculatedAtThermal, + incoherentApproximation, + primaryScatterer, + detail::tocpp(scatteringAtoms) + ); + return handle; +} + +// Create, general +Handle2ThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticCreate( + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + const bool calculatedAtThermal, + const bool incoherentApproximation, + const XMLName primaryScatterer, + ConstHandle2ConstScatteringAtoms scatteringAtoms +) { + ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + pid, + productFrame, + calculatedAtThermal, + incoherentApproximation, + primaryScatterer, + 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 +XMLName +ThermalNeutronScatteringLaw_incoherentInelasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const XMLName 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 +XMLName +ThermalNeutronScatteringLaw_incoherentInelasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const XMLName 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 +enums::Frame +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const enums::Frame productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// 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); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: incoherentApproximation +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentInelasticIncoherentApproximationHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IncoherentApproximationHas", self, extract::incoherentApproximation); +} + +// Get +// Returns by value +bool +ThermalNeutronScatteringLaw_incoherentInelasticIncoherentApproximationGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IncoherentApproximationGet", self, extract::incoherentApproximation); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticIncoherentApproximationSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const bool incoherentApproximation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IncoherentApproximationSet", self, extract::incoherentApproximation, incoherentApproximation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: primaryScatterer +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PrimaryScattererHas", self, extract::primaryScatterer); +} + +// Get +// Returns by value +XMLName +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PrimaryScattererGet", self, extract::primaryScatterer); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const XMLName primaryScatterer) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PrimaryScattererSet", self, extract::primaryScatterer, primaryScatterer); +} + + +// ----------------------------------------------------------------------------- +// 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/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.cpp" diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.h new file mode 100644 index 000000000..19ea65146 --- /dev/null +++ b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.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. +// +// 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_TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC +#define C_INTERFACE_TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC + +#include "GNDStk.h" +#include "v2.0/tsl/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 +extern_c Handle2ThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticCreateConst( + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + const bool calculatedAtThermal, + const bool incoherentApproximation, + const XMLName primaryScatterer, + ConstHandle2ConstScatteringAtoms scatteringAtoms +); + +// +++ Create, general +extern_c Handle2ThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticCreate( + const XMLName label, + const XMLName pid, + const enums::Frame productFrame, + const bool calculatedAtThermal, + const bool incoherentApproximation, + const XMLName primaryScatterer, + 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 XMLName +ThermalNeutronScatteringLaw_incoherentInelasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const XMLName label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticPidHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ThermalNeutronScatteringLaw_incoherentInelasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const XMLName pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get +// +++ Returns by value +extern_c enums::Frame +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const enums::Frame productFrame); + + +// ----------------------------------------------------------------------------- +// 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); + + +// ----------------------------------------------------------------------------- +// Metadatum: incoherentApproximation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticIncoherentApproximationHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get +// +++ Returns by value +extern_c bool +ThermalNeutronScatteringLaw_incoherentInelasticIncoherentApproximationGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticIncoherentApproximationSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const bool incoherentApproximation); + + +// ----------------------------------------------------------------------------- +// Metadatum: primaryScatterer +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get +// +++ Returns by value +extern_c XMLName +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const XMLName primaryScatterer); + + +// ----------------------------------------------------------------------------- +// 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/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.cpp b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.h b/standards/gnds-2.0/test/c/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/gnds-2.0/test/python/src/v2.0/appData.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/appData.python.cpp new file mode 100644 index 000000000..db64fb8b8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/appData.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// appData declarations +namespace python_appData { + void wrapConversion(py::module &); + void wrapENDFconversionFlags(py::module &); + void wrapInstitution(py::module &); + void wrapApplicationData(py::module &); +} // namespace python_appData + +// wrapper for appData +void wrapAppData(py::module &module) +{ + // create the appData submodule + py::module submodule = module.def_submodule( + "appData", + "test v2.0 appData" + ); + + // wrap appData components + python_appData::wrapConversion(submodule); + python_appData::wrapENDFconversionFlags(submodule); + python_appData::wrapInstitution(submodule); + python_appData::wrapApplicationData(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/appData/ApplicationData.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/appData/ApplicationData.python.cpp new file mode 100644 index 000000000..9405e7e7b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/appData/ApplicationData.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/appData/ApplicationData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_appData { + +// wrapper for appData::ApplicationData +void wrapApplicationData(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = appData::ApplicationData; + + // create the Python object + py::class_ object( + module, "ApplicationData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("institution") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set institution + object.def_property( + "institution", + [](const cppCLASS &self) -> decltype(auto) + { + return self.institution(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.institution() = value; + }, + cppCLASS::component_t::documentation("institution").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_appData +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/appData/Conversion.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/appData/Conversion.python.cpp new file mode 100644 index 000000000..886de62d6 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/appData/Conversion.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/appData/Conversion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_appData { + +// wrapper for appData::Conversion +void wrapConversion(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = appData::Conversion; + + // create the Python object + py::class_ object( + module, "Conversion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("flags") = std::nullopt, + py::arg("href") = std::nullopt, + 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_appData +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/appData/ENDFconversionFlags.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/appData/ENDFconversionFlags.python.cpp new file mode 100644 index 000000000..15f78fd15 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/appData/ENDFconversionFlags.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/appData/ENDFconversionFlags.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_appData { + +// wrapper for appData::ENDFconversionFlags +void wrapENDFconversionFlags(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = appData::ENDFconversionFlags; + + // create the Python object + py::class_ object( + module, "ENDFconversionFlags", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("conversion") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set conversion + object.def_property( + "conversion", + [](const cppCLASS &self) -> decltype(auto) + { + return self.conversion(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.conversion() = value; + }, + cppCLASS::component_t::documentation("conversion").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_appData +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/appData/Institution.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/appData/Institution.python.cpp new file mode 100644 index 000000000..f7255ce90 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/appData/Institution.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/appData/Institution.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_appData { + +// wrapper for appData::Institution +void wrapInstitution(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = appData::Institution; + + // create the Python object + py::class_ object( + module, "Institution", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("endfconversion_flags") = 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 ENDFconversionFlags + object.def_property( + "endfconversion_flags", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDFconversionFlags(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.ENDFconversionFlags() = value; + }, + cppCLASS::component_t::documentation("endfconversion_flags").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_appData +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/atomic.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/atomic.python.cpp new file mode 100644 index 000000000..ab4c85024 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/atomic.python.cpp @@ -0,0 +1,41 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// atomic declarations +namespace python_atomic { + void wrapFormFactor(py::module &); + void wrapRealAnomalousFactor(py::module &); + void wrapImaginaryAnomalousFactor(py::module &); + void wrapCoherentPhotonScattering(py::module &); + void wrapScatteringFactor(py::module &); + void wrapIncoherentPhotonScattering(py::module &); +} // namespace python_atomic + +// wrapper for atomic +void wrapAtomic(py::module &module) +{ + // create the atomic submodule + py::module submodule = module.def_submodule( + "atomic", + "test v2.0 atomic" + ); + + // wrap atomic components + python_atomic::wrapFormFactor(submodule); + python_atomic::wrapRealAnomalousFactor(submodule); + python_atomic::wrapImaginaryAnomalousFactor(submodule); + python_atomic::wrapCoherentPhotonScattering(submodule); + python_atomic::wrapScatteringFactor(submodule); + python_atomic::wrapIncoherentPhotonScattering(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/atomic/CoherentPhotonScattering.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/atomic/CoherentPhotonScattering.python.cpp new file mode 100644 index 000000000..0dff1f154 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/atomic/CoherentPhotonScattering.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/atomic/CoherentPhotonScattering.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// wrapper for atomic::CoherentPhotonScattering +void wrapCoherentPhotonScattering(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = atomic::CoherentPhotonScattering; + + // create the Python object + py::class_ object( + module, "CoherentPhotonScattering", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const enums::Frame &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("href") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("pid") = std::nullopt, + py::arg("product_frame"), + py::arg("form_factor") = std::nullopt, + py::arg("real_anomalous_factor") = std::nullopt, + py::arg("imaginary_anomalous_factor") = 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 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 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 enums::Frame &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_atomic +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/atomic/FormFactor.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/atomic/FormFactor.python.cpp new file mode 100644 index 000000000..3c263a992 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/atomic/FormFactor.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/atomic/FormFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// wrapper for atomic::FormFactor +void wrapFormFactor(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = atomic::FormFactor; + + // create the Python object + py::class_ object( + module, "FormFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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_atomic +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/atomic/ImaginaryAnomalousFactor.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/atomic/ImaginaryAnomalousFactor.python.cpp new file mode 100644 index 000000000..6fdaa0398 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/atomic/ImaginaryAnomalousFactor.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/atomic/ImaginaryAnomalousFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// wrapper for atomic::ImaginaryAnomalousFactor +void wrapImaginaryAnomalousFactor(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = atomic::ImaginaryAnomalousFactor; + + // create the Python object + py::class_ object( + module, "ImaginaryAnomalousFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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_atomic +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/atomic/IncoherentPhotonScattering.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/atomic/IncoherentPhotonScattering.python.cpp new file mode 100644 index 000000000..3c648ac38 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/atomic/IncoherentPhotonScattering.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/atomic/IncoherentPhotonScattering.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// wrapper for atomic::IncoherentPhotonScattering +void wrapIncoherentPhotonScattering(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = atomic::IncoherentPhotonScattering; + + // create the Python object + py::class_ object( + module, "IncoherentPhotonScattering", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const enums::Frame &, + const std::optional & + >(), + py::arg("href") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("pid") = std::nullopt, + py::arg("product_frame"), + py::arg("scattering_factor") = 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 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 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 enums::Frame &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_atomic +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/atomic/RealAnomalousFactor.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/atomic/RealAnomalousFactor.python.cpp new file mode 100644 index 000000000..acd2f6fa4 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/atomic/RealAnomalousFactor.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/atomic/RealAnomalousFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// wrapper for atomic::RealAnomalousFactor +void wrapRealAnomalousFactor(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = atomic::RealAnomalousFactor; + + // create the Python object + py::class_ object( + module, "RealAnomalousFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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_atomic +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/atomic/ScatteringFactor.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/atomic/ScatteringFactor.python.cpp new file mode 100644 index 000000000..811a1b706 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/atomic/ScatteringFactor.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/atomic/ScatteringFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_atomic { + +// wrapper for atomic::ScatteringFactor +void wrapScatteringFactor(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = atomic::ScatteringFactor; + + // create the Python object + py::class_ object( + module, "ScatteringFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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_atomic +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common.python.cpp new file mode 100644 index 000000000..7f298799d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common.python.cpp @@ -0,0 +1,47 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// common declarations +namespace python_common { + void wrapQ(py::module &); + void wrapEnergy(py::module &); + void wrapProduct(py::module &); + void wrapProducts(py::module &); + void wrapMass(py::module &); + void wrapProbability(py::module &); + void wrapTemperature(py::module &); + void wrapExternalFile(py::module &); + void wrapExternalFiles(py::module &); +} // namespace python_common + +// wrapper for common +void wrapCommon(py::module &module) +{ + // create the common submodule + py::module submodule = module.def_submodule( + "common", + "test v2.0 common" + ); + + // wrap common components + python_common::wrapQ(submodule); + python_common::wrapEnergy(submodule); + python_common::wrapProduct(submodule); + python_common::wrapProducts(submodule); + python_common::wrapMass(submodule); + python_common::wrapProbability(submodule); + python_common::wrapTemperature(submodule); + python_common::wrapExternalFile(submodule); + python_common::wrapExternalFiles(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common/Energy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common/Energy.python.cpp new file mode 100644 index 000000000..a7dcbcff3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common/Energy.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/common/Energy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// wrapper for common::Energy +void wrapEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = common::Energy; + + // create the Python object + py::class_ object( + module, "Energy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::vector & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("double"), + 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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common/ExternalFile.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common/ExternalFile.python.cpp new file mode 100644 index 000000000..e40a662e5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common/ExternalFile.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/common/ExternalFile.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// wrapper for common::ExternalFile +void wrapExternalFile(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = common::ExternalFile; + + // create the Python object + py::class_ object( + module, "ExternalFile", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("path"), + py::arg("checksum") = std::nullopt, + py::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 XMLName &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 XMLName &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_common +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common/ExternalFiles.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common/ExternalFiles.python.cpp new file mode 100644 index 000000000..333c66802 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common/ExternalFiles.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/common/ExternalFiles.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// wrapper for common::ExternalFiles +void wrapExternalFiles(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = common::ExternalFiles; + + // create the Python object + py::class_ object( + module, "ExternalFiles", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_common +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common/Mass.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common/Mass.python.cpp new file mode 100644 index 000000000..34a84e691 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common/Mass.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/common/Mass.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// wrapper for common::Mass +void wrapMass(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = common::Mass; + + // create the Python object + py::class_ object( + module, "Mass", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::vector & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("double"), + 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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common/Probability.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common/Probability.python.cpp new file mode 100644 index 000000000..850055e38 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common/Probability.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/common/Probability.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// wrapper for common::Probability +void wrapProbability(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = common::Probability; + + // create the Python object + py::class_ object( + module, "Probability", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("double") = 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common/Product.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common/Product.python.cpp new file mode 100644 index 000000000..58fc68a77 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common/Product.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/common/Product.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// wrapper for common::Product +void wrapProduct(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = common::Product; + + // create the Python object + py::class_ object( + module, "Product", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const transport::Multiplicity &, + const transport::Distribution & + >(), + py::arg("label"), + py::arg("pid"), + py::arg("multiplicity"), + py::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 XMLName &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 XMLName &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 transport::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 transport::Distribution &value) + { + self.distribution() = value; + }, + cppCLASS::component_t::documentation("distribution").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common/Products.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common/Products.python.cpp new file mode 100644 index 000000000..780d8080e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common/Products.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/common/Products.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// wrapper for common::Products +void wrapProducts(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = common::Products; + + // create the Python object + py::class_ object( + module, "Products", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::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_common +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common/Q.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common/Q.python.cpp new file mode 100644 index 000000000..7e849d719 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common/Q.python.cpp @@ -0,0 +1,213 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/common/Q.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// wrapper for common::Q +void wrapQ(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = common::Q; + using _t = std::variant< + containers::Constant1d, + containers::XYs1d, + containers::Regions1d, + containers::Polynomial1d, + containers::Gridded1d + >; + + // create the Python object + py::class_ object( + module, "Q", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const _t & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value"), + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("_constant1d_xys1dregions1dpolynomial1dgridded1d"), + 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 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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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() + ); + + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const containers::Constant1d &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const containers::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const containers::Regions1d &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const containers::Polynomial1d &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + object.def_property( + "gridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded1d(); + }, + [](cppCLASS &self, const containers::Gridded1d &value) + { + self.gridded1d() = value; + }, + cppCLASS::component_t::documentation("gridded1d").data() + ); + + object.def_property( + "_constant1d_xys1dregions1dpolynomial1dgridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._constant1dXYs1dregions1dpolynomial1dgridded1d(); + }, + [](cppCLASS &self, const _t &value) + { + self._constant1dXYs1dregions1dpolynomial1dgridded1d() = value; + }, + cppCLASS::component_t::documentation("_constant1d_xys1dregions1dpolynomial1dgridded1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_common +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/common/Temperature.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/common/Temperature.python.cpp new file mode 100644 index 000000000..7d1b4f75a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/common/Temperature.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/common/Temperature.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_common { + +// wrapper for common::Temperature +void wrapTemperature(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = common::Temperature; + + // create the Python object + py::class_ object( + module, "Temperature", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_common +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers.python.cpp new file mode 100644 index 000000000..0c433d497 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers.python.cpp @@ -0,0 +1,113 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// containers declarations +namespace python_containers { + void wrapStandard(py::module &); + void wrapLogNormal(py::module &); + void wrapInterval(py::module &); + void wrapConfidenceIntervals(py::module &); + void wrapCovariance(py::module &); + void wrapListOfCovariances(py::module &); + void wrapAxis(py::module &); + void wrapValues(py::module &); + void wrapLink(py::module &); + void wrapGrid(py::module &); + void wrapAxes(py::module &); + void wrapXYs1d(py::module &); + void wrapConstant1d(py::module &); + void wrapPolynomial1d(py::module &); + void wrapLegendre(py::module &); + void wrapArray(py::module &); + void wrapGridded1d(py::module &); + void wrapFunction1ds(py::module &); + void wrapRegions1d(py::module &); + void wrapPdf(py::module &); + void wrapUncertainty(py::module &); + void wrapXYs2d(py::module &); + void wrapGridded2d(py::module &); + void wrapFunction2ds(py::module &); + void wrapRegions2d(py::module &); + void wrapXYs3d(py::module &); + void wrapGridded3d(py::module &); + void wrapDouble(py::module &); + void wrapYs1d(py::module &); + void wrapString(py::module &); + void wrapInteger(py::module &); + void wrapFraction(py::module &); + void wrapColumn(py::module &); + void wrapColumnHeaders(py::module &); + void wrapData(py::module &); + void wrapTable(py::module &); + void wrapXs_in_xs_pdf_cdf1d(py::module &); + void wrapCdf_in_xs_pdf_cdf1d(py::module &); + void wrapXs_pdf_cdf1d(py::module &); + void wrapPdf_in_xs_pdf_cdf1d(py::module &); + void wrapFunction3ds(py::module &); + void wrapRegions3d(py::module &); +} // namespace python_containers + +// wrapper for containers +void wrapContainers(py::module &module) +{ + // create the containers submodule + py::module submodule = module.def_submodule( + "containers", + "test v2.0 containers" + ); + + // wrap containers components + python_containers::wrapStandard(submodule); + python_containers::wrapLogNormal(submodule); + python_containers::wrapInterval(submodule); + python_containers::wrapConfidenceIntervals(submodule); + python_containers::wrapCovariance(submodule); + python_containers::wrapListOfCovariances(submodule); + python_containers::wrapAxis(submodule); + python_containers::wrapValues(submodule); + python_containers::wrapLink(submodule); + python_containers::wrapGrid(submodule); + python_containers::wrapAxes(submodule); + python_containers::wrapXYs1d(submodule); + python_containers::wrapConstant1d(submodule); + python_containers::wrapPolynomial1d(submodule); + python_containers::wrapLegendre(submodule); + python_containers::wrapArray(submodule); + python_containers::wrapGridded1d(submodule); + python_containers::wrapFunction1ds(submodule); + python_containers::wrapRegions1d(submodule); + python_containers::wrapPdf(submodule); + python_containers::wrapUncertainty(submodule); + python_containers::wrapXYs2d(submodule); + python_containers::wrapGridded2d(submodule); + python_containers::wrapFunction2ds(submodule); + python_containers::wrapRegions2d(submodule); + python_containers::wrapXYs3d(submodule); + python_containers::wrapGridded3d(submodule); + python_containers::wrapDouble(submodule); + python_containers::wrapYs1d(submodule); + python_containers::wrapString(submodule); + python_containers::wrapInteger(submodule); + python_containers::wrapFraction(submodule); + python_containers::wrapColumn(submodule); + python_containers::wrapColumnHeaders(submodule); + python_containers::wrapData(submodule); + python_containers::wrapTable(submodule); + python_containers::wrapXs_in_xs_pdf_cdf1d(submodule); + python_containers::wrapCdf_in_xs_pdf_cdf1d(submodule); + python_containers::wrapXs_pdf_cdf1d(submodule); + python_containers::wrapPdf_in_xs_pdf_cdf1d(submodule); + python_containers::wrapFunction3ds(submodule); + python_containers::wrapRegions3d(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Array.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Array.python.cpp new file mode 100644 index 000000000..f7f94ed99 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Array.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Array.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Array +void wrapArray(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Array; + + // create the Python object + py::class_ object( + module, "Array", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const IntegerTuple &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional> &, + const std::optional> & + >(), + py::arg("shape"), + py::arg("compression") = std::nullopt, + py::arg("symmetry") = std::nullopt, + py::arg("permutation") = std::nullopt, + py::arg("storage_order") = std::nullopt, + py::arg("offset") = std::nullopt, + py::arg("values") = std::nullopt, + py::arg("array") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set shape + object.def_property( + "shape", + [](const cppCLASS &self) -> decltype(auto) + { + return self.shape(); + }, + [](cppCLASS &self, const IntegerTuple &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 permutation + object.def_property( + "permutation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.permutation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.permutation() = value; + }, + cppCLASS::component_t::documentation("permutation").data() + ); + + // get/set storageOrder + object.def_property( + "storage_order", + [](const cppCLASS &self) -> decltype(auto) + { + return self.storageOrder().value(); + }, + [](cppCLASS &self, const UTF8Text &value) + { + self.storageOrder() = value; + }, + cppCLASS::component_t::documentation("storage_order").data() + ); + + // get/set offset + object.def_property( + "offset", + [](const cppCLASS &self) -> decltype(auto) + { + return self.offset(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.offset() = value; + }, + cppCLASS::component_t::documentation("offset").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() + ); + + // 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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Axes.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Axes.python.cpp new file mode 100644 index 000000000..529bbb097 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Axes.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Axes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Axes +void wrapAxes(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Axes; + + // create the Python object + py::class_ object( + module, "Axes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional> &, + const std::optional> & + >(), + py::arg("href") = std::nullopt, + py::arg("axis") = std::nullopt, + py::arg("grid") = 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 axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::optional> &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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Axis.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Axis.python.cpp new file mode 100644 index 000000000..841ee8073 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Axis.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Axis.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Axis +void wrapAxis(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Axis; + + // create the Python object + py::class_ object( + module, "Axis", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const std::optional & + >(), + py::arg("index") = std::nullopt, + py::arg("label"), + py::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 XMLName &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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d.python.cpp new file mode 100644 index 000000000..c55f02bd3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Cdf_in_xs_pdf_cdf1d.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Cdf_in_xs_pdf_cdf1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Cdf_in_xs_pdf_cdf1d +void wrapCdf_in_xs_pdf_cdf1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Cdf_in_xs_pdf_cdf1d; + + // create the Python object + py::class_ object( + module, "Cdf_in_xs_pdf_cdf1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Values & + >(), + py::arg("values"), + cppCLASS::component_t::documentation("constructor").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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Column.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Column.python.cpp new file mode 100644 index 000000000..287dfb56c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Column.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Column.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Column +void wrapColumn(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Column; + + // create the Python object + py::class_ object( + module, "Column", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Integer32 &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + py::arg("index"), + py::arg("name"), + py::arg("unit") = std::nullopt, + py::arg("types") = 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 Integer32 &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 XMLName &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::optional &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set types + object.def_property( + "types", + [](const cppCLASS &self) -> decltype(auto) + { + return self.types(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.types() = value; + }, + cppCLASS::component_t::documentation("types").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/ColumnHeaders.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/ColumnHeaders.python.cpp new file mode 100644 index 000000000..bb8e1b9e8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/ColumnHeaders.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/ColumnHeaders.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::ColumnHeaders +void wrapColumnHeaders(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::ColumnHeaders; + + // create the Python object + py::class_ object( + module, "ColumnHeaders", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/ConfidenceIntervals.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/ConfidenceIntervals.python.cpp new file mode 100644 index 000000000..5c02a1f3a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/ConfidenceIntervals.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/ConfidenceIntervals.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::ConfidenceIntervals +void wrapConfidenceIntervals(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::ConfidenceIntervals; + + // create the Python object + py::class_ object( + module, "ConfidenceIntervals", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("interval"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set interval + object.def_property( + "interval", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interval(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.interval() = value; + }, + cppCLASS::component_t::documentation("interval").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Constant1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Constant1d.python.cpp new file mode 100644 index 000000000..a96ddbbe2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Constant1d.python.cpp @@ -0,0 +1,170 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Constant1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Constant1d +void wrapConstant1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Constant1d; + + // create the Python object + py::class_ object( + module, "Constant1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const Float64 &, + const Float64 &, + const containers::Axes & + >(), + py::arg("value") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("domain_min"), + py::arg("domain_max"), + py::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 std::optional &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").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 domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const Float64 &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 Float64 &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 containers::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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Covariance.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Covariance.python.cpp new file mode 100644 index 000000000..5ce4279d3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Covariance.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Covariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Covariance +void wrapCovariance(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Covariance; + + // create the Python object + py::class_ object( + module, "Covariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("href") = 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Data.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Data.python.cpp new file mode 100644 index 000000000..6b0a1feb3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Data.python.cpp @@ -0,0 +1,131 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Data.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Data +void wrapData(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Data; + + // create the Python object + py::class_ object( + module, "Data", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("sep") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set sep + object.def_property( + "sep", + [](const cppCLASS &self) -> decltype(auto) + { + return self.sep().value(); + }, + [](cppCLASS &self, const UTF8Text &value) + { + self.sep() = value; + }, + cppCLASS::component_t::documentation("sep").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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Double.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Double.python.cpp new file mode 100644 index 000000000..18b635591 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Double.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Double.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Double +void wrapDouble(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Double; + + // create the Python object + py::class_ object( + module, "Double", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const Float64 &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value"), + py::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 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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Fraction.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Fraction.python.cpp new file mode 100644 index 000000000..60cdfe334 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Fraction.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Fraction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Fraction +void wrapFraction(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Fraction; + + // create the Python object + py::class_ object( + module, "Fraction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const Fraction32 & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value"), + 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 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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Fraction32 &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Function1ds.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Function1ds.python.cpp new file mode 100644 index 000000000..b7770776e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Function1ds.python.cpp @@ -0,0 +1,68 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Function1ds.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Function1ds +void wrapFunction1ds(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Function1ds; + using _t = std::variant< + containers::XYs1d, + containers::Constant1d, + containers::Polynomial1d, + containers::Legendre, + containers::Gridded1d + >; + + // create the Python object + py::class_ object( + module, "Function1ds", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector<_t> & + >(), + py::arg("_xys1dconstant1dpolynomial1d_legendregridded1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "_xys1dconstant1dpolynomial1d_legendregridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs1dconstant1dpolynomial1dLegendregridded1d(); + }, + [](cppCLASS &self, const std::vector<_t> &value) + { + self._XYs1dconstant1dpolynomial1dLegendregridded1d() = value; + }, + cppCLASS::component_t::documentation("_xys1dconstant1dpolynomial1d_legendregridded1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Function2ds.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Function2ds.python.cpp new file mode 100644 index 000000000..ff552f6ea --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Function2ds.python.cpp @@ -0,0 +1,65 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Function2ds.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Function2ds +void wrapFunction2ds(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Function2ds; + using _t = std::variant< + containers::XYs2d, + containers::Gridded2d + >; + + // create the Python object + py::class_ object( + module, "Function2ds", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector<_t> & + >(), + py::arg("_xys2dgridded2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "_xys2dgridded2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs2dgridded2d(); + }, + [](cppCLASS &self, const std::vector<_t> &value) + { + self._XYs2dgridded2d() = value; + }, + cppCLASS::component_t::documentation("_xys2dgridded2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Function3ds.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Function3ds.python.cpp new file mode 100644 index 000000000..7e300b082 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Function3ds.python.cpp @@ -0,0 +1,65 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Function3ds.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Function3ds +void wrapFunction3ds(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Function3ds; + using _t = std::variant< + containers::XYs3d, + containers::Gridded3d + >; + + // create the Python object + py::class_ object( + module, "Function3ds", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector<_t> & + >(), + py::arg("_xys3dgridded3d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "_xys3dgridded3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs3dgridded3d(); + }, + [](cppCLASS &self, const std::vector<_t> &value) + { + self._XYs3dgridded3d() = value; + }, + cppCLASS::component_t::documentation("_xys3dgridded3d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Grid.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Grid.python.cpp new file mode 100644 index 000000000..aa11cf881 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Grid.python.cpp @@ -0,0 +1,171 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Grid.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Grid +void wrapGrid(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Grid; + using _t = std::variant< + containers::Values, + containers::Link + >; + + // create the Python object + py::class_ object( + module, "Grid", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const _t & + >(), + py::arg("index") = std::nullopt, + py::arg("interpolation") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("style") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("_valueslink"), + 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( + "_valueslink", + [](const cppCLASS &self) -> decltype(auto) + { + return self._valueslink(); + }, + [](cppCLASS &self, const _t &value) + { + self._valueslink() = value; + }, + cppCLASS::component_t::documentation("_valueslink").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Gridded1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Gridded1d.python.cpp new file mode 100644 index 000000000..5800cf5f2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Gridded1d.python.cpp @@ -0,0 +1,122 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Gridded1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Gridded1d +void wrapGridded1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Gridded1d; + + // create the Python object + py::class_ object( + module, "Gridded1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const containers::Array &, + const containers::Axes & + >(), + py::arg("label") = std::nullopt, + py::arg("array"), + py::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 array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const containers::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const containers::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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Gridded2d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Gridded2d.python.cpp new file mode 100644 index 000000000..47bfe61a3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Gridded2d.python.cpp @@ -0,0 +1,122 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Gridded2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Gridded2d +void wrapGridded2d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Gridded2d; + + // create the Python object + py::class_ object( + module, "Gridded2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const containers::Array &, + const containers::Axes & + >(), + py::arg("label") = std::nullopt, + py::arg("array"), + py::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 array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const containers::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const containers::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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Gridded3d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Gridded3d.python.cpp new file mode 100644 index 000000000..71aa2f184 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Gridded3d.python.cpp @@ -0,0 +1,122 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Gridded3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Gridded3d +void wrapGridded3d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Gridded3d; + + // create the Python object + py::class_ object( + module, "Gridded3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const containers::Array &, + const containers::Axes & + >(), + py::arg("label") = std::nullopt, + py::arg("array"), + py::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 array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const containers::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const containers::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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Integer.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Integer.python.cpp new file mode 100644 index 000000000..370ac25d2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Integer.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Integer.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Integer +void wrapInteger(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Integer; + + // create the Python object + py::class_ object( + module, "Integer", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const Integer32 & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value"), + 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 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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Interval.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Interval.python.cpp new file mode 100644 index 000000000..e88f3ae47 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Interval.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Interval.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Interval +void wrapInterval(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Interval; + + // create the Python object + py::class_ object( + module, "Interval", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Float64 &, + const Float64 &, + const Float64 & + >(), + py::arg("confidence"), + py::arg("lower"), + py::arg("upper"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set confidence + object.def_property( + "confidence", + [](const cppCLASS &self) -> decltype(auto) + { + return self.confidence(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.confidence() = value; + }, + cppCLASS::component_t::documentation("confidence").data() + ); + + // get/set lower + object.def_property( + "lower", + [](const cppCLASS &self) -> decltype(auto) + { + return self.lower(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.lower() = value; + }, + cppCLASS::component_t::documentation("lower").data() + ); + + // get/set upper + object.def_property( + "upper", + [](const cppCLASS &self) -> decltype(auto) + { + return self.upper(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.upper() = value; + }, + cppCLASS::component_t::documentation("upper").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Legendre.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Legendre.python.cpp new file mode 100644 index 000000000..0b38795c3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Legendre.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Legendre.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Legendre +void wrapLegendre(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Legendre; + + // create the Python object + py::class_ object( + module, "Legendre", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Values & + >(), + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("lower_index") = std::nullopt, + py::arg("domain_min") = std::nullopt, + py::arg("domain_max") = std::nullopt, + py::arg("values"), + 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 lowerIndex + object.def_property( + "lower_index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.lowerIndex().value(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.lowerIndex() = value; + }, + cppCLASS::component_t::documentation("lower_index").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin().value(); + }, + [](cppCLASS &self, const Float64 &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().value(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Link.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Link.python.cpp new file mode 100644 index 000000000..769e8b44c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Link.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Link.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Link +void wrapLink(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Link; + + // create the Python object + py::class_ object( + module, "Link", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/ListOfCovariances.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/ListOfCovariances.python.cpp new file mode 100644 index 000000000..2ba0c6cf9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/ListOfCovariances.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/ListOfCovariances.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::ListOfCovariances +void wrapListOfCovariances(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::ListOfCovariances; + + // create the Python object + py::class_ object( + module, "ListOfCovariances", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/LogNormal.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/LogNormal.python.cpp new file mode 100644 index 000000000..bd375425b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/LogNormal.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/LogNormal.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::LogNormal +void wrapLogNormal(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::LogNormal; + + // create the Python object + py::class_ object( + module, "LogNormal", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const extra::Double & + >(), + py::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 extra::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Pdf.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Pdf.python.cpp new file mode 100644 index 000000000..330102bec --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Pdf.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Pdf.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Pdf +void wrapPdf(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Pdf; + + // create the Python object + py::class_ object( + module, "Pdf", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d.python.cpp new file mode 100644 index 000000000..453541e90 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Pdf_in_xs_pdf_cdf1d.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Pdf_in_xs_pdf_cdf1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Pdf_in_xs_pdf_cdf1d +void wrapPdf_in_xs_pdf_cdf1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Pdf_in_xs_pdf_cdf1d; + + // create the Python object + py::class_ object( + module, "Pdf_in_xs_pdf_cdf1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Values & + >(), + py::arg("values"), + cppCLASS::component_t::documentation("constructor").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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Polynomial1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Polynomial1d.python.cpp new file mode 100644 index 000000000..0bea1dcf8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Polynomial1d.python.cpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Polynomial1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Polynomial1d +void wrapPolynomial1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Polynomial1d; + + // create the Python object + py::class_ object( + module, "Polynomial1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const Float64 &, + const Float64 &, + const containers::Axes &, + const std::optional &, + const containers::Values & + >(), + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("lower_index") = std::nullopt, + py::arg("domain_min"), + py::arg("domain_max"), + py::arg("axes"), + py::arg("uncertainty") = std::nullopt, + py::arg("values"), + 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 lowerIndex + object.def_property( + "lower_index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.lowerIndex().value(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.lowerIndex() = value; + }, + cppCLASS::component_t::documentation("lower_index").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const Float64 &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 Float64 &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 containers::Axes &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 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() + ); + + // 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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Regions1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Regions1d.python.cpp new file mode 100644 index 000000000..9a7a761ab --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Regions1d.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Regions1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Regions1d +void wrapRegions1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Regions1d; + + // create the Python object + py::class_ object( + module, "Regions1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Function1ds &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::arg("function1ds"), + py::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 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 containers::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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Regions2d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Regions2d.python.cpp new file mode 100644 index 000000000..545d423e6 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Regions2d.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Regions2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Regions2d +void wrapRegions2d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Regions2d; + + // create the Python object + py::class_ object( + module, "Regions2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Function2ds &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::arg("function2ds"), + py::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 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 function2ds + object.def_property( + "function2ds", + [](const cppCLASS &self) -> decltype(auto) + { + return self.function2ds(); + }, + [](cppCLASS &self, const containers::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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Regions3d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Regions3d.python.cpp new file mode 100644 index 000000000..0286b95d8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Regions3d.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Regions3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Regions3d +void wrapRegions3d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Regions3d; + + // create the Python object + py::class_ object( + module, "Regions3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Function3ds &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::arg("function3ds"), + py::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 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 function3ds + object.def_property( + "function3ds", + [](const cppCLASS &self) -> decltype(auto) + { + return self.function3ds(); + }, + [](cppCLASS &self, const containers::Function3ds &value) + { + self.function3ds() = value; + }, + cppCLASS::component_t::documentation("function3ds").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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Standard.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Standard.python.cpp new file mode 100644 index 000000000..50e7e6289 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Standard.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Standard.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Standard +void wrapStandard(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Standard; + + // create the Python object + py::class_ object( + module, "Standard", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const extra::Double & + >(), + py::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 extra::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/String.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/String.python.cpp new file mode 100644 index 000000000..79a5fa567 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/String.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/String.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::String +void wrapString(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::String; + + // create the Python object + py::class_ object( + module, "String", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const XMLName & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value"), + 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 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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Table.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Table.python.cpp new file mode 100644 index 000000000..1cca352f8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Table.python.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Table.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Table +void wrapTable(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Table; + + // create the Python object + py::class_ object( + module, "Table", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Integer32 &, + const Integer32 &, + const std::optional &, + const containers::ColumnHeaders &, + const containers::Data & + >(), + py::arg("columns"), + py::arg("rows"), + py::arg("storage_order") = std::nullopt, + py::arg("column_headers"), + py::arg("data"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set columns + object.def_property( + "columns", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columns(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.columns() = value; + }, + cppCLASS::component_t::documentation("columns").data() + ); + + // get/set rows + object.def_property( + "rows", + [](const cppCLASS &self) -> decltype(auto) + { + return self.rows(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.rows() = value; + }, + cppCLASS::component_t::documentation("rows").data() + ); + + // get/set storageOrder + object.def_property( + "storage_order", + [](const cppCLASS &self) -> decltype(auto) + { + return self.storageOrder().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.storageOrder() = value; + }, + cppCLASS::component_t::documentation("storage_order").data() + ); + + // get/set columnHeaders + object.def_property( + "column_headers", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnHeaders(); + }, + [](cppCLASS &self, const containers::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 containers::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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Uncertainty.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Uncertainty.python.cpp new file mode 100644 index 000000000..db0ef1d81 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Uncertainty.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Uncertainty.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Uncertainty +void wrapUncertainty(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Uncertainty; + + // create the Python object + py::class_ object( + module, "Uncertainty", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("standard") = std::nullopt, + py::arg("log_normal") = std::nullopt, + py::arg("confidence_intervals") = std::nullopt, + py::arg("pdf") = std::nullopt, + py::arg("xys1d") = std::nullopt, + py::arg("polynomial1d") = std::nullopt, + py::arg("covariance") = std::nullopt, + py::arg("list_of_covariances") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 logNormal + object.def_property( + "log_normal", + [](const cppCLASS &self) -> decltype(auto) + { + return self.logNormal(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.logNormal() = value; + }, + cppCLASS::component_t::documentation("log_normal").data() + ); + + // get/set confidenceIntervals + object.def_property( + "confidence_intervals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.confidenceIntervals(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.confidenceIntervals() = value; + }, + cppCLASS::component_t::documentation("confidence_intervals").data() + ); + + // get/set pdf + object.def_property( + "pdf", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pdf(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.pdf() = value; + }, + cppCLASS::component_t::documentation("pdf").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 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 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Values.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Values.python.cpp new file mode 100644 index 000000000..c40636d00 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Values.python.cpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Values.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Values +void wrapValues(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Values; + + // create the Python object + py::class_ object( + module, "Values", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("value_type") = std::nullopt, + py::arg("start") = std::nullopt, + py::arg("length") = std::nullopt, + py::arg("href") = std::nullopt, + py::arg("start_index") = std::nullopt, + py::arg("count") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::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 UTF8Text &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 Integer32 &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 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 startIndex + object.def_property( + "start_index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.startIndex(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.startIndex() = value; + }, + cppCLASS::component_t::documentation("start_index").data() + ); + + // get/set count + object.def_property( + "count", + [](const cppCLASS &self) -> decltype(auto) + { + return self.count(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.count() = value; + }, + cppCLASS::component_t::documentation("count").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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/XYs1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/XYs1d.python.cpp new file mode 100644 index 000000000..f0eb47946 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/XYs1d.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/XYs1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::XYs1d +void wrapXYs1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::XYs1d; + + // create the Python object + py::class_ object( + module, "XYs1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Values & + >(), + py::arg("index") = std::nullopt, + py::arg("interpolation") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::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 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 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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/XYs2d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/XYs2d.python.cpp new file mode 100644 index 000000000..6c40066b9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/XYs2d.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/XYs2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::XYs2d +void wrapXYs2d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::XYs2d; + + // create the Python object + py::class_ object( + module, "XYs2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Function1ds &, + const std::optional & + >(), + py::arg("index") = std::nullopt, + py::arg("interpolation") = std::nullopt, + py::arg("interpolation_qualifier") = std::nullopt, + py::arg("outer_domain_value") = std::nullopt, + py::arg("axes") = std::nullopt, + py::arg("function1ds"), + py::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().value(); + }, + [](cppCLASS &self, const enums::Interpolation &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 containers::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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/XYs3d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/XYs3d.python.cpp new file mode 100644 index 000000000..20bb898de --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/XYs3d.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/XYs3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::XYs3d +void wrapXYs3d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::XYs3d; + + // create the Python object + py::class_ object( + module, "XYs3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Function2ds &, + const std::optional & + >(), + py::arg("interpolation") = std::nullopt, + py::arg("interpolation_qualifier") = std::nullopt, + py::arg("axes") = std::nullopt, + py::arg("function2ds"), + py::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 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 containers::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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Xs_in_xs_pdf_cdf1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Xs_in_xs_pdf_cdf1d.python.cpp new file mode 100644 index 000000000..53d981a09 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Xs_in_xs_pdf_cdf1d.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Xs_in_xs_pdf_cdf1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Xs_in_xs_pdf_cdf1d +void wrapXs_in_xs_pdf_cdf1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Xs_in_xs_pdf_cdf1d; + + // create the Python object + py::class_ object( + module, "Xs_in_xs_pdf_cdf1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Values & + >(), + py::arg("values"), + cppCLASS::component_t::documentation("constructor").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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Xs_pdf_cdf1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Xs_pdf_cdf1d.python.cpp new file mode 100644 index 000000000..560c4b1be --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Xs_pdf_cdf1d.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Xs_pdf_cdf1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Xs_pdf_cdf1d +void wrapXs_pdf_cdf1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Xs_pdf_cdf1d; + + // create the Python object + py::class_ object( + module, "Xs_pdf_cdf1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const containers::Xs_in_xs_pdf_cdf1d &, + const containers::Pdf &, + const containers::Cdf_in_xs_pdf_cdf1d & + >(), + py::arg("outer_domain_value") = std::nullopt, + py::arg("xs_in_xs_pdf_cdf1d"), + py::arg("pdf"), + py::arg("cdf_in_xs_pdf_cdf1d"), + 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 std::optional &value) + { + self.outerDomainValue() = value; + }, + cppCLASS::component_t::documentation("outer_domain_value").data() + ); + + // get/set xs_in_xs_pdf_cdf1d + object.def_property( + "xs_in_xs_pdf_cdf1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.xs_in_xs_pdf_cdf1d(); + }, + [](cppCLASS &self, const containers::Xs_in_xs_pdf_cdf1d &value) + { + self.xs_in_xs_pdf_cdf1d() = value; + }, + cppCLASS::component_t::documentation("xs_in_xs_pdf_cdf1d").data() + ); + + // get/set pdf + object.def_property( + "pdf", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pdf(); + }, + [](cppCLASS &self, const containers::Pdf &value) + { + self.pdf() = value; + }, + cppCLASS::component_t::documentation("pdf").data() + ); + + // get/set cdf_in_xs_pdf_cdf1d + object.def_property( + "cdf_in_xs_pdf_cdf1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.cdf_in_xs_pdf_cdf1d(); + }, + [](cppCLASS &self, const containers::Cdf_in_xs_pdf_cdf1d &value) + { + self.cdf_in_xs_pdf_cdf1d() = value; + }, + cppCLASS::component_t::documentation("cdf_in_xs_pdf_cdf1d").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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/containers/Ys1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/containers/Ys1d.python.cpp new file mode 100644 index 000000000..72391619f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/containers/Ys1d.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/containers/Ys1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_containers { + +// wrapper for containers::Ys1d +void wrapYs1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = containers::Ys1d; + + // create the Python object + py::class_ object( + module, "Ys1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const containers::Axes &, + const containers::Values & + >(), + py::arg("interpolation") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("axes"), + py::arg("values"), + cppCLASS::component_t::documentation("constructor").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 axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const containers::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 containers::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_containers +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance.python.cpp new file mode 100644 index 000000000..2728191ad --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance.python.cpp @@ -0,0 +1,73 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// covariance declarations +namespace python_covariance { + void wrapSlice(py::module &); + void wrapSlices(py::module &); + void wrapRowData(py::module &); + void wrapColumnData(py::module &); + void wrapCovariance(py::module &); + void wrapRowSensitivity(py::module &); + void wrapColumnSensitivity(py::module &); + void wrapSandwichProduct(py::module &); + void wrapCovarianceMatrix(py::module &); + void wrapSummand(py::module &); + void wrapSum(py::module &); + void wrapShortRangeSelfScalingVariance(py::module &); + void wrapMixed(py::module &); + void wrapCovarianceSection(py::module &); + void wrapCovarianceSections(py::module &); + void wrapAverageParameterCovariance(py::module &); + void wrapParameterLink(py::module &); + void wrapParameters(py::module &); + void wrapParameterCovarianceMatrix(py::module &); + void wrapParameterCovariance(py::module &); + void wrapParameterCovariances(py::module &); + void wrapCovarianceSuite(py::module &); +} // namespace python_covariance + +// wrapper for covariance +void wrapCovariance(py::module &module) +{ + // create the covariance submodule + py::module submodule = module.def_submodule( + "covariance", + "test v2.0 covariance" + ); + + // wrap covariance components + python_covariance::wrapSlice(submodule); + python_covariance::wrapSlices(submodule); + python_covariance::wrapRowData(submodule); + python_covariance::wrapColumnData(submodule); + python_covariance::wrapCovariance(submodule); + python_covariance::wrapRowSensitivity(submodule); + python_covariance::wrapColumnSensitivity(submodule); + python_covariance::wrapSandwichProduct(submodule); + python_covariance::wrapCovarianceMatrix(submodule); + python_covariance::wrapSummand(submodule); + python_covariance::wrapSum(submodule); + python_covariance::wrapShortRangeSelfScalingVariance(submodule); + python_covariance::wrapMixed(submodule); + python_covariance::wrapCovarianceSection(submodule); + python_covariance::wrapCovarianceSections(submodule); + python_covariance::wrapAverageParameterCovariance(submodule); + python_covariance::wrapParameterLink(submodule); + python_covariance::wrapParameters(submodule); + python_covariance::wrapParameterCovarianceMatrix(submodule); + python_covariance::wrapParameterCovariance(submodule); + python_covariance::wrapParameterCovariances(submodule); + python_covariance::wrapCovarianceSuite(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/AverageParameterCovariance.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/AverageParameterCovariance.python.cpp new file mode 100644 index 000000000..498b7ebb1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/AverageParameterCovariance.python.cpp @@ -0,0 +1,141 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/AverageParameterCovariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::AverageParameterCovariance +void wrapAverageParameterCovariance(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::AverageParameterCovariance; + using _t = std::variant< + covariance::CovarianceMatrix + >; + + // create the Python object + py::class_ object( + module, "AverageParameterCovariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const _t & + >(), + py::arg("cross_term") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("column_data") = std::nullopt, + py::arg("row_data") = std::nullopt, + py::arg("_covariance_matrix"), + cppCLASS::component_t::documentation("constructor").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 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 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 rowData + object.def_property( + "row_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.rowData(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.rowData() = value; + }, + cppCLASS::component_t::documentation("row_data").data() + ); + + object.def_property( + "covariance_matrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covarianceMatrix(); + }, + [](cppCLASS &self, const covariance::CovarianceMatrix &value) + { + self.covarianceMatrix() = value; + }, + cppCLASS::component_t::documentation("covariance_matrix").data() + ); + + object.def_property( + "_covariance_matrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self._covarianceMatrix(); + }, + [](cppCLASS &self, const _t &value) + { + self._covarianceMatrix() = value; + }, + cppCLASS::component_t::documentation("_covariance_matrix").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/ColumnData.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/ColumnData.python.cpp new file mode 100644 index 000000000..4162ef35f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/ColumnData.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/ColumnData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::ColumnData +void wrapColumnData(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::ColumnData; + + // create the Python object + py::class_ object( + module, "ColumnData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("endf_mfmt") = std::nullopt, + py::arg("href") = std::nullopt, + py::arg("dimension") = std::nullopt, + py::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::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").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 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_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/ColumnSensitivity.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/ColumnSensitivity.python.cpp new file mode 100644 index 000000000..fb72021ef --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/ColumnSensitivity.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/ColumnSensitivity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::ColumnSensitivity +void wrapColumnSensitivity(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::ColumnSensitivity; + + // create the Python object + py::class_ object( + module, "ColumnSensitivity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Array & + >(), + py::arg("array"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const containers::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/Covariance.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/Covariance.python.cpp new file mode 100644 index 000000000..4ac19362e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/Covariance.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/Covariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::Covariance +void wrapCovariance(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::Covariance; + + // create the Python object + py::class_ object( + module, "Covariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Array & + >(), + py::arg("array"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const containers::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceMatrix.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceMatrix.python.cpp new file mode 100644 index 000000000..9514fcaa1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceMatrix.python.cpp @@ -0,0 +1,139 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/CovarianceMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::CovarianceMatrix +void wrapCovarianceMatrix(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::CovarianceMatrix; + using _t = std::variant< + containers::Gridded2d, + covariance::SandwichProduct + >; + + // create the Python object + py::class_ object( + module, "CovarianceMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const XMLName &, + const _t & + >(), + py::arg("label") = std::nullopt, + py::arg("product_frame") = std::nullopt, + py::arg("type"), + py::arg("_gridded2dsandwich_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::optional &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() + ); + + // get/set type + object.def_property( + "type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.type(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.type() = value; + }, + cppCLASS::component_t::documentation("type").data() + ); + + object.def_property( + "gridded2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded2d(); + }, + [](cppCLASS &self, const containers::Gridded2d &value) + { + self.gridded2d() = value; + }, + cppCLASS::component_t::documentation("gridded2d").data() + ); + + object.def_property( + "sandwich_product", + [](const cppCLASS &self) -> decltype(auto) + { + return self.sandwichProduct(); + }, + [](cppCLASS &self, const covariance::SandwichProduct &value) + { + self.sandwichProduct() = value; + }, + cppCLASS::component_t::documentation("sandwich_product").data() + ); + + object.def_property( + "_gridded2dsandwich_product", + [](const cppCLASS &self) -> decltype(auto) + { + return self._gridded2dsandwichProduct(); + }, + [](cppCLASS &self, const _t &value) + { + self._gridded2dsandwichProduct() = value; + }, + cppCLASS::component_t::documentation("_gridded2dsandwich_product").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceSection.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceSection.python.cpp new file mode 100644 index 000000000..a690693ac --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceSection.python.cpp @@ -0,0 +1,169 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/CovarianceSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::CovarianceSection +void wrapCovarianceSection(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::CovarianceSection; + using _t = std::variant< + covariance::CovarianceMatrix, + covariance::Sum, + covariance::Mixed + >; + + // create the Python object + py::class_ object( + module, "CovarianceSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const covariance::RowData &, + const std::optional &, + const _t & + >(), + py::arg("cross_term") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("row_data"), + py::arg("column_data") = std::nullopt, + py::arg("_covariance_matrixsummixed"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set crossTerm + object.def_property( + "cross_term", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossTerm().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.crossTerm() = value; + }, + cppCLASS::component_t::documentation("cross_term").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 rowData + object.def_property( + "row_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.rowData(); + }, + [](cppCLASS &self, const covariance::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() + ); + + object.def_property( + "covariance_matrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covarianceMatrix(); + }, + [](cppCLASS &self, const covariance::CovarianceMatrix &value) + { + self.covarianceMatrix() = value; + }, + cppCLASS::component_t::documentation("covariance_matrix").data() + ); + + object.def_property( + "sum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.sum(); + }, + [](cppCLASS &self, const covariance::Sum &value) + { + self.sum() = value; + }, + cppCLASS::component_t::documentation("sum").data() + ); + + object.def_property( + "mixed", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mixed(); + }, + [](cppCLASS &self, const covariance::Mixed &value) + { + self.mixed() = value; + }, + cppCLASS::component_t::documentation("mixed").data() + ); + + object.def_property( + "_covariance_matrixsummixed", + [](const cppCLASS &self) -> decltype(auto) + { + return self._covarianceMatrixsummixed(); + }, + [](cppCLASS &self, const _t &value) + { + self._covarianceMatrixsummixed() = value; + }, + cppCLASS::component_t::documentation("_covariance_matrixsummixed").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceSections.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceSections.python.cpp new file mode 100644 index 000000000..ada76944b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceSections.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/CovarianceSections.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::CovarianceSections +void wrapCovarianceSections(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::CovarianceSections; + + // create the Python object + py::class_ object( + module, "CovarianceSections", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::arg("covariance_section") = std::nullopt, + 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::optional> &value) + { + self.covarianceSection() = value; + }, + cppCLASS::component_t::documentation("covariance_section").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceSuite.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceSuite.python.cpp new file mode 100644 index 000000000..b2b25f776 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/CovarianceSuite.python.cpp @@ -0,0 +1,190 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/CovarianceSuite.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::CovarianceSuite +void wrapCovarianceSuite(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::CovarianceSuite; + + // create the Python object + py::class_ object( + module, "CovarianceSuite", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const enums::Interaction &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("evaluation") = std::nullopt, + py::arg("projectile") = std::nullopt, + py::arg("target") = std::nullopt, + py::arg("interaction"), + py::arg("format") = std::nullopt, + py::arg("external_files") = std::nullopt, + py::arg("styles") = std::nullopt, + py::arg("covariance_sections") = std::nullopt, + py::arg("parameter_covariances") = 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::optional &value) + { + self.evaluation() = value; + }, + cppCLASS::component_t::documentation("evaluation").data() + ); + + // get/set projectile + object.def_property( + "projectile", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectile(); + }, + [](cppCLASS &self, const std::optional &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::optional &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 enums::Interaction &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::optional &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 std::optional &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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/Mixed.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/Mixed.python.cpp new file mode 100644 index 000000000..88a1629de --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/Mixed.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/Mixed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::Mixed +void wrapMixed(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::Mixed; + + // create the Python object + py::class_ object( + module, "Mixed", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::optional> &, + const std::optional> &, + const std::optional> & + >(), + py::arg("label"), + py::arg("covariance_matrix") = std::nullopt, + py::arg("short_range_self_scaling_variance") = std::nullopt, + py::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 XMLName &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::optional> &value) + { + self.covarianceMatrix() = value; + }, + cppCLASS::component_t::documentation("covariance_matrix").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() + ); + + // 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_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterCovariance.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterCovariance.python.cpp new file mode 100644 index 000000000..675aa4d21 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterCovariance.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/ParameterCovariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::ParameterCovariance +void wrapParameterCovariance(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::ParameterCovariance; + + // create the Python object + py::class_ object( + module, "ParameterCovariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const covariance::RowData &, + const std::vector & + >(), + py::arg("label") = std::nullopt, + py::arg("row_data"), + py::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::optional &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 covariance::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 std::vector &value) + { + self.parameterCovarianceMatrix() = value; + }, + cppCLASS::component_t::documentation("parameter_covariance_matrix").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterCovarianceMatrix.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterCovarianceMatrix.python.cpp new file mode 100644 index 000000000..01992f2a2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterCovarianceMatrix.python.cpp @@ -0,0 +1,124 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/ParameterCovarianceMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::ParameterCovarianceMatrix +void wrapParameterCovarianceMatrix(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::ParameterCovarianceMatrix; + + // create the Python object + py::class_ object( + module, "ParameterCovarianceMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::optional &, + const covariance::Parameters &, + const containers::Array & + >(), + py::arg("label"), + py::arg("type") = std::nullopt, + py::arg("parameters"), + py::arg("array"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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::optional &value) + { + self.type() = value; + }, + cppCLASS::component_t::documentation("type").data() + ); + + // get/set parameters + object.def_property( + "parameters", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameters(); + }, + [](cppCLASS &self, const covariance::Parameters &value) + { + self.parameters() = value; + }, + cppCLASS::component_t::documentation("parameters").data() + ); + + // get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const containers::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterCovariances.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterCovariances.python.cpp new file mode 100644 index 000000000..e3ee109a7 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterCovariances.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/ParameterCovariances.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::ParameterCovariances +void wrapParameterCovariances(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::ParameterCovariances; + + // create the Python object + py::class_ object( + module, "ParameterCovariances", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> &, + const std::optional> & + >(), + py::arg("average_parameter_covariance") = std::nullopt, + py::arg("parameter_covariance") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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() + ); + + // get/set parameterCovariance + object.def_property( + "parameter_covariance", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameterCovariance(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.parameterCovariance() = value; + }, + cppCLASS::component_t::documentation("parameter_covariance").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterLink.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterLink.python.cpp new file mode 100644 index 000000000..46d58fe43 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/ParameterLink.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/ParameterLink.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::ParameterLink +void wrapParameterLink(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::ParameterLink; + + // create the Python object + py::class_ object( + module, "ParameterLink", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("href") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("matrix_start_index") = std::nullopt, + py::arg("n_parameters") = 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 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 matrixStartIndex + object.def_property( + "matrix_start_index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.matrixStartIndex().value(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.matrixStartIndex() = value; + }, + cppCLASS::component_t::documentation("matrix_start_index").data() + ); + + // get/set nParameters + object.def_property( + "n_parameters", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nParameters().value(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.nParameters() = value; + }, + cppCLASS::component_t::documentation("n_parameters").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/Parameters.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/Parameters.python.cpp new file mode 100644 index 000000000..4d66dfbcb --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/Parameters.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/Parameters.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::Parameters +void wrapParameters(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::Parameters; + + // create the Python object + py::class_ object( + module, "Parameters", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::arg("parameter_link") = std::nullopt, + 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::optional> &value) + { + self.parameterLink() = value; + }, + cppCLASS::component_t::documentation("parameter_link").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/RowData.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/RowData.python.cpp new file mode 100644 index 000000000..9454bb73e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/RowData.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/RowData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::RowData +void wrapRowData(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::RowData; + + // create the Python object + py::class_ object( + module, "RowData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("endf_mfmt") = std::nullopt, + py::arg("href") = std::nullopt, + py::arg("dimension") = std::nullopt, + py::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::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").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 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_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/RowSensitivity.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/RowSensitivity.python.cpp new file mode 100644 index 000000000..9c7ea0ae5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/RowSensitivity.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/RowSensitivity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::RowSensitivity +void wrapRowSensitivity(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::RowSensitivity; + + // create the Python object + py::class_ object( + module, "RowSensitivity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Array & + >(), + py::arg("array"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const containers::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/SandwichProduct.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/SandwichProduct.python.cpp new file mode 100644 index 000000000..818f9a3fb --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/SandwichProduct.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/SandwichProduct.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::SandwichProduct +void wrapSandwichProduct(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::SandwichProduct; + + // create the Python object + py::class_ object( + module, "SandwichProduct", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Axes &, + const covariance::Covariance &, + const covariance::RowSensitivity &, + const std::optional & + >(), + py::arg("axes"), + py::arg("covariance"), + py::arg("row_sensitivity"), + py::arg("column_sensitivity") = 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 containers::Axes &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set covariance + object.def_property( + "covariance", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covariance(); + }, + [](cppCLASS &self, const covariance::Covariance &value) + { + self.covariance() = value; + }, + cppCLASS::component_t::documentation("covariance").data() + ); + + // get/set rowSensitivity + object.def_property( + "row_sensitivity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.rowSensitivity(); + }, + [](cppCLASS &self, const covariance::RowSensitivity &value) + { + self.rowSensitivity() = value; + }, + cppCLASS::component_t::documentation("row_sensitivity").data() + ); + + // get/set columnSensitivity + object.def_property( + "column_sensitivity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnSensitivity(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.columnSensitivity() = value; + }, + cppCLASS::component_t::documentation("column_sensitivity").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_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/ShortRangeSelfScalingVariance.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/ShortRangeSelfScalingVariance.python.cpp new file mode 100644 index 000000000..a7ac4c23f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/ShortRangeSelfScalingVariance.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/ShortRangeSelfScalingVariance.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::ShortRangeSelfScalingVariance +void wrapShortRangeSelfScalingVariance(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::ShortRangeSelfScalingVariance; + + // create the Python object + py::class_ object( + module, "ShortRangeSelfScalingVariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("dependence_on_processed_group_width") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("type") = std::nullopt, + py::arg("gridded2d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set dependenceOnProcessedGroupWidth + object.def_property( + "dependence_on_processed_group_width", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dependenceOnProcessedGroupWidth(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.dependenceOnProcessedGroupWidth() = value; + }, + cppCLASS::component_t::documentation("dependence_on_processed_group_width").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 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 gridded2d + object.def_property( + "gridded2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.gridded2d() = value; + }, + cppCLASS::component_t::documentation("gridded2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/Slice.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/Slice.python.cpp new file mode 100644 index 000000000..aec0a1bcc --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/Slice.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/Slice.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::Slice +void wrapSlice(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::Slice; + + // create the Python object + py::class_ object( + module, "Slice", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const Integer32 & + >(), + py::arg("domain_min") = std::nullopt, + py::arg("domain_max") = std::nullopt, + py::arg("domain_value") = std::nullopt, + py::arg("domain_unit") = std::nullopt, + py::arg("dimension"), + 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 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 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 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 dimension + object.def_property( + "dimension", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dimension(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.dimension() = value; + }, + cppCLASS::component_t::documentation("dimension").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/Slices.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/Slices.python.cpp new file mode 100644 index 000000000..f614a0314 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/Slices.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/Slices.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::Slices +void wrapSlices(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::Slices; + + // create the Python object + py::class_ object( + module, "Slices", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/Sum.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/Sum.python.cpp new file mode 100644 index 000000000..bba0d5f77 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/Sum.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/Sum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::Sum +void wrapSum(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::Sum; + + // create the Python object + py::class_ object( + module, "Sum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Float64 &, + const Float64 &, + const XMLName &, + const std::optional &, + const std::optional> & + >(), + py::arg("domain_min"), + py::arg("domain_max"), + py::arg("domain_unit"), + py::arg("label") = std::nullopt, + py::arg("summand") = 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 Float64 &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 Float64 &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 XMLName &value) + { + self.domainUnit() = value; + }, + cppCLASS::component_t::documentation("domain_unit").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 summand + object.def_property( + "summand", + [](const cppCLASS &self) -> decltype(auto) + { + return self.summand(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.summand() = value; + }, + cppCLASS::component_t::documentation("summand").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/covariance/Summand.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/covariance/Summand.python.cpp new file mode 100644 index 000000000..860893b3b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/covariance/Summand.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/covariance/Summand.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_covariance { + +// wrapper for covariance::Summand +void wrapSummand(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = covariance::Summand; + + // create the Python object + py::class_ object( + module, "Summand", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("endf_mfmt") = std::nullopt, + py::arg("coefficient") = std::nullopt, + py::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_covariance +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/cpTransport.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/cpTransport.python.cpp new file mode 100644 index 000000000..dbfd553b1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/cpTransport.python.cpp @@ -0,0 +1,43 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// cpTransport declarations +namespace python_cpTransport { + void wrapRutherfordScattering(py::module &); + void wrapNuclearTerm(py::module &); + void wrapRealInterferenceTerm(py::module &); + void wrapImaginaryInterferenceTerm(py::module &); + void wrapNuclearAmplitudeExpansion(py::module &); + void wrapCoulombPlusNuclearElastic(py::module &); + void wrapNuclearPlusInterference(py::module &); +} // namespace python_cpTransport + +// wrapper for cpTransport +void wrapCpTransport(py::module &module) +{ + // create the cpTransport submodule + py::module submodule = module.def_submodule( + "cpTransport", + "test v2.0 cpTransport" + ); + + // wrap cpTransport components + python_cpTransport::wrapRutherfordScattering(submodule); + python_cpTransport::wrapNuclearTerm(submodule); + python_cpTransport::wrapRealInterferenceTerm(submodule); + python_cpTransport::wrapImaginaryInterferenceTerm(submodule); + python_cpTransport::wrapNuclearAmplitudeExpansion(submodule); + python_cpTransport::wrapCoulombPlusNuclearElastic(submodule); + python_cpTransport::wrapNuclearPlusInterference(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/cpTransport/CoulombPlusNuclearElastic.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/CoulombPlusNuclearElastic.python.cpp new file mode 100644 index 000000000..ca099a191 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/CoulombPlusNuclearElastic.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// wrapper for cpTransport::CoulombPlusNuclearElastic +void wrapCoulombPlusNuclearElastic(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = cpTransport::CoulombPlusNuclearElastic; + + // create the Python object + py::class_ object( + module, "CoulombPlusNuclearElastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("href") = std::nullopt, + py::arg("identical_particles") = std::nullopt, + py::arg("label"), + py::arg("pid") = std::nullopt, + py::arg("product_frame") = std::nullopt, + py::arg("rutherford_scattering") = std::nullopt, + py::arg("nuclear_amplitude_expansion") = 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 identicalParticles + object.def_property( + "identical_particles", + [](const cppCLASS &self) -> decltype(auto) + { + return self.identicalParticles().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.identicalParticles() = value; + }, + cppCLASS::component_t::documentation("identical_particles").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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::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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/cpTransport/ImaginaryInterferenceTerm.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/ImaginaryInterferenceTerm.python.cpp new file mode 100644 index 000000000..0d9129612 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/ImaginaryInterferenceTerm.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/cpTransport/ImaginaryInterferenceTerm.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// wrapper for cpTransport::ImaginaryInterferenceTerm +void wrapImaginaryInterferenceTerm(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = cpTransport::ImaginaryInterferenceTerm; + + // create the Python object + py::class_ object( + module, "ImaginaryInterferenceTerm", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys2d") = std::nullopt, + py::arg("regions2d") = std::nullopt, + 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::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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/cpTransport/NuclearAmplitudeExpansion.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/NuclearAmplitudeExpansion.python.cpp new file mode 100644 index 000000000..3c0f165c5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/NuclearAmplitudeExpansion.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/cpTransport/NuclearAmplitudeExpansion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// wrapper for cpTransport::NuclearAmplitudeExpansion +void wrapNuclearAmplitudeExpansion(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = cpTransport::NuclearAmplitudeExpansion; + + // create the Python object + py::class_ object( + module, "NuclearAmplitudeExpansion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const cpTransport::NuclearTerm &, + const cpTransport::RealInterferenceTerm &, + const cpTransport::ImaginaryInterferenceTerm & + >(), + py::arg("nuclear_term"), + py::arg("real_interference_term"), + py::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 cpTransport::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 cpTransport::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 cpTransport::ImaginaryInterferenceTerm &value) + { + self.imaginaryInterferenceTerm() = value; + }, + cppCLASS::component_t::documentation("imaginary_interference_term").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/cpTransport/NuclearPlusInterference.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/NuclearPlusInterference.python.cpp new file mode 100644 index 000000000..63fb37347 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/NuclearPlusInterference.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/cpTransport/NuclearPlusInterference.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// wrapper for cpTransport::NuclearPlusInterference +void wrapNuclearPlusInterference(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = cpTransport::NuclearPlusInterference; + + // create the Python object + py::class_ object( + module, "NuclearPlusInterference", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Float64 &, + const transport::CrossSection &, + const transport::Distribution & + >(), + py::arg("mu_cutoff"), + py::arg("cross_section"), + py::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 Float64 &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 transport::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 transport::Distribution &value) + { + self.distribution() = value; + }, + cppCLASS::component_t::documentation("distribution").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/cpTransport/NuclearTerm.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/NuclearTerm.python.cpp new file mode 100644 index 000000000..924b05d50 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/NuclearTerm.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/cpTransport/NuclearTerm.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// wrapper for cpTransport::NuclearTerm +void wrapNuclearTerm(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = cpTransport::NuclearTerm; + + // create the Python object + py::class_ object( + module, "NuclearTerm", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys2d") = std::nullopt, + py::arg("regions2d") = std::nullopt, + 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::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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/cpTransport/RealInterferenceTerm.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/RealInterferenceTerm.python.cpp new file mode 100644 index 000000000..ca2de116b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/RealInterferenceTerm.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/cpTransport/RealInterferenceTerm.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// wrapper for cpTransport::RealInterferenceTerm +void wrapRealInterferenceTerm(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = cpTransport::RealInterferenceTerm; + + // create the Python object + py::class_ object( + module, "RealInterferenceTerm", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys2d") = std::nullopt, + py::arg("regions2d") = std::nullopt, + 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::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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/cpTransport/RutherfordScattering.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/RutherfordScattering.python.cpp new file mode 100644 index 000000000..9880240cf --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/cpTransport/RutherfordScattering.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/cpTransport/RutherfordScattering.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_cpTransport { + +// wrapper for cpTransport::RutherfordScattering +void wrapRutherfordScattering(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = cpTransport::RutherfordScattering; + + // create the Python object + py::class_ object( + module, "RutherfordScattering", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_cpTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation.python.cpp new file mode 100644 index 000000000..111eecfdd --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation.python.cpp @@ -0,0 +1,107 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// documentation declarations +namespace python_documentation { + void wrapAffiliation(py::module &); + void wrapAffiliations(py::module &); + void wrapNote(py::module &); + void wrapAuthor(py::module &); + void wrapAuthors(py::module &); + void wrapContributors(py::module &); + void wrapCollaboration(py::module &); + void wrapCollaborations(py::module &); + void wrapDate(py::module &); + void wrapDates(py::module &); + void wrapCopyright(py::module &); + void wrapAcknowledgement(py::module &); + void wrapAcknowledgements(py::module &); + void wrapKeyword(py::module &); + void wrapKeywords(py::module &); + void wrapRelatedItem(py::module &); + void wrapRelatedItems(py::module &); + void wrapTitle(py::module &); + void wrapAbstract(py::module &); + void wrapBody(py::module &); + void wrapExecutionArguments(py::module &); + void wrapCodeRepo(py::module &); + void wrapInputDeck(py::module &); + void wrapInputDecks(py::module &); + void wrapOutputDeck(py::module &); + void wrapOutputDecks(py::module &); + void wrapComputerCode(py::module &); + void wrapComputerCodes(py::module &); + void wrapCovarianceScript(py::module &); + void wrapCorrectionScript(py::module &); + void wrapExforDataSet(py::module &); + void wrapExforDataSets(py::module &); + void wrapExperimentalDataSets(py::module &); + void wrapBibitem(py::module &); + void wrapBibliography(py::module &); + void wrapEndfCompatible(py::module &); + void wrapDocumentation(py::module &); + void wrapContributor(py::module &); + void wrapVersion(py::module &); +} // namespace python_documentation + +// wrapper for documentation +void wrapDocumentation(py::module &module) +{ + // create the documentation submodule + py::module submodule = module.def_submodule( + "documentation", + "test v2.0 documentation" + ); + + // wrap documentation components + python_documentation::wrapAffiliation(submodule); + python_documentation::wrapAffiliations(submodule); + python_documentation::wrapNote(submodule); + python_documentation::wrapAuthor(submodule); + python_documentation::wrapAuthors(submodule); + python_documentation::wrapContributors(submodule); + python_documentation::wrapCollaboration(submodule); + python_documentation::wrapCollaborations(submodule); + python_documentation::wrapDate(submodule); + python_documentation::wrapDates(submodule); + python_documentation::wrapCopyright(submodule); + python_documentation::wrapAcknowledgement(submodule); + python_documentation::wrapAcknowledgements(submodule); + python_documentation::wrapKeyword(submodule); + python_documentation::wrapKeywords(submodule); + python_documentation::wrapRelatedItem(submodule); + python_documentation::wrapRelatedItems(submodule); + python_documentation::wrapTitle(submodule); + python_documentation::wrapAbstract(submodule); + python_documentation::wrapBody(submodule); + python_documentation::wrapExecutionArguments(submodule); + python_documentation::wrapCodeRepo(submodule); + python_documentation::wrapInputDeck(submodule); + python_documentation::wrapInputDecks(submodule); + python_documentation::wrapOutputDeck(submodule); + python_documentation::wrapOutputDecks(submodule); + python_documentation::wrapComputerCode(submodule); + python_documentation::wrapComputerCodes(submodule); + python_documentation::wrapCovarianceScript(submodule); + python_documentation::wrapCorrectionScript(submodule); + python_documentation::wrapExforDataSet(submodule); + python_documentation::wrapExforDataSets(submodule); + python_documentation::wrapExperimentalDataSets(submodule); + python_documentation::wrapBibitem(submodule); + python_documentation::wrapBibliography(submodule); + python_documentation::wrapEndfCompatible(submodule); + python_documentation::wrapDocumentation(submodule); + python_documentation::wrapContributor(submodule); + python_documentation::wrapVersion(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Abstract.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Abstract.python.cpp new file mode 100644 index 000000000..38c2a6530 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Abstract.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Abstract.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Abstract +void wrapAbstract(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Abstract; + + // create the Python object + py::class_ object( + module, "Abstract", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Acknowledgement.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Acknowledgement.python.cpp new file mode 100644 index 000000000..258b138fc --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Acknowledgement.python.cpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Acknowledgement.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Acknowledgement +void wrapAcknowledgement(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Acknowledgement; + + // create the Python object + py::class_ object( + module, "Acknowledgement", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const XMLName & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("type"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 type + object.def_property( + "type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.type(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.type() = value; + }, + cppCLASS::component_t::documentation("type").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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Acknowledgements.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Acknowledgements.python.cpp new file mode 100644 index 000000000..2eb423810 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Acknowledgements.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Acknowledgements.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Acknowledgements +void wrapAcknowledgements(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Acknowledgements; + + // create the Python object + py::class_ object( + module, "Acknowledgements", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("acknowledgement"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set acknowledgement + object.def_property( + "acknowledgement", + [](const cppCLASS &self) -> decltype(auto) + { + return self.acknowledgement(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.acknowledgement() = value; + }, + cppCLASS::component_t::documentation("acknowledgement").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Affiliation.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Affiliation.python.cpp new file mode 100644 index 000000000..6a374a32b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Affiliation.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Affiliation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Affiliation +void wrapAffiliation(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Affiliation; + + // create the Python object + py::class_ object( + module, "Affiliation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const UTF8Text &, + const std::optional & + >(), + py::arg("name"), + py::arg("href") = 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 UTF8Text &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Affiliations.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Affiliations.python.cpp new file mode 100644 index 000000000..5a6ed1963 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Affiliations.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Affiliations.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Affiliations +void wrapAffiliations(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Affiliations; + + // create the Python object + py::class_ object( + module, "Affiliations", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("affiliation"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set affiliation + object.def_property( + "affiliation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.affiliation(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.affiliation() = value; + }, + cppCLASS::component_t::documentation("affiliation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Author.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Author.python.cpp new file mode 100644 index 000000000..ce5578a24 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Author.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Author.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Author +void wrapAuthor(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Author; + + // create the Python object + py::class_ object( + module, "Author", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const UTF8Text &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("name"), + py::arg("orcid") = std::nullopt, + py::arg("email") = std::nullopt, + py::arg("affiliations") = std::nullopt, + py::arg("note") = 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 UTF8Text &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").data() + ); + + // get/set orcid + object.def_property( + "orcid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.orcid(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.orcid() = value; + }, + cppCLASS::component_t::documentation("orcid").data() + ); + + // get/set email + object.def_property( + "email", + [](const cppCLASS &self) -> decltype(auto) + { + return self.email(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.email() = value; + }, + cppCLASS::component_t::documentation("email").data() + ); + + // get/set affiliations + object.def_property( + "affiliations", + [](const cppCLASS &self) -> decltype(auto) + { + return self.affiliations(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.affiliations() = value; + }, + cppCLASS::component_t::documentation("affiliations").data() + ); + + // get/set note + object.def_property( + "note", + [](const cppCLASS &self) -> decltype(auto) + { + return self.note(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.note() = value; + }, + cppCLASS::component_t::documentation("note").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Authors.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Authors.python.cpp new file mode 100644 index 000000000..cf6cd63a8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Authors.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Authors.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Authors +void wrapAuthors(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Authors; + + // create the Python object + py::class_ object( + module, "Authors", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Bibitem.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Bibitem.python.cpp new file mode 100644 index 000000000..eedceb965 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Bibitem.python.cpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Bibitem.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Bibitem +void wrapBibitem(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Bibitem; + + // create the Python object + py::class_ object( + module, "Bibitem", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const XMLName & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("xref"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 xref + object.def_property( + "xref", + [](const cppCLASS &self) -> decltype(auto) + { + return self.xref(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.xref() = value; + }, + cppCLASS::component_t::documentation("xref").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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Bibliography.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Bibliography.python.cpp new file mode 100644 index 000000000..e274922ae --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Bibliography.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Bibliography.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Bibliography +void wrapBibliography(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Bibliography; + + // create the Python object + py::class_ object( + module, "Bibliography", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("bibitem"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set bibitem + object.def_property( + "bibitem", + [](const cppCLASS &self) -> decltype(auto) + { + return self.bibitem(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.bibitem() = value; + }, + cppCLASS::component_t::documentation("bibitem").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Body.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Body.python.cpp new file mode 100644 index 000000000..e89c38331 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Body.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Body.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Body +void wrapBody(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Body; + + // create the Python object + py::class_ object( + module, "Body", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/CodeRepo.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/CodeRepo.python.cpp new file mode 100644 index 000000000..1dc85a1d5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/CodeRepo.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/CodeRepo.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::CodeRepo +void wrapCodeRepo(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::CodeRepo; + + // create the Python object + py::class_ object( + module, "CodeRepo", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const XMLName &, + const XMLName & + >(), + py::arg("label") = std::nullopt, + py::arg("revision_system"), + py::arg("href"), + py::arg("revision_id"), + 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 revisionSystem + object.def_property( + "revision_system", + [](const cppCLASS &self) -> decltype(auto) + { + return self.revisionSystem(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.revisionSystem() = value; + }, + cppCLASS::component_t::documentation("revision_system").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set revisionID + object.def_property( + "revision_id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.revisionID(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.revisionID() = value; + }, + cppCLASS::component_t::documentation("revision_id").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Collaboration.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Collaboration.python.cpp new file mode 100644 index 000000000..af3d60c73 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Collaboration.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Collaboration.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Collaboration +void wrapCollaboration(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Collaboration; + + // create the Python object + py::class_ object( + module, "Collaboration", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const UTF8Text &, + const std::optional & + >(), + py::arg("name"), + py::arg("href") = 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 UTF8Text &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Collaborations.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Collaborations.python.cpp new file mode 100644 index 000000000..10a256b24 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Collaborations.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Collaborations.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Collaborations +void wrapCollaborations(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Collaborations; + + // create the Python object + py::class_ object( + module, "Collaborations", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("collaboration"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set collaboration + object.def_property( + "collaboration", + [](const cppCLASS &self) -> decltype(auto) + { + return self.collaboration(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.collaboration() = value; + }, + cppCLASS::component_t::documentation("collaboration").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/ComputerCode.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/ComputerCode.python.cpp new file mode 100644 index 000000000..4e3fd3498 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/ComputerCode.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/ComputerCode.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::ComputerCode +void wrapComputerCode(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::ComputerCode; + + // create the Python object + py::class_ object( + module, "ComputerCode", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const UTF8Text &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("name"), + py::arg("version"), + py::arg("execution_arguments") = std::nullopt, + py::arg("code_repo") = std::nullopt, + py::arg("note") = std::nullopt, + py::arg("input_decks") = std::nullopt, + py::arg("output_decks") = 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 name + object.def_property( + "name", + [](const cppCLASS &self) -> decltype(auto) + { + return self.name(); + }, + [](cppCLASS &self, const UTF8Text &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 XMLName &value) + { + self.version() = value; + }, + cppCLASS::component_t::documentation("version").data() + ); + + // get/set executionArguments + object.def_property( + "execution_arguments", + [](const cppCLASS &self) -> decltype(auto) + { + return self.executionArguments(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.executionArguments() = value; + }, + cppCLASS::component_t::documentation("execution_arguments").data() + ); + + // get/set codeRepo + object.def_property( + "code_repo", + [](const cppCLASS &self) -> decltype(auto) + { + return self.codeRepo(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.codeRepo() = value; + }, + cppCLASS::component_t::documentation("code_repo").data() + ); + + // get/set note + object.def_property( + "note", + [](const cppCLASS &self) -> decltype(auto) + { + return self.note(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.note() = value; + }, + cppCLASS::component_t::documentation("note").data() + ); + + // get/set inputDecks + object.def_property( + "input_decks", + [](const cppCLASS &self) -> decltype(auto) + { + return self.inputDecks(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.inputDecks() = value; + }, + cppCLASS::component_t::documentation("input_decks").data() + ); + + // get/set outputDecks + object.def_property( + "output_decks", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outputDecks(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.outputDecks() = value; + }, + cppCLASS::component_t::documentation("output_decks").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/ComputerCodes.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/ComputerCodes.python.cpp new file mode 100644 index 000000000..feabea37c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/ComputerCodes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/ComputerCodes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::ComputerCodes +void wrapComputerCodes(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::ComputerCodes; + + // create the Python object + py::class_ object( + module, "ComputerCodes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("computer_code"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set computerCode + object.def_property( + "computer_code", + [](const cppCLASS &self) -> decltype(auto) + { + return self.computerCode(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.computerCode() = value; + }, + cppCLASS::component_t::documentation("computer_code").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Contributor.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Contributor.python.cpp new file mode 100644 index 000000000..440a1b6a7 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Contributor.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Contributor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Contributor +void wrapContributor(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Contributor; + + // create the Python object + py::class_ object( + module, "Contributor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const UTF8Text &, + const enums::ContributorType &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("name"), + py::arg("contributor_type"), + py::arg("orcid") = std::nullopt, + py::arg("email") = std::nullopt, + py::arg("affiliations") = std::nullopt, + py::arg("note") = 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 UTF8Text &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").data() + ); + + // get/set contributorType + object.def_property( + "contributor_type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.contributorType(); + }, + [](cppCLASS &self, const enums::ContributorType &value) + { + self.contributorType() = value; + }, + cppCLASS::component_t::documentation("contributor_type").data() + ); + + // get/set orcid + object.def_property( + "orcid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.orcid(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.orcid() = value; + }, + cppCLASS::component_t::documentation("orcid").data() + ); + + // get/set email + object.def_property( + "email", + [](const cppCLASS &self) -> decltype(auto) + { + return self.email(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.email() = value; + }, + cppCLASS::component_t::documentation("email").data() + ); + + // get/set affiliations + object.def_property( + "affiliations", + [](const cppCLASS &self) -> decltype(auto) + { + return self.affiliations(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.affiliations() = value; + }, + cppCLASS::component_t::documentation("affiliations").data() + ); + + // get/set note + object.def_property( + "note", + [](const cppCLASS &self) -> decltype(auto) + { + return self.note(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.note() = value; + }, + cppCLASS::component_t::documentation("note").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Contributors.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Contributors.python.cpp new file mode 100644 index 000000000..094b47afc --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Contributors.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Contributors.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Contributors +void wrapContributors(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Contributors; + + // create the Python object + py::class_ object( + module, "Contributors", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Copyright.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Copyright.python.cpp new file mode 100644 index 000000000..5e7c8fbc4 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Copyright.python.cpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Copyright.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Copyright +void wrapCopyright(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Copyright; + + // create the Python object + py::class_ object( + module, "Copyright", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("href") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/CorrectionScript.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/CorrectionScript.python.cpp new file mode 100644 index 000000000..ee196ce99 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/CorrectionScript.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/CorrectionScript.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::CorrectionScript +void wrapCorrectionScript(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::CorrectionScript; + + // create the Python object + py::class_ object( + module, "CorrectionScript", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/CovarianceScript.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/CovarianceScript.python.cpp new file mode 100644 index 000000000..9e5ab1249 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/CovarianceScript.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/CovarianceScript.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::CovarianceScript +void wrapCovarianceScript(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::CovarianceScript; + + // create the Python object + py::class_ object( + module, "CovarianceScript", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Date.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Date.python.cpp new file mode 100644 index 000000000..079ac110d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Date.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Date.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Date +void wrapDate(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Date; + + // create the Python object + py::class_ object( + module, "Date", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const enums::DateType &, + const std::string & + >(), + py::arg("date_type"), + py::arg("value"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set dateType + object.def_property( + "date_type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dateType(); + }, + [](cppCLASS &self, const enums::DateType &value) + { + self.dateType() = value; + }, + cppCLASS::component_t::documentation("date_type").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Dates.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Dates.python.cpp new file mode 100644 index 000000000..9217685fe --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Dates.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Dates.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Dates +void wrapDates(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Dates; + + // create the Python object + py::class_ object( + module, "Dates", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Documentation.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Documentation.python.cpp new file mode 100644 index 000000000..d8c41b1dd --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Documentation.python.cpp @@ -0,0 +1,348 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Documentation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Documentation +void wrapDocumentation(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Documentation; + + // create the Python object + py::class_ object( + module, "Documentation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const documentation::Authors &, + const std::optional &, + const std::optional &, + const documentation::Dates &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const documentation::Title &, + const std::optional &, + const documentation::Body &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("doi") = std::nullopt, + py::arg("publication_date") = std::nullopt, + py::arg("version") = std::nullopt, + py::arg("authors"), + py::arg("contributors") = std::nullopt, + py::arg("collaborations") = std::nullopt, + py::arg("dates"), + py::arg("copyright") = std::nullopt, + py::arg("acknowledgements") = std::nullopt, + py::arg("keywords") = std::nullopt, + py::arg("related_items") = std::nullopt, + py::arg("title"), + py::arg("abstract") = std::nullopt, + py::arg("body"), + py::arg("computer_codes") = std::nullopt, + py::arg("experimental_data_sets") = std::nullopt, + py::arg("bibliography") = std::nullopt, + py::arg("endf_compatible") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set doi + object.def_property( + "doi", + [](const cppCLASS &self) -> decltype(auto) + { + return self.doi(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.doi() = value; + }, + cppCLASS::component_t::documentation("doi").data() + ); + + // get/set publicationDate + object.def_property( + "publication_date", + [](const cppCLASS &self) -> decltype(auto) + { + return self.publicationDate(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.publicationDate() = value; + }, + cppCLASS::component_t::documentation("publication_date").data() + ); + + // get/set version + object.def_property( + "version", + [](const cppCLASS &self) -> decltype(auto) + { + return self.version(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.version() = value; + }, + cppCLASS::component_t::documentation("version").data() + ); + + // get/set authors + object.def_property( + "authors", + [](const cppCLASS &self) -> decltype(auto) + { + return self.authors(); + }, + [](cppCLASS &self, const documentation::Authors &value) + { + self.authors() = value; + }, + cppCLASS::component_t::documentation("authors").data() + ); + + // get/set contributors + object.def_property( + "contributors", + [](const cppCLASS &self) -> decltype(auto) + { + return self.contributors(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.contributors() = value; + }, + cppCLASS::component_t::documentation("contributors").data() + ); + + // get/set collaborations + object.def_property( + "collaborations", + [](const cppCLASS &self) -> decltype(auto) + { + return self.collaborations(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.collaborations() = value; + }, + cppCLASS::component_t::documentation("collaborations").data() + ); + + // get/set dates + object.def_property( + "dates", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dates(); + }, + [](cppCLASS &self, const documentation::Dates &value) + { + self.dates() = value; + }, + cppCLASS::component_t::documentation("dates").data() + ); + + // get/set copyright + object.def_property( + "copyright", + [](const cppCLASS &self) -> decltype(auto) + { + return self.copyright(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.copyright() = value; + }, + cppCLASS::component_t::documentation("copyright").data() + ); + + // get/set acknowledgements + object.def_property( + "acknowledgements", + [](const cppCLASS &self) -> decltype(auto) + { + return self.acknowledgements(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.acknowledgements() = value; + }, + cppCLASS::component_t::documentation("acknowledgements").data() + ); + + // get/set keywords + object.def_property( + "keywords", + [](const cppCLASS &self) -> decltype(auto) + { + return self.keywords(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.keywords() = value; + }, + cppCLASS::component_t::documentation("keywords").data() + ); + + // get/set relatedItems + object.def_property( + "related_items", + [](const cppCLASS &self) -> decltype(auto) + { + return self.relatedItems(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.relatedItems() = value; + }, + cppCLASS::component_t::documentation("related_items").data() + ); + + // get/set title + object.def_property( + "title", + [](const cppCLASS &self) -> decltype(auto) + { + return self.title(); + }, + [](cppCLASS &self, const documentation::Title &value) + { + self.title() = value; + }, + cppCLASS::component_t::documentation("title").data() + ); + + // get/set abstract + object.def_property( + "abstract", + [](const cppCLASS &self) -> decltype(auto) + { + return self.abstract(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.abstract() = value; + }, + cppCLASS::component_t::documentation("abstract").data() + ); + + // get/set body + object.def_property( + "body", + [](const cppCLASS &self) -> decltype(auto) + { + return self.body(); + }, + [](cppCLASS &self, const documentation::Body &value) + { + self.body() = value; + }, + cppCLASS::component_t::documentation("body").data() + ); + + // get/set computerCodes + object.def_property( + "computer_codes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.computerCodes(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.computerCodes() = value; + }, + cppCLASS::component_t::documentation("computer_codes").data() + ); + + // get/set experimentalDataSets + object.def_property( + "experimental_data_sets", + [](const cppCLASS &self) -> decltype(auto) + { + return self.experimentalDataSets(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.experimentalDataSets() = value; + }, + cppCLASS::component_t::documentation("experimental_data_sets").data() + ); + + // get/set bibliography + object.def_property( + "bibliography", + [](const cppCLASS &self) -> decltype(auto) + { + return self.bibliography(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.bibliography() = value; + }, + cppCLASS::component_t::documentation("bibliography").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/EndfCompatible.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/EndfCompatible.python.cpp new file mode 100644 index 000000000..0bd8d77ec --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/EndfCompatible.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/EndfCompatible.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::EndfCompatible +void wrapEndfCompatible(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::EndfCompatible; + + // create the Python object + py::class_ object( + module, "EndfCompatible", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/ExecutionArguments.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/ExecutionArguments.python.cpp new file mode 100644 index 000000000..4dd4c7a74 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/ExecutionArguments.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/ExecutionArguments.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::ExecutionArguments +void wrapExecutionArguments(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::ExecutionArguments; + + // create the Python object + py::class_ object( + module, "ExecutionArguments", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/ExforDataSet.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/ExforDataSet.python.cpp new file mode 100644 index 000000000..937fce2dd --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/ExforDataSet.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/ExforDataSet.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::ExforDataSet +void wrapExforDataSet(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::ExforDataSet; + + // create the Python object + py::class_ object( + module, "ExforDataSet", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("subentry"), + py::arg("retrieval_date"), + py::arg("covariance_script") = std::nullopt, + py::arg("correction_script") = std::nullopt, + py::arg("note") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set subentry + object.def_property( + "subentry", + [](const cppCLASS &self) -> decltype(auto) + { + return self.subentry(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.subentry() = value; + }, + cppCLASS::component_t::documentation("subentry").data() + ); + + // get/set retrievalDate + object.def_property( + "retrieval_date", + [](const cppCLASS &self) -> decltype(auto) + { + return self.retrievalDate(); + }, + [](cppCLASS &self, const std::string &value) + { + self.retrievalDate() = value; + }, + cppCLASS::component_t::documentation("retrieval_date").data() + ); + + // get/set covarianceScript + object.def_property( + "covariance_script", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covarianceScript(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.covarianceScript() = value; + }, + cppCLASS::component_t::documentation("covariance_script").data() + ); + + // get/set correctionScript + object.def_property( + "correction_script", + [](const cppCLASS &self) -> decltype(auto) + { + return self.correctionScript(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.correctionScript() = value; + }, + cppCLASS::component_t::documentation("correction_script").data() + ); + + // get/set note + object.def_property( + "note", + [](const cppCLASS &self) -> decltype(auto) + { + return self.note(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.note() = value; + }, + cppCLASS::component_t::documentation("note").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/ExforDataSets.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/ExforDataSets.python.cpp new file mode 100644 index 000000000..a34e67e4f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/ExforDataSets.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/ExforDataSets.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::ExforDataSets +void wrapExforDataSets(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::ExforDataSets; + + // create the Python object + py::class_ object( + module, "ExforDataSets", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("exfor_data_set"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set exforDataSet + object.def_property( + "exfor_data_set", + [](const cppCLASS &self) -> decltype(auto) + { + return self.exforDataSet(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.exforDataSet() = value; + }, + cppCLASS::component_t::documentation("exfor_data_set").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/ExperimentalDataSets.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/ExperimentalDataSets.python.cpp new file mode 100644 index 000000000..24bc7a331 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/ExperimentalDataSets.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/ExperimentalDataSets.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::ExperimentalDataSets +void wrapExperimentalDataSets(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::ExperimentalDataSets; + + // create the Python object + py::class_ object( + module, "ExperimentalDataSets", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const documentation::ExforDataSets & + >(), + py::arg("exfor_data_sets"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set exforDataSets + object.def_property( + "exfor_data_sets", + [](const cppCLASS &self) -> decltype(auto) + { + return self.exforDataSets(); + }, + [](cppCLASS &self, const documentation::ExforDataSets &value) + { + self.exforDataSets() = value; + }, + cppCLASS::component_t::documentation("exfor_data_sets").data() + ); + + // shortcut: get/set exforDataSet + object.def_property( + "exfor_data_set", + [](const cppCLASS &self) -> decltype(auto) + { + return self.exforDataSet(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.exforDataSet() = value; + }, + cppCLASS::component_t::documentation("exfor_data_set").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/InputDeck.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/InputDeck.python.cpp new file mode 100644 index 000000000..17145267e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/InputDeck.python.cpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/InputDeck.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::InputDeck +void wrapInputDeck(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::InputDeck; + + // create the Python object + py::class_ object( + module, "InputDeck", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("filename") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 filename + object.def_property( + "filename", + [](const cppCLASS &self) -> decltype(auto) + { + return self.filename(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.filename() = value; + }, + cppCLASS::component_t::documentation("filename").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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/InputDecks.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/InputDecks.python.cpp new file mode 100644 index 000000000..60df0189e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/InputDecks.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/InputDecks.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::InputDecks +void wrapInputDecks(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::InputDecks; + + // create the Python object + py::class_ object( + module, "InputDecks", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("input_deck"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set inputDeck + object.def_property( + "input_deck", + [](const cppCLASS &self) -> decltype(auto) + { + return self.inputDeck(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.inputDeck() = value; + }, + cppCLASS::component_t::documentation("input_deck").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Keyword.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Keyword.python.cpp new file mode 100644 index 000000000..baf10421b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Keyword.python.cpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Keyword.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Keyword +void wrapKeyword(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Keyword; + + // create the Python object + py::class_ object( + module, "Keyword", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const XMLName & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("type"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 type + object.def_property( + "type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.type(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.type() = value; + }, + cppCLASS::component_t::documentation("type").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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Keywords.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Keywords.python.cpp new file mode 100644 index 000000000..5e8ed70ae --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Keywords.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Keywords.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Keywords +void wrapKeywords(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Keywords; + + // create the Python object + py::class_ object( + module, "Keywords", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("keyword"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set keyword + object.def_property( + "keyword", + [](const cppCLASS &self) -> decltype(auto) + { + return self.keyword(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.keyword() = value; + }, + cppCLASS::component_t::documentation("keyword").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Note.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Note.python.cpp new file mode 100644 index 000000000..170da752e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Note.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Note.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Note +void wrapNote(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Note; + + // create the Python object + py::class_ object( + module, "Note", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/OutputDeck.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/OutputDeck.python.cpp new file mode 100644 index 000000000..c2bbb0b31 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/OutputDeck.python.cpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/OutputDeck.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::OutputDeck +void wrapOutputDeck(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::OutputDeck; + + // create the Python object + py::class_ object( + module, "OutputDeck", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("filename") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 filename + object.def_property( + "filename", + [](const cppCLASS &self) -> decltype(auto) + { + return self.filename(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.filename() = value; + }, + cppCLASS::component_t::documentation("filename").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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/OutputDecks.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/OutputDecks.python.cpp new file mode 100644 index 000000000..b8b738df1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/OutputDecks.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/OutputDecks.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::OutputDecks +void wrapOutputDecks(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::OutputDecks; + + // create the Python object + py::class_ object( + module, "OutputDecks", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("output_deck"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set outputDeck + object.def_property( + "output_deck", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outputDeck(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.outputDeck() = value; + }, + cppCLASS::component_t::documentation("output_deck").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/RelatedItem.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/RelatedItem.python.cpp new file mode 100644 index 000000000..c4e0b7003 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/RelatedItem.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/RelatedItem.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::RelatedItem +void wrapRelatedItem(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::RelatedItem; + + // create the Python object + py::class_ object( + module, "RelatedItem", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const UTF8Text &, + const std::optional &, + const std::optional & + >(), + py::arg("name"), + py::arg("href") = std::nullopt, + py::arg("relation_type") = 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 UTF8Text &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").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 relationType + object.def_property( + "relation_type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.relationType(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.relationType() = value; + }, + cppCLASS::component_t::documentation("relation_type").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/RelatedItems.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/RelatedItems.python.cpp new file mode 100644 index 000000000..5a2058861 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/RelatedItems.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/RelatedItems.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::RelatedItems +void wrapRelatedItems(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::RelatedItems; + + // create the Python object + py::class_ object( + module, "RelatedItems", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("related_item"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set relatedItem + object.def_property( + "related_item", + [](const cppCLASS &self) -> decltype(auto) + { + return self.relatedItem(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.relatedItem() = value; + }, + cppCLASS::component_t::documentation("related_item").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Title.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Title.python.cpp new file mode 100644 index 000000000..69444e23f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Title.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Title.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Title +void wrapTitle(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Title; + + // create the Python object + py::class_ object( + module, "Title", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/documentation/Version.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/documentation/Version.python.cpp new file mode 100644 index 000000000..278f66a85 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/documentation/Version.python.cpp @@ -0,0 +1,163 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/documentation/Version.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_documentation { + +// wrapper for documentation::Version +void wrapVersion(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = documentation::Version; + + // create the Python object + py::class_ object( + module, "Version", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("encoding") = std::nullopt, + py::arg("markup") = std::nullopt, + py::arg("label") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set encoding + object.def_property( + "encoding", + [](const cppCLASS &self) -> decltype(auto) + { + return self.encoding().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.encoding() = value; + }, + cppCLASS::component_t::documentation("encoding").data() + ); + + // get/set markup + object.def_property( + "markup", + [](const cppCLASS &self) -> decltype(auto) + { + return self.markup().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.markup() = value; + }, + cppCLASS::component_t::documentation("markup").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 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_documentation +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/extra.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/extra.python.cpp new file mode 100644 index 000000000..d2b0b50dc --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/extra.python.cpp @@ -0,0 +1,33 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// extra declarations +namespace python_extra { + void wrapDouble(py::module &); + void wrapUncertainty(py::module &); +} // namespace python_extra + +// wrapper for extra +void wrapExtra(py::module &module) +{ + // create the extra submodule + py::module submodule = module.def_submodule( + "extra", + "test v2.0 extra" + ); + + // wrap extra components + python_extra::wrapDouble(submodule); + python_extra::wrapUncertainty(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/extra/Double.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/extra/Double.python.cpp new file mode 100644 index 000000000..a2c835f55 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/extra/Double.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/extra/Double.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_extra { + +// wrapper for extra::Double +void wrapDouble(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = extra::Double; + + // create the Python object + py::class_ object( + module, "Double", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const Float64 & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value"), + 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 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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_extra +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/extra/Uncertainty.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/extra/Uncertainty.python.cpp new file mode 100644 index 000000000..4e2374c07 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/extra/Uncertainty.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/extra/Uncertainty.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_extra { + +// wrapper for extra::Uncertainty +void wrapUncertainty(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = extra::Uncertainty; + + // create the Python object + py::class_ object( + module, "Uncertainty", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("standard") = std::nullopt, + py::arg("log_normal") = std::nullopt, + py::arg("confidence_intervals") = std::nullopt, + py::arg("covariance") = std::nullopt, + py::arg("list_of_covariances") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 logNormal + object.def_property( + "log_normal", + [](const cppCLASS &self) -> decltype(auto) + { + return self.logNormal(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.logNormal() = value; + }, + cppCLASS::component_t::documentation("log_normal").data() + ); + + // get/set confidenceIntervals + object.def_property( + "confidence_intervals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.confidenceIntervals(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.confidenceIntervals() = value; + }, + cppCLASS::component_t::documentation("confidence_intervals").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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_extra +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData.python.cpp new file mode 100644 index 000000000..0c784a00c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// fissionFragmentData declarations +namespace python_fissionFragmentData { + void wrapRate(py::module &); + void wrapDelayedNeutron(py::module &); + void wrapDelayedNeutrons(py::module &); + void wrapFissionFragmentData(py::module &); +} // namespace python_fissionFragmentData + +// wrapper for fissionFragmentData +void wrapFissionFragmentData(py::module &module) +{ + // create the fissionFragmentData submodule + py::module submodule = module.def_submodule( + "fissionFragmentData", + "test v2.0 fissionFragmentData" + ); + + // wrap fissionFragmentData components + python_fissionFragmentData::wrapRate(submodule); + python_fissionFragmentData::wrapDelayedNeutron(submodule); + python_fissionFragmentData::wrapDelayedNeutrons(submodule); + python_fissionFragmentData::wrapFissionFragmentData(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/DelayedNeutron.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/DelayedNeutron.python.cpp new file mode 100644 index 000000000..01420e93f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/DelayedNeutron.python.cpp @@ -0,0 +1,150 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionFragmentData/DelayedNeutron.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionFragmentData { + +// wrapper for fissionFragmentData::DelayedNeutron +void wrapDelayedNeutron(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionFragmentData::DelayedNeutron; + + // create the Python object + py::class_ object( + module, "DelayedNeutron", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const fissionFragmentData::Rate &, + const common::Product & + >(), + py::arg("label"), + py::arg("rate"), + py::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 XMLName &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 fissionFragmentData::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 common::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 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 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_fissionFragmentData +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/DelayedNeutrons.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/DelayedNeutrons.python.cpp new file mode 100644 index 000000000..15af54f7e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/DelayedNeutrons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionFragmentData/DelayedNeutrons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionFragmentData { + +// wrapper for fissionFragmentData::DelayedNeutrons +void wrapDelayedNeutrons(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionFragmentData::DelayedNeutrons; + + // create the Python object + py::class_ object( + module, "DelayedNeutrons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_fissionFragmentData +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/FissionFragmentData.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/FissionFragmentData.python.cpp new file mode 100644 index 000000000..9defb68c6 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/FissionFragmentData.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionFragmentData/FissionFragmentData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionFragmentData { + +// wrapper for fissionFragmentData::FissionFragmentData +void wrapFissionFragmentData(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionFragmentData::FissionFragmentData; + + // create the Python object + py::class_ object( + module, "FissionFragmentData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("delayed_neutrons") = std::nullopt, + py::arg("fission_energy_released") = std::nullopt, + py::arg("product_yields") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 fissionEnergyReleased + object.def_property( + "fission_energy_released", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionEnergyReleased(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.fissionEnergyReleased() = value; + }, + cppCLASS::component_t::documentation("fission_energy_released").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionFragmentData +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/Rate.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/Rate.python.cpp new file mode 100644 index 000000000..02a5cc266 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionFragmentData/Rate.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionFragmentData/Rate.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionFragmentData { + +// wrapper for fissionFragmentData::Rate +void wrapRate(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionFragmentData::Rate; + + // create the Python object + py::class_ object( + module, "Rate", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Double & + >(), + py::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 containers::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_fissionFragmentData +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport.python.cpp new file mode 100644 index 000000000..3ac76fe7e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport.python.cpp @@ -0,0 +1,69 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// fissionTransport declarations +namespace python_fissionTransport { + void wrapSimpleMaxwellianFission(py::module &); + void wrapA(py::module &); + void wrapB(py::module &); + void wrapWatt(py::module &); + void wrapEFH(py::module &); + void wrapEFL(py::module &); + void wrapT_M(py::module &); + void wrapMadlandNix(py::module &); + void wrapDelayedBetaEnergy(py::module &); + void wrapDelayedGammaEnergy(py::module &); + void wrapDelayedNeutronKE(py::module &); + void wrapNeutrinoEnergy(py::module &); + void wrapNonNeutrinoEnergy(py::module &); + void wrapPromptGammaEnergy(py::module &); + void wrapPromptNeutronKE(py::module &); + void wrapPromptProductKE(py::module &); + void wrapTotalEnergy(py::module &); + void wrapFissionEnergyReleased(py::module &); + void wrapFissionComponent(py::module &); + void wrapFissionComponents(py::module &); +} // namespace python_fissionTransport + +// wrapper for fissionTransport +void wrapFissionTransport(py::module &module) +{ + // create the fissionTransport submodule + py::module submodule = module.def_submodule( + "fissionTransport", + "test v2.0 fissionTransport" + ); + + // wrap fissionTransport components + python_fissionTransport::wrapSimpleMaxwellianFission(submodule); + python_fissionTransport::wrapA(submodule); + python_fissionTransport::wrapB(submodule); + python_fissionTransport::wrapWatt(submodule); + python_fissionTransport::wrapEFH(submodule); + python_fissionTransport::wrapEFL(submodule); + python_fissionTransport::wrapT_M(submodule); + python_fissionTransport::wrapMadlandNix(submodule); + python_fissionTransport::wrapDelayedBetaEnergy(submodule); + python_fissionTransport::wrapDelayedGammaEnergy(submodule); + python_fissionTransport::wrapDelayedNeutronKE(submodule); + python_fissionTransport::wrapNeutrinoEnergy(submodule); + python_fissionTransport::wrapNonNeutrinoEnergy(submodule); + python_fissionTransport::wrapPromptGammaEnergy(submodule); + python_fissionTransport::wrapPromptNeutronKE(submodule); + python_fissionTransport::wrapPromptProductKE(submodule); + python_fissionTransport::wrapTotalEnergy(submodule); + python_fissionTransport::wrapFissionEnergyReleased(submodule); + python_fissionTransport::wrapFissionComponent(submodule); + python_fissionTransport::wrapFissionComponents(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/A.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/A.python.cpp new file mode 100644 index 000000000..6c0ae3947 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/A.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/A.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::A +void wrapA(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::A; + + // create the Python object + py::class_ object( + module, "A", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/B.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/B.python.cpp new file mode 100644 index 000000000..cc9daed4e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/B.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/B.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::B +void wrapB(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::B; + + // create the Python object + py::class_ object( + module, "B", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/DelayedBetaEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/DelayedBetaEnergy.python.cpp new file mode 100644 index 000000000..6c8c86a25 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/DelayedBetaEnergy.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/DelayedBetaEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::DelayedBetaEnergy +void wrapDelayedBetaEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::DelayedBetaEnergy; + + // create the Python object + py::class_ object( + module, "DelayedBetaEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("polynomial1d") = 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/DelayedGammaEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/DelayedGammaEnergy.python.cpp new file mode 100644 index 000000000..b39f4eaa9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/DelayedGammaEnergy.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/DelayedGammaEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::DelayedGammaEnergy +void wrapDelayedGammaEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::DelayedGammaEnergy; + + // create the Python object + py::class_ object( + module, "DelayedGammaEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("polynomial1d") = 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/DelayedNeutronKE.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/DelayedNeutronKE.python.cpp new file mode 100644 index 000000000..cc3491a44 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/DelayedNeutronKE.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/DelayedNeutronKE.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::DelayedNeutronKE +void wrapDelayedNeutronKE(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::DelayedNeutronKE; + + // create the Python object + py::class_ object( + module, "DelayedNeutronKE", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::arg("polynomial1d") = 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 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_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/EFH.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/EFH.python.cpp new file mode 100644 index 000000000..fbf4e2ab2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/EFH.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/EFH.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::EFH +void wrapEFH(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::EFH; + + // create the Python object + py::class_ object( + module, "EFH", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Float64 & + >(), + py::arg("unit"), + py::arg("value"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/EFL.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/EFL.python.cpp new file mode 100644 index 000000000..795056153 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/EFL.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/EFL.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::EFL +void wrapEFL(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::EFL; + + // create the Python object + py::class_ object( + module, "EFL", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Float64 & + >(), + py::arg("unit"), + py::arg("value"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/FissionComponent.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/FissionComponent.python.cpp new file mode 100644 index 000000000..a7eadb2af --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/FissionComponent.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/FissionComponent.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::FissionComponent +void wrapFissionComponent(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::FissionComponent; + + // create the Python object + py::class_ object( + module, "FissionComponent", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + py::arg("endf_mt") = std::nullopt, + py::arg("fission_genre"), + py::arg("label"), + py::arg("cross_section") = std::nullopt, + py::arg("output_channel") = std::nullopt, + 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 std::optional &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 XMLName &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 XMLName &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 std::optional &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 std::optional &value) + { + self.outputChannel() = value; + }, + cppCLASS::component_t::documentation("output_channel").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/FissionComponents.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/FissionComponents.python.cpp new file mode 100644 index 000000000..fac18bde4 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/FissionComponents.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/FissionComponents.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::FissionComponents +void wrapFissionComponents(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::FissionComponents; + + // create the Python object + py::class_ object( + module, "FissionComponents", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::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_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/FissionEnergyReleased.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/FissionEnergyReleased.python.cpp new file mode 100644 index 000000000..7dc073b83 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/FissionEnergyReleased.python.cpp @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/FissionEnergyReleased.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::FissionEnergyReleased +void wrapFissionEnergyReleased(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::FissionEnergyReleased; + + // create the Python object + py::class_ object( + module, "FissionEnergyReleased", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("label") = std::nullopt, + py::arg("delayed_beta_energy") = std::nullopt, + py::arg("delayed_gamma_energy") = std::nullopt, + py::arg("delayed_neutron_ke") = std::nullopt, + py::arg("neutrino_energy") = std::nullopt, + py::arg("non_neutrino_energy") = std::nullopt, + py::arg("prompt_gamma_energy") = std::nullopt, + py::arg("prompt_neutron_ke") = std::nullopt, + py::arg("prompt_product_ke") = std::nullopt, + py::arg("total_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::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set delayedBetaEnergy + object.def_property( + "delayed_beta_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.delayedBetaEnergy(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.delayedBetaEnergy() = value; + }, + cppCLASS::component_t::documentation("delayed_beta_energy").data() + ); + + // get/set delayedGammaEnergy + object.def_property( + "delayed_gamma_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.delayedGammaEnergy(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.delayedGammaEnergy() = value; + }, + cppCLASS::component_t::documentation("delayed_gamma_energy").data() + ); + + // get/set delayedNeutronKE + object.def_property( + "delayed_neutron_ke", + [](const cppCLASS &self) -> decltype(auto) + { + return self.delayedNeutronKE(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.delayedNeutronKE() = value; + }, + cppCLASS::component_t::documentation("delayed_neutron_ke").data() + ); + + // get/set neutrinoEnergy + object.def_property( + "neutrino_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.neutrinoEnergy(); + }, + [](cppCLASS &self, const std::optional &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 std::optional &value) + { + self.nonNeutrinoEnergy() = value; + }, + cppCLASS::component_t::documentation("non_neutrino_energy").data() + ); + + // get/set promptGammaEnergy + object.def_property( + "prompt_gamma_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.promptGammaEnergy(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.promptGammaEnergy() = value; + }, + cppCLASS::component_t::documentation("prompt_gamma_energy").data() + ); + + // get/set promptNeutronKE + object.def_property( + "prompt_neutron_ke", + [](const cppCLASS &self) -> decltype(auto) + { + return self.promptNeutronKE(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.promptNeutronKE() = value; + }, + cppCLASS::component_t::documentation("prompt_neutron_ke").data() + ); + + // get/set promptProductKE + object.def_property( + "prompt_product_ke", + [](const cppCLASS &self) -> decltype(auto) + { + return self.promptProductKE(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.promptProductKE() = value; + }, + cppCLASS::component_t::documentation("prompt_product_ke").data() + ); + + // get/set totalEnergy + object.def_property( + "total_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.totalEnergy(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.totalEnergy() = value; + }, + cppCLASS::component_t::documentation("total_energy").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/MadlandNix.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/MadlandNix.python.cpp new file mode 100644 index 000000000..b6419eb70 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/MadlandNix.python.cpp @@ -0,0 +1,150 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/MadlandNix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::MadlandNix +void wrapMadlandNix(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::MadlandNix; + + // create the Python object + py::class_ object( + module, "MadlandNix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const fissionTransport::EFH &, + const fissionTransport::EFL &, + const fissionTransport::T_M & + >(), + py::arg("efh"), + py::arg("efl"), + py::arg("t_m"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set EFH + object.def_property( + "efh", + [](const cppCLASS &self) -> decltype(auto) + { + return self.EFH(); + }, + [](cppCLASS &self, const fissionTransport::EFH &value) + { + self.EFH() = value; + }, + cppCLASS::component_t::documentation("efh").data() + ); + + // get/set EFL + object.def_property( + "efl", + [](const cppCLASS &self) -> decltype(auto) + { + return self.EFL(); + }, + [](cppCLASS &self, const fissionTransport::EFL &value) + { + self.EFL() = value; + }, + cppCLASS::component_t::documentation("efl").data() + ); + + // get/set T_M + object.def_property( + "t_m", + [](const cppCLASS &self) -> decltype(auto) + { + return self.T_M(); + }, + [](cppCLASS &self, const fissionTransport::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_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/NeutrinoEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/NeutrinoEnergy.python.cpp new file mode 100644 index 000000000..c9c11e2a1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/NeutrinoEnergy.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/NeutrinoEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::NeutrinoEnergy +void wrapNeutrinoEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::NeutrinoEnergy; + + // create the Python object + py::class_ object( + module, "NeutrinoEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("polynomial1d") = 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/NonNeutrinoEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/NonNeutrinoEnergy.python.cpp new file mode 100644 index 000000000..aaf160938 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/NonNeutrinoEnergy.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/NonNeutrinoEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::NonNeutrinoEnergy +void wrapNonNeutrinoEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::NonNeutrinoEnergy; + + // create the Python object + py::class_ object( + module, "NonNeutrinoEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("polynomial1d") = 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/PromptGammaEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/PromptGammaEnergy.python.cpp new file mode 100644 index 000000000..b3909093e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/PromptGammaEnergy.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/PromptGammaEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::PromptGammaEnergy +void wrapPromptGammaEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::PromptGammaEnergy; + + // create the Python object + py::class_ object( + module, "PromptGammaEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::arg("polynomial1d") = 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 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_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/PromptNeutronKE.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/PromptNeutronKE.python.cpp new file mode 100644 index 000000000..89eb80b26 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/PromptNeutronKE.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/PromptNeutronKE.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::PromptNeutronKE +void wrapPromptNeutronKE(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::PromptNeutronKE; + + // create the Python object + py::class_ object( + module, "PromptNeutronKE", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::arg("polynomial1d") = 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 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_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/PromptProductKE.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/PromptProductKE.python.cpp new file mode 100644 index 000000000..6d92a83bc --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/PromptProductKE.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/PromptProductKE.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::PromptProductKE +void wrapPromptProductKE(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::PromptProductKE; + + // create the Python object + py::class_ object( + module, "PromptProductKE", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::arg("polynomial1d") = 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 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_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/SimpleMaxwellianFission.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/SimpleMaxwellianFission.python.cpp new file mode 100644 index 000000000..ec86596fd --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/SimpleMaxwellianFission.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/SimpleMaxwellianFission.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::SimpleMaxwellianFission +void wrapSimpleMaxwellianFission(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::SimpleMaxwellianFission; + + // create the Python object + py::class_ object( + module, "SimpleMaxwellianFission", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("u") = std::nullopt, + py::arg("theta") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set U + object.def_property( + "u", + [](const cppCLASS &self) -> decltype(auto) + { + return self.U(); + }, + [](cppCLASS &self, const std::optional &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 std::optional &value) + { + self.theta() = value; + }, + cppCLASS::component_t::documentation("theta").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/T_M.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/T_M.python.cpp new file mode 100644 index 000000000..5a29de7c0 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/T_M.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/T_M.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::T_M +void wrapT_M(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::T_M; + + // create the Python object + py::class_ object( + module, "T_M", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::XYs1d & + >(), + py::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 containers::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_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/TotalEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/TotalEnergy.python.cpp new file mode 100644 index 000000000..29c7195f4 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/TotalEnergy.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/TotalEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::TotalEnergy +void wrapTotalEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::TotalEnergy; + + // create the Python object + py::class_ object( + module, "TotalEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("polynomial1d") = 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/Watt.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/Watt.python.cpp new file mode 100644 index 000000000..622f86f09 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fissionTransport/Watt.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fissionTransport/Watt.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fissionTransport { + +// wrapper for fissionTransport::Watt +void wrapWatt(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fissionTransport::Watt; + + // create the Python object + py::class_ object( + module, "Watt", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const transport::U &, + const fissionTransport::A &, + const fissionTransport::B & + >(), + py::arg("u"), + py::arg("a"), + py::arg("b"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set U + object.def_property( + "u", + [](const cppCLASS &self) -> decltype(auto) + { + return self.U(); + }, + [](cppCLASS &self, const transport::U &value) + { + self.U() = value; + }, + cppCLASS::component_t::documentation("u").data() + ); + + // get/set a + object.def_property( + "a", + [](const cppCLASS &self) -> decltype(auto) + { + return self.a(); + }, + [](cppCLASS &self, const fissionTransport::A &value) + { + self.a() = value; + }, + cppCLASS::component_t::documentation("a").data() + ); + + // get/set b + object.def_property( + "b", + [](const cppCLASS &self) -> decltype(auto) + { + return self.b(); + }, + [](cppCLASS &self, const fissionTransport::B &value) + { + self.b() = value; + }, + cppCLASS::component_t::documentation("b").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fissionTransport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy.python.cpp new file mode 100644 index 000000000..1211d5113 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// fpy declarations +namespace python_fpy { + void wrapNuclides(py::module &); + void wrapTime(py::module &); + void wrapYields(py::module &); + void wrapEnergy(py::module &); + void wrapIncidentEnergy(py::module &); + void wrapIncidentEnergies(py::module &); + void wrapElapsedTime(py::module &); + void wrapElapsedTimes(py::module &); + void wrapProductYield(py::module &); + void wrapProductYields(py::module &); +} // namespace python_fpy + +// wrapper for fpy +void wrapFpy(py::module &module) +{ + // create the fpy submodule + py::module submodule = module.def_submodule( + "fpy", + "test v2.0 fpy" + ); + + // wrap fpy components + python_fpy::wrapNuclides(submodule); + python_fpy::wrapTime(submodule); + python_fpy::wrapYields(submodule); + python_fpy::wrapEnergy(submodule); + python_fpy::wrapIncidentEnergy(submodule); + python_fpy::wrapIncidentEnergies(submodule); + python_fpy::wrapElapsedTime(submodule); + python_fpy::wrapElapsedTimes(submodule); + python_fpy::wrapProductYield(submodule); + python_fpy::wrapProductYields(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/ElapsedTime.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/ElapsedTime.python.cpp new file mode 100644 index 000000000..e1a0e3b8c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/ElapsedTime.python.cpp @@ -0,0 +1,123 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/ElapsedTime.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::ElapsedTime +void wrapElapsedTime(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::ElapsedTime; + using _t = std::variant< + fpy::Yields, + fpy::IncidentEnergies + >; + + // create the Python object + py::class_ object( + module, "ElapsedTime", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const fpy::Time &, + const _t & + >(), + py::arg("label") = std::nullopt, + py::arg("time"), + py::arg("_yieldsincident_energies"), + 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 time + object.def_property( + "time", + [](const cppCLASS &self) -> decltype(auto) + { + return self.time(); + }, + [](cppCLASS &self, const fpy::Time &value) + { + self.time() = value; + }, + cppCLASS::component_t::documentation("time").data() + ); + + object.def_property( + "yields", + [](const cppCLASS &self) -> decltype(auto) + { + return self.yields(); + }, + [](cppCLASS &self, const fpy::Yields &value) + { + self.yields() = value; + }, + cppCLASS::component_t::documentation("yields").data() + ); + + object.def_property( + "incident_energies", + [](const cppCLASS &self) -> decltype(auto) + { + return self.incidentEnergies(); + }, + [](cppCLASS &self, const fpy::IncidentEnergies &value) + { + self.incidentEnergies() = value; + }, + cppCLASS::component_t::documentation("incident_energies").data() + ); + + object.def_property( + "_yieldsincident_energies", + [](const cppCLASS &self) -> decltype(auto) + { + return self._yieldsincidentEnergies(); + }, + [](cppCLASS &self, const _t &value) + { + self._yieldsincidentEnergies() = value; + }, + cppCLASS::component_t::documentation("_yieldsincident_energies").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/ElapsedTimes.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/ElapsedTimes.python.cpp new file mode 100644 index 000000000..1c119bdba --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/ElapsedTimes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/ElapsedTimes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::ElapsedTimes +void wrapElapsedTimes(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::ElapsedTimes; + + // create the Python object + py::class_ object( + module, "ElapsedTimes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/Energy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/Energy.python.cpp new file mode 100644 index 000000000..1c7b76b3d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/Energy.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/Energy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::Energy +void wrapEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::Energy; + + // create the Python object + py::class_ object( + module, "Energy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Double & + >(), + py::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 containers::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_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/IncidentEnergies.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/IncidentEnergies.python.cpp new file mode 100644 index 000000000..aed8c1e89 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/IncidentEnergies.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/IncidentEnergies.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::IncidentEnergies +void wrapIncidentEnergies(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::IncidentEnergies; + + // create the Python object + py::class_ object( + module, "IncidentEnergies", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/IncidentEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/IncidentEnergy.python.cpp new file mode 100644 index 000000000..42b98659f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/IncidentEnergy.python.cpp @@ -0,0 +1,136 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/IncidentEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::IncidentEnergy +void wrapIncidentEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::IncidentEnergy; + + // create the Python object + py::class_ object( + module, "IncidentEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const fpy::Energy &, + const fpy::Yields & + >(), + py::arg("label"), + py::arg("energy"), + py::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 XMLName &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 fpy::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 fpy::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 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 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_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/Nuclides.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/Nuclides.python.cpp new file mode 100644 index 000000000..69cd23655 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/Nuclides.python.cpp @@ -0,0 +1,131 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/Nuclides.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::Nuclides +void wrapNuclides(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::Nuclides; + + // create the Python object + py::class_ object( + module, "Nuclides", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("href") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::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( + "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_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/ProductYield.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/ProductYield.python.cpp new file mode 100644 index 000000000..f6d8668e6 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/ProductYield.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/ProductYield.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::ProductYield +void wrapProductYield(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::ProductYield; + + // create the Python object + py::class_ object( + module, "ProductYield", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::optional &, + const fpy::ElapsedTimes & + >(), + py::arg("label"), + py::arg("nuclides") = std::nullopt, + py::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 XMLName &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 fpy::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_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/ProductYields.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/ProductYields.python.cpp new file mode 100644 index 000000000..802518ec2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/ProductYields.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/ProductYields.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::ProductYields +void wrapProductYields(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::ProductYields; + + // create the Python object + py::class_ object( + module, "ProductYields", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/Time.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/Time.python.cpp new file mode 100644 index 000000000..c3afa8b3a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/Time.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/Time.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::Time +void wrapTime(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::Time; + using _t = std::variant< + containers::Double, + containers::String + >; + + // create the Python object + py::class_ object( + module, "Time", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_doublestring"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const containers::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + object.def_property( + "string", + [](const cppCLASS &self) -> decltype(auto) + { + return self.string(); + }, + [](cppCLASS &self, const containers::String &value) + { + self.string() = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + object.def_property( + "_doublestring", + [](const cppCLASS &self) -> decltype(auto) + { + return self._Doublestring(); + }, + [](cppCLASS &self, const _t &value) + { + self._Doublestring() = value; + }, + cppCLASS::component_t::documentation("_doublestring").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/fpy/Yields.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/fpy/Yields.python.cpp new file mode 100644 index 000000000..6523ef23d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/fpy/Yields.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/fpy/Yields.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_fpy { + +// wrapper for fpy::Yields +void wrapYields(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = fpy::Yields; + + // create the Python object + py::class_ object( + module, "Yields", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const fpy::Nuclides &, + const containers::Values &, + const std::optional & + >(), + py::arg("nuclides"), + py::arg("values"), + py::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set nuclides + object.def_property( + "nuclides", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclides(); + }, + [](cppCLASS &self, const fpy::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 containers::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_fpy +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/map.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/map.python.cpp new file mode 100644 index 000000000..0c623e73a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/map.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// map declarations +namespace python_map { + void wrapImport(py::module &); + void wrapProtare(py::module &); + void wrapTNSL(py::module &); + void wrapMap(py::module &); +} // namespace python_map + +// wrapper for map +void wrapMap(py::module &module) +{ + // create the map submodule + py::module submodule = module.def_submodule( + "map", + "test v2.0 map" + ); + + // wrap map components + python_map::wrapImport(submodule); + python_map::wrapProtare(submodule); + python_map::wrapTNSL(submodule); + python_map::wrapMap(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/map/Import.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/map/Import.python.cpp new file mode 100644 index 000000000..cf209962e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/map/Import.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/map/Import.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_map { + +// wrapper for map::Import +void wrapImport(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = map::Import; + + // create the Python object + py::class_ object( + module, "Import", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::string &, + const std::optional & + >(), + py::arg("path"), + py::arg("checksum"), + py::arg("algorithm") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set path + object.def_property( + "path", + [](const cppCLASS &self) -> decltype(auto) + { + return self.path(); + }, + [](cppCLASS &self, const XMLName &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::string &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_map +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/map/Map.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/map/Map.python.cpp new file mode 100644 index 000000000..3aeb6da2c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/map/Map.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/map/Map.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_map { + +// wrapper for map::Map +void wrapMap(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = map::Map; + + // create the Python object + py::class_ object( + module, "Map", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const std::string &, + const enums::HashAlgorithm &, + const std::optional> &, + const std::optional> &, + const std::optional> & + >(), + py::arg("library"), + py::arg("format"), + py::arg("checksum"), + py::arg("algorithm"), + py::arg("import") = std::nullopt, + py::arg("protare") = std::nullopt, + py::arg("tnsl") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set library + object.def_property( + "library", + [](const cppCLASS &self) -> decltype(auto) + { + return self.library(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.library() = value; + }, + cppCLASS::component_t::documentation("library").data() + ); + + // get/set format + object.def_property( + "format", + [](const cppCLASS &self) -> decltype(auto) + { + return self.format(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.format() = value; + }, + cppCLASS::component_t::documentation("format").data() + ); + + // get/set checksum + object.def_property( + "checksum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.checksum(); + }, + [](cppCLASS &self, const std::string &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 enums::HashAlgorithm &value) + { + self.algorithm() = value; + }, + cppCLASS::component_t::documentation("algorithm").data() + ); + + // get/set import + object.def_property( + "import", + [](const cppCLASS &self) -> decltype(auto) + { + return self.import(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.import() = value; + }, + cppCLASS::component_t::documentation("import").data() + ); + + // get/set protare + object.def_property( + "protare", + [](const cppCLASS &self) -> decltype(auto) + { + return self.protare(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.protare() = value; + }, + cppCLASS::component_t::documentation("protare").data() + ); + + // get/set TNSL + object.def_property( + "tnsl", + [](const cppCLASS &self) -> decltype(auto) + { + return self.TNSL(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.TNSL() = value; + }, + cppCLASS::component_t::documentation("tnsl").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_map +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/map/Protare.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/map/Protare.python.cpp new file mode 100644 index 000000000..9cc2a95e8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/map/Protare.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/map/Protare.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_map { + +// wrapper for map::Protare +void wrapProtare(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = map::Protare; + + // create the Python object + py::class_ object( + module, "Protare", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const XMLName &, + const XMLName &, + const XMLName &, + const std::string &, + const std::optional & + >(), + py::arg("projectile"), + py::arg("target"), + py::arg("evaluation"), + py::arg("path"), + py::arg("interaction"), + py::arg("checksum"), + py::arg("algorithm") = 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 XMLName &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 XMLName &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 XMLName &value) + { + self.evaluation() = value; + }, + cppCLASS::component_t::documentation("evaluation").data() + ); + + // get/set path + object.def_property( + "path", + [](const cppCLASS &self) -> decltype(auto) + { + return self.path(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.path() = value; + }, + cppCLASS::component_t::documentation("path").data() + ); + + // get/set interaction + object.def_property( + "interaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interaction(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.interaction() = value; + }, + cppCLASS::component_t::documentation("interaction").data() + ); + + // get/set checksum + object.def_property( + "checksum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.checksum(); + }, + [](cppCLASS &self, const std::string &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_map +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/map/TNSL.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/map/TNSL.python.cpp new file mode 100644 index 000000000..cc7122e32 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/map/TNSL.python.cpp @@ -0,0 +1,190 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/map/TNSL.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_map { + +// wrapper for map::TNSL +void wrapTNSL(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = map::TNSL; + + // create the Python object + py::class_ object( + module, "TNSL", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const XMLName &, + const XMLName &, + const std::optional &, + const std::string &, + const std::optional &, + const XMLName &, + const XMLName & + >(), + py::arg("projectile"), + py::arg("target"), + py::arg("evaluation"), + py::arg("path"), + py::arg("interaction") = std::nullopt, + py::arg("checksum"), + py::arg("algorithm") = std::nullopt, + py::arg("standard_target"), + py::arg("standard_evaluation"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set projectile + object.def_property( + "projectile", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectile(); + }, + [](cppCLASS &self, const XMLName &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 XMLName &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 XMLName &value) + { + self.evaluation() = value; + }, + cppCLASS::component_t::documentation("evaluation").data() + ); + + // get/set path + object.def_property( + "path", + [](const cppCLASS &self) -> decltype(auto) + { + return self.path(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.path() = value; + }, + cppCLASS::component_t::documentation("path").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 checksum + object.def_property( + "checksum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.checksum(); + }, + [](cppCLASS &self, const std::string &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() + ); + + // get/set standardTarget + object.def_property( + "standard_target", + [](const cppCLASS &self) -> decltype(auto) + { + return self.standardTarget(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.standardTarget() = value; + }, + cppCLASS::component_t::documentation("standard_target").data() + ); + + // get/set standardEvaluation + object.def_property( + "standard_evaluation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.standardEvaluation(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.standardEvaluation() = value; + }, + cppCLASS::component_t::documentation("standard_evaluation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_map +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops.python.cpp new file mode 100644 index 000000000..3d75e9a65 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops.python.cpp @@ -0,0 +1,143 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// pops declarations +namespace python_pops { + void wrapStandard(py::module &); + void wrapLogNormal(py::module &); + void wrapInterval(py::module &); + void wrapConfidenceIntervals(py::module &); + void wrapPdf(py::module &); + void wrapUncertainty(py::module &); + void wrapAlias(py::module &); + void wrapMetaStable(py::module &); + void wrapAliases(py::module &); + void wrapCharge(py::module &); + void wrapHalflife(py::module &); + void wrapMass(py::module &); + void wrapSpin(py::module &); + void wrapParity(py::module &); + void wrapProbability(py::module &); + void wrapShell(py::module &); + void wrapInternalConversionCoefficients(py::module &); + void wrapPhotonEmissionProbabilities(py::module &); + void wrapQ(py::module &); + void wrapProduct(py::module &); + void wrapProducts(py::module &); + void wrapDecay(py::module &); + void wrapDecayPath(py::module &); + void wrapContinuum(py::module &); + void wrapDiscreteEnergy(py::module &); + void wrapIntensity(py::module &); + void wrapInternalPairFormationCoefficient(py::module &); + void wrapPositronEmissionIntensity(py::module &); + void wrapDiscrete(py::module &); + void wrapSpectrum(py::module &); + void wrapSpectra(py::module &); + void wrapDecayMode(py::module &); + void wrapDecayModes(py::module &); + void wrapAverageEnergy(py::module &); + void wrapAverageEnergies(py::module &); + void wrapDecayData(py::module &); + void wrapGaugeBoson(py::module &); + void wrapGaugeBosons(py::module &); + void wrapLepton(py::module &); + void wrapLeptons(py::module &); + void wrapBaryon(py::module &); + void wrapBaryons(py::module &); + void wrapBindingEnergy(py::module &); + void wrapConfiguration(py::module &); + void wrapConfigurations(py::module &); + void wrapAtomic(py::module &); + void wrapEnergy(py::module &); + void wrapNucleus(py::module &); + void wrapNuclide(py::module &); + void wrapNuclides(py::module &); + void wrapIsotope(py::module &); + void wrapIsotopes(py::module &); + void wrapChemicalElement(py::module &); + void wrapChemicalElements(py::module &); + void wrapUnorthodoxes(py::module &); + void wrapPoPs_database(py::module &); + void wrapUnorthodox(py::module &); +} // namespace python_pops + +// wrapper for pops +void wrapPops(py::module &module) +{ + // create the pops submodule + py::module submodule = module.def_submodule( + "pops", + "test v2.0 pops" + ); + + // wrap pops components + python_pops::wrapStandard(submodule); + python_pops::wrapLogNormal(submodule); + python_pops::wrapInterval(submodule); + python_pops::wrapConfidenceIntervals(submodule); + python_pops::wrapPdf(submodule); + python_pops::wrapUncertainty(submodule); + python_pops::wrapAlias(submodule); + python_pops::wrapMetaStable(submodule); + python_pops::wrapAliases(submodule); + python_pops::wrapCharge(submodule); + python_pops::wrapHalflife(submodule); + python_pops::wrapMass(submodule); + python_pops::wrapSpin(submodule); + python_pops::wrapParity(submodule); + python_pops::wrapProbability(submodule); + python_pops::wrapShell(submodule); + python_pops::wrapInternalConversionCoefficients(submodule); + python_pops::wrapPhotonEmissionProbabilities(submodule); + python_pops::wrapQ(submodule); + python_pops::wrapProduct(submodule); + python_pops::wrapProducts(submodule); + python_pops::wrapDecay(submodule); + python_pops::wrapDecayPath(submodule); + python_pops::wrapContinuum(submodule); + python_pops::wrapDiscreteEnergy(submodule); + python_pops::wrapIntensity(submodule); + python_pops::wrapInternalPairFormationCoefficient(submodule); + python_pops::wrapPositronEmissionIntensity(submodule); + python_pops::wrapDiscrete(submodule); + python_pops::wrapSpectrum(submodule); + python_pops::wrapSpectra(submodule); + python_pops::wrapDecayMode(submodule); + python_pops::wrapDecayModes(submodule); + python_pops::wrapAverageEnergy(submodule); + python_pops::wrapAverageEnergies(submodule); + python_pops::wrapDecayData(submodule); + python_pops::wrapGaugeBoson(submodule); + python_pops::wrapGaugeBosons(submodule); + python_pops::wrapLepton(submodule); + python_pops::wrapLeptons(submodule); + python_pops::wrapBaryon(submodule); + python_pops::wrapBaryons(submodule); + python_pops::wrapBindingEnergy(submodule); + python_pops::wrapConfiguration(submodule); + python_pops::wrapConfigurations(submodule); + python_pops::wrapAtomic(submodule); + python_pops::wrapEnergy(submodule); + python_pops::wrapNucleus(submodule); + python_pops::wrapNuclide(submodule); + python_pops::wrapNuclides(submodule); + python_pops::wrapIsotope(submodule); + python_pops::wrapIsotopes(submodule); + python_pops::wrapChemicalElement(submodule); + python_pops::wrapChemicalElements(submodule); + python_pops::wrapUnorthodoxes(submodule); + python_pops::wrapPoPs_database(submodule); + python_pops::wrapUnorthodox(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Alias.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Alias.python.cpp new file mode 100644 index 000000000..201fee9b3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Alias.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Alias.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Alias +void wrapAlias(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Alias; + + // create the Python object + py::class_ object( + module, "Alias", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName & + >(), + py::arg("id"), + py::arg("pid"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const XMLName &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 XMLName &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Aliases.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Aliases.python.cpp new file mode 100644 index 000000000..d1c2ab09e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Aliases.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Aliases.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Aliases +void wrapAliases(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Aliases; + + // create the Python object + py::class_ object( + module, "Aliases", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> &, + const std::optional> & + >(), + py::arg("alias") = std::nullopt, + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Atomic.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Atomic.python.cpp new file mode 100644 index 000000000..05d7292a9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Atomic.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Atomic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Atomic +void wrapAtomic(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Atomic; + + // create the Python object + py::class_ object( + module, "Atomic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("configurations") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set configurations + object.def_property( + "configurations", + [](const cppCLASS &self) -> decltype(auto) + { + return self.configurations(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.configurations() = value; + }, + cppCLASS::component_t::documentation("configurations").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/AverageEnergies.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/AverageEnergies.python.cpp new file mode 100644 index 000000000..dfdf35086 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/AverageEnergies.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/AverageEnergies.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::AverageEnergies +void wrapAverageEnergies(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::AverageEnergies; + + // create the Python object + py::class_ object( + module, "AverageEnergies", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/AverageEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/AverageEnergy.python.cpp new file mode 100644 index 000000000..2d6e85e5f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/AverageEnergy.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/AverageEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::AverageEnergy +void wrapAverageEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::AverageEnergy; + + // create the Python object + py::class_ object( + module, "AverageEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Float64 &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("value"), + py::arg("unit"), + py::arg("documentation") = std::nullopt, + py::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 XMLName &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 Float64 &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 XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Baryon.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Baryon.python.cpp new file mode 100644 index 000000000..f0c236f43 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Baryon.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Baryon.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Baryon +void wrapBaryon(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Baryon; + + // create the Python object + py::class_ object( + module, "Baryon", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("id"), + py::arg("charge") = std::nullopt, + py::arg("halflife") = std::nullopt, + py::arg("mass") = std::nullopt, + py::arg("spin") = std::nullopt, + py::arg("parity") = std::nullopt, + py::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 XMLName &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const std::optional &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 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Baryons.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Baryons.python.cpp new file mode 100644 index 000000000..64786427a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Baryons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Baryons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Baryons +void wrapBaryons(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Baryons; + + // create the Python object + py::class_ object( + module, "Baryons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::arg("baryon") = std::nullopt, + 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::optional> &value) + { + self.baryon() = value; + }, + cppCLASS::component_t::documentation("baryon").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/BindingEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/BindingEnergy.python.cpp new file mode 100644 index 000000000..e49c19dcc --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/BindingEnergy.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/BindingEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::BindingEnergy +void wrapBindingEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::BindingEnergy; + + // create the Python object + py::class_ object( + module, "BindingEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional> & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value"), + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("double") = 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 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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Charge.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Charge.python.cpp new file mode 100644 index 000000000..34d95a888 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Charge.python.cpp @@ -0,0 +1,171 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Charge.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Charge +void wrapCharge(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Charge; + using _t = std::variant< + containers::Integer, + containers::Fraction + >; + + // create the Python object + py::class_ object( + module, "Charge", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const _t & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("_integerfraction"), + 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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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() + ); + + object.def_property( + "integer", + [](const cppCLASS &self) -> decltype(auto) + { + return self.integer(); + }, + [](cppCLASS &self, const containers::Integer &value) + { + self.integer() = value; + }, + cppCLASS::component_t::documentation("integer").data() + ); + + object.def_property( + "fraction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fraction(); + }, + [](cppCLASS &self, const containers::Fraction &value) + { + self.fraction() = value; + }, + cppCLASS::component_t::documentation("fraction").data() + ); + + object.def_property( + "_integerfraction", + [](const cppCLASS &self) -> decltype(auto) + { + return self._integerfraction(); + }, + [](cppCLASS &self, const _t &value) + { + self._integerfraction() = value; + }, + cppCLASS::component_t::documentation("_integerfraction").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/ChemicalElement.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/ChemicalElement.python.cpp new file mode 100644 index 000000000..4f62cb01a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/ChemicalElement.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/ChemicalElement.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::ChemicalElement +void wrapChemicalElement(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::ChemicalElement; + + // create the Python object + py::class_ object( + module, "ChemicalElement", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Integer32 &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("symbol"), + py::arg("z"), + py::arg("name") = std::nullopt, + py::arg("atomic") = std::nullopt, + py::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 XMLName &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 Integer32 &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::optional &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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/ChemicalElements.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/ChemicalElements.python.cpp new file mode 100644 index 000000000..130744da7 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/ChemicalElements.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/ChemicalElements.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::ChemicalElements +void wrapChemicalElements(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::ChemicalElements; + + // create the Python object + py::class_ object( + module, "ChemicalElements", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::arg("chemical_element") = std::nullopt, + 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::optional> &value) + { + self.chemicalElement() = value; + }, + cppCLASS::component_t::documentation("chemical_element").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/ConfidenceIntervals.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/ConfidenceIntervals.python.cpp new file mode 100644 index 000000000..9457b2895 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/ConfidenceIntervals.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/ConfidenceIntervals.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::ConfidenceIntervals +void wrapConfidenceIntervals(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::ConfidenceIntervals; + + // create the Python object + py::class_ object( + module, "ConfidenceIntervals", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("interval"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set interval + object.def_property( + "interval", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interval(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.interval() = value; + }, + cppCLASS::component_t::documentation("interval").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Configuration.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Configuration.python.cpp new file mode 100644 index 000000000..9a46458a6 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Configuration.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Configuration.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Configuration +void wrapConfiguration(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Configuration; + + // create the Python object + py::class_ object( + module, "Configuration", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const Float64 &, + const pops::BindingEnergy &, + const std::optional & + >(), + py::arg("subshell"), + py::arg("electron_number"), + py::arg("binding_energy"), + py::arg("decay_data") = std::nullopt, + 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 Float64 &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 pops::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::optional &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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Configurations.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Configurations.python.cpp new file mode 100644 index 000000000..6bdc2f933 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Configurations.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Configurations.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Configurations +void wrapConfigurations(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Configurations; + + // create the Python object + py::class_ object( + module, "Configurations", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Continuum.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Continuum.python.cpp new file mode 100644 index 000000000..4edc83f85 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Continuum.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Continuum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Continuum +void wrapContinuum(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Continuum; + + // create the Python object + py::class_ object( + module, "Continuum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Decay.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Decay.python.cpp new file mode 100644 index 000000000..a0ee4ee52 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Decay.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Decay.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Decay +void wrapDecay(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Decay; + + // create the Python object + py::class_ object( + module, "Decay", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Integer32 &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("index"), + py::arg("mode") = std::nullopt, + py::arg("complete") = std::nullopt, + py::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 Integer32 &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().value(); + }, + [](cppCLASS &self, const bool &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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/DecayData.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/DecayData.python.cpp new file mode 100644 index 000000000..1116a024b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/DecayData.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/DecayData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::DecayData +void wrapDecayData(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::DecayData; + + // create the Python object + py::class_ object( + module, "DecayData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("decay_modes") = std::nullopt, + py::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 std::optional &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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/DecayMode.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/DecayMode.python.cpp new file mode 100644 index 000000000..4b6c1b11e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/DecayMode.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/DecayMode.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::DecayMode +void wrapDecayMode(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::DecayMode; + + // create the Python object + py::class_ object( + module, "DecayMode", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const enums::DecayType &, + const pops::Probability &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("mode"), + py::arg("probability"), + py::arg("internal_conversion_coefficients") = std::nullopt, + py::arg("photon_emission_probabilities") = std::nullopt, + py::arg("q") = std::nullopt, + py::arg("decay_path") = std::nullopt, + py::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 XMLName &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 enums::DecayType &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 pops::Probability &value) + { + self.probability() = value; + }, + cppCLASS::component_t::documentation("probability").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 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 decayPath + object.def_property( + "decay_path", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decayPath(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.decayPath() = value; + }, + cppCLASS::component_t::documentation("decay_path").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/DecayModes.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/DecayModes.python.cpp new file mode 100644 index 000000000..9757603db --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/DecayModes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/DecayModes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::DecayModes +void wrapDecayModes(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::DecayModes; + + // create the Python object + py::class_ object( + module, "DecayModes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/DecayPath.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/DecayPath.python.cpp new file mode 100644 index 000000000..e7ac7db1d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/DecayPath.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/DecayPath.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::DecayPath +void wrapDecayPath(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::DecayPath; + + // create the Python object + py::class_ object( + module, "DecayPath", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Discrete.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Discrete.python.cpp new file mode 100644 index 000000000..a17b73577 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Discrete.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Discrete.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Discrete +void wrapDiscrete(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Discrete; + + // create the Python object + py::class_ object( + module, "Discrete", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const pops::DiscreteEnergy &, + const pops::Intensity &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("type") = std::nullopt, + py::arg("discrete_energy"), + py::arg("intensity"), + py::arg("internal_conversion_coefficients") = std::nullopt, + py::arg("internal_pair_formation_coefficient") = std::nullopt, + py::arg("photon_emission_probabilities") = std::nullopt, + py::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 discreteEnergy + object.def_property( + "discrete_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.discreteEnergy(); + }, + [](cppCLASS &self, const pops::DiscreteEnergy &value) + { + self.discreteEnergy() = value; + }, + cppCLASS::component_t::documentation("discrete_energy").data() + ); + + // get/set intensity + object.def_property( + "intensity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.intensity(); + }, + [](cppCLASS &self, const pops::Intensity &value) + { + self.intensity() = value; + }, + cppCLASS::component_t::documentation("intensity").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 internalPairFormationCoefficient + object.def_property( + "internal_pair_formation_coefficient", + [](const cppCLASS &self) -> decltype(auto) + { + return self.internalPairFormationCoefficient(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.internalPairFormationCoefficient() = value; + }, + cppCLASS::component_t::documentation("internal_pair_formation_coefficient").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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/DiscreteEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/DiscreteEnergy.python.cpp new file mode 100644 index 000000000..25f713551 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/DiscreteEnergy.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/DiscreteEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::DiscreteEnergy +void wrapDiscreteEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::DiscreteEnergy; + + // create the Python object + py::class_ object( + module, "DiscreteEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const Float64 &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("value"), + py::arg("unit"), + py::arg("documentation") = std::nullopt, + py::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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &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 XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Energy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Energy.python.cpp new file mode 100644 index 000000000..45d92ae64 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Energy.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Energy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Energy +void wrapEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Energy; + + // create the Python object + py::class_ object( + module, "Energy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional> & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("double") = 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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/GaugeBoson.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/GaugeBoson.python.cpp new file mode 100644 index 000000000..980c4fe39 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/GaugeBoson.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/GaugeBoson.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::GaugeBoson +void wrapGaugeBoson(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::GaugeBoson; + + // create the Python object + py::class_ object( + module, "GaugeBoson", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("id"), + py::arg("charge") = std::nullopt, + py::arg("halflife") = std::nullopt, + py::arg("mass") = std::nullopt, + py::arg("spin") = std::nullopt, + py::arg("parity") = std::nullopt, + py::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 XMLName &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const std::optional &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 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/GaugeBosons.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/GaugeBosons.python.cpp new file mode 100644 index 000000000..40cd9821f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/GaugeBosons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/GaugeBosons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::GaugeBosons +void wrapGaugeBosons(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::GaugeBosons; + + // create the Python object + py::class_ object( + module, "GaugeBosons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::arg("gauge_boson") = std::nullopt, + 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::optional> &value) + { + self.gaugeBoson() = value; + }, + cppCLASS::component_t::documentation("gauge_boson").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Halflife.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Halflife.python.cpp new file mode 100644 index 000000000..321f7971c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Halflife.python.cpp @@ -0,0 +1,171 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Halflife.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Halflife +void wrapHalflife(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Halflife; + using _t = std::variant< + containers::String, + containers::Double + >; + + // create the Python object + py::class_ object( + module, "Halflife", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const _t & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("_string_double"), + 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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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() + ); + + object.def_property( + "string", + [](const cppCLASS &self) -> decltype(auto) + { + return self.string(); + }, + [](cppCLASS &self, const containers::String &value) + { + self.string() = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const containers::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + object.def_property( + "_string_double", + [](const cppCLASS &self) -> decltype(auto) + { + return self._stringDouble(); + }, + [](cppCLASS &self, const _t &value) + { + self._stringDouble() = value; + }, + cppCLASS::component_t::documentation("_string_double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Intensity.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Intensity.python.cpp new file mode 100644 index 000000000..15bc96658 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Intensity.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Intensity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Intensity +void wrapIntensity(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Intensity; + + // create the Python object + py::class_ object( + module, "Intensity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/InternalConversionCoefficients.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/InternalConversionCoefficients.python.cpp new file mode 100644 index 000000000..9822104ca --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/InternalConversionCoefficients.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/InternalConversionCoefficients.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::InternalConversionCoefficients +void wrapInternalConversionCoefficients(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::InternalConversionCoefficients; + + // create the Python object + py::class_ object( + module, "InternalConversionCoefficients", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/InternalPairFormationCoefficient.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/InternalPairFormationCoefficient.python.cpp new file mode 100644 index 000000000..c364b2b01 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/InternalPairFormationCoefficient.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/InternalPairFormationCoefficient.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::InternalPairFormationCoefficient +void wrapInternalPairFormationCoefficient(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::InternalPairFormationCoefficient; + + // create the Python object + py::class_ object( + module, "InternalPairFormationCoefficient", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const Float64 &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("value"), + py::arg("unit"), + py::arg("documentation") = std::nullopt, + py::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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &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 XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Interval.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Interval.python.cpp new file mode 100644 index 000000000..bd0b51e6f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Interval.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Interval.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Interval +void wrapInterval(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Interval; + + // create the Python object + py::class_ object( + module, "Interval", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Float64 &, + const Float64 &, + const Float64 & + >(), + py::arg("confidence"), + py::arg("lower"), + py::arg("upper"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set confidence + object.def_property( + "confidence", + [](const cppCLASS &self) -> decltype(auto) + { + return self.confidence(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.confidence() = value; + }, + cppCLASS::component_t::documentation("confidence").data() + ); + + // get/set lower + object.def_property( + "lower", + [](const cppCLASS &self) -> decltype(auto) + { + return self.lower(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.lower() = value; + }, + cppCLASS::component_t::documentation("lower").data() + ); + + // get/set upper + object.def_property( + "upper", + [](const cppCLASS &self) -> decltype(auto) + { + return self.upper(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.upper() = value; + }, + cppCLASS::component_t::documentation("upper").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Isotope.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Isotope.python.cpp new file mode 100644 index 000000000..7bee041ae --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Isotope.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Isotope.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Isotope +void wrapIsotope(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Isotope; + + // create the Python object + py::class_ object( + module, "Isotope", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Integer32 &, + const XMLName &, + const std::optional & + >(), + py::arg("a"), + py::arg("symbol"), + py::arg("nuclides") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set A + object.def_property( + "a", + [](const cppCLASS &self) -> decltype(auto) + { + return self.A(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.A() = value; + }, + cppCLASS::component_t::documentation("a").data() + ); + + // get/set symbol + object.def_property( + "symbol", + [](const cppCLASS &self) -> decltype(auto) + { + return self.symbol(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.symbol() = value; + }, + cppCLASS::component_t::documentation("symbol").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Isotopes.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Isotopes.python.cpp new file mode 100644 index 000000000..6cabcc54c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Isotopes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Isotopes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Isotopes +void wrapIsotopes(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Isotopes; + + // create the Python object + py::class_ object( + module, "Isotopes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Lepton.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Lepton.python.cpp new file mode 100644 index 000000000..199807a73 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Lepton.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Lepton.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Lepton +void wrapLepton(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Lepton; + + // create the Python object + py::class_ object( + module, "Lepton", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("generation") = std::nullopt, + py::arg("id"), + py::arg("charge") = std::nullopt, + py::arg("halflife") = std::nullopt, + py::arg("mass") = std::nullopt, + py::arg("spin") = std::nullopt, + py::arg("parity") = std::nullopt, + py::arg("decay_data") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set generation + object.def_property( + "generation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.generation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.generation() = value; + }, + cppCLASS::component_t::documentation("generation").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const std::optional &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 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Leptons.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Leptons.python.cpp new file mode 100644 index 000000000..e70882594 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Leptons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Leptons.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Leptons +void wrapLeptons(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Leptons; + + // create the Python object + py::class_ object( + module, "Leptons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/LogNormal.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/LogNormal.python.cpp new file mode 100644 index 000000000..b31f8a646 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/LogNormal.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/LogNormal.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::LogNormal +void wrapLogNormal(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::LogNormal; + + // create the Python object + py::class_ object( + module, "LogNormal", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const extra::Double & + >(), + py::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 extra::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Mass.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Mass.python.cpp new file mode 100644 index 000000000..057fcc936 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Mass.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Mass.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Mass +void wrapMass(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Mass; + + // create the Python object + py::class_ object( + module, "Mass", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("double") = 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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/MetaStable.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/MetaStable.python.cpp new file mode 100644 index 000000000..501ee4e33 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/MetaStable.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/MetaStable.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::MetaStable +void wrapMetaStable(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::MetaStable; + + // create the Python object + py::class_ object( + module, "MetaStable", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Integer32 &, + const XMLName & + >(), + py::arg("id"), + py::arg("meta_stable_index"), + py::arg("pid"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set metaStableIndex + object.def_property( + "meta_stable_index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.metaStableIndex(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.metaStableIndex() = value; + }, + cppCLASS::component_t::documentation("meta_stable_index").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Nucleus.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Nucleus.python.cpp new file mode 100644 index 000000000..e0e0151d5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Nucleus.python.cpp @@ -0,0 +1,190 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Nucleus.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Nucleus +void wrapNucleus(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Nucleus; + + // create the Python object + py::class_ object( + module, "Nucleus", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Integer32 &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("id"), + py::arg("index"), + py::arg("charge") = std::nullopt, + py::arg("energy") = std::nullopt, + py::arg("halflife") = std::nullopt, + py::arg("spin") = std::nullopt, + py::arg("parity") = std::nullopt, + py::arg("decay_data") = std::nullopt, + py::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 XMLName &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 Integer32 &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.charge() = value; + }, + cppCLASS::component_t::documentation("charge").data() + ); + + // get/set energy + object.def_property( + "energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energy(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.energy() = value; + }, + cppCLASS::component_t::documentation("energy").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 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Nuclide.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Nuclide.python.cpp new file mode 100644 index 000000000..009b7c744 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Nuclide.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Nuclide.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Nuclide +void wrapNuclide(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Nuclide; + + // create the Python object + py::class_ object( + module, "Nuclide", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("id"), + py::arg("charge") = std::nullopt, + py::arg("mass") = std::nullopt, + py::arg("spin") = std::nullopt, + py::arg("parity") = std::nullopt, + py::arg("nucleus") = std::nullopt, + py::arg("decay_data") = std::nullopt, + py::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 XMLName &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.charge() = value; + }, + cppCLASS::component_t::documentation("charge").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 nucleus + object.def_property( + "nucleus", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nucleus(); + }, + [](cppCLASS &self, const std::optional &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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Nuclides.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Nuclides.python.cpp new file mode 100644 index 000000000..c573041dc --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Nuclides.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Nuclides.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Nuclides +void wrapNuclides(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Nuclides; + + // create the Python object + py::class_ object( + module, "Nuclides", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Parity.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Parity.python.cpp new file mode 100644 index 000000000..89a814cd9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Parity.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Parity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Parity +void wrapParity(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Parity; + + // create the Python object + py::class_ object( + module, "Parity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional> & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("integer") = 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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 integer + object.def_property( + "integer", + [](const cppCLASS &self) -> decltype(auto) + { + return self.integer(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.integer() = value; + }, + cppCLASS::component_t::documentation("integer").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Pdf.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Pdf.python.cpp new file mode 100644 index 000000000..02f27c9f7 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Pdf.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Pdf.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Pdf +void wrapPdf(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Pdf; + + // create the Python object + py::class_ object( + module, "Pdf", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/PhotonEmissionProbabilities.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/PhotonEmissionProbabilities.python.cpp new file mode 100644 index 000000000..9c3e5871b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/PhotonEmissionProbabilities.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/PhotonEmissionProbabilities.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::PhotonEmissionProbabilities +void wrapPhotonEmissionProbabilities(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::PhotonEmissionProbabilities; + + // create the Python object + py::class_ object( + module, "PhotonEmissionProbabilities", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/PoPs_database.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/PoPs_database.python.cpp new file mode 100644 index 000000000..bcfb6484e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/PoPs_database.python.cpp @@ -0,0 +1,222 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/PoPs_database.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::PoPs_database +void wrapPoPs_database(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::PoPs_database; + + // create the Python object + py::class_ object( + module, "PoPs_database", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("name"), + py::arg("version"), + py::arg("format"), + py::arg("styles") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::arg("aliases") = std::nullopt, + py::arg("gauge_bosons") = std::nullopt, + py::arg("leptons") = std::nullopt, + py::arg("baryons") = std::nullopt, + py::arg("chemical_elements") = std::nullopt, + py::arg("unorthodoxes") = 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 XMLName &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 XMLName &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 XMLName &value) + { + self.format() = value; + }, + cppCLASS::component_t::documentation("format").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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 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() + ); + + // 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/PositronEmissionIntensity.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/PositronEmissionIntensity.python.cpp new file mode 100644 index 000000000..93e74353c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/PositronEmissionIntensity.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/PositronEmissionIntensity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::PositronEmissionIntensity +void wrapPositronEmissionIntensity(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::PositronEmissionIntensity; + + // create the Python object + py::class_ object( + module, "PositronEmissionIntensity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Float64 &, + const std::optional & + >(), + py::arg("value"), + py::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 Float64 &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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Probability.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Probability.python.cpp new file mode 100644 index 000000000..65cf487f6 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Probability.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Probability.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Probability +void wrapProbability(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Probability; + + // create the Python object + py::class_ object( + module, "Probability", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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 std::vector &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Product.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Product.python.cpp new file mode 100644 index 000000000..decfcede3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Product.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Product.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Product +void wrapProduct(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Product; + + // create the Python object + py::class_ object( + module, "Product", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName & + >(), + py::arg("label"), + py::arg("pid"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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 XMLName &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Products.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Products.python.cpp new file mode 100644 index 000000000..3e39da169 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Products.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Products.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Products +void wrapProducts(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Products; + + // create the Python object + py::class_ object( + module, "Products", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Q.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Q.python.cpp new file mode 100644 index 000000000..845d670df --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Q.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Q.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Q +void wrapQ(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Q; + + // create the Python object + py::class_ object( + module, "Q", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::vector & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value"), + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("double"), + 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 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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Shell.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Shell.python.cpp new file mode 100644 index 000000000..c38bda4f0 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Shell.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Shell.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Shell +void wrapShell(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Shell; + + // create the Python object + py::class_ object( + module, "Shell", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Float64 &, + const std::optional & + >(), + py::arg("label"), + py::arg("value"), + py::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 XMLName &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 Float64 &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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Spectra.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Spectra.python.cpp new file mode 100644 index 000000000..bdf95ea3b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Spectra.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Spectra.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Spectra +void wrapSpectra(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Spectra; + + // create the Python object + py::class_ object( + module, "Spectra", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Spectrum.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Spectrum.python.cpp new file mode 100644 index 000000000..3649eb0fa --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Spectrum.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Spectrum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Spectrum +void wrapSpectrum(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Spectrum; + + // create the Python object + py::class_ object( + module, "Spectrum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional> & + >(), + py::arg("label"), + py::arg("pid"), + py::arg("continuum") = std::nullopt, + py::arg("discrete") = 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 XMLName &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 XMLName &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").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() + ); + + // get/set discrete + object.def_property( + "discrete", + [](const cppCLASS &self) -> decltype(auto) + { + return self.discrete(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.discrete() = value; + }, + cppCLASS::component_t::documentation("discrete").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Spin.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Spin.python.cpp new file mode 100644 index 000000000..4d5b7f6f5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Spin.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Spin.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Spin +void wrapSpin(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Spin; + + // create the Python object + py::class_ object( + module, "Spin", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional> & + >(), + py::arg("label") = std::nullopt, + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("documentation") = std::nullopt, + py::arg("uncertainty") = std::nullopt, + py::arg("fraction") = 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 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 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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 fraction + object.def_property( + "fraction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fraction(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.fraction() = value; + }, + cppCLASS::component_t::documentation("fraction").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Standard.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Standard.python.cpp new file mode 100644 index 000000000..eb4fa40ed --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Standard.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Standard.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Standard +void wrapStandard(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Standard; + + // create the Python object + py::class_ object( + module, "Standard", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const extra::Double & + >(), + py::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 extra::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Uncertainty.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Uncertainty.python.cpp new file mode 100644 index 000000000..c8cef59f9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Uncertainty.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Uncertainty.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Uncertainty +void wrapUncertainty(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Uncertainty; + + // create the Python object + py::class_ object( + module, "Uncertainty", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("standard") = std::nullopt, + py::arg("log_normal") = std::nullopt, + py::arg("confidence_intervals") = std::nullopt, + py::arg("pdf") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 logNormal + object.def_property( + "log_normal", + [](const cppCLASS &self) -> decltype(auto) + { + return self.logNormal(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.logNormal() = value; + }, + cppCLASS::component_t::documentation("log_normal").data() + ); + + // get/set confidenceIntervals + object.def_property( + "confidence_intervals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.confidenceIntervals(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.confidenceIntervals() = value; + }, + cppCLASS::component_t::documentation("confidence_intervals").data() + ); + + // get/set pdf + object.def_property( + "pdf", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pdf(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.pdf() = value; + }, + cppCLASS::component_t::documentation("pdf").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Unorthodox.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Unorthodox.python.cpp new file mode 100644 index 000000000..34966484d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Unorthodox.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Unorthodox.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Unorthodox +void wrapUnorthodox(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Unorthodox; + + // create the Python object + py::class_ object( + module, "Unorthodox", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::optional &, + const std::optional & + >(), + py::arg("id"), + py::arg("charge") = std::nullopt, + py::arg("mass") = 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 XMLName &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.charge() = value; + }, + cppCLASS::component_t::documentation("charge").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/pops/Unorthodoxes.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/pops/Unorthodoxes.python.cpp new file mode 100644 index 000000000..3cb7966a2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/pops/Unorthodoxes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/pops/Unorthodoxes.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_pops { + +// wrapper for pops::Unorthodoxes +void wrapUnorthodoxes(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = pops::Unorthodoxes; + + // create the Python object + py::class_ object( + module, "Unorthodoxes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_pops +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/processed.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/processed.python.cpp new file mode 100644 index 000000000..d85559665 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/processed.python.cpp @@ -0,0 +1,43 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// processed declarations +namespace python_processed { + void wrapAngularEnergyMC(py::module &); + void wrapEnergyAngularMC(py::module &); + void wrapMultiGroup3d(py::module &); + void wrapAverageProductEnergy(py::module &); + void wrapAverageProductMomentum(py::module &); + void wrapAvailableMomentum(py::module &); + void wrapAvailableEnergy(py::module &); +} // namespace python_processed + +// wrapper for processed +void wrapProcessed(py::module &module) +{ + // create the processed submodule + py::module submodule = module.def_submodule( + "processed", + "test v2.0 processed" + ); + + // wrap processed components + python_processed::wrapAngularEnergyMC(submodule); + python_processed::wrapEnergyAngularMC(submodule); + python_processed::wrapMultiGroup3d(submodule); + python_processed::wrapAverageProductEnergy(submodule); + python_processed::wrapAverageProductMomentum(submodule); + python_processed::wrapAvailableMomentum(submodule); + python_processed::wrapAvailableEnergy(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/processed/AngularEnergyMC.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/processed/AngularEnergyMC.python.cpp new file mode 100644 index 000000000..779cf8aa6 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/processed/AngularEnergyMC.python.cpp @@ -0,0 +1,180 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/processed/AngularEnergyMC.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// wrapper for processed::AngularEnergyMC +void wrapAngularEnergyMC(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = processed::AngularEnergyMC; + + // create the Python object + py::class_ object( + module, "AngularEnergyMC", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const transport::Angular_uncorrelated &, + const transport::AngularEnergy & + >(), + py::arg("label"), + py::arg("product_frame"), + py::arg("angular_uncorrelated"), + py::arg("angular_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 XMLName &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 XMLName &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set angular_uncorrelated + object.def_property( + "angular_uncorrelated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angular_uncorrelated(); + }, + [](cppCLASS &self, const transport::Angular_uncorrelated &value) + { + self.angular_uncorrelated() = value; + }, + cppCLASS::component_t::documentation("angular_uncorrelated").data() + ); + + // get/set angularEnergy + object.def_property( + "angular_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angularEnergy(); + }, + [](cppCLASS &self, const transport::AngularEnergy &value) + { + self.angularEnergy() = value; + }, + cppCLASS::component_t::documentation("angular_energy").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 XYs3d + object.def_property( + "xys3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs3d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs3d() = value; + }, + cppCLASS::component_t::documentation("xys3d").data() + ); + + // shortcut: get/set forward + object.def_property( + "forward", + [](const cppCLASS &self) -> decltype(auto) + { + return self.forward(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.forward() = value; + }, + cppCLASS::component_t::documentation("forward").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() + ); + + // 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/processed/AvailableEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/processed/AvailableEnergy.python.cpp new file mode 100644 index 000000000..1203fe1a8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/processed/AvailableEnergy.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/processed/AvailableEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// wrapper for processed::AvailableEnergy +void wrapAvailableEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = processed::AvailableEnergy; + + // create the Python object + py::class_ object( + module, "AvailableEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::arg("gridded1d") = 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 gridded1d + object.def_property( + "gridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.gridded1d() = value; + }, + cppCLASS::component_t::documentation("gridded1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/processed/AvailableMomentum.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/processed/AvailableMomentum.python.cpp new file mode 100644 index 000000000..2386db126 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/processed/AvailableMomentum.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/processed/AvailableMomentum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// wrapper for processed::AvailableMomentum +void wrapAvailableMomentum(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = processed::AvailableMomentum; + + // create the Python object + py::class_ object( + module, "AvailableMomentum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::arg("gridded1d") = 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 gridded1d + object.def_property( + "gridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.gridded1d() = value; + }, + cppCLASS::component_t::documentation("gridded1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_processed +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/processed/AverageProductEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/processed/AverageProductEnergy.python.cpp new file mode 100644 index 000000000..ae9c7e0b1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/processed/AverageProductEnergy.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/processed/AverageProductEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// wrapper for processed::AverageProductEnergy +void wrapAverageProductEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = processed::AverageProductEnergy; + + // create the Python object + py::class_ object( + module, "AverageProductEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::XYs1d &, + const std::optional &, + const std::optional & + >(), + py::arg("xys1d"), + py::arg("gridded1d") = std::nullopt, + py::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 containers::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set gridded1d + object.def_property( + "gridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.gridded1d() = value; + }, + cppCLASS::component_t::documentation("gridded1d").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_processed +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/processed/AverageProductMomentum.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/processed/AverageProductMomentum.python.cpp new file mode 100644 index 000000000..9bf8a6b4e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/processed/AverageProductMomentum.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/processed/AverageProductMomentum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// wrapper for processed::AverageProductMomentum +void wrapAverageProductMomentum(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = processed::AverageProductMomentum; + + // create the Python object + py::class_ object( + module, "AverageProductMomentum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::arg("gridded1d") = std::nullopt, + py::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 gridded1d + object.def_property( + "gridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.gridded1d() = value; + }, + cppCLASS::component_t::documentation("gridded1d").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_processed +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/processed/EnergyAngularMC.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/processed/EnergyAngularMC.python.cpp new file mode 100644 index 000000000..1ba3efa2e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/processed/EnergyAngularMC.python.cpp @@ -0,0 +1,180 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/processed/EnergyAngularMC.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// wrapper for processed::EnergyAngularMC +void wrapEnergyAngularMC(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = processed::EnergyAngularMC; + + // create the Python object + py::class_ object( + module, "EnergyAngularMC", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const common::Energy &, + const transport::EnergyAngular & + >(), + py::arg("label"), + py::arg("product_frame"), + py::arg("energy"), + py::arg("energy_angular"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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 XMLName &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set energy + object.def_property( + "energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energy(); + }, + [](cppCLASS &self, const common::Energy &value) + { + self.energy() = value; + }, + cppCLASS::component_t::documentation("energy").data() + ); + + // get/set energyAngular + object.def_property( + "energy_angular", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energyAngular(); + }, + [](cppCLASS &self, const transport::EnergyAngular &value) + { + self.energyAngular() = value; + }, + cppCLASS::component_t::documentation("energy_angular").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 XYs3d + object.def_property( + "xys3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs3d(); + }, + [](cppCLASS &self, const std::decay_t &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 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 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_processed +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/processed/MultiGroup3d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/processed/MultiGroup3d.python.cpp new file mode 100644 index 000000000..68a9b2f9e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/processed/MultiGroup3d.python.cpp @@ -0,0 +1,150 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/processed/MultiGroup3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_processed { + +// wrapper for processed::MultiGroup3d +void wrapMultiGroup3d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = processed::MultiGroup3d; + + // create the Python object + py::class_ object( + module, "MultiGroup3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const containers::Gridded3d & + >(), + py::arg("label"), + py::arg("product_frame"), + py::arg("gridded3d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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 XMLName &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set gridded3d + object.def_property( + "gridded3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded3d(); + }, + [](cppCLASS &self, const containers::Gridded3d &value) + { + self.gridded3d() = value; + }, + cppCLASS::component_t::documentation("gridded3d").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_processed +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances.python.cpp new file mode 100644 index 000000000..3404c5d8f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances.python.cpp @@ -0,0 +1,79 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// resonances declarations +namespace python_resonances { + void wrapScatteringRadius(py::module &); + void wrapHardSphereRadius(py::module &); + void wrapResonanceReaction(py::module &); + void wrapResonanceReactions(py::module &); + void wrapExternalRMatrix(py::module &); + void wrapChannel(py::module &); + void wrapChannels(py::module &); + void wrapResonanceParameters(py::module &); + void wrapSpinGroup(py::module &); + void wrapSpinGroups(py::module &); + void wrapRMatrix(py::module &); + void wrapBreitWigner(py::module &); + void wrapEnergyInterval(py::module &); + void wrapEnergyIntervals(py::module &); + void wrapResolved(py::module &); + void wrapLevelSpacing(py::module &); + void wrapWidth(py::module &); + void wrapWidths(py::module &); + void wrapJ(py::module &); + void wrapJs(py::module &); + void wrapL(py::module &); + void wrapLs(py::module &); + void wrapTabulatedWidths(py::module &); + void wrapUnresolved(py::module &); + void wrapResonances(py::module &); +} // namespace python_resonances + +// wrapper for resonances +void wrapResonances(py::module &module) +{ + // create the resonances submodule + py::module submodule = module.def_submodule( + "resonances", + "test v2.0 resonances" + ); + + // wrap resonances components + python_resonances::wrapScatteringRadius(submodule); + python_resonances::wrapHardSphereRadius(submodule); + python_resonances::wrapResonanceReaction(submodule); + python_resonances::wrapResonanceReactions(submodule); + python_resonances::wrapExternalRMatrix(submodule); + python_resonances::wrapChannel(submodule); + python_resonances::wrapChannels(submodule); + python_resonances::wrapResonanceParameters(submodule); + python_resonances::wrapSpinGroup(submodule); + python_resonances::wrapSpinGroups(submodule); + python_resonances::wrapRMatrix(submodule); + python_resonances::wrapBreitWigner(submodule); + python_resonances::wrapEnergyInterval(submodule); + python_resonances::wrapEnergyIntervals(submodule); + python_resonances::wrapResolved(submodule); + python_resonances::wrapLevelSpacing(submodule); + python_resonances::wrapWidth(submodule); + python_resonances::wrapWidths(submodule); + python_resonances::wrapJ(submodule); + python_resonances::wrapJs(submodule); + python_resonances::wrapL(submodule); + python_resonances::wrapLs(submodule); + python_resonances::wrapTabulatedWidths(submodule); + python_resonances::wrapUnresolved(submodule); + python_resonances::wrapResonances(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/BreitWigner.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/BreitWigner.python.cpp new file mode 100644 index 000000000..a0e0f3bcb --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/BreitWigner.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/BreitWigner.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::BreitWigner +void wrapBreitWigner(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::BreitWigner; + + // create the Python object + py::class_ object( + module, "BreitWigner", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("approximation"), + py::arg("calculate_channel_radius") = std::nullopt, + py::arg("use_for_self_shielding_only") = std::nullopt, + py::arg("po_ps_database") = std::nullopt, + py::arg("scattering_radius") = std::nullopt, + py::arg("hard_sphere_radius") = std::nullopt, + py::arg("resonance_parameters") = 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 XMLName &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 XMLName &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().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.calculateChannelRadius() = value; + }, + cppCLASS::component_t::documentation("calculate_channel_radius").data() + ); + + // get/set useForSelfShieldingOnly + object.def_property( + "use_for_self_shielding_only", + [](const cppCLASS &self) -> decltype(auto) + { + return self.useForSelfShieldingOnly().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.useForSelfShieldingOnly() = value; + }, + cppCLASS::component_t::documentation("use_for_self_shielding_only").data() + ); + + // get/set PoPs_database + object.def_property( + "po_ps_database", + [](const cppCLASS &self) -> decltype(auto) + { + return self.PoPs_database(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.PoPs_database() = value; + }, + cppCLASS::component_t::documentation("po_ps_database").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() + ); + + // get/set resonanceParameters + object.def_property( + "resonance_parameters", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceParameters(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.resonanceParameters() = value; + }, + cppCLASS::component_t::documentation("resonance_parameters").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/Channel.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/Channel.python.cpp new file mode 100644 index 000000000..208967eda --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/Channel.python.cpp @@ -0,0 +1,190 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/Channel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::Channel +void wrapChannel(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::Channel; + + // create the Python object + py::class_ object( + module, "Channel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::string &, + const Integer32 &, + const Fraction32 &, + const std::optional &, + const Integer32 &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label"), + py::arg("resonance_reaction"), + py::arg("l"), + py::arg("channel_spin"), + py::arg("boundary_condition_value") = std::nullopt, + py::arg("column_index"), + py::arg("external_rmatrix") = std::nullopt, + py::arg("scattering_radius") = std::nullopt, + py::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 XMLName &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 Integer32 &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 Fraction32 &value) + { + self.channelSpin() = value; + }, + cppCLASS::component_t::documentation("channel_spin").data() + ); + + // get/set boundaryConditionValue + object.def_property( + "boundary_condition_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.boundaryConditionValue(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.boundaryConditionValue() = value; + }, + cppCLASS::component_t::documentation("boundary_condition_value").data() + ); + + // get/set columnIndex + object.def_property( + "column_index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnIndex(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.columnIndex() = value; + }, + cppCLASS::component_t::documentation("column_index").data() + ); + + // get/set externalRMatrix + object.def_property( + "external_rmatrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.externalRMatrix(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.externalRMatrix() = value; + }, + cppCLASS::component_t::documentation("external_rmatrix").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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/Channels.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/Channels.python.cpp new file mode 100644 index 000000000..a3a9e5397 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/Channels.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/Channels.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::Channels +void wrapChannels(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::Channels; + + // create the Python object + py::class_ object( + module, "Channels", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/EnergyInterval.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/EnergyInterval.python.cpp new file mode 100644 index 000000000..d633f39f3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/EnergyInterval.python.cpp @@ -0,0 +1,155 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/EnergyInterval.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::EnergyInterval +void wrapEnergyInterval(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::EnergyInterval; + using _t = std::variant< + resonances::RMatrix, + resonances::BreitWigner + >; + + // create the Python object + py::class_ object( + module, "EnergyInterval", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Integer32 &, + const Float64 &, + const Float64 &, + const XMLName &, + const _t & + >(), + py::arg("index"), + py::arg("domain_min"), + py::arg("domain_max"), + py::arg("domain_unit"), + py::arg("_rmatrix_breit_wigner"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const Float64 &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 Float64 &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 XMLName &value) + { + self.domainUnit() = value; + }, + cppCLASS::component_t::documentation("domain_unit").data() + ); + + object.def_property( + "rmatrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.RMatrix(); + }, + [](cppCLASS &self, const resonances::RMatrix &value) + { + self.RMatrix() = value; + }, + cppCLASS::component_t::documentation("rmatrix").data() + ); + + object.def_property( + "breit_wigner", + [](const cppCLASS &self) -> decltype(auto) + { + return self.BreitWigner(); + }, + [](cppCLASS &self, const resonances::BreitWigner &value) + { + self.BreitWigner() = value; + }, + cppCLASS::component_t::documentation("breit_wigner").data() + ); + + object.def_property( + "_rmatrix_breit_wigner", + [](const cppCLASS &self) -> decltype(auto) + { + return self._RMatrixBreitWigner(); + }, + [](cppCLASS &self, const _t &value) + { + self._RMatrixBreitWigner() = value; + }, + cppCLASS::component_t::documentation("_rmatrix_breit_wigner").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/EnergyIntervals.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/EnergyIntervals.python.cpp new file mode 100644 index 000000000..32f57c852 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/EnergyIntervals.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/EnergyIntervals.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::EnergyIntervals +void wrapEnergyIntervals(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::EnergyIntervals; + + // create the Python object + py::class_ object( + module, "EnergyIntervals", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::vector & + >(), + py::arg("label"), + py::arg("energy_interval"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set energyInterval + object.def_property( + "energy_interval", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energyInterval(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.energyInterval() = value; + }, + cppCLASS::component_t::documentation("energy_interval").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/ExternalRMatrix.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/ExternalRMatrix.python.cpp new file mode 100644 index 000000000..a37bc5805 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/ExternalRMatrix.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/ExternalRMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::ExternalRMatrix +void wrapExternalRMatrix(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::ExternalRMatrix; + + // create the Python object + py::class_ object( + module, "ExternalRMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::vector & + >(), + py::arg("type") = std::nullopt, + py::arg("double"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set type + object.def_property( + "type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.type().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.type() = value; + }, + cppCLASS::component_t::documentation("type").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/HardSphereRadius.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/HardSphereRadius.python.cpp new file mode 100644 index 000000000..2a217c840 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/HardSphereRadius.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/HardSphereRadius.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::HardSphereRadius +void wrapHardSphereRadius(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::HardSphereRadius; + + // create the Python object + py::class_ object( + module, "HardSphereRadius", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Constant1d & + >(), + py::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 containers::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/J.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/J.python.cpp new file mode 100644 index 000000000..f0a7c617e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/J.python.cpp @@ -0,0 +1,124 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/J.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::J +void wrapJ(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::J; + + // create the Python object + py::class_ object( + module, "J", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Fraction32 &, + const resonances::LevelSpacing &, + const resonances::Widths & + >(), + py::arg("label"), + py::arg("value"), + py::arg("level_spacing"), + py::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 XMLName &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 Fraction32 &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 resonances::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 resonances::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/Js.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/Js.python.cpp new file mode 100644 index 000000000..7a26316c6 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/Js.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/Js.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::Js +void wrapJs(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::Js; + + // create the Python object + py::class_ object( + module, "Js", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/L.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/L.python.cpp new file mode 100644 index 000000000..12a80e32d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/L.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/L.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::L +void wrapL(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::L; + + // create the Python object + py::class_ object( + module, "L", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Integer32 &, + const resonances::Js & + >(), + py::arg("label"), + py::arg("value"), + py::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 XMLName &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 Integer32 &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 resonances::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/LevelSpacing.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/LevelSpacing.python.cpp new file mode 100644 index 000000000..b2a4c3610 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/LevelSpacing.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/LevelSpacing.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::LevelSpacing +void wrapLevelSpacing(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::LevelSpacing; + + // create the Python object + py::class_ object( + module, "LevelSpacing", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("constant1d") = std::nullopt, + py::arg("xys1d") = std::nullopt, + py::arg("regions1d") = 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/Ls.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/Ls.python.cpp new file mode 100644 index 000000000..68ce32cef --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/Ls.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/Ls.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::Ls +void wrapLs(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::Ls; + + // create the Python object + py::class_ object( + module, "Ls", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/RMatrix.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/RMatrix.python.cpp new file mode 100644 index 000000000..95ebb6df3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/RMatrix.python.cpp @@ -0,0 +1,250 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/RMatrix.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::RMatrix +void wrapRMatrix(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::RMatrix; + + // create the Python object + py::class_ object( + module, "RMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const resonances::ResonanceReactions &, + const resonances::SpinGroups & + >(), + py::arg("label"), + py::arg("approximation"), + py::arg("boundary_condition") = std::nullopt, + py::arg("boundary_condition_value") = std::nullopt, + py::arg("calculate_channel_radius") = std::nullopt, + py::arg("calculate_penetrability") = std::nullopt, + py::arg("use_for_self_shielding_only") = std::nullopt, + py::arg("supports_angular_reconstruction") = std::nullopt, + py::arg("po_ps_database") = std::nullopt, + py::arg("resonance_reactions"), + py::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 XMLName &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 XMLName &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().value(); + }, + [](cppCLASS &self, const enums::BoundaryCondition &value) + { + self.boundaryCondition() = value; + }, + cppCLASS::component_t::documentation("boundary_condition").data() + ); + + // get/set boundaryConditionValue + object.def_property( + "boundary_condition_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.boundaryConditionValue(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.boundaryConditionValue() = value; + }, + cppCLASS::component_t::documentation("boundary_condition_value").data() + ); + + // get/set calculateChannelRadius + object.def_property( + "calculate_channel_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.calculateChannelRadius().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.calculateChannelRadius() = value; + }, + cppCLASS::component_t::documentation("calculate_channel_radius").data() + ); + + // get/set calculatePenetrability + object.def_property( + "calculate_penetrability", + [](const cppCLASS &self) -> decltype(auto) + { + return self.calculatePenetrability().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.calculatePenetrability() = value; + }, + cppCLASS::component_t::documentation("calculate_penetrability").data() + ); + + // get/set useForSelfShieldingOnly + object.def_property( + "use_for_self_shielding_only", + [](const cppCLASS &self) -> decltype(auto) + { + return self.useForSelfShieldingOnly().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.useForSelfShieldingOnly() = value; + }, + cppCLASS::component_t::documentation("use_for_self_shielding_only").data() + ); + + // get/set supportsAngularReconstruction + object.def_property( + "supports_angular_reconstruction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.supportsAngularReconstruction().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.supportsAngularReconstruction() = value; + }, + cppCLASS::component_t::documentation("supports_angular_reconstruction").data() + ); + + // get/set PoPs_database + object.def_property( + "po_ps_database", + [](const cppCLASS &self) -> decltype(auto) + { + return self.PoPs_database(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.PoPs_database() = value; + }, + cppCLASS::component_t::documentation("po_ps_database").data() + ); + + // get/set resonanceReactions + object.def_property( + "resonance_reactions", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReactions(); + }, + [](cppCLASS &self, const resonances::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 resonances::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/Resolved.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/Resolved.python.cpp new file mode 100644 index 000000000..3931a4b27 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/Resolved.python.cpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/Resolved.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::Resolved +void wrapResolved(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::Resolved; + using _t = std::variant< + resonances::RMatrix, + resonances::BreitWigner, + resonances::EnergyIntervals + >; + + // create the Python object + py::class_ object( + module, "Resolved", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Float64 &, + const Float64 &, + const XMLName &, + const _t & + >(), + py::arg("domain_min"), + py::arg("domain_max"), + py::arg("domain_unit"), + py::arg("_rmatrix_breit_wignerenergy_intervals"), + 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 Float64 &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 Float64 &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 XMLName &value) + { + self.domainUnit() = value; + }, + cppCLASS::component_t::documentation("domain_unit").data() + ); + + object.def_property( + "rmatrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.RMatrix(); + }, + [](cppCLASS &self, const resonances::RMatrix &value) + { + self.RMatrix() = value; + }, + cppCLASS::component_t::documentation("rmatrix").data() + ); + + object.def_property( + "breit_wigner", + [](const cppCLASS &self) -> decltype(auto) + { + return self.BreitWigner(); + }, + [](cppCLASS &self, const resonances::BreitWigner &value) + { + self.BreitWigner() = value; + }, + cppCLASS::component_t::documentation("breit_wigner").data() + ); + + object.def_property( + "energy_intervals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energyIntervals(); + }, + [](cppCLASS &self, const resonances::EnergyIntervals &value) + { + self.energyIntervals() = value; + }, + cppCLASS::component_t::documentation("energy_intervals").data() + ); + + object.def_property( + "_rmatrix_breit_wignerenergy_intervals", + [](const cppCLASS &self) -> decltype(auto) + { + return self._RMatrixBreitWignerenergyIntervals(); + }, + [](cppCLASS &self, const _t &value) + { + self._RMatrixBreitWignerenergyIntervals() = value; + }, + cppCLASS::component_t::documentation("_rmatrix_breit_wignerenergy_intervals").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/ResonanceParameters.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/ResonanceParameters.python.cpp new file mode 100644 index 000000000..dbac86c4e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/ResonanceParameters.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/ResonanceParameters.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::ResonanceParameters +void wrapResonanceParameters(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::ResonanceParameters; + + // create the Python object + py::class_ object( + module, "ResonanceParameters", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Table & + >(), + py::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 containers::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/ResonanceReaction.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/ResonanceReaction.python.cpp new file mode 100644 index 000000000..8fc453549 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/ResonanceReaction.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/ResonanceReaction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::ResonanceReaction +void wrapResonanceReaction(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::ResonanceReaction; + + // create the Python object + py::class_ object( + module, "ResonanceReaction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Link & + >(), + py::arg("label"), + py::arg("ejectile"), + py::arg("boundary_condition_value") = std::nullopt, + py::arg("eliminated") = std::nullopt, + py::arg("q") = std::nullopt, + py::arg("scattering_radius") = std::nullopt, + py::arg("hard_sphere_radius") = std::nullopt, + py::arg("link"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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 XMLName &value) + { + self.ejectile() = value; + }, + cppCLASS::component_t::documentation("ejectile").data() + ); + + // get/set boundaryConditionValue + object.def_property( + "boundary_condition_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.boundaryConditionValue(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.boundaryConditionValue() = value; + }, + cppCLASS::component_t::documentation("boundary_condition_value").data() + ); + + // get/set eliminated + object.def_property( + "eliminated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.eliminated().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.eliminated() = value; + }, + cppCLASS::component_t::documentation("eliminated").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() + ); + + // 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 link + 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/ResonanceReactions.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/ResonanceReactions.python.cpp new file mode 100644 index 000000000..ec60c243e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/ResonanceReactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/ResonanceReactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::ResonanceReactions +void wrapResonanceReactions(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::ResonanceReactions; + + // create the Python object + py::class_ object( + module, "ResonanceReactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/Resonances.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/Resonances.python.cpp new file mode 100644 index 000000000..6bc8fda93 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/Resonances.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/Resonances.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::Resonances +void wrapResonances(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::Resonances; + + // create the Python object + py::class_ object( + module, "Resonances", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const resonances::ScatteringRadius &, + const std::optional &, + const std::optional> &, + const std::optional> & + >(), + py::arg("href") = std::nullopt, + py::arg("scattering_radius"), + py::arg("hard_sphere_radius") = std::nullopt, + py::arg("resolved") = std::nullopt, + py::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 resonances::ScatteringRadius &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() + ); + + // 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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/ScatteringRadius.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/ScatteringRadius.python.cpp new file mode 100644 index 000000000..5340475ed --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/ScatteringRadius.python.cpp @@ -0,0 +1,105 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/ScatteringRadius.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::ScatteringRadius +void wrapScatteringRadius(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::ScatteringRadius; + using _t = std::variant< + containers::Constant1d, + containers::XYs1d, + containers::Regions1d + >; + + // create the Python object + py::class_ object( + module, "ScatteringRadius", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_constant1d_xys1dregions1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const containers::Constant1d &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const containers::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const containers::Regions1d &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + object.def_property( + "_constant1d_xys1dregions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._constant1dXYs1dregions1d(); + }, + [](cppCLASS &self, const _t &value) + { + self._constant1dXYs1dregions1d() = value; + }, + cppCLASS::component_t::documentation("_constant1d_xys1dregions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/SpinGroup.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/SpinGroup.python.cpp new file mode 100644 index 000000000..bd3cce6d2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/SpinGroup.python.cpp @@ -0,0 +1,182 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/SpinGroup.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::SpinGroup +void wrapSpinGroup(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::SpinGroup; + + // create the Python object + py::class_ object( + module, "SpinGroup", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Fraction32 &, + const std::optional &, + const resonances::Channels &, + const resonances::ResonanceParameters & + >(), + py::arg("label"), + py::arg("spin"), + py::arg("parity") = std::nullopt, + py::arg("channels"), + py::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 XMLName &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 Fraction32 &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().value(); + }, + [](cppCLASS &self, const Integer32 &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 resonances::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 resonances::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/SpinGroups.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/SpinGroups.python.cpp new file mode 100644 index 000000000..3e478ef84 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/SpinGroups.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/SpinGroups.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::SpinGroups +void wrapSpinGroups(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::SpinGroups; + + // create the Python object + py::class_ object( + module, "SpinGroups", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/TabulatedWidths.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/TabulatedWidths.python.cpp new file mode 100644 index 000000000..dff3e6a8e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/TabulatedWidths.python.cpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/TabulatedWidths.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::TabulatedWidths +void wrapTabulatedWidths(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::TabulatedWidths; + + // create the Python object + py::class_ object( + module, "TabulatedWidths", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const resonances::ResonanceReactions &, + const resonances::Ls & + >(), + py::arg("label"), + py::arg("approximation"), + py::arg("use_for_self_shielding_only") = std::nullopt, + py::arg("po_ps_database") = std::nullopt, + py::arg("scattering_radius") = std::nullopt, + py::arg("hard_sphere_radius") = std::nullopt, + py::arg("resonance_reactions"), + py::arg("ls"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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 XMLName &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().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.useForSelfShieldingOnly() = value; + }, + cppCLASS::component_t::documentation("use_for_self_shielding_only").data() + ); + + // get/set PoPs_database + object.def_property( + "po_ps_database", + [](const cppCLASS &self) -> decltype(auto) + { + return self.PoPs_database(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.PoPs_database() = value; + }, + cppCLASS::component_t::documentation("po_ps_database").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() + ); + + // get/set resonanceReactions + object.def_property( + "resonance_reactions", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReactions(); + }, + [](cppCLASS &self, const resonances::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 resonances::Ls &value) + { + self.Ls() = value; + }, + cppCLASS::component_t::documentation("ls").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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/Unresolved.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/Unresolved.python.cpp new file mode 100644 index 000000000..abe33e9fb --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/Unresolved.python.cpp @@ -0,0 +1,125 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/Unresolved.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::Unresolved +void wrapUnresolved(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::Unresolved; + using _t = std::variant< + resonances::TabulatedWidths + >; + + // create the Python object + py::class_ object( + module, "Unresolved", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Float64 &, + const Float64 &, + const XMLName &, + const _t & + >(), + py::arg("domain_min"), + py::arg("domain_max"), + py::arg("domain_unit"), + py::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 Float64 &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 Float64 &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 XMLName &value) + { + self.domainUnit() = value; + }, + cppCLASS::component_t::documentation("domain_unit").data() + ); + + object.def_property( + "tabulated_widths", + [](const cppCLASS &self) -> decltype(auto) + { + return self.tabulatedWidths(); + }, + [](cppCLASS &self, const resonances::TabulatedWidths &value) + { + self.tabulatedWidths() = value; + }, + cppCLASS::component_t::documentation("tabulated_widths").data() + ); + + object.def_property( + "_tabulated_widths", + [](const cppCLASS &self) -> decltype(auto) + { + return self._tabulatedWidths(); + }, + [](cppCLASS &self, const _t &value) + { + self._tabulatedWidths() = value; + }, + cppCLASS::component_t::documentation("_tabulated_widths").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/Width.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/Width.python.cpp new file mode 100644 index 000000000..41d12f68a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/Width.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/Width.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::Width +void wrapWidth(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::Width; + + // create the Python object + py::class_ object( + module, "Width", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const Float64 &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("resonance_reaction"), + py::arg("degrees_of_freedom"), + py::arg("constant1d") = std::nullopt, + py::arg("xys1d") = std::nullopt, + py::arg("regions1d") = std::nullopt, + 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::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 Float64 &value) + { + self.degreesOfFreedom() = value; + }, + cppCLASS::component_t::documentation("degrees_of_freedom").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/resonances/Widths.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/resonances/Widths.python.cpp new file mode 100644 index 000000000..f82b94041 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/resonances/Widths.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/resonances/Widths.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_resonances { + +// wrapper for resonances::Widths +void wrapWidths(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = resonances::Widths; + + // create the Python object + py::class_ object( + module, "Widths", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_resonances +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles.python.cpp new file mode 100644 index 000000000..b8c7aaafa --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles.python.cpp @@ -0,0 +1,77 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// styles declarations +namespace python_styles { + void wrapProjectileEnergyDomain(py::module &); + void wrapTemperature(py::module &); + void wrapEvaluated(py::module &); + void wrapCrossSectionReconstructed(py::module &); + void wrapAngularDistributionReconstructed(py::module &); + void wrapCoulombPlusNuclearElasticMuCutoff(py::module &); + void wrapHeated(py::module &); + void wrapAverageProductData(py::module &); + void wrapMonteCarlo_cdf(py::module &); + void wrapGriddedCrossSection(py::module &); + void wrapURR_probabilityTables(py::module &); + void wrapMultiGroup(py::module &); + void wrapTransportable(py::module &); + void wrapTransportables(py::module &); + void wrapFlux(py::module &); + void wrapInverseSpeed(py::module &); + void wrapHeatedMultiGroup(py::module &); + void wrapSnElasticUpScatter(py::module &); + void wrapStyles(py::module &); + void wrapSigmaZeros(py::module &); + void wrapBondarenko(py::module &); + void wrapMultiBand(py::module &); + void wrapEqualProbableBins(py::module &); + void wrapRealization(py::module &); +} // namespace python_styles + +// wrapper for styles +void wrapStyles(py::module &module) +{ + // create the styles submodule + py::module submodule = module.def_submodule( + "styles", + "test v2.0 styles" + ); + + // wrap styles components + python_styles::wrapProjectileEnergyDomain(submodule); + python_styles::wrapTemperature(submodule); + python_styles::wrapEvaluated(submodule); + python_styles::wrapCrossSectionReconstructed(submodule); + python_styles::wrapAngularDistributionReconstructed(submodule); + python_styles::wrapCoulombPlusNuclearElasticMuCutoff(submodule); + python_styles::wrapHeated(submodule); + python_styles::wrapAverageProductData(submodule); + python_styles::wrapMonteCarlo_cdf(submodule); + python_styles::wrapGriddedCrossSection(submodule); + python_styles::wrapURR_probabilityTables(submodule); + python_styles::wrapMultiGroup(submodule); + python_styles::wrapTransportable(submodule); + python_styles::wrapTransportables(submodule); + python_styles::wrapFlux(submodule); + python_styles::wrapInverseSpeed(submodule); + python_styles::wrapHeatedMultiGroup(submodule); + python_styles::wrapSnElasticUpScatter(submodule); + python_styles::wrapStyles(submodule); + python_styles::wrapSigmaZeros(submodule); + python_styles::wrapBondarenko(submodule); + python_styles::wrapMultiBand(submodule); + python_styles::wrapEqualProbableBins(submodule); + python_styles::wrapRealization(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/AngularDistributionReconstructed.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/AngularDistributionReconstructed.python.cpp new file mode 100644 index 000000000..909c1d6aa --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/AngularDistributionReconstructed.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/AngularDistributionReconstructed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::AngularDistributionReconstructed +void wrapAngularDistributionReconstructed(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::AngularDistributionReconstructed; + + // create the Python object + py::class_ object( + module, "AngularDistributionReconstructed", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("date"), + py::arg("label"), + py::arg("derived_from") = std::nullopt, + py::arg("temperature") = std::nullopt, + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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::optional &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/AverageProductData.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/AverageProductData.python.cpp new file mode 100644 index 000000000..2184595d1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/AverageProductData.python.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/AverageProductData.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::AverageProductData +void wrapAverageProductData(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::AverageProductData; + + // create the Python object + py::class_ object( + module, "AverageProductData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const std::optional &, + const styles::Temperature &, + const std::optional & + >(), + py::arg("date"), + py::arg("label"), + py::arg("derived_from") = std::nullopt, + py::arg("temperature"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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::optional &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set temperature + object.def_property( + "temperature", + [](const cppCLASS &self) -> decltype(auto) + { + return self.temperature(); + }, + [](cppCLASS &self, const styles::Temperature &value) + { + self.temperature() = value; + }, + cppCLASS::component_t::documentation("temperature").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/Bondarenko.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/Bondarenko.python.cpp new file mode 100644 index 000000000..4d0e14925 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/Bondarenko.python.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/Bondarenko.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::Bondarenko +void wrapBondarenko(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::Bondarenko; + + // create the Python object + py::class_ object( + module, "Bondarenko", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const styles::SigmaZeros &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("sigma_zeros"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set sigmaZeros + object.def_property( + "sigma_zeros", + [](const cppCLASS &self) -> decltype(auto) + { + return self.sigmaZeros(); + }, + [](cppCLASS &self, const styles::SigmaZeros &value) + { + self.sigmaZeros() = value; + }, + cppCLASS::component_t::documentation("sigma_zeros").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.python.cpp new file mode 100644 index 000000000..c204bed26 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::CoulombPlusNuclearElasticMuCutoff +void wrapCoulombPlusNuclearElasticMuCutoff(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::CoulombPlusNuclearElasticMuCutoff; + + // create the Python object + py::class_ object( + module, "CoulombPlusNuclearElasticMuCutoff", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const Float64 &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("mu_cutoff"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set muCutoff + object.def_property( + "mu_cutoff", + [](const cppCLASS &self) -> decltype(auto) + { + return self.muCutoff(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.muCutoff() = value; + }, + cppCLASS::component_t::documentation("mu_cutoff").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/CrossSectionReconstructed.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/CrossSectionReconstructed.python.cpp new file mode 100644 index 000000000..56bd1d728 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/CrossSectionReconstructed.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/CrossSectionReconstructed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::CrossSectionReconstructed +void wrapCrossSectionReconstructed(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::CrossSectionReconstructed; + + // create the Python object + py::class_ object( + module, "CrossSectionReconstructed", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("date"), + py::arg("label"), + py::arg("derived_from") = std::nullopt, + py::arg("temperature") = std::nullopt, + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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::optional &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").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 documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/EqualProbableBins.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/EqualProbableBins.python.cpp new file mode 100644 index 000000000..1630c9aef --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/EqualProbableBins.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/EqualProbableBins.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::EqualProbableBins +void wrapEqualProbableBins(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::EqualProbableBins; + + // create the Python object + py::class_ object( + module, "EqualProbableBins", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const Integer32 &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("number_of_bins"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set numberOfBins + object.def_property( + "number_of_bins", + [](const cppCLASS &self) -> decltype(auto) + { + return self.numberOfBins(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.numberOfBins() = value; + }, + cppCLASS::component_t::documentation("number_of_bins").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/Evaluated.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/Evaluated.python.cpp new file mode 100644 index 000000000..add8c97c0 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/Evaluated.python.cpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/Evaluated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::Evaluated +void wrapEvaluated(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::Evaluated; + + // create the Python object + py::class_ object( + module, "Evaluated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const std::optional &, + const XMLName &, + const XMLName &, + const styles::ProjectileEnergyDomain &, + const styles::Temperature &, + const documentation::Documentation & + >(), + py::arg("date"), + py::arg("label"), + py::arg("derived_from") = std::nullopt, + py::arg("library"), + py::arg("version"), + py::arg("projectile_energy_domain"), + py::arg("temperature"), + py::arg("documentation"), + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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::optional &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set library + object.def_property( + "library", + [](const cppCLASS &self) -> decltype(auto) + { + return self.library(); + }, + [](cppCLASS &self, const XMLName &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 XMLName &value) + { + self.version() = value; + }, + cppCLASS::component_t::documentation("version").data() + ); + + // get/set projectileEnergyDomain + object.def_property( + "projectile_energy_domain", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectileEnergyDomain(); + }, + [](cppCLASS &self, const styles::ProjectileEnergyDomain &value) + { + self.projectileEnergyDomain() = value; + }, + cppCLASS::component_t::documentation("projectile_energy_domain").data() + ); + + // get/set temperature + object.def_property( + "temperature", + [](const cppCLASS &self) -> decltype(auto) + { + return self.temperature(); + }, + [](cppCLASS &self, const styles::Temperature &value) + { + self.temperature() = value; + }, + cppCLASS::component_t::documentation("temperature").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const documentation::Documentation &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/Flux.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/Flux.python.cpp new file mode 100644 index 000000000..950d3a7df --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/Flux.python.cpp @@ -0,0 +1,120 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/Flux.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::Flux +void wrapFlux(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::Flux; + + // create the Python object + py::class_ object( + module, "Flux", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const containers::XYs2d & + >(), + py::arg("label"), + py::arg("xys2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const containers::XYs2d &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").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 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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/GriddedCrossSection.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/GriddedCrossSection.python.cpp new file mode 100644 index 000000000..0549e3a38 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/GriddedCrossSection.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/GriddedCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::GriddedCrossSection +void wrapGriddedCrossSection(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::GriddedCrossSection; + + // create the Python object + py::class_ object( + module, "GriddedCrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const containers::Grid &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("grid"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const containers::Grid &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/Heated.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/Heated.python.cpp new file mode 100644 index 000000000..2dbac80b3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/Heated.python.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/Heated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::Heated +void wrapHeated(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::Heated; + + // create the Python object + py::class_ object( + module, "Heated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const styles::Temperature &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("temperature"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set temperature + object.def_property( + "temperature", + [](const cppCLASS &self) -> decltype(auto) + { + return self.temperature(); + }, + [](cppCLASS &self, const styles::Temperature &value) + { + self.temperature() = value; + }, + cppCLASS::component_t::documentation("temperature").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/HeatedMultiGroup.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/HeatedMultiGroup.python.cpp new file mode 100644 index 000000000..7fa1791ea --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/HeatedMultiGroup.python.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/HeatedMultiGroup.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::HeatedMultiGroup +void wrapHeatedMultiGroup(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::HeatedMultiGroup; + + // create the Python object + py::class_ object( + module, "HeatedMultiGroup", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const styles::Transportables &, + const styles::Flux &, + const styles::InverseSpeed &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("transportables"), + py::arg("flux"), + py::arg("inverse_speed"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set transportables + object.def_property( + "transportables", + [](const cppCLASS &self) -> decltype(auto) + { + return self.transportables(); + }, + [](cppCLASS &self, const styles::Transportables &value) + { + self.transportables() = value; + }, + cppCLASS::component_t::documentation("transportables").data() + ); + + // get/set flux + object.def_property( + "flux", + [](const cppCLASS &self) -> decltype(auto) + { + return self.flux(); + }, + [](cppCLASS &self, const styles::Flux &value) + { + self.flux() = value; + }, + cppCLASS::component_t::documentation("flux").data() + ); + + // get/set inverseSpeed + object.def_property( + "inverse_speed", + [](const cppCLASS &self) -> decltype(auto) + { + return self.inverseSpeed(); + }, + [](cppCLASS &self, const styles::InverseSpeed &value) + { + self.inverseSpeed() = value; + }, + cppCLASS::component_t::documentation("inverse_speed").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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 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 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 gridded1d + object.def_property( + "gridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.gridded1d() = value; + }, + cppCLASS::component_t::documentation("gridded1d").data() + ); + + // shortcut: get/set transportable + object.def_property( + "transportable", + [](const cppCLASS &self) -> decltype(auto) + { + return self.transportable(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.transportable() = value; + }, + cppCLASS::component_t::documentation("transportable").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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/InverseSpeed.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/InverseSpeed.python.cpp new file mode 100644 index 000000000..85fae9748 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/InverseSpeed.python.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/InverseSpeed.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::InverseSpeed +void wrapInverseSpeed(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::InverseSpeed; + + // create the Python object + py::class_ object( + module, "InverseSpeed", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const containers::Gridded1d & + >(), + py::arg("label") = std::nullopt, + py::arg("gridded1d"), + 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 gridded1d + object.def_property( + "gridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded1d(); + }, + [](cppCLASS &self, const containers::Gridded1d &value) + { + self.gridded1d() = value; + }, + cppCLASS::component_t::documentation("gridded1d").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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/MonteCarlo_cdf.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/MonteCarlo_cdf.python.cpp new file mode 100644 index 000000000..1a6d225c1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/MonteCarlo_cdf.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/MonteCarlo_cdf.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::MonteCarlo_cdf +void wrapMonteCarlo_cdf(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::MonteCarlo_cdf; + + // create the Python object + py::class_ object( + module, "MonteCarlo_cdf", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/MultiBand.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/MultiBand.python.cpp new file mode 100644 index 000000000..8ef7387cb --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/MultiBand.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/MultiBand.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::MultiBand +void wrapMultiBand(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::MultiBand; + + // create the Python object + py::class_ object( + module, "MultiBand", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const Integer32 &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("number_of_bands"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set numberOfBands + object.def_property( + "number_of_bands", + [](const cppCLASS &self) -> decltype(auto) + { + return self.numberOfBands(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.numberOfBands() = value; + }, + cppCLASS::component_t::documentation("number_of_bands").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/MultiGroup.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/MultiGroup.python.cpp new file mode 100644 index 000000000..4f22bdcdd --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/MultiGroup.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/MultiGroup.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::MultiGroup +void wrapMultiGroup(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::MultiGroup; + + // create the Python object + py::class_ object( + module, "MultiGroup", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const containers::Grid & + >(), + py::arg("label"), + py::arg("grid"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const containers::Grid &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/ProjectileEnergyDomain.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/ProjectileEnergyDomain.python.cpp new file mode 100644 index 000000000..d848a7373 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/ProjectileEnergyDomain.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/ProjectileEnergyDomain.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::ProjectileEnergyDomain +void wrapProjectileEnergyDomain(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::ProjectileEnergyDomain; + + // create the Python object + py::class_ object( + module, "ProjectileEnergyDomain", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const Float64 &, + const Float64 &, + const XMLName & + >(), + py::arg("label") = std::nullopt, + py::arg("max"), + py::arg("min"), + py::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::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set max + object.def_property( + "max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.max(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.max() = value; + }, + cppCLASS::component_t::documentation("max").data() + ); + + // get/set min + object.def_property( + "min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.min(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.min() = value; + }, + cppCLASS::component_t::documentation("min").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/Realization.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/Realization.python.cpp new file mode 100644 index 000000000..fd9eb2deb --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/Realization.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/Realization.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::Realization +void wrapRealization(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::Realization; + + // create the Python object + py::class_ object( + module, "Realization", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/SigmaZeros.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/SigmaZeros.python.cpp new file mode 100644 index 000000000..19384afce --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/SigmaZeros.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/SigmaZeros.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::SigmaZeros +void wrapSigmaZeros(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::SigmaZeros; + + // create the Python object + py::class_ object( + module, "SigmaZeros", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const containers::Values & + >(), + py::arg("label") = std::nullopt, + py::arg("values"), + 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 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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/SnElasticUpScatter.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/SnElasticUpScatter.python.cpp new file mode 100644 index 000000000..818d36bc9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/SnElasticUpScatter.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/SnElasticUpScatter.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::SnElasticUpScatter +void wrapSnElasticUpScatter(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::SnElasticUpScatter; + + // create the Python object + py::class_ object( + module, "SnElasticUpScatter", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("upper_calculated_group") = std::nullopt, + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set upperCalculatedGroup + object.def_property( + "upper_calculated_group", + [](const cppCLASS &self) -> decltype(auto) + { + return self.upperCalculatedGroup(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.upperCalculatedGroup() = value; + }, + cppCLASS::component_t::documentation("upper_calculated_group").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/Styles.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/Styles.python.cpp new file mode 100644 index 000000000..2f88a98be --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/Styles.python.cpp @@ -0,0 +1,222 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/Styles.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::Styles +void wrapStyles(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::Styles; + + // create the Python object + py::class_ object( + module, "Styles", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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> & + >(), + py::arg("evaluated") = std::nullopt, + py::arg("cross_section_reconstructed") = std::nullopt, + py::arg("angular_distribution_reconstructed") = std::nullopt, + py::arg("coulomb_plus_nuclear_elastic_mu_cutoff") = std::nullopt, + py::arg("heated") = std::nullopt, + py::arg("average_product_data") = std::nullopt, + py::arg("monte_carlo_cdf") = std::nullopt, + py::arg("gridded_cross_section") = std::nullopt, + py::arg("urr_probability_tables") = std::nullopt, + py::arg("heated_multi_group") = std::nullopt, + py::arg("sn_elastic_up_scatter") = 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 std::optional> &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() + ); + + // get/set angularDistributionReconstructed + object.def_property( + "angular_distribution_reconstructed", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angularDistributionReconstructed(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.angularDistributionReconstructed() = value; + }, + cppCLASS::component_t::documentation("angular_distribution_reconstructed").data() + ); + + // get/set CoulombPlusNuclearElasticMuCutoff + object.def_property( + "coulomb_plus_nuclear_elastic_mu_cutoff", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElasticMuCutoff(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.CoulombPlusNuclearElasticMuCutoff() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic_mu_cutoff").data() + ); + + // get/set heated + object.def_property( + "heated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.heated(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.heated() = value; + }, + cppCLASS::component_t::documentation("heated").data() + ); + + // get/set averageProductData + object.def_property( + "average_product_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.averageProductData(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.averageProductData() = value; + }, + cppCLASS::component_t::documentation("average_product_data").data() + ); + + // get/set MonteCarlo_cdf + object.def_property( + "monte_carlo_cdf", + [](const cppCLASS &self) -> decltype(auto) + { + return self.MonteCarlo_cdf(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.MonteCarlo_cdf() = value; + }, + cppCLASS::component_t::documentation("monte_carlo_cdf").data() + ); + + // get/set griddedCrossSection + object.def_property( + "gridded_cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.griddedCrossSection(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.griddedCrossSection() = value; + }, + cppCLASS::component_t::documentation("gridded_cross_section").data() + ); + + // get/set URR_probabilityTables + object.def_property( + "urr_probability_tables", + [](const cppCLASS &self) -> decltype(auto) + { + return self.URR_probabilityTables(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.URR_probabilityTables() = value; + }, + cppCLASS::component_t::documentation("urr_probability_tables").data() + ); + + // get/set heatedMultiGroup + object.def_property( + "heated_multi_group", + [](const cppCLASS &self) -> decltype(auto) + { + return self.heatedMultiGroup(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.heatedMultiGroup() = value; + }, + cppCLASS::component_t::documentation("heated_multi_group").data() + ); + + // get/set SnElasticUpScatter + object.def_property( + "sn_elastic_up_scatter", + [](const cppCLASS &self) -> decltype(auto) + { + return self.SnElasticUpScatter(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.SnElasticUpScatter() = value; + }, + cppCLASS::component_t::documentation("sn_elastic_up_scatter").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/Temperature.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/Temperature.python.cpp new file mode 100644 index 000000000..7bbf2a61d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/Temperature.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/Temperature.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::Temperature +void wrapTemperature(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::Temperature; + + // create the Python object + py::class_ object( + module, "Temperature", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const Float64 &, + const XMLName &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("value"), + py::arg("unit"), + py::arg("documentation") = std::nullopt, + py::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 value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &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 XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/Transportable.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/Transportable.python.cpp new file mode 100644 index 000000000..d3bb4fb4f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/Transportable.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/Transportable.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::Transportable +void wrapTransportable(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::Transportable; + + // create the Python object + py::class_ object( + module, "Transportable", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const styles::MultiGroup & + >(), + py::arg("conserve") = std::nullopt, + py::arg("label"), + py::arg("multi_group"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set conserve + object.def_property( + "conserve", + [](const cppCLASS &self) -> decltype(auto) + { + return self.conserve().value(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.conserve() = value; + }, + cppCLASS::component_t::documentation("conserve").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set multiGroup + object.def_property( + "multi_group", + [](const cppCLASS &self) -> decltype(auto) + { + return self.multiGroup(); + }, + [](cppCLASS &self, const styles::MultiGroup &value) + { + self.multiGroup() = value; + }, + cppCLASS::component_t::documentation("multi_group").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_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/Transportables.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/Transportables.python.cpp new file mode 100644 index 000000000..077a8f278 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/Transportables.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/Transportables.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::Transportables +void wrapTransportables(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::Transportables; + + // create the Python object + py::class_ object( + module, "Transportables", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::vector & + >(), + py::arg("label") = std::nullopt, + py::arg("transportable"), + 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 transportable + object.def_property( + "transportable", + [](const cppCLASS &self) -> decltype(auto) + { + return self.transportable(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.transportable() = value; + }, + cppCLASS::component_t::documentation("transportable").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/styles/URR_probabilityTables.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/styles/URR_probabilityTables.python.cpp new file mode 100644 index 000000000..837684299 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/styles/URR_probabilityTables.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/styles/URR_probabilityTables.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_styles { + +// wrapper for styles::URR_probabilityTables +void wrapURR_probabilityTables(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = styles::URR_probabilityTables; + + // create the Python object + py::class_ object( + module, "URR_probabilityTables", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const XMLName &, + const XMLName &, + const std::optional & + >(), + py::arg("date"), + py::arg("derived_from"), + py::arg("label"), + py::arg("documentation") = std::nullopt, + 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::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_styles +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport.python.cpp new file mode 100644 index 000000000..5ab1addff --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport.python.cpp @@ -0,0 +1,145 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// transport declarations +namespace python_transport { + void wrapBranching1d(py::module &); + void wrapReference(py::module &); + void wrapMultiplicity(py::module &); + void wrapIsotropic2d(py::module &); + void wrapRecoil(py::module &); + void wrapAngularTwoBody(py::module &); + void wrapForward(py::module &); + void wrapAngular_uncorrelated(py::module &); + void wrapU(py::module &); + void wrapG(py::module &); + void wrapTheta(py::module &); + void wrapGeneralEvaporation(py::module &); + void wrapDiscreteGamma(py::module &); + void wrapPrimaryGamma(py::module &); + void wrapNBodyPhaseSpace(py::module &); + void wrapEvaporation(py::module &); + void wrapWeighted(py::module &); + void wrapWeightedFunctionals(py::module &); + void wrapEnergy_uncorrelated(py::module &); + void wrapUncorrelated(py::module &); + void wrapAngularEnergy(py::module &); + void wrapEnergyAngular(py::module &); + void wrapF(py::module &); + void wrapR(py::module &); + void wrapA(py::module &); + void wrapKalbachMann(py::module &); + void wrapBranching3d(py::module &); + void wrapUnspecified(py::module &); + void wrapMultiGroup3d(py::module &); + void wrapDistribution(py::module &); + void wrapResonancesLink(py::module &); + void wrapResolvedRegion(py::module &); + void wrapUnresolvedRegion(py::module &); + void wrapFastRegion(py::module &); + void wrapBackground(py::module &); + void wrapResonancesWithBackground(py::module &); + void wrapURR_probabilityTables1d(py::module &); + void wrapCrossSection(py::module &); + void wrapOutputChannel(py::module &); + void wrapDoubleDifferentialCrossSection(py::module &); + void wrapReaction(py::module &); + void wrapReactions(py::module &); + void wrapOrphanProduct(py::module &); + void wrapOrphanProducts(py::module &); + void wrapAdd(py::module &); + void wrapSummands(py::module &); + void wrapCrossSectionSum(py::module &); + void wrapCrossSectionSums(py::module &); + void wrapMultiplicitySum(py::module &); + void wrapMultiplicitySums(py::module &); + void wrapSums(py::module &); + void wrapProduction(py::module &); + void wrapProductions(py::module &); + void wrapIncompleteReactions(py::module &); + void wrapReactionSuite(py::module &); + void wrapCoherentPhoton(py::module &); + void wrapIncoherentPhoton(py::module &); + void wrapPhotonEmissionProbabilities(py::module &); +} // namespace python_transport + +// wrapper for transport +void wrapTransport(py::module &module) +{ + // create the transport submodule + py::module submodule = module.def_submodule( + "transport", + "test v2.0 transport" + ); + + // wrap transport components + python_transport::wrapBranching1d(submodule); + python_transport::wrapReference(submodule); + python_transport::wrapMultiplicity(submodule); + python_transport::wrapIsotropic2d(submodule); + python_transport::wrapRecoil(submodule); + python_transport::wrapAngularTwoBody(submodule); + python_transport::wrapForward(submodule); + python_transport::wrapAngular_uncorrelated(submodule); + python_transport::wrapU(submodule); + python_transport::wrapG(submodule); + python_transport::wrapTheta(submodule); + python_transport::wrapGeneralEvaporation(submodule); + python_transport::wrapDiscreteGamma(submodule); + python_transport::wrapPrimaryGamma(submodule); + python_transport::wrapNBodyPhaseSpace(submodule); + python_transport::wrapEvaporation(submodule); + python_transport::wrapWeighted(submodule); + python_transport::wrapWeightedFunctionals(submodule); + python_transport::wrapEnergy_uncorrelated(submodule); + python_transport::wrapUncorrelated(submodule); + python_transport::wrapAngularEnergy(submodule); + python_transport::wrapEnergyAngular(submodule); + python_transport::wrapF(submodule); + python_transport::wrapR(submodule); + python_transport::wrapA(submodule); + python_transport::wrapKalbachMann(submodule); + python_transport::wrapBranching3d(submodule); + python_transport::wrapUnspecified(submodule); + python_transport::wrapMultiGroup3d(submodule); + python_transport::wrapDistribution(submodule); + python_transport::wrapResonancesLink(submodule); + python_transport::wrapResolvedRegion(submodule); + python_transport::wrapUnresolvedRegion(submodule); + python_transport::wrapFastRegion(submodule); + python_transport::wrapBackground(submodule); + python_transport::wrapResonancesWithBackground(submodule); + python_transport::wrapURR_probabilityTables1d(submodule); + python_transport::wrapCrossSection(submodule); + python_transport::wrapOutputChannel(submodule); + python_transport::wrapDoubleDifferentialCrossSection(submodule); + python_transport::wrapReaction(submodule); + python_transport::wrapReactions(submodule); + python_transport::wrapOrphanProduct(submodule); + python_transport::wrapOrphanProducts(submodule); + python_transport::wrapAdd(submodule); + python_transport::wrapSummands(submodule); + python_transport::wrapCrossSectionSum(submodule); + python_transport::wrapCrossSectionSums(submodule); + python_transport::wrapMultiplicitySum(submodule); + python_transport::wrapMultiplicitySums(submodule); + python_transport::wrapSums(submodule); + python_transport::wrapProduction(submodule); + python_transport::wrapProductions(submodule); + python_transport::wrapIncompleteReactions(submodule); + python_transport::wrapReactionSuite(submodule); + python_transport::wrapCoherentPhoton(submodule); + python_transport::wrapIncoherentPhoton(submodule); + python_transport::wrapPhotonEmissionProbabilities(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/A.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/A.python.cpp new file mode 100644 index 000000000..d7c6dc69f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/A.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/A.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::A +void wrapA(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::A; + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // create the Python object + py::class_ object( + module, "A", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_xys2dregions2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const containers::XYs2d &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + object.def_property( + "regions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions2d(); + }, + [](cppCLASS &self, const containers::Regions2d &value) + { + self.regions2d() = value; + }, + cppCLASS::component_t::documentation("regions2d").data() + ); + + object.def_property( + "_xys2dregions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs2dregions2d(); + }, + [](cppCLASS &self, const _t &value) + { + self._XYs2dregions2d() = value; + }, + cppCLASS::component_t::documentation("_xys2dregions2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Add.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Add.python.cpp new file mode 100644 index 000000000..9bb0f9ff1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Add.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Add.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Add +void wrapAdd(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Add; + + // create the Python object + py::class_ object( + module, "Add", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("href") = 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/AngularEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/AngularEnergy.python.cpp new file mode 100644 index 000000000..7e9d80248 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/AngularEnergy.python.cpp @@ -0,0 +1,136 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/AngularEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::AngularEnergy +void wrapAngularEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::AngularEnergy; + + // create the Python object + py::class_ object( + module, "AngularEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const containers::XYs3d & + >(), + py::arg("label"), + py::arg("product_frame"), + py::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 XMLName &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 XMLName &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 containers::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() + ); + + // 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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/AngularTwoBody.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/AngularTwoBody.python.cpp new file mode 100644 index 000000000..daa86f898 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/AngularTwoBody.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/AngularTwoBody.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::AngularTwoBody +void wrapAngularTwoBody(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::AngularTwoBody; + + // create the Python object + py::class_ object( + module, "AngularTwoBody", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("product_frame"), + py::arg("xys2d") = std::nullopt, + py::arg("regions2d") = std::nullopt, + py::arg("isotropic2d") = std::nullopt, + py::arg("recoil") = 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 productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const XMLName &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 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Angular_uncorrelated.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Angular_uncorrelated.python.cpp new file mode 100644 index 000000000..70103656c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Angular_uncorrelated.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Angular_uncorrelated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Angular_uncorrelated +void wrapAngular_uncorrelated(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Angular_uncorrelated; + + // create the Python object + py::class_ object( + module, "Angular_uncorrelated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("xys2d") = std::nullopt, + py::arg("isotropic2d") = std::nullopt, + py::arg("forward") = std::nullopt, + 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::optional &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").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 forward + object.def_property( + "forward", + [](const cppCLASS &self) -> decltype(auto) + { + return self.forward(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.forward() = value; + }, + cppCLASS::component_t::documentation("forward").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Background.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Background.python.cpp new file mode 100644 index 000000000..d9a676167 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Background.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Background.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Background +void wrapBackground(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Background; + + // create the Python object + py::class_ object( + module, "Background", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("resolved_region") = std::nullopt, + py::arg("unresolved_region") = std::nullopt, + py::arg("fast_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 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() + ); + + // get/set fastRegion + object.def_property( + "fast_region", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fastRegion(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.fastRegion() = value; + }, + cppCLASS::component_t::documentation("fast_region").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Branching1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Branching1d.python.cpp new file mode 100644 index 000000000..54d68f18b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Branching1d.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Branching1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Branching1d +void wrapBranching1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Branching1d; + + // create the Python object + py::class_ object( + module, "Branching1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName & + >(), + py::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 XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Branching3d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Branching3d.python.cpp new file mode 100644 index 000000000..47d562cc5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Branching3d.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Branching3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Branching3d +void wrapBranching3d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Branching3d; + + // create the Python object + py::class_ object( + module, "Branching3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName & + >(), + py::arg("label"), + py::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 XMLName &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 XMLName &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/CoherentPhoton.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/CoherentPhoton.python.cpp new file mode 100644 index 000000000..4d4d98414 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/CoherentPhoton.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/CoherentPhoton.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::CoherentPhoton +void wrapCoherentPhoton(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::CoherentPhoton; + + // create the Python object + py::class_ object( + module, "CoherentPhoton", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/CrossSection.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/CrossSection.python.cpp new file mode 100644 index 000000000..9d5058dfa --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/CrossSection.python.cpp @@ -0,0 +1,205 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/CrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::CrossSection +void wrapCrossSection(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::CrossSection; + using _t = std::variant< + containers::XYs1d, + containers::Regions1d, + transport::ResonancesWithBackground, + cpTransport::CoulombPlusNuclearElastic, + tsl::ThermalNeutronScatteringLaw1d, + transport::Reference, + containers::Gridded1d, + containers::Ys1d, + transport::URR_probabilityTables1d + >; + + // create the Python object + py::class_ object( + module, "CrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const _t & + >(), + py::arg("label") = std::nullopt, + py::arg("_xys1dregions1dresonances_with_background_coulomb_plus_nuclear_elasticthermal_neutron_scattering_law1dreferencegridded1d_ys1d_urr_probability_tables1d"), + 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() + ); + + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const containers::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const containers::Regions1d &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + object.def_property( + "resonances_with_background", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonancesWithBackground(); + }, + [](cppCLASS &self, const transport::ResonancesWithBackground &value) + { + self.resonancesWithBackground() = value; + }, + cppCLASS::component_t::documentation("resonances_with_background").data() + ); + + object.def_property( + "coulomb_plus_nuclear_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElastic(); + }, + [](cppCLASS &self, const cpTransport::CoulombPlusNuclearElastic &value) + { + self.CoulombPlusNuclearElastic() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic").data() + ); + + object.def_property( + "thermal_neutron_scattering_law1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw1d(); + }, + [](cppCLASS &self, const tsl::ThermalNeutronScatteringLaw1d &value) + { + self.thermalNeutronScatteringLaw1d() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law1d").data() + ); + + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const transport::Reference &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + object.def_property( + "gridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded1d(); + }, + [](cppCLASS &self, const containers::Gridded1d &value) + { + self.gridded1d() = value; + }, + cppCLASS::component_t::documentation("gridded1d").data() + ); + + object.def_property( + "ys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Ys1d(); + }, + [](cppCLASS &self, const containers::Ys1d &value) + { + self.Ys1d() = value; + }, + cppCLASS::component_t::documentation("ys1d").data() + ); + + object.def_property( + "urr_probability_tables1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.URR_probabilityTables1d(); + }, + [](cppCLASS &self, const transport::URR_probabilityTables1d &value) + { + self.URR_probabilityTables1d() = value; + }, + cppCLASS::component_t::documentation("urr_probability_tables1d").data() + ); + + object.def_property( + "_xys1dregions1dresonances_with_background_coulomb_plus_nuclear_elasticthermal_neutron_scattering_law1dreferencegridded1d_ys1d_urr_probability_tables1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d(); + }, + [](cppCLASS &self, const _t &value) + { + self._XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d() = value; + }, + cppCLASS::component_t::documentation("_xys1dregions1dresonances_with_background_coulomb_plus_nuclear_elasticthermal_neutron_scattering_law1dreferencegridded1d_ys1d_urr_probability_tables1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/CrossSectionSum.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/CrossSectionSum.python.cpp new file mode 100644 index 000000000..145cd96e4 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/CrossSectionSum.python.cpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/CrossSectionSum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::CrossSectionSum +void wrapCrossSectionSum(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::CrossSectionSum; + + // create the Python object + py::class_ object( + module, "CrossSectionSum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const common::Q &, + const transport::CrossSection &, + const transport::Summands & + >(), + py::arg("endf_mt") = std::nullopt, + py::arg("label"), + py::arg("q"), + py::arg("cross_section"), + py::arg("summands"), + 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 std::optional &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const common::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 transport::CrossSection &value) + { + self.crossSection() = value; + }, + cppCLASS::component_t::documentation("cross_section").data() + ); + + // get/set summands + object.def_property( + "summands", + [](const cppCLASS &self) -> decltype(auto) + { + return self.summands(); + }, + [](cppCLASS &self, const transport::Summands &value) + { + self.summands() = value; + }, + cppCLASS::component_t::documentation("summands").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 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 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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/CrossSectionSums.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/CrossSectionSums.python.cpp new file mode 100644 index 000000000..ae7afe0f2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/CrossSectionSums.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/CrossSectionSums.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::CrossSectionSums +void wrapCrossSectionSums(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::CrossSectionSums; + + // create the Python object + py::class_ object( + module, "CrossSectionSums", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::arg("cross_section_sum") = std::nullopt, + 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::optional> &value) + { + self.crossSectionSum() = value; + }, + cppCLASS::component_t::documentation("cross_section_sum").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/DiscreteGamma.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/DiscreteGamma.python.cpp new file mode 100644 index 000000000..2f02ce8f3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/DiscreteGamma.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/DiscreteGamma.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::DiscreteGamma +void wrapDiscreteGamma(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::DiscreteGamma; + + // create the Python object + py::class_ object( + module, "DiscreteGamma", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("domain_max") = std::nullopt, + py::arg("domain_min") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("axes") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 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 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Distribution.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Distribution.python.cpp new file mode 100644 index 000000000..382d910d1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Distribution.python.cpp @@ -0,0 +1,287 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Distribution.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Distribution +void wrapDistribution(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Distribution; + using _t = std::variant< + transport::AngularTwoBody, + transport::Uncorrelated, + transport::AngularEnergy, + transport::EnergyAngular, + transport::KalbachMann, + transport::Reference, + transport::Branching3d, + cpTransport::CoulombPlusNuclearElastic, + tsl::ThermalNeutronScatteringLaw, + atomic::CoherentPhotonScattering, + atomic::IncoherentPhotonScattering, + transport::Unspecified, + transport::MultiGroup3d, + processed::AngularEnergyMC, + processed::EnergyAngularMC, + containers::XYs2d + >; + + // create the Python object + py::class_ object( + module, "Distribution", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_angular_two_bodyuncorrelatedangular_energyenergy_angular_kalbach_mannreferencebranching3d_coulomb_plus_nuclear_elasticthermal_neutron_scattering_lawcoherent_photon_scatteringincoherent_photon_scatteringunspecifiedmulti_group3dangular_energy_mcenergy_angular_mcxys2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "angular_two_body", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angularTwoBody(); + }, + [](cppCLASS &self, const transport::AngularTwoBody &value) + { + self.angularTwoBody() = value; + }, + cppCLASS::component_t::documentation("angular_two_body").data() + ); + + object.def_property( + "uncorrelated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncorrelated(); + }, + [](cppCLASS &self, const transport::Uncorrelated &value) + { + self.uncorrelated() = value; + }, + cppCLASS::component_t::documentation("uncorrelated").data() + ); + + object.def_property( + "angular_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angularEnergy(); + }, + [](cppCLASS &self, const transport::AngularEnergy &value) + { + self.angularEnergy() = value; + }, + cppCLASS::component_t::documentation("angular_energy").data() + ); + + object.def_property( + "energy_angular", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energyAngular(); + }, + [](cppCLASS &self, const transport::EnergyAngular &value) + { + self.energyAngular() = value; + }, + cppCLASS::component_t::documentation("energy_angular").data() + ); + + object.def_property( + "kalbach_mann", + [](const cppCLASS &self) -> decltype(auto) + { + return self.KalbachMann(); + }, + [](cppCLASS &self, const transport::KalbachMann &value) + { + self.KalbachMann() = value; + }, + cppCLASS::component_t::documentation("kalbach_mann").data() + ); + + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const transport::Reference &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + object.def_property( + "branching3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching3d(); + }, + [](cppCLASS &self, const transport::Branching3d &value) + { + self.branching3d() = value; + }, + cppCLASS::component_t::documentation("branching3d").data() + ); + + object.def_property( + "coulomb_plus_nuclear_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElastic(); + }, + [](cppCLASS &self, const cpTransport::CoulombPlusNuclearElastic &value) + { + self.CoulombPlusNuclearElastic() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic").data() + ); + + object.def_property( + "thermal_neutron_scattering_law", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw(); + }, + [](cppCLASS &self, const tsl::ThermalNeutronScatteringLaw &value) + { + self.thermalNeutronScatteringLaw() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law").data() + ); + + object.def_property( + "coherent_photon_scattering", + [](const cppCLASS &self) -> decltype(auto) + { + return self.coherentPhotonScattering(); + }, + [](cppCLASS &self, const atomic::CoherentPhotonScattering &value) + { + self.coherentPhotonScattering() = value; + }, + cppCLASS::component_t::documentation("coherent_photon_scattering").data() + ); + + object.def_property( + "incoherent_photon_scattering", + [](const cppCLASS &self) -> decltype(auto) + { + return self.incoherentPhotonScattering(); + }, + [](cppCLASS &self, const atomic::IncoherentPhotonScattering &value) + { + self.incoherentPhotonScattering() = value; + }, + cppCLASS::component_t::documentation("incoherent_photon_scattering").data() + ); + + object.def_property( + "unspecified", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unspecified(); + }, + [](cppCLASS &self, const transport::Unspecified &value) + { + self.unspecified() = value; + }, + cppCLASS::component_t::documentation("unspecified").data() + ); + + object.def_property( + "multi_group3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.multiGroup3d(); + }, + [](cppCLASS &self, const transport::MultiGroup3d &value) + { + self.multiGroup3d() = value; + }, + cppCLASS::component_t::documentation("multi_group3d").data() + ); + + object.def_property( + "angular_energy_mc", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angularEnergyMC(); + }, + [](cppCLASS &self, const processed::AngularEnergyMC &value) + { + self.angularEnergyMC() = value; + }, + cppCLASS::component_t::documentation("angular_energy_mc").data() + ); + + object.def_property( + "energy_angular_mc", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energyAngularMC(); + }, + [](cppCLASS &self, const processed::EnergyAngularMC &value) + { + self.energyAngularMC() = value; + }, + cppCLASS::component_t::documentation("energy_angular_mc").data() + ); + + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const containers::XYs2d &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + object.def_property( + "_angular_two_bodyuncorrelatedangular_energyenergy_angular_kalbach_mannreferencebranching3d_coulomb_plus_nuclear_elasticthermal_neutron_scattering_lawcoherent_photon_scatteringincoherent_photon_scatteringunspecifiedmulti_group3dangular_energy_mcenergy_angular_mcxys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d(); + }, + [](cppCLASS &self, const _t &value) + { + self._angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d() = value; + }, + cppCLASS::component_t::documentation("_angular_two_bodyuncorrelatedangular_energyenergy_angular_kalbach_mannreferencebranching3d_coulomb_plus_nuclear_elasticthermal_neutron_scattering_lawcoherent_photon_scatteringincoherent_photon_scatteringunspecifiedmulti_group3dangular_energy_mcenergy_angular_mcxys2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/DoubleDifferentialCrossSection.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/DoubleDifferentialCrossSection.python.cpp new file mode 100644 index 000000000..d1748bf51 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/DoubleDifferentialCrossSection.python.cpp @@ -0,0 +1,190 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/DoubleDifferentialCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::DoubleDifferentialCrossSection +void wrapDoubleDifferentialCrossSection(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::DoubleDifferentialCrossSection; + + // create the Python object + py::class_ object( + module, "DoubleDifferentialCrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("regions3d") = std::nullopt, + py::arg("xys3d") = std::nullopt, + py::arg("coulomb_plus_nuclear_elastic") = std::nullopt, + py::arg("reference") = std::nullopt, + py::arg("coherent_photon_scattering") = std::nullopt, + py::arg("incoherent_photon_scattering") = std::nullopt, + py::arg("thermal_neutron_scattering_law_coherent_elastic") = std::nullopt, + py::arg("thermal_neutron_scattering_law_incoherent_elastic") = std::nullopt, + py::arg("thermal_neutron_scattering_law_incoherent_inelastic") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set regions3d + object.def_property( + "regions3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions3d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions3d() = value; + }, + cppCLASS::component_t::documentation("regions3d").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() + ); + + // 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 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 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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/EnergyAngular.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/EnergyAngular.python.cpp new file mode 100644 index 000000000..ea2da87a2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/EnergyAngular.python.cpp @@ -0,0 +1,136 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/EnergyAngular.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::EnergyAngular +void wrapEnergyAngular(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::EnergyAngular; + + // create the Python object + py::class_ object( + module, "EnergyAngular", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const containers::XYs3d & + >(), + py::arg("label") = std::nullopt, + py::arg("product_frame"), + py::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::optional &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 XMLName &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 containers::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() + ); + + // 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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Energy_uncorrelated.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Energy_uncorrelated.python.cpp new file mode 100644 index 000000000..6d4059644 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Energy_uncorrelated.python.cpp @@ -0,0 +1,222 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Energy_uncorrelated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Energy_uncorrelated +void wrapEnergy_uncorrelated(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Energy_uncorrelated; + + // create the Python object + py::class_ object( + module, "Energy_uncorrelated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::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 & + >(), + py::arg("xys2d") = std::nullopt, + py::arg("regions2d") = std::nullopt, + py::arg("general_evaporation") = std::nullopt, + py::arg("discrete_gamma") = std::nullopt, + py::arg("primary_gamma") = std::nullopt, + py::arg("nbody_phase_space") = std::nullopt, + py::arg("evaporation") = std::nullopt, + py::arg("weighted_functionals") = std::nullopt, + py::arg("simple_maxwellian_fission") = std::nullopt, + py::arg("watt") = std::nullopt, + py::arg("madland_nix") = std::nullopt, + 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::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 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 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 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 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 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 Watt + object.def_property( + "watt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Watt(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.Watt() = value; + }, + cppCLASS::component_t::documentation("watt").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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Evaporation.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Evaporation.python.cpp new file mode 100644 index 000000000..a18f602d0 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Evaporation.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Evaporation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Evaporation +void wrapEvaporation(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Evaporation; + + // create the Python object + py::class_ object( + module, "Evaporation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("u") = std::nullopt, + py::arg("theta") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set U + object.def_property( + "u", + [](const cppCLASS &self) -> decltype(auto) + { + return self.U(); + }, + [](cppCLASS &self, const std::optional &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 std::optional &value) + { + self.theta() = value; + }, + cppCLASS::component_t::documentation("theta").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/F.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/F.python.cpp new file mode 100644 index 000000000..0841d09cd --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/F.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/F.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::F +void wrapF(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::F; + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // create the Python object + py::class_ object( + module, "F", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_xys2dregions2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const containers::XYs2d &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + object.def_property( + "regions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions2d(); + }, + [](cppCLASS &self, const containers::Regions2d &value) + { + self.regions2d() = value; + }, + cppCLASS::component_t::documentation("regions2d").data() + ); + + object.def_property( + "_xys2dregions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs2dregions2d(); + }, + [](cppCLASS &self, const _t &value) + { + self._XYs2dregions2d() = value; + }, + cppCLASS::component_t::documentation("_xys2dregions2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/FastRegion.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/FastRegion.python.cpp new file mode 100644 index 000000000..727970d62 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/FastRegion.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/FastRegion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::FastRegion +void wrapFastRegion(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::FastRegion; + using _t = std::variant< + containers::XYs1d, + containers::Regions1d + >; + + // create the Python object + py::class_ object( + module, "FastRegion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_xys1dregions1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const containers::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const containers::Regions1d &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + object.def_property( + "_xys1dregions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs1dregions1d(); + }, + [](cppCLASS &self, const _t &value) + { + self._XYs1dregions1d() = value; + }, + cppCLASS::component_t::documentation("_xys1dregions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Forward.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Forward.python.cpp new file mode 100644 index 000000000..2cf127f93 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Forward.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Forward.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Forward +void wrapForward(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Forward; + + // create the Python object + py::class_ object( + module, "Forward", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/G.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/G.python.cpp new file mode 100644 index 000000000..7b7a9aa5c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/G.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/G.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::G +void wrapG(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::G; + + // create the Python object + py::class_ object( + module, "G", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/GeneralEvaporation.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/GeneralEvaporation.python.cpp new file mode 100644 index 000000000..16abe64d5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/GeneralEvaporation.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/GeneralEvaporation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::GeneralEvaporation +void wrapGeneralEvaporation(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::GeneralEvaporation; + + // create the Python object + py::class_ object( + module, "GeneralEvaporation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("u") = std::nullopt, + py::arg("g") = std::nullopt, + py::arg("theta") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set U + object.def_property( + "u", + [](const cppCLASS &self) -> decltype(auto) + { + return self.U(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.U() = value; + }, + cppCLASS::component_t::documentation("u").data() + ); + + // get/set g + object.def_property( + "g", + [](const cppCLASS &self) -> decltype(auto) + { + return self.g(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.g() = value; + }, + cppCLASS::component_t::documentation("g").data() + ); + + // get/set theta + object.def_property( + "theta", + [](const cppCLASS &self) -> decltype(auto) + { + return self.theta(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.theta() = value; + }, + cppCLASS::component_t::documentation("theta").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/IncoherentPhoton.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/IncoherentPhoton.python.cpp new file mode 100644 index 000000000..cf2db4905 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/IncoherentPhoton.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/IncoherentPhoton.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::IncoherentPhoton +void wrapIncoherentPhoton(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::IncoherentPhoton; + + // create the Python object + py::class_ object( + module, "IncoherentPhoton", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/IncompleteReactions.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/IncompleteReactions.python.cpp new file mode 100644 index 000000000..861533f23 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/IncompleteReactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/IncompleteReactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::IncompleteReactions +void wrapIncompleteReactions(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::IncompleteReactions; + + // create the Python object + py::class_ object( + module, "IncompleteReactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("reaction") = std::nullopt, + 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::optional &value) + { + self.reaction() = value; + }, + cppCLASS::component_t::documentation("reaction").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Isotropic2d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Isotropic2d.python.cpp new file mode 100644 index 000000000..3f9cdb4a0 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Isotropic2d.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Isotropic2d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Isotropic2d +void wrapIsotropic2d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Isotropic2d; + + // create the Python object + py::class_ object( + module, "Isotropic2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/KalbachMann.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/KalbachMann.python.cpp new file mode 100644 index 000000000..30cf07fb4 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/KalbachMann.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/KalbachMann.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::KalbachMann +void wrapKalbachMann(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::KalbachMann; + + // create the Python object + py::class_ object( + module, "KalbachMann", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const transport::F &, + const transport::R &, + const std::optional & + >(), + py::arg("label") = std::nullopt, + py::arg("product_frame"), + py::arg("f"), + py::arg("r"), + py::arg("a") = 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 productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const XMLName &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 transport::F &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 transport::R &value) + { + self.r() = value; + }, + cppCLASS::component_t::documentation("r").data() + ); + + // get/set a + object.def_property( + "a", + [](const cppCLASS &self) -> decltype(auto) + { + return self.a(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.a() = value; + }, + cppCLASS::component_t::documentation("a").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/MultiGroup3d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/MultiGroup3d.python.cpp new file mode 100644 index 000000000..89468488f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/MultiGroup3d.python.cpp @@ -0,0 +1,150 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/MultiGroup3d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::MultiGroup3d +void wrapMultiGroup3d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::MultiGroup3d; + + // create the Python object + py::class_ object( + module, "MultiGroup3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const containers::Gridded3d & + >(), + py::arg("label"), + py::arg("product_frame"), + py::arg("gridded3d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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 XMLName &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set gridded3d + object.def_property( + "gridded3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded3d(); + }, + [](cppCLASS &self, const containers::Gridded3d &value) + { + self.gridded3d() = value; + }, + cppCLASS::component_t::documentation("gridded3d").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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Multiplicity.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Multiplicity.python.cpp new file mode 100644 index 000000000..7e5fea081 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Multiplicity.python.cpp @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Multiplicity.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Multiplicity +void wrapMultiplicity(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Multiplicity; + using _t = std::variant< + containers::XYs1d, + containers::Constant1d, + containers::Polynomial1d, + transport::Branching1d, + transport::Reference, + containers::Gridded1d, + containers::Regions1d + >; + + // create the Python object + py::class_ object( + module, "Multiplicity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_xys1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const containers::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const containers::Constant1d &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const containers::Polynomial1d &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + object.def_property( + "branching1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching1d(); + }, + [](cppCLASS &self, const transport::Branching1d &value) + { + self.branching1d() = value; + }, + cppCLASS::component_t::documentation("branching1d").data() + ); + + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const transport::Reference &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + object.def_property( + "gridded1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded1d(); + }, + [](cppCLASS &self, const containers::Gridded1d &value) + { + self.gridded1d() = value; + }, + cppCLASS::component_t::documentation("gridded1d").data() + ); + + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const containers::Regions1d &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + object.def_property( + "_xys1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d(); + }, + [](cppCLASS &self, const _t &value) + { + self._XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d() = value; + }, + cppCLASS::component_t::documentation("_xys1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/MultiplicitySum.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/MultiplicitySum.python.cpp new file mode 100644 index 000000000..76fe835aa --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/MultiplicitySum.python.cpp @@ -0,0 +1,124 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/MultiplicitySum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::MultiplicitySum +void wrapMultiplicitySum(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::MultiplicitySum; + + // create the Python object + py::class_ object( + module, "MultiplicitySum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const transport::Multiplicity &, + const transport::Summands & + >(), + py::arg("endf_mt") = std::nullopt, + py::arg("label"), + py::arg("multiplicity"), + py::arg("summands"), + 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 std::optional &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set multiplicity + object.def_property( + "multiplicity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.multiplicity(); + }, + [](cppCLASS &self, const transport::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 transport::Summands &value) + { + self.summands() = value; + }, + cppCLASS::component_t::documentation("summands").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/MultiplicitySums.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/MultiplicitySums.python.cpp new file mode 100644 index 000000000..40cda9e5b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/MultiplicitySums.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/MultiplicitySums.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::MultiplicitySums +void wrapMultiplicitySums(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::MultiplicitySums; + + // create the Python object + py::class_ object( + module, "MultiplicitySums", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::arg("multiplicity_sum") = std::nullopt, + 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::optional> &value) + { + self.multiplicitySum() = value; + }, + cppCLASS::component_t::documentation("multiplicity_sum").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/NBodyPhaseSpace.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/NBodyPhaseSpace.python.cpp new file mode 100644 index 000000000..abb724036 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/NBodyPhaseSpace.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/NBodyPhaseSpace.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::NBodyPhaseSpace +void wrapNBodyPhaseSpace(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::NBodyPhaseSpace; + + // create the Python object + py::class_ object( + module, "NBodyPhaseSpace", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("number_of_products") = std::nullopt, + py::arg("mass") = std::nullopt, + 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 std::optional &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 std::optional &value) + { + self.mass() = value; + }, + cppCLASS::component_t::documentation("mass").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/OrphanProduct.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/OrphanProduct.python.cpp new file mode 100644 index 000000000..015bf9d53 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/OrphanProduct.python.cpp @@ -0,0 +1,152 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/OrphanProduct.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::OrphanProduct +void wrapOrphanProduct(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::OrphanProduct; + + // create the Python object + py::class_ object( + module, "OrphanProduct", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Integer32 &, + const XMLName &, + const transport::CrossSection &, + const transport::OutputChannel & + >(), + py::arg("endf_mt"), + py::arg("label"), + py::arg("cross_section"), + py::arg("output_channel"), + 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 Integer32 &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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() + ); + + // get/set outputChannel + object.def_property( + "output_channel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outputChannel(); + }, + [](cppCLASS &self, const transport::OutputChannel &value) + { + self.outputChannel() = value; + }, + cppCLASS::component_t::documentation("output_channel").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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/OrphanProducts.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/OrphanProducts.python.cpp new file mode 100644 index 000000000..3ea22b1dd --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/OrphanProducts.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/OrphanProducts.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::OrphanProducts +void wrapOrphanProducts(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::OrphanProducts; + + // create the Python object + py::class_ object( + module, "OrphanProducts", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/OutputChannel.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/OutputChannel.python.cpp new file mode 100644 index 000000000..27e750431 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/OutputChannel.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/OutputChannel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::OutputChannel +void wrapOutputChannel(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::OutputChannel; + + // create the Python object + py::class_ object( + module, "OutputChannel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("genre") = std::nullopt, + py::arg("process") = std::nullopt, + py::arg("q") = std::nullopt, + py::arg("products") = std::nullopt, + py::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::optional &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 std::optional &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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/PhotonEmissionProbabilities.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/PhotonEmissionProbabilities.python.cpp new file mode 100644 index 000000000..1708512ba --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/PhotonEmissionProbabilities.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/PhotonEmissionProbabilities.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::PhotonEmissionProbabilities +void wrapPhotonEmissionProbabilities(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::PhotonEmissionProbabilities; + + // create the Python object + py::class_ object( + module, "PhotonEmissionProbabilities", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("shell") = std::nullopt, + 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::optional &value) + { + self.shell() = value; + }, + cppCLASS::component_t::documentation("shell").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/PrimaryGamma.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/PrimaryGamma.python.cpp new file mode 100644 index 000000000..e32008ecf --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/PrimaryGamma.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/PrimaryGamma.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::PrimaryGamma +void wrapPrimaryGamma(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::PrimaryGamma; + + // create the Python object + py::class_ object( + module, "PrimaryGamma", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("domain_max") = std::nullopt, + py::arg("domain_min") = std::nullopt, + py::arg("value") = std::nullopt, + py::arg("final_state") = std::nullopt, + py::arg("axes") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 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 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 finalState + object.def_property( + "final_state", + [](const cppCLASS &self) -> decltype(auto) + { + return self.finalState(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.finalState() = value; + }, + cppCLASS::component_t::documentation("final_state").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Production.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Production.python.cpp new file mode 100644 index 000000000..c8d52e878 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Production.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Production.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Production +void wrapProduction(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Production; + + // create the Python object + py::class_ object( + module, "Production", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("endf_mt") = std::nullopt, + py::arg("label") = std::nullopt, + py::arg("cross_section") = std::nullopt, + py::arg("output_channel") = std::nullopt, + 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 std::optional &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").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 crossSection + object.def_property( + "cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSection(); + }, + [](cppCLASS &self, const std::optional &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 std::optional &value) + { + self.outputChannel() = value; + }, + cppCLASS::component_t::documentation("output_channel").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Productions.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Productions.python.cpp new file mode 100644 index 000000000..6b8fea81c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Productions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Productions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Productions +void wrapProductions(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Productions; + + // create the Python object + py::class_ object( + module, "Productions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("production") = std::nullopt, + 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::optional &value) + { + self.production() = value; + }, + cppCLASS::component_t::documentation("production").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/R.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/R.python.cpp new file mode 100644 index 000000000..fc4188360 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/R.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/R.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::R +void wrapR(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::R; + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // create the Python object + py::class_ object( + module, "R", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_xys2dregions2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const containers::XYs2d &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + object.def_property( + "regions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions2d(); + }, + [](cppCLASS &self, const containers::Regions2d &value) + { + self.regions2d() = value; + }, + cppCLASS::component_t::documentation("regions2d").data() + ); + + object.def_property( + "_xys2dregions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs2dregions2d(); + }, + [](cppCLASS &self, const _t &value) + { + self._XYs2dregions2d() = value; + }, + cppCLASS::component_t::documentation("_xys2dregions2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Reaction.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Reaction.python.cpp new file mode 100644 index 000000000..5b30a8e7f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Reaction.python.cpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Reaction.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Reaction +void wrapReaction(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Reaction; + + // create the Python object + py::class_ object( + module, "Reaction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const Integer32 &, + const std::optional &, + const XMLName &, + const std::optional &, + const transport::CrossSection &, + const transport::OutputChannel & + >(), + py::arg("endf_mt"), + py::arg("fission_genre") = std::nullopt, + py::arg("label"), + py::arg("double_differential_cross_section") = std::nullopt, + py::arg("cross_section"), + py::arg("output_channel"), + 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 Integer32 &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 XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").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() + ); + + // 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() + ); + + // get/set outputChannel + object.def_property( + "output_channel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outputChannel(); + }, + [](cppCLASS &self, const transport::OutputChannel &value) + { + self.outputChannel() = value; + }, + cppCLASS::component_t::documentation("output_channel").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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/ReactionSuite.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/ReactionSuite.python.cpp new file mode 100644 index 000000000..3f7406774 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/ReactionSuite.python.cpp @@ -0,0 +1,402 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/ReactionSuite.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::ReactionSuite +void wrapReactionSuite(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::ReactionSuite; + + // create the Python object + py::class_ object( + module, "ReactionSuite", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const XMLName &, + const enums::Frame &, + const XMLName &, + const enums::Interaction &, + const std::optional &, + const styles::Styles &, + const pops::PoPs_database &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("evaluation"), + py::arg("format"), + py::arg("projectile"), + py::arg("projectile_frame"), + py::arg("target"), + py::arg("interaction"), + py::arg("external_files") = std::nullopt, + py::arg("styles"), + py::arg("po_ps_database"), + py::arg("resonances") = std::nullopt, + py::arg("reactions") = std::nullopt, + py::arg("orphan_products") = std::nullopt, + py::arg("sums") = std::nullopt, + py::arg("fission_components") = std::nullopt, + py::arg("productions") = std::nullopt, + py::arg("incomplete_reactions") = std::nullopt, + py::arg("application_data") = 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 XMLName &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 XMLName &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 XMLName &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 XMLName &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 enums::Interaction &value) + { + self.interaction() = value; + }, + cppCLASS::component_t::documentation("interaction").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 styles::Styles &value) + { + self.styles() = value; + }, + cppCLASS::component_t::documentation("styles").data() + ); + + // get/set PoPs_database + object.def_property( + "po_ps_database", + [](const cppCLASS &self) -> decltype(auto) + { + return self.PoPs_database(); + }, + [](cppCLASS &self, const pops::PoPs_database &value) + { + self.PoPs_database() = value; + }, + cppCLASS::component_t::documentation("po_ps_database").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 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() + ); + + // 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 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 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 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 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() + ); + + // 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() + ); + + // 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 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 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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Reactions.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Reactions.python.cpp new file mode 100644 index 000000000..73d6b7c4c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Reactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Reactions.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Reactions +void wrapReactions(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Reactions; + + // create the Python object + py::class_ object( + module, "Reactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Recoil.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Recoil.python.cpp new file mode 100644 index 000000000..3a95a0bc8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Recoil.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Recoil.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Recoil +void wrapRecoil(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Recoil; + + // create the Python object + py::class_ object( + module, "Recoil", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Reference.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Reference.python.cpp new file mode 100644 index 000000000..f2b1ad5d1 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Reference.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Reference.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Reference +void wrapReference(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Reference; + + // create the Python object + py::class_ object( + module, "Reference", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("href") = std::nullopt, + py::arg("label") = 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/ResolvedRegion.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/ResolvedRegion.python.cpp new file mode 100644 index 000000000..18fdd2e52 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/ResolvedRegion.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/ResolvedRegion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::ResolvedRegion +void wrapResolvedRegion(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::ResolvedRegion; + using _t = std::variant< + containers::XYs1d, + containers::Regions1d + >; + + // create the Python object + py::class_ object( + module, "ResolvedRegion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_xys1dregions1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const containers::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const containers::Regions1d &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + object.def_property( + "_xys1dregions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs1dregions1d(); + }, + [](cppCLASS &self, const _t &value) + { + self._XYs1dregions1d() = value; + }, + cppCLASS::component_t::documentation("_xys1dregions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/ResonancesLink.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/ResonancesLink.python.cpp new file mode 100644 index 000000000..1e87726ce --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/ResonancesLink.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/ResonancesLink.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::ResonancesLink +void wrapResonancesLink(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::ResonancesLink; + + // create the Python object + py::class_ object( + module, "ResonancesLink", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::string & + >(), + py::arg("label") = std::nullopt, + py::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::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::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/ResonancesWithBackground.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/ResonancesWithBackground.python.cpp new file mode 100644 index 000000000..a81e04b68 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/ResonancesWithBackground.python.cpp @@ -0,0 +1,152 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/ResonancesWithBackground.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::ResonancesWithBackground +void wrapResonancesWithBackground(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::ResonancesWithBackground; + + // create the Python object + py::class_ object( + module, "ResonancesWithBackground", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const transport::ResonancesLink &, + const transport::Background &, + const std::optional & + >(), + py::arg("label"), + py::arg("resonances_link"), + py::arg("background"), + py::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 XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set resonancesLink + object.def_property( + "resonances_link", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonancesLink(); + }, + [](cppCLASS &self, const transport::ResonancesLink &value) + { + self.resonancesLink() = value; + }, + cppCLASS::component_t::documentation("resonances_link").data() + ); + + // get/set background + object.def_property( + "background", + [](const cppCLASS &self) -> decltype(auto) + { + return self.background(); + }, + [](cppCLASS &self, const transport::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 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 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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Summands.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Summands.python.cpp new file mode 100644 index 000000000..547ebba4c --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Summands.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Summands.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Summands +void wrapSummands(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Summands; + + // create the Python object + py::class_ object( + module, "Summands", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional> & + >(), + py::arg("add") = std::nullopt, + 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::optional> &value) + { + self.add() = value; + }, + cppCLASS::component_t::documentation("add").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Sums.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Sums.python.cpp new file mode 100644 index 000000000..6f38c4e82 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Sums.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Sums.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Sums +void wrapSums(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Sums; + + // create the Python object + py::class_ object( + module, "Sums", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const transport::CrossSectionSums &, + const std::optional & + >(), + py::arg("cross_section_sums"), + py::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 transport::CrossSectionSums &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() + ); + + // shortcut: get/set crossSectionSum + object.def_property( + "cross_section_sum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSectionSum(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.crossSectionSum() = value; + }, + cppCLASS::component_t::documentation("cross_section_sum").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Theta.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Theta.python.cpp new file mode 100644 index 000000000..d34da5fa3 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Theta.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Theta.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Theta +void wrapTheta(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Theta; + + // create the Python object + py::class_ object( + module, "Theta", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("xys1d") = std::nullopt, + py::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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/U.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/U.python.cpp new file mode 100644 index 000000000..75a409b14 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/U.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/U.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::U +void wrapU(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::U; + + // create the Python object + py::class_ object( + module, "U", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/URR_probabilityTables1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/URR_probabilityTables1d.python.cpp new file mode 100644 index 000000000..62d274e66 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/URR_probabilityTables1d.python.cpp @@ -0,0 +1,107 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/URR_probabilityTables1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::URR_probabilityTables1d +void wrapURR_probabilityTables1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::URR_probabilityTables1d; + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // create the Python object + py::class_ object( + module, "URR_probabilityTables1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const _t & + >(), + py::arg("label"), + py::arg("_xys2dregions2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const containers::XYs2d &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + object.def_property( + "regions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions2d(); + }, + [](cppCLASS &self, const containers::Regions2d &value) + { + self.regions2d() = value; + }, + cppCLASS::component_t::documentation("regions2d").data() + ); + + object.def_property( + "_xys2dregions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs2dregions2d(); + }, + [](cppCLASS &self, const _t &value) + { + self._XYs2dregions2d() = value; + }, + cppCLASS::component_t::documentation("_xys2dregions2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Uncorrelated.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Uncorrelated.python.cpp new file mode 100644 index 000000000..9c7423f06 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Uncorrelated.python.cpp @@ -0,0 +1,278 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Uncorrelated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Uncorrelated +void wrapUncorrelated(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Uncorrelated; + + // create the Python object + py::class_ object( + module, "Uncorrelated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName &, + const transport::Angular_uncorrelated &, + const transport::Energy_uncorrelated & + >(), + py::arg("label") = std::nullopt, + py::arg("product_frame"), + py::arg("angular_uncorrelated"), + py::arg("energy_uncorrelated"), + 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 productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set angular_uncorrelated + object.def_property( + "angular_uncorrelated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angular_uncorrelated(); + }, + [](cppCLASS &self, const transport::Angular_uncorrelated &value) + { + self.angular_uncorrelated() = value; + }, + cppCLASS::component_t::documentation("angular_uncorrelated").data() + ); + + // get/set energy_uncorrelated + object.def_property( + "energy_uncorrelated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energy_uncorrelated(); + }, + [](cppCLASS &self, const transport::Energy_uncorrelated &value) + { + self.energy_uncorrelated() = value; + }, + cppCLASS::component_t::documentation("energy_uncorrelated").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 Watt + object.def_property( + "watt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Watt(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Watt() = value; + }, + cppCLASS::component_t::documentation("watt").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 forward + object.def_property( + "forward", + [](const cppCLASS &self) -> decltype(auto) + { + return self.forward(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.forward() = value; + }, + cppCLASS::component_t::documentation("forward").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 regions2d + object.def_property( + "regions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions2d() = value; + }, + cppCLASS::component_t::documentation("regions2d").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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/UnresolvedRegion.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/UnresolvedRegion.python.cpp new file mode 100644 index 000000000..183a6a646 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/UnresolvedRegion.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/UnresolvedRegion.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::UnresolvedRegion +void wrapUnresolvedRegion(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::UnresolvedRegion; + using _t = std::variant< + containers::XYs1d, + containers::Regions1d + >; + + // create the Python object + py::class_ object( + module, "UnresolvedRegion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const _t & + >(), + py::arg("_xys1dregions1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const containers::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const containers::Regions1d &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + object.def_property( + "_xys1dregions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self._XYs1dregions1d(); + }, + [](cppCLASS &self, const _t &value) + { + self._XYs1dregions1d() = value; + }, + cppCLASS::component_t::documentation("_xys1dregions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Unspecified.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Unspecified.python.cpp new file mode 100644 index 000000000..79fc62287 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Unspecified.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Unspecified.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Unspecified +void wrapUnspecified(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Unspecified; + + // create the Python object + py::class_ object( + module, "Unspecified", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const XMLName & + >(), + py::arg("label") = std::nullopt, + py::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::optional &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 XMLName &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/Weighted.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/Weighted.python.cpp new file mode 100644 index 000000000..3f9e86842 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/Weighted.python.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/Weighted.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::Weighted +void wrapWeighted(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::Weighted; + + // create the Python object + py::class_ object( + module, "Weighted", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::XYs1d &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + py::arg("xys1d"), + py::arg("xys2d") = std::nullopt, + py::arg("evaporation") = std::nullopt, + py::arg("general_evaporation") = std::nullopt, + py::arg("simple_maxwellian_fission") = std::nullopt, + py::arg("watt") = std::nullopt, + py::arg("madland_nix") = 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 containers::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").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 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 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 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 Watt + object.def_property( + "watt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Watt(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.Watt() = value; + }, + cppCLASS::component_t::documentation("watt").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() + ); + + // 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_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/transport/WeightedFunctionals.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/transport/WeightedFunctionals.python.cpp new file mode 100644 index 000000000..f10e7509f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/transport/WeightedFunctionals.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/transport/WeightedFunctionals.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_transport { + +// wrapper for transport::WeightedFunctionals +void wrapWeightedFunctionals(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = transport::WeightedFunctionals; + + // create the Python object + py::class_ object( + module, "WeightedFunctionals", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const transport::Weighted & + >(), + py::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 transport::Weighted &value) + { + self.weighted() = value; + }, + cppCLASS::component_t::documentation("weighted").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 Watt + object.def_property( + "watt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Watt(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Watt() = value; + }, + cppCLASS::component_t::documentation("watt").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 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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl.python.cpp new file mode 100644 index 000000000..5c9cfb6c9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl.python.cpp @@ -0,0 +1,79 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// tsl declarations +namespace python_tsl { + void wrapMass(py::module &); + void wrapThermalNeutronScatteringLaw(py::module &); + void wrapThermalNeutronScatteringLaw1d(py::module &); + void wrapS_table(py::module &); + void wrapBraggEnergy(py::module &); + void wrapStructureFactor(py::module &); + void wrapBraggEdge(py::module &); + void wrapBraggEdges(py::module &); + void wrapThermalNeutronScatteringLaw_coherentElastic(py::module &); + void wrapBoundAtomCrossSection(py::module &); + void wrapDebyeWallerIntegral(py::module &); + void wrapThermalNeutronScatteringLaw_incoherentElastic(py::module &); + void wrapE_critical(py::module &); + void wrapE_max(py::module &); + void wrapCoherentAtomCrossSection(py::module &); + void wrapDistinctScatteringKernel(py::module &); + void wrapPhononSpectrum(py::module &); + void wrapGaussianApproximation(py::module &); + void wrapSCTApproximation(py::module &); + void wrapFreeGasApproximation(py::module &); + void wrapSelfScatteringKernel(py::module &); + void wrapT_effective(py::module &); + void wrapScatteringAtom(py::module &); + void wrapScatteringAtoms(py::module &); + void wrapThermalNeutronScatteringLaw_incoherentInelastic(py::module &); +} // namespace python_tsl + +// wrapper for tsl +void wrapTsl(py::module &module) +{ + // create the tsl submodule + py::module submodule = module.def_submodule( + "tsl", + "test v2.0 tsl" + ); + + // wrap tsl components + python_tsl::wrapMass(submodule); + python_tsl::wrapThermalNeutronScatteringLaw(submodule); + python_tsl::wrapThermalNeutronScatteringLaw1d(submodule); + python_tsl::wrapS_table(submodule); + python_tsl::wrapBraggEnergy(submodule); + python_tsl::wrapStructureFactor(submodule); + python_tsl::wrapBraggEdge(submodule); + python_tsl::wrapBraggEdges(submodule); + python_tsl::wrapThermalNeutronScatteringLaw_coherentElastic(submodule); + python_tsl::wrapBoundAtomCrossSection(submodule); + python_tsl::wrapDebyeWallerIntegral(submodule); + python_tsl::wrapThermalNeutronScatteringLaw_incoherentElastic(submodule); + python_tsl::wrapE_critical(submodule); + python_tsl::wrapE_max(submodule); + python_tsl::wrapCoherentAtomCrossSection(submodule); + python_tsl::wrapDistinctScatteringKernel(submodule); + python_tsl::wrapPhononSpectrum(submodule); + python_tsl::wrapGaussianApproximation(submodule); + python_tsl::wrapSCTApproximation(submodule); + python_tsl::wrapFreeGasApproximation(submodule); + python_tsl::wrapSelfScatteringKernel(submodule); + python_tsl::wrapT_effective(submodule); + python_tsl::wrapScatteringAtom(submodule); + python_tsl::wrapScatteringAtoms(submodule); + python_tsl::wrapThermalNeutronScatteringLaw_incoherentInelastic(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/BoundAtomCrossSection.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/BoundAtomCrossSection.python.cpp new file mode 100644 index 000000000..a8948768a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/BoundAtomCrossSection.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/BoundAtomCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::BoundAtomCrossSection +void wrapBoundAtomCrossSection(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::BoundAtomCrossSection; + + // create the Python object + py::class_ object( + module, "BoundAtomCrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Float64 & + >(), + py::arg("unit"), + py::arg("value"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/BraggEdge.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/BraggEdge.python.cpp new file mode 100644 index 000000000..bfbddd18e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/BraggEdge.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/BraggEdge.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::BraggEdge +void wrapBraggEdge(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::BraggEdge; + + // create the Python object + py::class_ object( + module, "BraggEdge", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const tsl::BraggEnergy &, + const tsl::StructureFactor & + >(), + py::arg("label"), + py::arg("bragg_energy"), + py::arg("structure_factor"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set BraggEnergy + object.def_property( + "bragg_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.BraggEnergy(); + }, + [](cppCLASS &self, const tsl::BraggEnergy &value) + { + self.BraggEnergy() = value; + }, + cppCLASS::component_t::documentation("bragg_energy").data() + ); + + // get/set structureFactor + object.def_property( + "structure_factor", + [](const cppCLASS &self) -> decltype(auto) + { + return self.structureFactor(); + }, + [](cppCLASS &self, const tsl::StructureFactor &value) + { + self.structureFactor() = value; + }, + cppCLASS::component_t::documentation("structure_factor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/BraggEdges.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/BraggEdges.python.cpp new file mode 100644 index 000000000..cd787b1ad --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/BraggEdges.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/BraggEdges.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::BraggEdges +void wrapBraggEdges(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::BraggEdges; + + // create the Python object + py::class_ object( + module, "BraggEdges", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::arg("bragg_edge"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set BraggEdge + object.def_property( + "bragg_edge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.BraggEdge(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.BraggEdge() = value; + }, + cppCLASS::component_t::documentation("bragg_edge").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/BraggEnergy.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/BraggEnergy.python.cpp new file mode 100644 index 000000000..5631d08b4 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/BraggEnergy.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/BraggEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::BraggEnergy +void wrapBraggEnergy(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::BraggEnergy; + + // create the Python object + py::class_ object( + module, "BraggEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::XYs1d & + >(), + py::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 containers::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_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/CoherentAtomCrossSection.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/CoherentAtomCrossSection.python.cpp new file mode 100644 index 000000000..db31d56d9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/CoherentAtomCrossSection.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/CoherentAtomCrossSection.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::CoherentAtomCrossSection +void wrapCoherentAtomCrossSection(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::CoherentAtomCrossSection; + + // create the Python object + py::class_ object( + module, "CoherentAtomCrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Float64 & + >(), + py::arg("unit"), + py::arg("value"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/DebyeWallerIntegral.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/DebyeWallerIntegral.python.cpp new file mode 100644 index 000000000..d60cfb8d8 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/DebyeWallerIntegral.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/DebyeWallerIntegral.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::DebyeWallerIntegral +void wrapDebyeWallerIntegral(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::DebyeWallerIntegral; + + // create the Python object + py::class_ object( + module, "DebyeWallerIntegral", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::XYs1d & + >(), + py::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 containers::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_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/DistinctScatteringKernel.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/DistinctScatteringKernel.python.cpp new file mode 100644 index 000000000..1a1607449 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/DistinctScatteringKernel.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/DistinctScatteringKernel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::DistinctScatteringKernel +void wrapDistinctScatteringKernel(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::DistinctScatteringKernel; + + // create the Python object + py::class_ object( + module, "DistinctScatteringKernel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("gridded3d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/E_critical.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/E_critical.python.cpp new file mode 100644 index 000000000..cccbfd0a2 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/E_critical.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/E_critical.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::E_critical +void wrapE_critical(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::E_critical; + + // create the Python object + py::class_ object( + module, "E_critical", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/E_max.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/E_max.python.cpp new file mode 100644 index 000000000..3df6a50f5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/E_max.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/E_max.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::E_max +void wrapE_max(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::E_max; + + // create the Python object + py::class_ object( + module, "E_max", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const std::optional & + >(), + py::arg("unit") = std::nullopt, + py::arg("value") = std::nullopt, + cppCLASS::component_t::documentation("constructor").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 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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/FreeGasApproximation.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/FreeGasApproximation.python.cpp new file mode 100644 index 000000000..e1c5c4311 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/FreeGasApproximation.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/FreeGasApproximation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::FreeGasApproximation +void wrapFreeGasApproximation(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::FreeGasApproximation; + + // create the Python object + py::class_ object( + module, "FreeGasApproximation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/GaussianApproximation.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/GaussianApproximation.python.cpp new file mode 100644 index 000000000..254fc1cb9 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/GaussianApproximation.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/GaussianApproximation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::GaussianApproximation +void wrapGaussianApproximation(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::GaussianApproximation; + + // create the Python object + py::class_ object( + module, "GaussianApproximation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional & + >(), + py::arg("phonon_spectrum") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set phononSpectrum + object.def_property( + "phonon_spectrum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.phononSpectrum(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.phononSpectrum() = value; + }, + cppCLASS::component_t::documentation("phonon_spectrum").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/Mass.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/Mass.python.cpp new file mode 100644 index 000000000..85ff71054 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/Mass.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/Mass.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::Mass +void wrapMass(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::Mass; + + // create the Python object + py::class_ object( + module, "Mass", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const Float64 & + >(), + py::arg("unit"), + py::arg("value"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const Float64 &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/PhononSpectrum.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/PhononSpectrum.python.cpp new file mode 100644 index 000000000..89aa2556a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/PhononSpectrum.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/PhononSpectrum.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::PhononSpectrum +void wrapPhononSpectrum(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::PhononSpectrum; + + // create the Python object + py::class_ object( + module, "PhononSpectrum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::XYs1d & + >(), + py::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 containers::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_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/SCTApproximation.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/SCTApproximation.python.cpp new file mode 100644 index 000000000..3da47467f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/SCTApproximation.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/SCTApproximation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::SCTApproximation +void wrapSCTApproximation(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::SCTApproximation; + + // create the Python object + py::class_ object( + module, "SCTApproximation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/S_table.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/S_table.python.cpp new file mode 100644 index 000000000..d6ffcc946 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/S_table.python.cpp @@ -0,0 +1,118 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/S_table.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::S_table +void wrapS_table(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::S_table; + + // create the Python object + py::class_ object( + module, "S_table", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::Gridded2d & + >(), + py::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 containers::Gridded2d &value) + { + self.gridded2d() = value; + }, + cppCLASS::component_t::documentation("gridded2d").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_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/ScatteringAtom.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/ScatteringAtom.python.cpp new file mode 100644 index 000000000..b8b40df5f --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/ScatteringAtom.python.cpp @@ -0,0 +1,222 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/ScatteringAtom.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::ScatteringAtom +void wrapScatteringAtom(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::ScatteringAtom; + + // create the Python object + py::class_ object( + module, "ScatteringAtom", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const bool &, + const Integer32 &, + const tsl::Mass &, + const std::optional &, + const tsl::E_max &, + const tsl::BoundAtomCrossSection &, + const std::optional &, + const std::optional &, + const tsl::SelfScatteringKernel &, + const std::optional & + >(), + py::arg("pid"), + py::arg("primary_scatterer"), + py::arg("number_per_molecule"), + py::arg("mass"), + py::arg("e_critical") = std::nullopt, + py::arg("e_max"), + py::arg("bound_atom_cross_section"), + py::arg("coherent_atom_cross_section") = std::nullopt, + py::arg("distinct_scattering_kernel") = std::nullopt, + py::arg("self_scattering_kernel"), + py::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 XMLName &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set primaryScatterer + object.def_property( + "primary_scatterer", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryScatterer(); + }, + [](cppCLASS &self, const bool &value) + { + self.primaryScatterer() = value; + }, + cppCLASS::component_t::documentation("primary_scatterer").data() + ); + + // get/set numberPerMolecule + object.def_property( + "number_per_molecule", + [](const cppCLASS &self) -> decltype(auto) + { + return self.numberPerMolecule(); + }, + [](cppCLASS &self, const Integer32 &value) + { + self.numberPerMolecule() = value; + }, + cppCLASS::component_t::documentation("number_per_molecule").data() + ); + + // get/set mass + object.def_property( + "mass", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass(); + }, + [](cppCLASS &self, const tsl::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 tsl::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 tsl::BoundAtomCrossSection &value) + { + self.boundAtomCrossSection() = value; + }, + cppCLASS::component_t::documentation("bound_atom_cross_section").data() + ); + + // get/set coherentAtomCrossSection + object.def_property( + "coherent_atom_cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.coherentAtomCrossSection(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.coherentAtomCrossSection() = value; + }, + cppCLASS::component_t::documentation("coherent_atom_cross_section").data() + ); + + // get/set distinctScatteringKernel + object.def_property( + "distinct_scattering_kernel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.distinctScatteringKernel(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.distinctScatteringKernel() = value; + }, + cppCLASS::component_t::documentation("distinct_scattering_kernel").data() + ); + + // get/set selfScatteringKernel + object.def_property( + "self_scattering_kernel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.selfScatteringKernel(); + }, + [](cppCLASS &self, const tsl::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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/ScatteringAtoms.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/ScatteringAtoms.python.cpp new file mode 100644 index 000000000..5a5504845 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/ScatteringAtoms.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/ScatteringAtoms.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::ScatteringAtoms +void wrapScatteringAtoms(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::ScatteringAtoms; + + // create the Python object + py::class_ object( + module, "ScatteringAtoms", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/SelfScatteringKernel.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/SelfScatteringKernel.python.cpp new file mode 100644 index 000000000..62c54a093 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/SelfScatteringKernel.python.cpp @@ -0,0 +1,135 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/SelfScatteringKernel.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::SelfScatteringKernel +void wrapSelfScatteringKernel(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::SelfScatteringKernel; + using _t = std::variant< + containers::Gridded3d, + tsl::GaussianApproximation, + tsl::SCTApproximation, + tsl::FreeGasApproximation + >; + + // create the Python object + py::class_ object( + module, "SelfScatteringKernel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::optional &, + const _t & + >(), + py::arg("symmetric") = std::nullopt, + py::arg("_gridded3d_gaussian_approximation_sctapproximationfree_gas_approximation"), + 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() + ); + + object.def_property( + "gridded3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded3d(); + }, + [](cppCLASS &self, const containers::Gridded3d &value) + { + self.gridded3d() = value; + }, + cppCLASS::component_t::documentation("gridded3d").data() + ); + + object.def_property( + "gaussian_approximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.GaussianApproximation(); + }, + [](cppCLASS &self, const tsl::GaussianApproximation &value) + { + self.GaussianApproximation() = value; + }, + cppCLASS::component_t::documentation("gaussian_approximation").data() + ); + + object.def_property( + "sctapproximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.SCTApproximation(); + }, + [](cppCLASS &self, const tsl::SCTApproximation &value) + { + self.SCTApproximation() = value; + }, + cppCLASS::component_t::documentation("sctapproximation").data() + ); + + object.def_property( + "free_gas_approximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.freeGasApproximation(); + }, + [](cppCLASS &self, const tsl::FreeGasApproximation &value) + { + self.freeGasApproximation() = value; + }, + cppCLASS::component_t::documentation("free_gas_approximation").data() + ); + + object.def_property( + "_gridded3d_gaussian_approximation_sctapproximationfree_gas_approximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self._gridded3dGaussianApproximationSCTApproximationfreeGasApproximation(); + }, + [](cppCLASS &self, const _t &value) + { + self._gridded3dGaussianApproximationSCTApproximationfreeGasApproximation() = value; + }, + cppCLASS::component_t::documentation("_gridded3d_gaussian_approximation_sctapproximationfree_gas_approximation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/StructureFactor.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/StructureFactor.python.cpp new file mode 100644 index 000000000..6bc423a0a --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/StructureFactor.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/StructureFactor.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::StructureFactor +void wrapStructureFactor(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::StructureFactor; + + // create the Python object + py::class_ object( + module, "StructureFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::XYs1d & + >(), + py::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 containers::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_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/T_effective.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/T_effective.python.cpp new file mode 100644 index 000000000..0289a7fbc --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/T_effective.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/T_effective.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::T_effective +void wrapT_effective(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::T_effective; + + // create the Python object + py::class_ object( + module, "T_effective", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const containers::XYs1d & + >(), + py::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 containers::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_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw.python.cpp new file mode 100644 index 000000000..7f92fcc5e --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::ThermalNeutronScatteringLaw +void wrapThermalNeutronScatteringLaw(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::ThermalNeutronScatteringLaw; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName & + >(), + py::arg("label"), + py::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 XMLName &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 XMLName &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.python.cpp new file mode 100644 index 000000000..6f482941d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw1d.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw1d.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::ThermalNeutronScatteringLaw1d +void wrapThermalNeutronScatteringLaw1d(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::ThermalNeutronScatteringLaw1d; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName & + >(), + py::arg("label"), + py::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 XMLName &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 XMLName &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.python.cpp new file mode 100644 index 000000000..84635da0b --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.python.cpp @@ -0,0 +1,139 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::ThermalNeutronScatteringLaw_coherentElastic +void wrapThermalNeutronScatteringLaw_coherentElastic(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::ThermalNeutronScatteringLaw_coherentElastic; + using _t = std::variant< + tsl::S_table, + tsl::BraggEdges + >; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw_coherentElastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::optional &, + const std::optional &, + const _t & + >(), + py::arg("label"), + py::arg("pid") = std::nullopt, + py::arg("product_frame") = std::nullopt, + py::arg("_s_table_bragg_edges"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const XMLName &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().value(); + }, + [](cppCLASS &self, const XMLName &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().value(); + }, + [](cppCLASS &self, const enums::Frame &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + object.def_property( + "s_table", + [](const cppCLASS &self) -> decltype(auto) + { + return self.S_table(); + }, + [](cppCLASS &self, const tsl::S_table &value) + { + self.S_table() = value; + }, + cppCLASS::component_t::documentation("s_table").data() + ); + + object.def_property( + "bragg_edges", + [](const cppCLASS &self) -> decltype(auto) + { + return self.BraggEdges(); + }, + [](cppCLASS &self, const tsl::BraggEdges &value) + { + self.BraggEdges() = value; + }, + cppCLASS::component_t::documentation("bragg_edges").data() + ); + + object.def_property( + "_s_table_bragg_edges", + [](const cppCLASS &self) -> decltype(auto) + { + return self._S_tableBraggEdges(); + }, + [](cppCLASS &self, const _t &value) + { + self._S_tableBraggEdges() = value; + }, + cppCLASS::component_t::documentation("_s_table_bragg_edges").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp new file mode 100644 index 000000000..d2786507d --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp @@ -0,0 +1,182 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::ThermalNeutronScatteringLaw_incoherentElastic +void wrapThermalNeutronScatteringLaw_incoherentElastic(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::ThermalNeutronScatteringLaw_incoherentElastic; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw_incoherentElastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const XMLName &, + const enums::Frame &, + const tsl::BoundAtomCrossSection &, + const tsl::DebyeWallerIntegral & + >(), + py::arg("label"), + py::arg("pid"), + py::arg("product_frame"), + py::arg("bound_atom_cross_section"), + py::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 XMLName &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 XMLName &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 enums::Frame &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 tsl::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 tsl::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_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp new file mode 100644 index 000000000..925fa03d5 --- /dev/null +++ b/standards/gnds-2.0/test/python/src/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_tsl { + +// wrapper for tsl::ThermalNeutronScatteringLaw_incoherentInelastic +void wrapThermalNeutronScatteringLaw_incoherentInelastic(py::module &module) +{ + using namespace test; + using namespace test::v2_0; + + // type aliases + using cppCLASS = tsl::ThermalNeutronScatteringLaw_incoherentInelastic; + + // create the Python object + py::class_ object( + module, "ThermalNeutronScatteringLaw_incoherentInelastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const XMLName &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const XMLName &, + const tsl::ScatteringAtoms & + >(), + py::arg("label"), + py::arg("pid") = std::nullopt, + py::arg("product_frame") = std::nullopt, + py::arg("calculated_at_thermal") = std::nullopt, + py::arg("incoherent_approximation") = std::nullopt, + py::arg("primary_scatterer"), + py::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 XMLName &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().value(); + }, + [](cppCLASS &self, const XMLName &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().value(); + }, + [](cppCLASS &self, const enums::Frame &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set calculatedAtThermal + object.def_property( + "calculated_at_thermal", + [](const cppCLASS &self) -> decltype(auto) + { + return self.calculatedAtThermal().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.calculatedAtThermal() = value; + }, + cppCLASS::component_t::documentation("calculated_at_thermal").data() + ); + + // get/set incoherentApproximation + object.def_property( + "incoherent_approximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.incoherentApproximation().value(); + }, + [](cppCLASS &self, const bool &value) + { + self.incoherentApproximation() = value; + }, + cppCLASS::component_t::documentation("incoherent_approximation").data() + ); + + // get/set primaryScatterer + object.def_property( + "primary_scatterer", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryScatterer(); + }, + [](cppCLASS &self, const XMLName &value) + { + self.primaryScatterer() = value; + }, + cppCLASS::component_t::documentation("primary_scatterer").data() + ); + + // get/set scatteringAtoms + object.def_property( + "scattering_atoms", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringAtoms(); + }, + [](cppCLASS &self, const tsl::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_tsl +} // namespace python_v2_0 diff --git a/standards/gnds-2.0/test/src/test/v2.0.hpp b/standards/gnds-2.0/test/src/test/v2.0.hpp new file mode 100644 index 000000000..2c8e9f742 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0.hpp @@ -0,0 +1,620 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0 +#define TEST_V2_0 + +#include "test/v2.0/fissionTransport/A.hpp" + +#include "test/v2.0/transport/A.hpp" + +#include "test/v2.0/documentation/Abstract.hpp" +#include "test/v2.0/documentation/Acknowledgement.hpp" +#include "test/v2.0/documentation/Acknowledgements.hpp" + +#include "test/v2.0/transport/Add.hpp" + +#include "test/v2.0/documentation/Affiliation.hpp" +#include "test/v2.0/documentation/Affiliations.hpp" + +#include "test/v2.0/pops/Alias.hpp" +#include "test/v2.0/pops/Aliases.hpp" + +#include "test/v2.0/styles/AngularDistributionReconstructed.hpp" + +#include "test/v2.0/transport/AngularEnergy.hpp" + +#include "test/v2.0/processed/AngularEnergyMC.hpp" + +#include "test/v2.0/transport/AngularTwoBody.hpp" +#include "test/v2.0/transport/Angular_uncorrelated.hpp" + +#include "test/v2.0/appData/ApplicationData.hpp" + +#include "test/v2.0/containers/Array.hpp" + +#include "test/v2.0/pops/Atomic.hpp" + +#include "test/v2.0/documentation/Author.hpp" +#include "test/v2.0/documentation/Authors.hpp" + +#include "test/v2.0/processed/AvailableEnergy.hpp" +#include "test/v2.0/processed/AvailableMomentum.hpp" + +#include "test/v2.0/pops/AverageEnergies.hpp" +#include "test/v2.0/pops/AverageEnergy.hpp" + +#include "test/v2.0/covariance/AverageParameterCovariance.hpp" + +#include "test/v2.0/styles/AverageProductData.hpp" + +#include "test/v2.0/processed/AverageProductEnergy.hpp" +#include "test/v2.0/processed/AverageProductMomentum.hpp" + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/containers/Axis.hpp" + +#include "test/v2.0/fissionTransport/B.hpp" + +#include "test/v2.0/transport/Background.hpp" + +#include "test/v2.0/pops/Baryon.hpp" +#include "test/v2.0/pops/Baryons.hpp" + +#include "test/v2.0/documentation/Bibitem.hpp" +#include "test/v2.0/documentation/Bibliography.hpp" + +#include "test/v2.0/pops/BindingEnergy.hpp" + +#include "test/v2.0/documentation/Body.hpp" + +#include "test/v2.0/styles/Bondarenko.hpp" + +#include "test/v2.0/tsl/BoundAtomCrossSection.hpp" +#include "test/v2.0/tsl/BraggEdge.hpp" +#include "test/v2.0/tsl/BraggEdges.hpp" +#include "test/v2.0/tsl/BraggEnergy.hpp" + +#include "test/v2.0/transport/Branching1d.hpp" +#include "test/v2.0/transport/Branching3d.hpp" + +#include "test/v2.0/resonances/BreitWigner.hpp" + +#include "test/v2.0/containers/Cdf_in_xs_pdf_cdf1d.hpp" + +#include "test/v2.0/resonances/Channel.hpp" +#include "test/v2.0/resonances/Channels.hpp" + +#include "test/v2.0/pops/Charge.hpp" +#include "test/v2.0/pops/ChemicalElement.hpp" +#include "test/v2.0/pops/ChemicalElements.hpp" + +#include "test/v2.0/documentation/CodeRepo.hpp" + +#include "test/v2.0/tsl/CoherentAtomCrossSection.hpp" + +#include "test/v2.0/transport/CoherentPhoton.hpp" + +#include "test/v2.0/atomic/CoherentPhotonScattering.hpp" + +#include "test/v2.0/documentation/Collaboration.hpp" +#include "test/v2.0/documentation/Collaborations.hpp" + +#include "test/v2.0/containers/Column.hpp" + +#include "test/v2.0/covariance/ColumnData.hpp" + +#include "test/v2.0/containers/ColumnHeaders.hpp" + +#include "test/v2.0/covariance/ColumnSensitivity.hpp" + +#include "test/v2.0/documentation/ComputerCode.hpp" +#include "test/v2.0/documentation/ComputerCodes.hpp" + +#include "test/v2.0/containers/ConfidenceIntervals.hpp" + +#include "test/v2.0/pops/ConfidenceIntervals.hpp" +#include "test/v2.0/pops/Configuration.hpp" +#include "test/v2.0/pops/Configurations.hpp" + +#include "test/v2.0/containers/Constant1d.hpp" + +#include "test/v2.0/pops/Continuum.hpp" + +#include "test/v2.0/documentation/Contributor.hpp" +#include "test/v2.0/documentation/Contributors.hpp" + +#include "test/v2.0/appData/Conversion.hpp" + +#include "test/v2.0/documentation/Copyright.hpp" +#include "test/v2.0/documentation/CorrectionScript.hpp" + +#include "test/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp" + +#include "test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.hpp" + +#include "test/v2.0/containers/Covariance.hpp" + +#include "test/v2.0/covariance/Covariance.hpp" +#include "test/v2.0/covariance/CovarianceMatrix.hpp" + +#include "test/v2.0/documentation/CovarianceScript.hpp" + +#include "test/v2.0/covariance/CovarianceSection.hpp" +#include "test/v2.0/covariance/CovarianceSections.hpp" +#include "test/v2.0/covariance/CovarianceSuite.hpp" + +#include "test/v2.0/transport/CrossSection.hpp" + +#include "test/v2.0/styles/CrossSectionReconstructed.hpp" + +#include "test/v2.0/transport/CrossSectionSum.hpp" +#include "test/v2.0/transport/CrossSectionSums.hpp" + +#include "test/v2.0/containers/Data.hpp" + +#include "test/v2.0/documentation/Date.hpp" +#include "test/v2.0/documentation/Dates.hpp" + +#include "test/v2.0/tsl/DebyeWallerIntegral.hpp" + +#include "test/v2.0/pops/Decay.hpp" +#include "test/v2.0/pops/DecayData.hpp" +#include "test/v2.0/pops/DecayMode.hpp" +#include "test/v2.0/pops/DecayModes.hpp" +#include "test/v2.0/pops/DecayPath.hpp" + +#include "test/v2.0/fissionTransport/DelayedBetaEnergy.hpp" +#include "test/v2.0/fissionTransport/DelayedGammaEnergy.hpp" + +#include "test/v2.0/fissionFragmentData/DelayedNeutron.hpp" + +#include "test/v2.0/fissionTransport/DelayedNeutronKE.hpp" + +#include "test/v2.0/fissionFragmentData/DelayedNeutrons.hpp" + +#include "test/v2.0/pops/Discrete.hpp" +#include "test/v2.0/pops/DiscreteEnergy.hpp" + +#include "test/v2.0/transport/DiscreteGamma.hpp" + +#include "test/v2.0/tsl/DistinctScatteringKernel.hpp" + +#include "test/v2.0/transport/Distribution.hpp" + +#include "test/v2.0/documentation/Documentation.hpp" + +#include "test/v2.0/containers/Double.hpp" + +#include "test/v2.0/extra/Double.hpp" + +#include "test/v2.0/transport/DoubleDifferentialCrossSection.hpp" + +#include "test/v2.0/fissionTransport/EFH.hpp" +#include "test/v2.0/fissionTransport/EFL.hpp" + +#include "test/v2.0/appData/ENDFconversionFlags.hpp" + +#include "test/v2.0/tsl/E_critical.hpp" +#include "test/v2.0/tsl/E_max.hpp" + +#include "test/v2.0/fpy/ElapsedTime.hpp" +#include "test/v2.0/fpy/ElapsedTimes.hpp" + +#include "test/v2.0/documentation/EndfCompatible.hpp" + +#include "test/v2.0/common/Energy.hpp" + +#include "test/v2.0/fpy/Energy.hpp" + +#include "test/v2.0/pops/Energy.hpp" + +#include "test/v2.0/transport/EnergyAngular.hpp" + +#include "test/v2.0/processed/EnergyAngularMC.hpp" + +#include "test/v2.0/resonances/EnergyInterval.hpp" +#include "test/v2.0/resonances/EnergyIntervals.hpp" + +#include "test/v2.0/transport/Energy_uncorrelated.hpp" + +#include "test/v2.0/styles/EqualProbableBins.hpp" +#include "test/v2.0/styles/Evaluated.hpp" + +#include "test/v2.0/transport/Evaporation.hpp" + +#include "test/v2.0/documentation/ExecutionArguments.hpp" +#include "test/v2.0/documentation/ExforDataSet.hpp" +#include "test/v2.0/documentation/ExforDataSets.hpp" +#include "test/v2.0/documentation/ExperimentalDataSets.hpp" + +#include "test/v2.0/common/ExternalFile.hpp" +#include "test/v2.0/common/ExternalFiles.hpp" + +#include "test/v2.0/resonances/ExternalRMatrix.hpp" + +#include "test/v2.0/transport/F.hpp" +#include "test/v2.0/transport/FastRegion.hpp" + +#include "test/v2.0/fissionTransport/FissionComponent.hpp" +#include "test/v2.0/fissionTransport/FissionComponents.hpp" +#include "test/v2.0/fissionTransport/FissionEnergyReleased.hpp" + +#include "test/v2.0/fissionFragmentData/FissionFragmentData.hpp" + +#include "test/v2.0/styles/Flux.hpp" + +#include "test/v2.0/atomic/FormFactor.hpp" + +#include "test/v2.0/transport/Forward.hpp" + +#include "test/v2.0/containers/Fraction.hpp" + +#include "test/v2.0/tsl/FreeGasApproximation.hpp" + +#include "test/v2.0/containers/Function1ds.hpp" +#include "test/v2.0/containers/Function2ds.hpp" +#include "test/v2.0/containers/Function3ds.hpp" + +#include "test/v2.0/transport/G.hpp" + +#include "test/v2.0/pops/GaugeBoson.hpp" +#include "test/v2.0/pops/GaugeBosons.hpp" + +#include "test/v2.0/tsl/GaussianApproximation.hpp" + +#include "test/v2.0/transport/GeneralEvaporation.hpp" + +#include "test/v2.0/containers/Grid.hpp" +#include "test/v2.0/containers/Gridded1d.hpp" +#include "test/v2.0/containers/Gridded2d.hpp" +#include "test/v2.0/containers/Gridded3d.hpp" + +#include "test/v2.0/styles/GriddedCrossSection.hpp" + +#include "test/v2.0/pops/Halflife.hpp" + +#include "test/v2.0/resonances/HardSphereRadius.hpp" + +#include "test/v2.0/styles/Heated.hpp" +#include "test/v2.0/styles/HeatedMultiGroup.hpp" + +#include "test/v2.0/atomic/ImaginaryAnomalousFactor.hpp" + +#include "test/v2.0/cpTransport/ImaginaryInterferenceTerm.hpp" + +#include "test/v2.0/map/Import.hpp" + +#include "test/v2.0/fpy/IncidentEnergies.hpp" +#include "test/v2.0/fpy/IncidentEnergy.hpp" + +#include "test/v2.0/transport/IncoherentPhoton.hpp" + +#include "test/v2.0/atomic/IncoherentPhotonScattering.hpp" + +#include "test/v2.0/transport/IncompleteReactions.hpp" + +#include "test/v2.0/documentation/InputDeck.hpp" +#include "test/v2.0/documentation/InputDecks.hpp" + +#include "test/v2.0/appData/Institution.hpp" + +#include "test/v2.0/containers/Integer.hpp" + +#include "test/v2.0/pops/Intensity.hpp" +#include "test/v2.0/pops/InternalConversionCoefficients.hpp" +#include "test/v2.0/pops/InternalPairFormationCoefficient.hpp" + +#include "test/v2.0/containers/Interval.hpp" + +#include "test/v2.0/pops/Interval.hpp" + +#include "test/v2.0/styles/InverseSpeed.hpp" + +#include "test/v2.0/pops/Isotope.hpp" +#include "test/v2.0/pops/Isotopes.hpp" + +#include "test/v2.0/transport/Isotropic2d.hpp" + +#include "test/v2.0/resonances/J.hpp" +#include "test/v2.0/resonances/Js.hpp" + +#include "test/v2.0/transport/KalbachMann.hpp" + +#include "test/v2.0/documentation/Keyword.hpp" +#include "test/v2.0/documentation/Keywords.hpp" + +#include "test/v2.0/resonances/L.hpp" + +#include "test/v2.0/containers/Legendre.hpp" + +#include "test/v2.0/pops/Lepton.hpp" +#include "test/v2.0/pops/Leptons.hpp" + +#include "test/v2.0/resonances/LevelSpacing.hpp" + +#include "test/v2.0/containers/Link.hpp" +#include "test/v2.0/containers/ListOfCovariances.hpp" +#include "test/v2.0/containers/LogNormal.hpp" + +#include "test/v2.0/pops/LogNormal.hpp" + +#include "test/v2.0/resonances/Ls.hpp" + +#include "test/v2.0/fissionTransport/MadlandNix.hpp" + +#include "test/v2.0/map/Map.hpp" + +#include "test/v2.0/common/Mass.hpp" + +#include "test/v2.0/pops/Mass.hpp" + +#include "test/v2.0/tsl/Mass.hpp" + +#include "test/v2.0/pops/MetaStable.hpp" + +#include "test/v2.0/covariance/Mixed.hpp" + +#include "test/v2.0/styles/MonteCarlo_cdf.hpp" +#include "test/v2.0/styles/MultiBand.hpp" +#include "test/v2.0/styles/MultiGroup.hpp" + +#include "test/v2.0/processed/MultiGroup3d.hpp" + +#include "test/v2.0/transport/MultiGroup3d.hpp" +#include "test/v2.0/transport/Multiplicity.hpp" +#include "test/v2.0/transport/MultiplicitySum.hpp" +#include "test/v2.0/transport/MultiplicitySums.hpp" +#include "test/v2.0/transport/NBodyPhaseSpace.hpp" + +#include "test/v2.0/fissionTransport/NeutrinoEnergy.hpp" +#include "test/v2.0/fissionTransport/NonNeutrinoEnergy.hpp" + +#include "test/v2.0/documentation/Note.hpp" + +#include "test/v2.0/cpTransport/NuclearAmplitudeExpansion.hpp" +#include "test/v2.0/cpTransport/NuclearPlusInterference.hpp" +#include "test/v2.0/cpTransport/NuclearTerm.hpp" + +#include "test/v2.0/pops/Nucleus.hpp" +#include "test/v2.0/pops/Nuclide.hpp" + +#include "test/v2.0/fpy/Nuclides.hpp" + +#include "test/v2.0/pops/Nuclides.hpp" + +#include "test/v2.0/transport/OrphanProduct.hpp" +#include "test/v2.0/transport/OrphanProducts.hpp" +#include "test/v2.0/transport/OutputChannel.hpp" + +#include "test/v2.0/documentation/OutputDeck.hpp" +#include "test/v2.0/documentation/OutputDecks.hpp" + +#include "test/v2.0/covariance/ParameterCovariance.hpp" +#include "test/v2.0/covariance/ParameterCovarianceMatrix.hpp" +#include "test/v2.0/covariance/ParameterCovariances.hpp" +#include "test/v2.0/covariance/ParameterLink.hpp" +#include "test/v2.0/covariance/Parameters.hpp" + +#include "test/v2.0/pops/Parity.hpp" + +#include "test/v2.0/containers/Pdf.hpp" + +#include "test/v2.0/pops/Pdf.hpp" + +#include "test/v2.0/containers/Pdf_in_xs_pdf_cdf1d.hpp" + +#include "test/v2.0/tsl/PhononSpectrum.hpp" + +#include "test/v2.0/pops/PhotonEmissionProbabilities.hpp" + +#include "test/v2.0/transport/PhotonEmissionProbabilities.hpp" + +#include "test/v2.0/pops/PoPs_database.hpp" + +#include "test/v2.0/containers/Polynomial1d.hpp" + +#include "test/v2.0/pops/PositronEmissionIntensity.hpp" + +#include "test/v2.0/transport/PrimaryGamma.hpp" + +#include "test/v2.0/common/Probability.hpp" + +#include "test/v2.0/pops/Probability.hpp" + +#include "test/v2.0/common/Product.hpp" + +#include "test/v2.0/pops/Product.hpp" + +#include "test/v2.0/fpy/ProductYield.hpp" +#include "test/v2.0/fpy/ProductYields.hpp" + +#include "test/v2.0/transport/Production.hpp" +#include "test/v2.0/transport/Productions.hpp" + +#include "test/v2.0/common/Products.hpp" + +#include "test/v2.0/pops/Products.hpp" + +#include "test/v2.0/styles/ProjectileEnergyDomain.hpp" + +#include "test/v2.0/fissionTransport/PromptGammaEnergy.hpp" +#include "test/v2.0/fissionTransport/PromptNeutronKE.hpp" +#include "test/v2.0/fissionTransport/PromptProductKE.hpp" + +#include "test/v2.0/map/Protare.hpp" + +#include "test/v2.0/common/Q.hpp" + +#include "test/v2.0/pops/Q.hpp" + +#include "test/v2.0/transport/R.hpp" + +#include "test/v2.0/resonances/RMatrix.hpp" + +#include "test/v2.0/fissionFragmentData/Rate.hpp" + +#include "test/v2.0/transport/Reaction.hpp" +#include "test/v2.0/transport/ReactionSuite.hpp" +#include "test/v2.0/transport/Reactions.hpp" + +#include "test/v2.0/atomic/RealAnomalousFactor.hpp" + +#include "test/v2.0/cpTransport/RealInterferenceTerm.hpp" + +#include "test/v2.0/styles/Realization.hpp" + +#include "test/v2.0/transport/Recoil.hpp" +#include "test/v2.0/transport/Reference.hpp" + +#include "test/v2.0/containers/Regions1d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" +#include "test/v2.0/containers/Regions3d.hpp" + +#include "test/v2.0/documentation/RelatedItem.hpp" +#include "test/v2.0/documentation/RelatedItems.hpp" + +#include "test/v2.0/resonances/Resolved.hpp" + +#include "test/v2.0/transport/ResolvedRegion.hpp" + +#include "test/v2.0/resonances/ResonanceParameters.hpp" +#include "test/v2.0/resonances/ResonanceReaction.hpp" +#include "test/v2.0/resonances/ResonanceReactions.hpp" +#include "test/v2.0/resonances/Resonances.hpp" + +#include "test/v2.0/transport/ResonancesLink.hpp" +#include "test/v2.0/transport/ResonancesWithBackground.hpp" + +#include "test/v2.0/covariance/RowData.hpp" +#include "test/v2.0/covariance/RowSensitivity.hpp" + +#include "test/v2.0/cpTransport/RutherfordScattering.hpp" + +#include "test/v2.0/tsl/SCTApproximation.hpp" +#include "test/v2.0/tsl/S_table.hpp" + +#include "test/v2.0/covariance/SandwichProduct.hpp" + +#include "test/v2.0/tsl/ScatteringAtom.hpp" +#include "test/v2.0/tsl/ScatteringAtoms.hpp" + +#include "test/v2.0/atomic/ScatteringFactor.hpp" + +#include "test/v2.0/resonances/ScatteringRadius.hpp" + +#include "test/v2.0/tsl/SelfScatteringKernel.hpp" + +#include "test/v2.0/pops/Shell.hpp" + +#include "test/v2.0/covariance/ShortRangeSelfScalingVariance.hpp" + +#include "test/v2.0/styles/SigmaZeros.hpp" + +#include "test/v2.0/fissionTransport/SimpleMaxwellianFission.hpp" + +#include "test/v2.0/covariance/Slice.hpp" +#include "test/v2.0/covariance/Slices.hpp" + +#include "test/v2.0/styles/SnElasticUpScatter.hpp" + +#include "test/v2.0/pops/Spectra.hpp" +#include "test/v2.0/pops/Spectrum.hpp" +#include "test/v2.0/pops/Spin.hpp" + +#include "test/v2.0/resonances/SpinGroup.hpp" +#include "test/v2.0/resonances/SpinGroups.hpp" + +#include "test/v2.0/containers/Standard.hpp" + +#include "test/v2.0/pops/Standard.hpp" + +#include "test/v2.0/containers/String.hpp" + +#include "test/v2.0/tsl/StructureFactor.hpp" + +#include "test/v2.0/styles/Styles.hpp" + +#include "test/v2.0/covariance/Sum.hpp" +#include "test/v2.0/covariance/Summand.hpp" + +#include "test/v2.0/transport/Summands.hpp" +#include "test/v2.0/transport/Sums.hpp" + +#include "test/v2.0/map/TNSL.hpp" + +#include "test/v2.0/fissionTransport/T_M.hpp" + +#include "test/v2.0/tsl/T_effective.hpp" + +#include "test/v2.0/containers/Table.hpp" + +#include "test/v2.0/resonances/TabulatedWidths.hpp" + +#include "test/v2.0/common/Temperature.hpp" + +#include "test/v2.0/styles/Temperature.hpp" + +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw.hpp" +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw1d.hpp" +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" + +#include "test/v2.0/transport/Theta.hpp" + +#include "test/v2.0/fpy/Time.hpp" + +#include "test/v2.0/documentation/Title.hpp" + +#include "test/v2.0/fissionTransport/TotalEnergy.hpp" + +#include "test/v2.0/styles/Transportable.hpp" +#include "test/v2.0/styles/Transportables.hpp" + +#include "test/v2.0/transport/U.hpp" + +#include "test/v2.0/styles/URR_probabilityTables.hpp" + +#include "test/v2.0/transport/URR_probabilityTables1d.hpp" + +#include "test/v2.0/containers/Uncertainty.hpp" + +#include "test/v2.0/extra/Uncertainty.hpp" + +#include "test/v2.0/pops/Uncertainty.hpp" + +#include "test/v2.0/transport/Uncorrelated.hpp" + +#include "test/v2.0/pops/Unorthodox.hpp" +#include "test/v2.0/pops/Unorthodoxes.hpp" + +#include "test/v2.0/resonances/Unresolved.hpp" + +#include "test/v2.0/transport/UnresolvedRegion.hpp" +#include "test/v2.0/transport/Unspecified.hpp" + +#include "test/v2.0/containers/Values.hpp" + +#include "test/v2.0/documentation/Version.hpp" + +#include "test/v2.0/fissionTransport/Watt.hpp" + +#include "test/v2.0/transport/Weighted.hpp" +#include "test/v2.0/transport/WeightedFunctionals.hpp" + +#include "test/v2.0/resonances/Width.hpp" +#include "test/v2.0/resonances/Widths.hpp" + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/XYs3d.hpp" +#include "test/v2.0/containers/Xs_in_xs_pdf_cdf1d.hpp" +#include "test/v2.0/containers/Xs_pdf_cdf1d.hpp" + +#include "test/v2.0/fpy/Yields.hpp" + +#include "test/v2.0/containers/Ys1d.hpp" + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/appData/ApplicationData.hpp b/standards/gnds-2.0/test/src/test/v2.0/appData/ApplicationData.hpp new file mode 100644 index 000000000..0b269f0ac --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/appData/ApplicationData.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_APPDATA_APPLICATIONDATA +#define TEST_V2_0_APPDATA_APPLICATIONDATA + +#include "test/v2.0/appData/Institution.hpp" + +namespace test { +namespace v2_0 { +namespace appData { + +// ----------------------------------------------------------------------------- +// appData:: +// 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 "appData"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->institution \ + ) + + // default + ApplicationData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ApplicationData( + const wrapper> + &institution + ) : + GNDSTK_COMPONENT(BlockData{}), + institution(this,institution) + { + Component::finish(); + } + + // from node + explicit ApplicationData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ApplicationData(const ApplicationData &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + institution(this,other.institution) + { + Component::finish(other); + } + + // move + ApplicationData(ApplicationData &&other) : + 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 "test/v2.0/appData/ApplicationData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ApplicationData + +} // namespace appData +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/appData/ApplicationData/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/appData/ApplicationData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/appData/ApplicationData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/appData/Conversion.hpp b/standards/gnds-2.0/test/src/test/v2.0/appData/Conversion.hpp new file mode 100644 index 000000000..f4ed08d05 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/appData/Conversion.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_APPDATA_CONVERSION +#define TEST_V2_0_APPDATA_CONVERSION + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace appData { + +// ----------------------------------------------------------------------------- +// appData:: +// 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 "appData"; } + 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::optional{} + / Meta<>("flags") | + 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", + "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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->flags, \ + this->href \ + ) + + // default + Conversion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Conversion( + const wrapper> + &flags, + const wrapper> + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + flags(this,flags), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Conversion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Conversion(const Conversion &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + flags(this,other.flags), + href(this,other.href) + { + Component::finish(other); + } + + // move + Conversion(Conversion &&other) : + 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 "test/v2.0/appData/Conversion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Conversion + +} // namespace appData +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/appData/Conversion/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/appData/Conversion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/appData/Conversion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/appData/ENDFconversionFlags.hpp b/standards/gnds-2.0/test/src/test/v2.0/appData/ENDFconversionFlags.hpp new file mode 100644 index 000000000..5d372274b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/appData/ENDFconversionFlags.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_APPDATA_ENDFCONVERSIONFLAGS +#define TEST_V2_0_APPDATA_ENDFCONVERSIONFLAGS + +#include "test/v2.0/appData/Conversion.hpp" + +namespace test { +namespace v2_0 { +namespace appData { + +// ----------------------------------------------------------------------------- +// appData:: +// 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 "appData"; } + 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{} | + + // 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", + "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", + "conversion" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + conversion{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->conversion \ + ) + + // default + ENDFconversionFlags() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ENDFconversionFlags( + const wrapper> + &conversion + ) : + GNDSTK_COMPONENT(BlockData{}), + conversion(this,conversion) + { + Component::finish(); + } + + // from node + explicit ENDFconversionFlags(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ENDFconversionFlags(const ENDFconversionFlags &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + conversion(this,other.conversion) + { + Component::finish(other); + } + + // move + ENDFconversionFlags(ENDFconversionFlags &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + 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; + conversion = other.conversion; + } + return *this; + } + + // move + ENDFconversionFlags &operator=(ENDFconversionFlags &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + conversion = std::move(other.conversion); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/appData/ENDFconversionFlags/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ENDFconversionFlags + +} // namespace appData +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/appData/ENDFconversionFlags/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/appData/ENDFconversionFlags/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/appData/ENDFconversionFlags/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/appData/Institution.hpp b/standards/gnds-2.0/test/src/test/v2.0/appData/Institution.hpp new file mode 100644 index 000000000..3f39eb16f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/appData/Institution.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_APPDATA_INSTITUTION +#define TEST_V2_0_APPDATA_INSTITUTION + +#include "test/v2.0/appData/ENDFconversionFlags.hpp" + +namespace test { +namespace v2_0 { +namespace appData { + +// ----------------------------------------------------------------------------- +// appData:: +// 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 "appData"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDFconversionFlags \ + ) + + // default + Institution() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Institution( + const wrapper> + &label, + const wrapper> + &ENDFconversionFlags = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ENDFconversionFlags(this,ENDFconversionFlags) + { + Component::finish(); + } + + // from node + explicit Institution(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Institution(const Institution &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ENDFconversionFlags(this,other.ENDFconversionFlags) + { + Component::finish(other); + } + + // move + Institution(Institution &&other) : + 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 "test/v2.0/appData/Institution/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Institution + +} // namespace appData +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/appData/Institution/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/appData/Institution/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/appData/Institution/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/CoherentPhotonScattering.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/CoherentPhotonScattering.hpp new file mode 100644 index 000000000..d4b7faa8c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/CoherentPhotonScattering.hpp @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_ATOMIC_COHERENTPHOTONSCATTERING +#define TEST_V2_0_ATOMIC_COHERENTPHOTONSCATTERING + +#include "test/v2.0/atomic/FormFactor.hpp" +#include "test/v2.0/atomic/RealAnomalousFactor.hpp" +#include "test/v2.0/atomic/ImaginaryAnomalousFactor.hpp" + +namespace test { +namespace v2_0 { +namespace atomic { + +// ----------------------------------------------------------------------------- +// atomic:: +// 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 "atomic"; } + 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::optional{} + / Meta<>("href") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("pid") | + enums::Frame{} + / 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", + "href", + "label", + "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", + "href", + "label", + "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> + href{this}; + Field> + label{this}; + Field> + pid{this}; + Field + productFrame{this}; + + // children + Field> + formFactor{this}; + Field> + realAnomalousFactor{this}; + Field> + imaginaryAnomalousFactor{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->formFactor, \ + this->realAnomalousFactor, \ + this->imaginaryAnomalousFactor \ + ) + + // default + CoherentPhotonScattering() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CoherentPhotonScattering( + const wrapper> + &href, + const wrapper> + &label = {}, + const wrapper> + &pid = {}, + const wrapper + &productFrame = {}, + const wrapper> + &formFactor = {}, + const wrapper> + &realAnomalousFactor = {}, + const wrapper> + &imaginaryAnomalousFactor = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href), + label(this,label), + pid(this,pid), + productFrame(this,productFrame), + formFactor(this,formFactor), + realAnomalousFactor(this,realAnomalousFactor), + imaginaryAnomalousFactor(this,imaginaryAnomalousFactor) + { + Component::finish(); + } + + // from node + explicit CoherentPhotonScattering(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CoherentPhotonScattering(const CoherentPhotonScattering &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href), + label(this,other.label), + 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) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)), + label(this,std::move(other.label)), + 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; + href = other.href; + label = other.label; + 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); + href = std::move(other.href); + label = std::move(other.label); + 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 "test/v2.0/atomic/CoherentPhotonScattering/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CoherentPhotonScattering + +} // namespace atomic +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/CoherentPhotonScattering/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/CoherentPhotonScattering/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/CoherentPhotonScattering/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/FormFactor.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/FormFactor.hpp new file mode 100644 index 000000000..665fef691 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/FormFactor.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_ATOMIC_FORMFACTOR +#define TEST_V2_0_ATOMIC_FORMFACTOR + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace atomic { + +// ----------------------------------------------------------------------------- +// atomic:: +// 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 "atomic"; } + 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") | + --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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + FormFactor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FormFactor( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit FormFactor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FormFactor(const FormFactor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + FormFactor(FormFactor &&other) : + 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 + FormFactor &operator=(const FormFactor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + 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); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/atomic/FormFactor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FormFactor + +} // namespace atomic +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/FormFactor/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/FormFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/FormFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/ImaginaryAnomalousFactor.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/ImaginaryAnomalousFactor.hpp new file mode 100644 index 000000000..007977089 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/ImaginaryAnomalousFactor.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_ATOMIC_IMAGINARYANOMALOUSFACTOR +#define TEST_V2_0_ATOMIC_IMAGINARYANOMALOUSFACTOR + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace atomic { + +// ----------------------------------------------------------------------------- +// atomic:: +// 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 "atomic"; } + 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") | + --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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + ImaginaryAnomalousFactor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ImaginaryAnomalousFactor( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit ImaginaryAnomalousFactor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ImaginaryAnomalousFactor(const ImaginaryAnomalousFactor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + ImaginaryAnomalousFactor(ImaginaryAnomalousFactor &&other) : + 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 + ImaginaryAnomalousFactor &operator=(const ImaginaryAnomalousFactor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + 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); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/atomic/ImaginaryAnomalousFactor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ImaginaryAnomalousFactor + +} // namespace atomic +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/ImaginaryAnomalousFactor/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/ImaginaryAnomalousFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/ImaginaryAnomalousFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/IncoherentPhotonScattering.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/IncoherentPhotonScattering.hpp new file mode 100644 index 000000000..2c72a63b6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/IncoherentPhotonScattering.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_ATOMIC_INCOHERENTPHOTONSCATTERING +#define TEST_V2_0_ATOMIC_INCOHERENTPHOTONSCATTERING + +#include "test/v2.0/atomic/ScatteringFactor.hpp" + +namespace test { +namespace v2_0 { +namespace atomic { + +// ----------------------------------------------------------------------------- +// atomic:: +// 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 "atomic"; } + 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::optional{} + / Meta<>("href") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("pid") | + enums::Frame{} + / 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", + "href", + "label", + "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", + "href", + "label", + "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> + href{this}; + Field> + label{this}; + Field> + pid{this}; + Field + productFrame{this}; + + // children + Field> + scatteringFactor{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->scatteringFactor \ + ) + + // default + IncoherentPhotonScattering() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncoherentPhotonScattering( + const wrapper> + &href, + const wrapper> + &label = {}, + const wrapper> + &pid = {}, + const wrapper + &productFrame = {}, + const wrapper> + &scatteringFactor = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href), + label(this,label), + pid(this,pid), + productFrame(this,productFrame), + scatteringFactor(this,scatteringFactor) + { + Component::finish(); + } + + // from node + explicit IncoherentPhotonScattering(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncoherentPhotonScattering(const IncoherentPhotonScattering &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href), + label(this,other.label), + pid(this,other.pid), + productFrame(this,other.productFrame), + scatteringFactor(this,other.scatteringFactor) + { + Component::finish(other); + } + + // move + IncoherentPhotonScattering(IncoherentPhotonScattering &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)), + label(this,std::move(other.label)), + 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; + href = other.href; + label = other.label; + 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); + href = std::move(other.href); + label = std::move(other.label); + pid = std::move(other.pid); + productFrame = std::move(other.productFrame); + scatteringFactor = std::move(other.scatteringFactor); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/atomic/IncoherentPhotonScattering/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class IncoherentPhotonScattering + +} // namespace atomic +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/IncoherentPhotonScattering/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/IncoherentPhotonScattering/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/IncoherentPhotonScattering/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/RealAnomalousFactor.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/RealAnomalousFactor.hpp new file mode 100644 index 000000000..aeff8ef8d --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/RealAnomalousFactor.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_ATOMIC_REALANOMALOUSFACTOR +#define TEST_V2_0_ATOMIC_REALANOMALOUSFACTOR + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace atomic { + +// ----------------------------------------------------------------------------- +// atomic:: +// 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 "atomic"; } + 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") | + --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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + RealAnomalousFactor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RealAnomalousFactor( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit RealAnomalousFactor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RealAnomalousFactor(const RealAnomalousFactor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + RealAnomalousFactor(RealAnomalousFactor &&other) : + 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 + RealAnomalousFactor &operator=(const RealAnomalousFactor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + 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); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/atomic/RealAnomalousFactor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RealAnomalousFactor + +} // namespace atomic +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/RealAnomalousFactor/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/RealAnomalousFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/RealAnomalousFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/ScatteringFactor.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/ScatteringFactor.hpp new file mode 100644 index 000000000..d24e8c571 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/ScatteringFactor.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_ATOMIC_SCATTERINGFACTOR +#define TEST_V2_0_ATOMIC_SCATTERINGFACTOR + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace atomic { + +// ----------------------------------------------------------------------------- +// atomic:: +// 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 "atomic"; } + 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") | + --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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + ScatteringFactor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringFactor( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit ScatteringFactor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringFactor(const ScatteringFactor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + ScatteringFactor(ScatteringFactor &&other) : + 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 + ScatteringFactor &operator=(const ScatteringFactor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + 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); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/atomic/ScatteringFactor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ScatteringFactor + +} // namespace atomic +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/atomic/ScatteringFactor/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/atomic/ScatteringFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/atomic/ScatteringFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Energy.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Energy.hpp new file mode 100644 index 000000000..880b071ea --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Energy.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COMMON_ENERGY +#define TEST_V2_0_COMMON_ENERGY + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace common { + +// ----------------------------------------------------------------------------- +// common:: +// 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 "common"; } + 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<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + ++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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + Field> + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->Double \ + ) + + // default + Energy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Energy( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper> + &Double = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Energy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Energy(const Energy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Energy(Energy &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Energy &operator=(const Energy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + Double = other.Double; + } + return *this; + } + + // move + Energy &operator=(Energy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/common/Energy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Energy + +} // namespace common +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Energy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Energy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Energy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFile.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFile.hpp new file mode 100644 index 000000000..0cf6ad2fc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFile.hpp @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COMMON_EXTERNALFILE +#define TEST_V2_0_COMMON_EXTERNALFILE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace common { + +// ----------------------------------------------------------------------------- +// common:: +// 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 "common"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->path, \ + this->checksum, \ + this->algorithm \ + ) + + // default + ExternalFile() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ExternalFile( + const wrapper + &label, + const wrapper + &path = {}, + const wrapper> + &checksum = {}, + const wrapper> + &algorithm = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + path(this,path), + checksum(this,checksum), + algorithm(this,algorithm) + { + Component::finish(); + } + + // from node + explicit ExternalFile(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExternalFile(const ExternalFile &other) : + 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) : + 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 "test/v2.0/common/ExternalFile/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ExternalFile + +} // namespace common +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFile/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFile/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFile/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFiles.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFiles.hpp new file mode 100644 index 000000000..1397d66ba --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFiles.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COMMON_EXTERNALFILES +#define TEST_V2_0_COMMON_EXTERNALFILES + +#include "test/v2.0/common/ExternalFile.hpp" + +namespace test { +namespace v2_0 { +namespace common { + +// ----------------------------------------------------------------------------- +// common:: +// 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 "common"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->externalFile \ + ) + + // default + ExternalFiles() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ExternalFiles( + const wrapper> + &externalFile + ) : + GNDSTK_COMPONENT(BlockData{}), + externalFile(this,externalFile) + { + Component::finish(); + } + + // from node + explicit ExternalFiles(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExternalFiles(const ExternalFiles &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + externalFile(this,other.externalFile) + { + Component::finish(other); + } + + // move + ExternalFiles(ExternalFiles &&other) : + 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 "test/v2.0/common/ExternalFiles/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ExternalFiles + +} // namespace common +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFiles/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFiles/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/ExternalFiles/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Mass.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Mass.hpp new file mode 100644 index 000000000..a662b74eb --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Mass.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COMMON_MASS +#define TEST_V2_0_COMMON_MASS + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace common { + +// ----------------------------------------------------------------------------- +// common:: +// 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 "common"; } + 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<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + ++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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + Field> + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->Double \ + ) + + // default + Mass() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Mass( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper> + &Double = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Mass(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Mass(const Mass &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Mass(Mass &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + 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; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + Double = other.Double; + } + return *this; + } + + // move + Mass &operator=(Mass &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/common/Mass/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Mass + +} // namespace common +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Mass/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Mass/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Mass/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Probability.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Probability.hpp new file mode 100644 index 000000000..2bb150451 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Probability.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COMMON_PROBABILITY +#define TEST_V2_0_COMMON_PROBABILITY + +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace common { + +// ----------------------------------------------------------------------------- +// common:: +// 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 "common"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Probability() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Probability( + const wrapper> + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Probability(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Probability(const Probability &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Probability(Probability &&other) : + 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 "test/v2.0/common/Probability/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Probability + +} // namespace common +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Probability/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Probability/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Probability/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Product.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Product.hpp new file mode 100644 index 000000000..ad684426c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Product.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COMMON_PRODUCT +#define TEST_V2_0_COMMON_PRODUCT + +#include "test/v2.0/transport/Multiplicity.hpp" +#include "test/v2.0/transport/Distribution.hpp" + +namespace test { +namespace v2_0 { +namespace common { + +// ----------------------------------------------------------------------------- +// common:: +// 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 "common"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->multiplicity, \ + this->distribution \ + ) + + // default + Product() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Product( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper + &multiplicity = {}, + const wrapper + &distribution = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + multiplicity(this,multiplicity), + distribution(this,distribution) + { + Component::finish(); + } + + // from node + explicit Product(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Product(const Product &other) : + 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) : + 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 "test/v2.0/common/Product/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Product + +} // namespace common +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Product/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Product/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Product/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Products.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Products.hpp new file mode 100644 index 000000000..ceb11f7d7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Products.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COMMON_PRODUCTS +#define TEST_V2_0_COMMON_PRODUCTS + +#include "test/v2.0/common/Product.hpp" + +namespace test { +namespace v2_0 { +namespace common { + +// ----------------------------------------------------------------------------- +// common:: +// 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 "common"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->product \ + ) + + // default + Products() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Products( + const wrapper>> + &product + ) : + GNDSTK_COMPONENT(BlockData{}), + product(this,product) + { + Component::finish(); + } + + // from node + explicit Products(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Products(const Products &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + product(this,other.product) + { + Component::finish(other); + } + + // move + Products(Products &&other) : + 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 "test/v2.0/common/Products/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Products + +} // namespace common +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Products/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Products/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Products/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Q.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Q.hpp new file mode 100644 index 000000000..57cffa87b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Q.hpp @@ -0,0 +1,274 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COMMON_Q +#define TEST_V2_0_COMMON_Q + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" +#include "test/v2.0/containers/Constant1d.hpp" +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" +#include "test/v2.0/containers/Polynomial1d.hpp" +#include "test/v2.0/containers/Gridded1d.hpp" + +namespace test { +namespace v2_0 { +namespace common { + +// ----------------------------------------------------------------------------- +// common:: +// class Q +// ----------------------------------------------------------------------------- + +class Q : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::Constant1d, + containers::XYs1d, + containers::Regions1d, + containers::Polynomial1d, + containers::Gridded1d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "common"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + XMLName{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + _t{} + / --(Child<>("constant1d") || Child<>("XYs1d") || Child<>("regions1d") || Child<>("polynomial1d") || Child<>("gridded1d")) + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "unit", + "value", + "documentation", + "uncertainty", + "_constant1dXYs1dregions1dpolynomial1dgridded1d" + }; + 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", + "unit", + "value", + "documentation", + "uncertainty", + "_constant1d_xys1dregions1dpolynomial1dgridded1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + + // children - variant + Field<_t> + _constant1dXYs1dregions1dpolynomial1dgridded1d{this}; + FieldPart constant1d{_constant1dXYs1dregions1dpolynomial1dgridded1d}; + FieldPart XYs1d{_constant1dXYs1dregions1dpolynomial1dgridded1d}; + FieldPart regions1d{_constant1dXYs1dregions1dpolynomial1dgridded1d}; + FieldPart polynomial1d{_constant1dXYs1dregions1dpolynomial1dgridded1d}; + FieldPart gridded1d{_constant1dXYs1dregions1dpolynomial1dgridded1d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->_constant1dXYs1dregions1dpolynomial1dgridded1d \ + ) + + // default + Q() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Q( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper<_t> + &_constant1dXYs1dregions1dpolynomial1dgridded1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + _constant1dXYs1dregions1dpolynomial1dgridded1d(this,_constant1dXYs1dregions1dpolynomial1dgridded1d) + { + Component::finish(); + } + + // from node + explicit Q(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Q(const Q &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + _constant1dXYs1dregions1dpolynomial1dgridded1d(this,other._constant1dXYs1dregions1dpolynomial1dgridded1d) + { + Component::finish(other); + } + + // move + Q(Q &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + _constant1dXYs1dregions1dpolynomial1dgridded1d(this,std::move(other._constant1dXYs1dregions1dpolynomial1dgridded1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Q &operator=(const Q &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + _constant1dXYs1dregions1dpolynomial1dgridded1d = other._constant1dXYs1dregions1dpolynomial1dgridded1d; + } + return *this; + } + + // move + Q &operator=(Q &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + _constant1dXYs1dregions1dpolynomial1dgridded1d = std::move(other._constant1dXYs1dregions1dpolynomial1dgridded1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/common/Q/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Q + +} // namespace common +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Q/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Q/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Q/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Temperature.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Temperature.hpp new file mode 100644 index 000000000..c6dcfac90 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Temperature.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COMMON_TEMPERATURE +#define TEST_V2_0_COMMON_TEMPERATURE + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace common { + +// ----------------------------------------------------------------------------- +// common:: +// 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 "common"; } + 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 + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --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", + "unit", + "value", + "documentation", + "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", + "unit", + "value", + "documentation", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty \ + ) + + // default + Temperature() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Temperature( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Temperature(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Temperature(const Temperature &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Temperature(Temperature &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Temperature &operator=(const Temperature &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Temperature &operator=(Temperature &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/common/Temperature/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Temperature + +} // namespace common +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/common/Temperature/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/common/Temperature/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/common/Temperature/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Array.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Array.hpp new file mode 100644 index 000000000..efeee5073 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Array.hpp @@ -0,0 +1,287 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_ARRAY +#define TEST_V2_0_CONTAINERS_ARRAY + +#include "test/v2.0/containers/Values.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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 + IntegerTuple{} + / Meta<>("shape") | + std::optional{} + / Meta<>("compression") | + std::optional{} + / Meta<>("symmetry") | + std::optional{} + / Meta<>("permutation") | + Defaulted{"row-major"} + / Meta<>("storageOrder") | + std::optional{} + / Meta<>("offset") | + + // children + ++Child> + ("values") | + ++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", + "shape", + "compression", + "symmetry", + "permutation", + "storageOrder", + "offset", + "values", + "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", + "shape", + "compression", + "symmetry", + "permutation", + "storage_order", + "offset", + "values", + "array" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const UTF8Text storageOrder = "row-major"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + shape{this}; + Field> + compression{this}; + Field> + symmetry{this}; + Field> + permutation{this}; + Field> + storageOrder{this,defaults.storageOrder}; + Field> + offset{this}; + + // children + Field>> + values{this}; + Field>> + array{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shape, \ + this->compression, \ + this->symmetry, \ + this->permutation, \ + this->storageOrder, \ + this->offset, \ + this->values, \ + this->array \ + ) + + // default + Array() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Array( + const wrapper + &shape, + const wrapper> + &compression = {}, + const wrapper> + &symmetry = {}, + const wrapper> + &permutation = {}, + const wrapper> + &storageOrder = {}, + const wrapper> + &offset = {}, + const wrapper>> + &values = {}, + const wrapper>> + &array = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + shape(this,shape), + compression(this,compression), + symmetry(this,symmetry), + permutation(this,permutation), + storageOrder(this,defaults.storageOrder,storageOrder), + offset(this,offset), + values(this,values), + array(this,array) + { + Component::finish(); + } + + // from node + explicit Array(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Array(const Array &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shape(this,other.shape), + compression(this,other.compression), + symmetry(this,other.symmetry), + permutation(this,other.permutation), + storageOrder(this,other.storageOrder), + offset(this,other.offset), + values(this,other.values), + array(this,other.array) + { + Component::finish(other); + } + + // move + Array(Array &&other) : + 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)), + permutation(this,std::move(other.permutation)), + storageOrder(this,std::move(other.storageOrder)), + offset(this,std::move(other.offset)), + values(this,std::move(other.values)), + array(this,std::move(other.array)) + { + 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; + permutation = other.permutation; + storageOrder = other.storageOrder; + offset = other.offset; + values = other.values; + array = other.array; + } + 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); + permutation = std::move(other.permutation); + storageOrder = std::move(other.storageOrder); + offset = std::move(other.offset); + values = std::move(other.values); + array = std::move(other.array); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Array/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Array + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Array/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Array/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Array/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Axes.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Axes.hpp new file mode 100644 index 000000000..434687c93 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Axes.hpp @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_AXES +#define TEST_V2_0_CONTAINERS_AXES + +#include "test/v2.0/containers/Axis.hpp" +#include "test/v2.0/containers/Grid.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "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 + ++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 + Field>> + axis{this}; + Field>> + grid{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->axis, \ + this->grid \ + ) + + // default + Axes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axes( + const wrapper> + &href, + const wrapper>> + &axis = {}, + const wrapper>> + &grid = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href), + axis(this,axis), + grid(this,grid) + { + Component::finish(); + } + + // from node + explicit Axes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axes(const Axes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href), + axis(this,other.axis), + grid(this,other.grid) + { + Component::finish(other); + } + + // move + Axes(Axes &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)), + 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; + href = other.href; + 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); + href = std::move(other.href); + axis = std::move(other.axis); + grid = std::move(other.grid); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Axes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Axes + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Axes/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Axes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Axes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Axis.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Axis.hpp new file mode 100644 index 000000000..217ad3cf6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Axis.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_AXIS +#define TEST_V2_0_CONTAINERS_AXIS + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +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") | + XMLName{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->label, \ + this->unit \ + ) + + // default + Axis() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axis( + const wrapper> + &index, + const wrapper + &label = {}, + const wrapper> + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + label(this,label), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Axis(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axis(const Axis &other) : + 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) : + 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 "test/v2.0/containers/Axis/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Axis + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Axis/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Axis/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Axis/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Cdf_in_xs_pdf_cdf1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Cdf_in_xs_pdf_cdf1d.hpp new file mode 100644 index 000000000..f7ee222c2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Cdf_in_xs_pdf_cdf1d.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_CDF_IN_XS_PDF_CDF1D +#define TEST_V2_0_CONTAINERS_CDF_IN_XS_PDF_CDF1D + +#include "test/v2.0/containers/Values.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Cdf_in_xs_pdf_cdf1d +// ----------------------------------------------------------------------------- + +class Cdf_in_xs_pdf_cdf1d : + 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 "Cdf_in_xs_pdf_cdf1d"; } + static auto NODENAME() { return "cdf"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // 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", + "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", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->values \ + ) + + // default + Cdf_in_xs_pdf_cdf1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Cdf_in_xs_pdf_cdf1d( + const wrapper + &values + ) : + GNDSTK_COMPONENT(BlockData{}), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Cdf_in_xs_pdf_cdf1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Cdf_in_xs_pdf_cdf1d(const Cdf_in_xs_pdf_cdf1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + values(this,other.values) + { + Component::finish(other); + } + + // move + Cdf_in_xs_pdf_cdf1d(Cdf_in_xs_pdf_cdf1d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Cdf_in_xs_pdf_cdf1d &operator=(const Cdf_in_xs_pdf_cdf1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + values = other.values; + } + return *this; + } + + // move + Cdf_in_xs_pdf_cdf1d &operator=(Cdf_in_xs_pdf_cdf1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Cdf_in_xs_pdf_cdf1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Cdf_in_xs_pdf_cdf1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Column.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Column.hpp new file mode 100644 index 000000000..27544f26f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Column.hpp @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_COLUMN +#define TEST_V2_0_CONTAINERS_COLUMN + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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 + Integer32{} + / Meta<>("index") | + XMLName{} + / Meta<>("name") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("types") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "types" + }; + 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", + "types" + }; + 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}; + Field> + types{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->name, \ + this->unit, \ + this->types \ + ) + + // default + Column() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Column( + const wrapper + &index, + const wrapper + &name = {}, + const wrapper> + &unit = {}, + const wrapper> + &types = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + name(this,name), + unit(this,unit), + types(this,types) + { + Component::finish(); + } + + // from node + explicit Column(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Column(const Column &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + name(this,other.name), + unit(this,other.unit), + types(this,other.types) + { + Component::finish(other); + } + + // move + Column(Column &&other) : + 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)), + types(this,std::move(other.types)) + { + 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; + types = other.types; + } + 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); + types = std::move(other.types); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Column/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Column + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Column/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Column/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Column/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/ColumnHeaders.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/ColumnHeaders.hpp new file mode 100644 index 000000000..9cb10d2f3 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/ColumnHeaders.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_COLUMNHEADERS +#define TEST_V2_0_CONTAINERS_COLUMNHEADERS + +#include "test/v2.0/containers/Column.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->column \ + ) + + // default + ColumnHeaders() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ColumnHeaders( + const wrapper> + &column + ) : + GNDSTK_COMPONENT(BlockData{}), + column(this,column) + { + Component::finish(); + } + + // from node + explicit ColumnHeaders(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ColumnHeaders(const ColumnHeaders &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + column(this,other.column) + { + Component::finish(other); + } + + // move + ColumnHeaders(ColumnHeaders &&other) : + 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 "test/v2.0/containers/ColumnHeaders/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ColumnHeaders + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/ColumnHeaders/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/ColumnHeaders/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/ColumnHeaders/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/ConfidenceIntervals.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/ConfidenceIntervals.hpp new file mode 100644 index 000000000..7eba6eb02 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/ConfidenceIntervals.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_CONFIDENCEINTERVALS +#define TEST_V2_0_CONTAINERS_CONFIDENCEINTERVALS + +#include "test/v2.0/containers/Interval.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class ConfidenceIntervals +// ----------------------------------------------------------------------------- + +class ConfidenceIntervals : + 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 "ConfidenceIntervals"; } + static auto NODENAME() { return "confidenceIntervals"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("interval") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "interval" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "interval" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + interval{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->interval \ + ) + + // default + ConfidenceIntervals() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ConfidenceIntervals( + const wrapper> + &interval + ) : + GNDSTK_COMPONENT(BlockData{}), + interval(this,interval) + { + Component::finish(); + } + + // from node + explicit ConfidenceIntervals(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ConfidenceIntervals(const ConfidenceIntervals &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + interval(this,other.interval) + { + Component::finish(other); + } + + // move + ConfidenceIntervals(ConfidenceIntervals &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + interval(this,std::move(other.interval)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ConfidenceIntervals &operator=(const ConfidenceIntervals &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + interval = other.interval; + } + return *this; + } + + // move + ConfidenceIntervals &operator=(ConfidenceIntervals &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + interval = std::move(other.interval); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/ConfidenceIntervals/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ConfidenceIntervals + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/ConfidenceIntervals/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/ConfidenceIntervals/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/ConfidenceIntervals/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Constant1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Constant1d.hpp new file mode 100644 index 000000000..b4ea4b1b9 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Constant1d.hpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_CONSTANT1D +#define TEST_V2_0_CONTAINERS_CONSTANT1D + +#include "test/v2.0/containers/Axes.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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<>("value") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("outerDomainValue") | + Float64{} + / Meta<>("domainMin") | + Float64{} + / 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", + "label", + "outerDomainValue", + "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", + "label", + "outer_domain_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> + label{this}; + Field> + outerDomainValue{this}; + Field + domainMin{this}; + Field + domainMax{this}; + + // children + Field + axes{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->label, \ + this->outerDomainValue, \ + this->domainMin, \ + this->domainMax, \ + this->axes \ + ) + + // default + Constant1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Constant1d( + const wrapper> + &value, + const wrapper> + &label = {}, + const wrapper> + &outerDomainValue = {}, + const wrapper + &domainMin = {}, + const wrapper + &domainMax = {}, + const wrapper + &axes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + label(this,label), + outerDomainValue(this,outerDomainValue), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit Constant1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Constant1d(const Constant1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + label(this,other.label), + outerDomainValue(this,other.outerDomainValue), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + axes(this,other.axes) + { + Component::finish(other); + } + + // move + Constant1d(Constant1d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + label(this,std::move(other.label)), + outerDomainValue(this,std::move(other.outerDomainValue)), + 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; + value = other.value; + label = other.label; + outerDomainValue = other.outerDomainValue; + 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); + value = std::move(other.value); + label = std::move(other.label); + outerDomainValue = std::move(other.outerDomainValue); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + axes = std::move(other.axes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Constant1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Constant1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Constant1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Constant1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Constant1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Covariance.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Covariance.hpp new file mode 100644 index 000000000..bb1f39896 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Covariance.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_COVARIANCE +#define TEST_V2_0_CONTAINERS_COVARIANCE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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") + ; + } + + // Data member names. Usually - but not necessarily - the same 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + Covariance() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Covariance( + const wrapper> + &label, + const wrapper> + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Covariance(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Covariance(const Covariance &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + Covariance(Covariance &&other) : + 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 + Covariance &operator=(const Covariance &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + } + 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); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Covariance/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Covariance + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Covariance/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Covariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Covariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Data.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Data.hpp new file mode 100644 index 000000000..b3da58684 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Data.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_DATA +#define TEST_V2_0_CONTAINERS_DATA + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Data +// ----------------------------------------------------------------------------- + +class Data : + 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 "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{} | + + // metadata + Defaulted{"whiteSpace"} + / Meta<>("sep") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "sep" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "sep" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const UTF8Text sep = "whiteSpace"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + sep{this,defaults.sep}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->sep \ + ) + + // default + Data() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Data( + const wrapper> + &sep + ) : + GNDSTK_COMPONENT(BlockData{}), + sep(this,defaults.sep,sep) + { + Component::finish(); + } + + // from node + explicit Data(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Data(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Data(const Data &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + sep(this,other.sep) + { + Component::finish(other); + } + + // move + Data(Data &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + sep(this,std::move(other.sep)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Data &operator=(const Data &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + sep = other.sep; + } + return *this; + } + + // move + Data &operator=(Data &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + sep = std::move(other.sep); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Data/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Data + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Data/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Data/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Data/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Double.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Double.hpp new file mode 100644 index 000000000..aaea7079d --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Double.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_DOUBLE +#define TEST_V2_0_CONTAINERS_DOUBLE + +#include "test/v2.0/containers/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + Float64{} + / 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", + "unit", + "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", + "unit", + "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> + unit{this}; + Field + value{this}; + + // children + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->uncertainty \ + ) + + // default + Double() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Double( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper + &value = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Double(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Double(const Double &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Double(Double &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + 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; + unit = other.unit; + value = other.value; + 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); + unit = std::move(other.unit); + value = std::move(other.value); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Double/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Double + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Double/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Double/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Double/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Fraction.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Fraction.hpp new file mode 100644 index 000000000..2e554c9c5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Fraction.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_FRACTION +#define TEST_V2_0_CONTAINERS_FRACTION + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + Fraction32{} + / 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", + "label", + "unit", + "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", + "label", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value \ + ) + + // default + Fraction() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Fraction( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit Fraction(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Fraction(const Fraction &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + Fraction(Fraction &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Fraction &operator=(const Fraction &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + } + 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); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Fraction/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Fraction + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Fraction/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Fraction/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Fraction/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Function1ds.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Function1ds.hpp new file mode 100644 index 000000000..c692de72d --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Function1ds.hpp @@ -0,0 +1,196 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_FUNCTION1DS +#define TEST_V2_0_CONTAINERS_FUNCTION1DS + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Constant1d.hpp" +#include "test/v2.0/containers/Polynomial1d.hpp" +#include "test/v2.0/containers/Legendre.hpp" +#include "test/v2.0/containers/Gridded1d.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Function1ds +// ----------------------------------------------------------------------------- + +class Function1ds : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::XYs1d, + containers::Constant1d, + containers::Polynomial1d, + containers::Legendre, + containers::Gridded1d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + 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 + _t{} + / ++(Child<>("XYs1d") || Child<>("constant1d") || Child<>("polynomial1d") || Child<>("Legendre") || Child<>("gridded1d")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "_XYs1dconstant1dpolynomial1dLegendregridded1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys1dconstant1dpolynomial1d_legendregridded1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field> + _XYs1dconstant1dpolynomial1dLegendregridded1d{this}; + FieldPart XYs1d{_XYs1dconstant1dpolynomial1dLegendregridded1d}; + FieldPart constant1d{_XYs1dconstant1dpolynomial1dLegendregridded1d}; + FieldPart polynomial1d{_XYs1dconstant1dpolynomial1dLegendregridded1d}; + FieldPart Legendre{_XYs1dconstant1dpolynomial1dLegendregridded1d}; + FieldPart gridded1d{_XYs1dconstant1dpolynomial1dLegendregridded1d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs1dconstant1dpolynomial1dLegendregridded1d \ + ) + + // default + Function1ds() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Function1ds( + const wrapper> + &_XYs1dconstant1dpolynomial1dLegendregridded1d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs1dconstant1dpolynomial1dLegendregridded1d(this,_XYs1dconstant1dpolynomial1dLegendregridded1d) + { + Component::finish(); + } + + // from node + explicit Function1ds(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Function1ds(const Function1ds &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs1dconstant1dpolynomial1dLegendregridded1d(this,other._XYs1dconstant1dpolynomial1dLegendregridded1d) + { + Component::finish(other); + } + + // move + Function1ds(Function1ds &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs1dconstant1dpolynomial1dLegendregridded1d(this,std::move(other._XYs1dconstant1dpolynomial1dLegendregridded1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Function1ds &operator=(const Function1ds &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs1dconstant1dpolynomial1dLegendregridded1d = other._XYs1dconstant1dpolynomial1dLegendregridded1d; + } + return *this; + } + + // move + Function1ds &operator=(Function1ds &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs1dconstant1dpolynomial1dLegendregridded1d = std::move(other._XYs1dconstant1dpolynomial1dLegendregridded1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Function1ds/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Function1ds + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Function1ds/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Function1ds/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Function1ds/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Function2ds.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Function2ds.hpp new file mode 100644 index 000000000..f1e98b203 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Function2ds.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_FUNCTION2DS +#define TEST_V2_0_CONTAINERS_FUNCTION2DS + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Gridded2d.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Function2ds +// ----------------------------------------------------------------------------- + +class Function2ds : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::XYs2d, + containers::Gridded2d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + 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 + _t{} + / ++(Child<>("XYs2d") || 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", + "_XYs2dgridded2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys2dgridded2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field> + _XYs2dgridded2d{this}; + FieldPart XYs2d{_XYs2dgridded2d}; + FieldPart gridded2d{_XYs2dgridded2d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs2dgridded2d \ + ) + + // default + Function2ds() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Function2ds( + const wrapper> + &_XYs2dgridded2d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs2dgridded2d(this,_XYs2dgridded2d) + { + Component::finish(); + } + + // from node + explicit Function2ds(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Function2ds(const Function2ds &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs2dgridded2d(this,other._XYs2dgridded2d) + { + Component::finish(other); + } + + // move + Function2ds(Function2ds &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs2dgridded2d(this,std::move(other._XYs2dgridded2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Function2ds &operator=(const Function2ds &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs2dgridded2d = other._XYs2dgridded2d; + } + return *this; + } + + // move + Function2ds &operator=(Function2ds &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs2dgridded2d = std::move(other._XYs2dgridded2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Function2ds/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Function2ds + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Function2ds/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Function2ds/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Function2ds/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Function3ds.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Function3ds.hpp new file mode 100644 index 000000000..7f9b351b9 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Function3ds.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_FUNCTION3DS +#define TEST_V2_0_CONTAINERS_FUNCTION3DS + +#include "test/v2.0/containers/XYs3d.hpp" +#include "test/v2.0/containers/Gridded3d.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Function3ds +// ----------------------------------------------------------------------------- + +class Function3ds : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::XYs3d, + containers::Gridded3d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + static auto CLASS() { return "Function3ds"; } + static auto NODENAME() { return "function3ds"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + _t{} + / ++(Child<>("XYs3d") || Child<>("gridded3d")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "_XYs3dgridded3d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys3dgridded3d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field> + _XYs3dgridded3d{this}; + FieldPart XYs3d{_XYs3dgridded3d}; + FieldPart gridded3d{_XYs3dgridded3d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs3dgridded3d \ + ) + + // default + Function3ds() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Function3ds( + const wrapper> + &_XYs3dgridded3d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs3dgridded3d(this,_XYs3dgridded3d) + { + Component::finish(); + } + + // from node + explicit Function3ds(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Function3ds(const Function3ds &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs3dgridded3d(this,other._XYs3dgridded3d) + { + Component::finish(other); + } + + // move + Function3ds(Function3ds &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs3dgridded3d(this,std::move(other._XYs3dgridded3d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Function3ds &operator=(const Function3ds &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs3dgridded3d = other._XYs3dgridded3d; + } + return *this; + } + + // move + Function3ds &operator=(Function3ds &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs3dgridded3d = std::move(other._XYs3dgridded3d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Function3ds/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Function3ds + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Function3ds/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Function3ds/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Function3ds/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Grid.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Grid.hpp new file mode 100644 index 000000000..f7354a888 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Grid.hpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_GRID +#define TEST_V2_0_CONTAINERS_GRID + +#include "test/v2.0/containers/Values.hpp" +#include "test/v2.0/containers/Link.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Grid +// ----------------------------------------------------------------------------- + +class Grid : + public Component +{ + friend class Component; + + using _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{enums::Interpolation::linlin} + / Meta<>("interpolation") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("style") | + std::optional{} + / Meta<>("unit") | + + // children + _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", + "_valueslink" + }; + 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", + "_valueslink" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const enums::Interpolation interpolation = 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<_t> + _valueslink{this}; + FieldPart values{_valueslink}; + FieldPart link{_valueslink}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->interpolation, \ + this->label, \ + this->style, \ + this->unit, \ + this->_valueslink \ + ) + + // default + Grid() : + 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<_t> + &_valueslink = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + interpolation(this,defaults.interpolation,interpolation), + label(this,label), + style(this,style), + unit(this,unit), + _valueslink(this,_valueslink) + { + Component::finish(); + } + + // from node + explicit Grid(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Grid(const Grid &other) : + 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), + _valueslink(this,other._valueslink) + { + Component::finish(other); + } + + // move + Grid(Grid &&other) : + 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)), + _valueslink(this,std::move(other._valueslink)) + { + 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; + _valueslink = other._valueslink; + } + 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); + _valueslink = std::move(other._valueslink); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Grid/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Grid + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Grid/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Grid/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Grid/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded1d.hpp new file mode 100644 index 000000000..1c3005fbc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded1d.hpp @@ -0,0 +1,218 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_GRIDDED1D +#define TEST_V2_0_CONTAINERS_GRIDDED1D + +#include "test/v2.0/containers/Array.hpp" +#include "test/v2.0/containers/Axes.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Gridded1d +// ----------------------------------------------------------------------------- + +class Gridded1d : + 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 "Gridded1d"; } + static auto NODENAME() { return "gridded1d"; } + + // 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 + ("array") | + --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", + "array", + "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", + "array", + "axes" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + + // children + Field + array{this}; + Field + axes{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->array, \ + this->axes \ + ) + + // default + Gridded1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Gridded1d( + const wrapper> + &label, + const wrapper + &array = {}, + const wrapper + &axes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + array(this,array), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit Gridded1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Gridded1d(const Gridded1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + array(this,other.array), + axes(this,other.axes) + { + Component::finish(other); + } + + // move + Gridded1d(Gridded1d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + array(this,std::move(other.array)), + axes(this,std::move(other.axes)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Gridded1d &operator=(const Gridded1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + array = other.array; + axes = other.axes; + } + return *this; + } + + // move + Gridded1d &operator=(Gridded1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + array = std::move(other.array); + axes = std::move(other.axes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Gridded1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Gridded1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded2d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded2d.hpp new file mode 100644 index 000000000..28619d957 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded2d.hpp @@ -0,0 +1,218 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_GRIDDED2D +#define TEST_V2_0_CONTAINERS_GRIDDED2D + +#include "test/v2.0/containers/Array.hpp" +#include "test/v2.0/containers/Axes.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + + // children + --Child + ("array") | + --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", + "array", + "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", + "array", + "axes" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + + // children + Field + array{this}; + Field + axes{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->array, \ + this->axes \ + ) + + // default + Gridded2d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Gridded2d( + const wrapper> + &label, + const wrapper + &array = {}, + const wrapper + &axes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + array(this,array), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit Gridded2d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Gridded2d(const Gridded2d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + array(this,other.array), + axes(this,other.axes) + { + Component::finish(other); + } + + // move + Gridded2d(Gridded2d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + array(this,std::move(other.array)), + axes(this,std::move(other.axes)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Gridded2d &operator=(const Gridded2d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + array = other.array; + axes = other.axes; + } + return *this; + } + + // move + Gridded2d &operator=(Gridded2d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + array = std::move(other.array); + axes = std::move(other.axes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Gridded2d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Gridded2d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded2d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded3d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded3d.hpp new file mode 100644 index 000000000..f63a3c9db --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded3d.hpp @@ -0,0 +1,218 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_GRIDDED3D +#define TEST_V2_0_CONTAINERS_GRIDDED3D + +#include "test/v2.0/containers/Array.hpp" +#include "test/v2.0/containers/Axes.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + + // children + --Child + ("array") | + --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", + "array", + "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", + "array", + "axes" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + + // children + Field + array{this}; + Field + axes{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->array, \ + this->axes \ + ) + + // default + Gridded3d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Gridded3d( + const wrapper> + &label, + const wrapper + &array = {}, + const wrapper + &axes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + array(this,array), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit Gridded3d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Gridded3d(const Gridded3d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + array(this,other.array), + axes(this,other.axes) + { + Component::finish(other); + } + + // move + Gridded3d(Gridded3d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + array(this,std::move(other.array)), + axes(this,std::move(other.axes)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Gridded3d &operator=(const Gridded3d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + array = other.array; + axes = other.axes; + } + return *this; + } + + // move + Gridded3d &operator=(Gridded3d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + array = std::move(other.array); + axes = std::move(other.axes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Gridded3d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Gridded3d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded3d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Gridded3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Integer.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Integer.hpp new file mode 100644 index 000000000..bb0f91229 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Integer.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_INTEGER +#define TEST_V2_0_CONTAINERS_INTEGER + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + Integer32{} + / 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", + "label", + "unit", + "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", + "label", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value \ + ) + + // default + Integer() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Integer( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit Integer(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Integer(const Integer &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + Integer(Integer &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Integer &operator=(const Integer &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + } + 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); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Integer/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Integer + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Integer/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Integer/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Integer/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Interval.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Interval.hpp new file mode 100644 index 000000000..97d952ead --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Interval.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_INTERVAL +#define TEST_V2_0_CONTAINERS_INTERVAL + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Interval +// ----------------------------------------------------------------------------- + +class Interval : + 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 "Interval"; } + static auto NODENAME() { return "interval"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Float64{} + / Meta<>("confidence") | + Float64{} + / Meta<>("lower") | + Float64{} + / Meta<>("upper") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "confidence", + "lower", + "upper" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "confidence", + "lower", + "upper" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + confidence{this}; + Field + lower{this}; + Field + upper{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->confidence, \ + this->lower, \ + this->upper \ + ) + + // default + Interval() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Interval( + const wrapper + &confidence, + const wrapper + &lower = {}, + const wrapper + &upper = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + confidence(this,confidence), + lower(this,lower), + upper(this,upper) + { + Component::finish(); + } + + // from node + explicit Interval(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Interval(const Interval &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + confidence(this,other.confidence), + lower(this,other.lower), + upper(this,other.upper) + { + Component::finish(other); + } + + // move + Interval(Interval &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + confidence(this,std::move(other.confidence)), + lower(this,std::move(other.lower)), + upper(this,std::move(other.upper)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Interval &operator=(const Interval &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + confidence = other.confidence; + lower = other.lower; + upper = other.upper; + } + return *this; + } + + // move + Interval &operator=(Interval &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + confidence = std::move(other.confidence); + lower = std::move(other.lower); + upper = std::move(other.upper); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Interval/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Interval + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Interval/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Interval/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Interval/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Legendre.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Legendre.hpp new file mode 100644 index 000000000..5d7980844 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Legendre.hpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_LEGENDRE +#define TEST_V2_0_CONTAINERS_LEGENDRE + +#include "test/v2.0/containers/Values.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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 + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("outerDomainValue") | + Defaulted{0} + / Meta<>("lowerIndex") | + Defaulted{-1.0} + / Meta<>("domainMin") | + Defaulted{1.0} + / Meta<>("domainMax") | + + // 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", + "label", + "outerDomainValue", + "lowerIndex", + "domainMin", + "domainMax", + "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", + "label", + "outer_domain_value", + "lower_index", + "domain_min", + "domain_max", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const Integer32 lowerIndex = 0; + static inline const Float64 domainMin = -1.0; + static inline const Float64 domainMax = 1.0; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + outerDomainValue{this}; + Field> + lowerIndex{this,defaults.lowerIndex}; + Field> + domainMin{this,defaults.domainMin}; + Field> + domainMax{this,defaults.domainMax}; + + // children + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->outerDomainValue, \ + this->lowerIndex, \ + this->domainMin, \ + this->domainMax, \ + this->values \ + ) + + // default + Legendre() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Legendre( + const wrapper> + &label, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &lowerIndex = {}, + const wrapper> + &domainMin = {}, + const wrapper> + &domainMax = {}, + const wrapper + &values = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + outerDomainValue(this,outerDomainValue), + lowerIndex(this,defaults.lowerIndex,lowerIndex), + domainMin(this,defaults.domainMin,domainMin), + domainMax(this,defaults.domainMax,domainMax), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Legendre(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Legendre(const Legendre &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + outerDomainValue(this,other.outerDomainValue), + lowerIndex(this,other.lowerIndex), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + values(this,other.values) + { + Component::finish(other); + } + + // move + Legendre(Legendre &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + outerDomainValue(this,std::move(other.outerDomainValue)), + lowerIndex(this,std::move(other.lowerIndex)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + 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; + label = other.label; + outerDomainValue = other.outerDomainValue; + lowerIndex = other.lowerIndex; + domainMin = other.domainMin; + domainMax = other.domainMax; + values = other.values; + } + return *this; + } + + // move + Legendre &operator=(Legendre &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + outerDomainValue = std::move(other.outerDomainValue); + lowerIndex = std::move(other.lowerIndex); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Legendre/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Legendre + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Legendre/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Legendre/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Legendre/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Link.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Link.hpp new file mode 100644 index 000000000..ab40faba7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Link.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_LINK +#define TEST_V2_0_CONTAINERS_LINK + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Link() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Link( + const wrapper + &href + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Link(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Link(const Link &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Link(Link &&other) : + 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 "test/v2.0/containers/Link/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Link + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Link/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Link/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Link/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/ListOfCovariances.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/ListOfCovariances.hpp new file mode 100644 index 000000000..b094dc3bb --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/ListOfCovariances.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_LISTOFCOVARIANCES +#define TEST_V2_0_CONTAINERS_LISTOFCOVARIANCES + +#include "test/v2.0/containers/Covariance.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->covariance \ + ) + + // default + ListOfCovariances() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ListOfCovariances( + const wrapper> + &covariance + ) : + GNDSTK_COMPONENT(BlockData{}), + covariance(this,covariance) + { + Component::finish(); + } + + // from node + explicit ListOfCovariances(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ListOfCovariances(const ListOfCovariances &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + covariance(this,other.covariance) + { + Component::finish(other); + } + + // move + ListOfCovariances(ListOfCovariances &&other) : + 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 "test/v2.0/containers/ListOfCovariances/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ListOfCovariances + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/ListOfCovariances/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/ListOfCovariances/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/ListOfCovariances/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/LogNormal.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/LogNormal.hpp new file mode 100644 index 000000000..3b1980b91 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/LogNormal.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_LOGNORMAL +#define TEST_V2_0_CONTAINERS_LOGNORMAL + +#include "test/v2.0/extra/Double.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class LogNormal +// ----------------------------------------------------------------------------- + +class LogNormal : + 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 "LogNormal"; } + static auto NODENAME() { return "logNormal"; } + + // 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + LogNormal() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit LogNormal( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit LogNormal(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + LogNormal(const LogNormal &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + LogNormal(LogNormal &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + LogNormal &operator=(const LogNormal &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Double = other.Double; + } + return *this; + } + + // move + LogNormal &operator=(LogNormal &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/LogNormal/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class LogNormal + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/LogNormal/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/LogNormal/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/LogNormal/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf.hpp new file mode 100644 index 000000000..fb3839ef1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_PDF +#define TEST_V2_0_CONTAINERS_PDF + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Pdf +// ----------------------------------------------------------------------------- + +class Pdf : + 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 "Pdf"; } + static auto NODENAME() { return "pdf"; } + + // 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + Pdf() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Pdf( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit Pdf(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Pdf(const Pdf &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + Pdf(Pdf &&other) : + 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 + Pdf &operator=(const Pdf &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + Pdf &operator=(Pdf &&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 "test/v2.0/containers/Pdf/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Pdf + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf_in_xs_pdf_cdf1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf_in_xs_pdf_cdf1d.hpp new file mode 100644 index 000000000..07b8d7397 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf_in_xs_pdf_cdf1d.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_PDF_IN_XS_PDF_CDF1D +#define TEST_V2_0_CONTAINERS_PDF_IN_XS_PDF_CDF1D + +#include "test/v2.0/containers/Values.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Pdf_in_xs_pdf_cdf1d +// ----------------------------------------------------------------------------- + +class Pdf_in_xs_pdf_cdf1d : + 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 "Pdf_in_xs_pdf_cdf1d"; } + static auto NODENAME() { return "pdf"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // 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", + "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", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->values \ + ) + + // default + Pdf_in_xs_pdf_cdf1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Pdf_in_xs_pdf_cdf1d( + const wrapper + &values + ) : + GNDSTK_COMPONENT(BlockData{}), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Pdf_in_xs_pdf_cdf1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Pdf_in_xs_pdf_cdf1d(const Pdf_in_xs_pdf_cdf1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + values(this,other.values) + { + Component::finish(other); + } + + // move + Pdf_in_xs_pdf_cdf1d(Pdf_in_xs_pdf_cdf1d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Pdf_in_xs_pdf_cdf1d &operator=(const Pdf_in_xs_pdf_cdf1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + values = other.values; + } + return *this; + } + + // move + Pdf_in_xs_pdf_cdf1d &operator=(Pdf_in_xs_pdf_cdf1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Pdf_in_xs_pdf_cdf1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Pdf_in_xs_pdf_cdf1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Polynomial1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Polynomial1d.hpp new file mode 100644 index 000000000..b06dd33e1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Polynomial1d.hpp @@ -0,0 +1,295 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_POLYNOMIAL1D +#define TEST_V2_0_CONTAINERS_POLYNOMIAL1D + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/extra/Uncertainty.hpp" +#include "test/v2.0/containers/Values.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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") | + std::optional{} + / Meta<>("outerDomainValue") | + Defaulted{0} + / Meta<>("lowerIndex") | + Float64{} + / Meta<>("domainMin") | + Float64{} + / Meta<>("domainMax") | + + // children + --Child + ("axes") | + --Child> + ("uncertainty") | + --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", + "label", + "outerDomainValue", + "lowerIndex", + "domainMin", + "domainMax", + "axes", + "uncertainty", + "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", + "label", + "outer_domain_value", + "lower_index", + "domain_min", + "domain_max", + "axes", + "uncertainty", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const Integer32 lowerIndex = 0; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + outerDomainValue{this}; + Field> + lowerIndex{this,defaults.lowerIndex}; + Field + domainMin{this}; + Field + domainMax{this}; + + // children + Field + axes{this}; + Field> + uncertainty{this}; + Field + values{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->outerDomainValue, \ + this->lowerIndex, \ + this->domainMin, \ + this->domainMax, \ + this->axes, \ + this->uncertainty, \ + this->values \ + ) + + // default + Polynomial1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Polynomial1d( + const wrapper> + &label, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &lowerIndex = {}, + const wrapper + &domainMin = {}, + const wrapper + &domainMax = {}, + const wrapper + &axes = {}, + const wrapper> + &uncertainty = {}, + const wrapper + &values = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + outerDomainValue(this,outerDomainValue), + lowerIndex(this,defaults.lowerIndex,lowerIndex), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes), + uncertainty(this,uncertainty), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Polynomial1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Polynomial1d(const Polynomial1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + outerDomainValue(this,other.outerDomainValue), + lowerIndex(this,other.lowerIndex), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + axes(this,other.axes), + uncertainty(this,other.uncertainty), + values(this,other.values) + { + Component::finish(other); + } + + // move + Polynomial1d(Polynomial1d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + outerDomainValue(this,std::move(other.outerDomainValue)), + lowerIndex(this,std::move(other.lowerIndex)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + axes(this,std::move(other.axes)), + uncertainty(this,std::move(other.uncertainty)), + 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; + label = other.label; + outerDomainValue = other.outerDomainValue; + lowerIndex = other.lowerIndex; + domainMin = other.domainMin; + domainMax = other.domainMax; + axes = other.axes; + uncertainty = other.uncertainty; + values = other.values; + } + 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); + outerDomainValue = std::move(other.outerDomainValue); + lowerIndex = std::move(other.lowerIndex); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + axes = std::move(other.axes); + uncertainty = std::move(other.uncertainty); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Polynomial1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Polynomial1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Polynomial1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Polynomial1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Polynomial1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Regions1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions1d.hpp new file mode 100644 index 000000000..3f14f0bdc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions1d.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_REGIONS1D +#define TEST_V2_0_CONTAINERS_REGIONS1D + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/containers/Function1ds.hpp" +#include "test/v2.0/extra/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +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 + ("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", + "label", + "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", + "label", + "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> + label{this}; + Field> + outerDomainValue{this}; + + // children + Field> + axes{this}; + Field + function1ds{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->function1ds, \ + this->uncertainty \ + ) + + // default + Regions1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Regions1d( + const wrapper> + &label, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper + &function1ds = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + function1ds(this,function1ds), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Regions1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Regions1d(const Regions1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + outerDomainValue(this,other.outerDomainValue), + axes(this,other.axes), + function1ds(this,other.function1ds), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Regions1d(Regions1d &&other) : + 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)), + function1ds(this,std::move(other.function1ds)), + uncertainty(this,std::move(other.uncertainty)) + { + 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; + function1ds = other.function1ds; + uncertainty = other.uncertainty; + } + 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); + function1ds = std::move(other.function1ds); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Regions1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Regions1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Regions1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Regions2d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions2d.hpp new file mode 100644 index 000000000..6b921c289 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions2d.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_REGIONS2D +#define TEST_V2_0_CONTAINERS_REGIONS2D + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/containers/Function2ds.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("outerDomainValue") | + + // 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", + "label", + "outerDomainValue", + "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", + "label", + "outer_domain_value", + "axes", + "function2ds", + "uncertainty" + }; + 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 + function2ds{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->function2ds, \ + this->uncertainty \ + ) + + // default + Regions2d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Regions2d( + const wrapper> + &label, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper + &function2ds = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + function2ds(this,function2ds), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Regions2d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Regions2d(const Regions2d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + outerDomainValue(this,other.outerDomainValue), + axes(this,other.axes), + function2ds(this,other.function2ds), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Regions2d(Regions2d &&other) : + 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)), + 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; + label = other.label; + outerDomainValue = other.outerDomainValue; + 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); + label = std::move(other.label); + outerDomainValue = std::move(other.outerDomainValue); + axes = std::move(other.axes); + function2ds = std::move(other.function2ds); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Regions2d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Regions2d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Regions2d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Regions3d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions3d.hpp new file mode 100644 index 000000000..1a34dfc47 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions3d.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_REGIONS3D +#define TEST_V2_0_CONTAINERS_REGIONS3D + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/containers/Function3ds.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Regions3d +// ----------------------------------------------------------------------------- + +class Regions3d : + 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 "Regions3d"; } + static auto NODENAME() { return "regions3d"; } + + // 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 + ("function3ds") | + --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", + "outerDomainValue", + "axes", + "function3ds", + "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", + "outer_domain_value", + "axes", + "function3ds", + "uncertainty" + }; + 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 + function3ds{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->function3ds, \ + this->uncertainty \ + ) + + // default + Regions3d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Regions3d( + const wrapper> + &label, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper + &function3ds = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + function3ds(this,function3ds), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Regions3d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Regions3d(const Regions3d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + outerDomainValue(this,other.outerDomainValue), + axes(this,other.axes), + function3ds(this,other.function3ds), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Regions3d(Regions3d &&other) : + 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)), + function3ds(this,std::move(other.function3ds)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Regions3d &operator=(const Regions3d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + outerDomainValue = other.outerDomainValue; + axes = other.axes; + function3ds = other.function3ds; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Regions3d &operator=(Regions3d &&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); + function3ds = std::move(other.function3ds); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Regions3d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Regions3d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Regions3d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Regions3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Standard.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Standard.hpp new file mode 100644 index 000000000..143d6a7a9 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Standard.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_STANDARD +#define TEST_V2_0_CONTAINERS_STANDARD + +#include "test/v2.0/extra/Double.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Standard() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Standard( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Standard(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Standard(const Standard &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Standard(Standard &&other) : + 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 "test/v2.0/containers/Standard/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Standard + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Standard/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Standard/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Standard/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/String.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/String.hpp new file mode 100644 index 000000000..e133c25e6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/String.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_STRING +#define TEST_V2_0_CONTAINERS_STRING + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + XMLName{} + / 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", + "label", + "unit", + "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", + "label", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value \ + ) + + // default + String() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit String( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit String(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + String(const String &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + String(String &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + String &operator=(const String &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + } + 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); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/String/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class String + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/String/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/String/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/String/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Table.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Table.hpp new file mode 100644 index 000000000..0b78326b6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Table.hpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_TABLE +#define TEST_V2_0_CONTAINERS_TABLE + +#include "test/v2.0/containers/ColumnHeaders.hpp" +#include "test/v2.0/containers/Data.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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 + Integer32{} + / Meta<>("columns") | + Integer32{} + / Meta<>("rows") | + Defaulted{"row-major"} + / Meta<>("storageOrder") | + + // 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", + "columns", + "rows", + "storageOrder", + "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", + "columns", + "rows", + "storage_order", + "column_headers", + "data" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const XMLName storageOrder = "row-major"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + columns{this}; + Field + rows{this}; + Field> + storageOrder{this,defaults.storageOrder}; + + // children + Field + columnHeaders{this}; + Field + data{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(columnHeaders(),column); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->columns, \ + this->rows, \ + this->storageOrder, \ + this->columnHeaders, \ + this->data \ + ) + + // default + Table() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Table( + const wrapper + &columns, + const wrapper + &rows = {}, + const wrapper> + &storageOrder = {}, + const wrapper + &columnHeaders = {}, + const wrapper + &data = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + columns(this,columns), + rows(this,rows), + storageOrder(this,defaults.storageOrder,storageOrder), + columnHeaders(this,columnHeaders), + data(this,data) + { + Component::finish(); + } + + // from node + explicit Table(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Table(const Table &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + columns(this,other.columns), + rows(this,other.rows), + storageOrder(this,other.storageOrder), + columnHeaders(this,other.columnHeaders), + data(this,other.data) + { + Component::finish(other); + } + + // move + Table(Table &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + columns(this,std::move(other.columns)), + rows(this,std::move(other.rows)), + storageOrder(this,std::move(other.storageOrder)), + 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; + columns = other.columns; + rows = other.rows; + storageOrder = other.storageOrder; + 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); + columns = std::move(other.columns); + rows = std::move(other.rows); + storageOrder = std::move(other.storageOrder); + columnHeaders = std::move(other.columnHeaders); + data = std::move(other.data); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Table/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Table + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Table/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Table/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Table/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Uncertainty.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Uncertainty.hpp new file mode 100644 index 000000000..b22cf13e1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Uncertainty.hpp @@ -0,0 +1,284 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_UNCERTAINTY +#define TEST_V2_0_CONTAINERS_UNCERTAINTY + +#include "test/v2.0/containers/Standard.hpp" +#include "test/v2.0/containers/LogNormal.hpp" +#include "test/v2.0/containers/ConfidenceIntervals.hpp" +#include "test/v2.0/containers/Pdf.hpp" +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Polynomial1d.hpp" +#include "test/v2.0/containers/Covariance.hpp" +#include "test/v2.0/containers/ListOfCovariances.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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> + ("standard") | + --Child> + ("logNormal") | + --Child> + ("confidenceIntervals") | + --Child> + ("pdf") | + --Child> + ("XYs1d") | + --Child> + ("polynomial1d") | + --Child> + ("covariance") | + --Child> + ("listOfCovariances") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "standard", + "logNormal", + "confidenceIntervals", + "pdf", + "XYs1d", + "polynomial1d", + "covariance", + "listOfCovariances" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "standard", + "log_normal", + "confidence_intervals", + "pdf", + "xys1d", + "polynomial1d", + "covariance", + "list_of_covariances" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + standard{this}; + Field> + logNormal{this}; + Field> + confidenceIntervals{this}; + Field> + pdf{this}; + Field> + XYs1d{this}; + Field> + polynomial1d{this}; + Field> + covariance{this}; + Field> + listOfCovariances{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->standard, \ + this->logNormal, \ + this->confidenceIntervals, \ + this->pdf, \ + this->XYs1d, \ + this->polynomial1d, \ + this->covariance, \ + this->listOfCovariances \ + ) + + // default + Uncertainty() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Uncertainty( + const wrapper> + &standard, + const wrapper> + &logNormal = {}, + const wrapper> + &confidenceIntervals = {}, + const wrapper> + &pdf = {}, + const wrapper> + &XYs1d = {}, + const wrapper> + &polynomial1d = {}, + const wrapper> + &covariance = {}, + const wrapper> + &listOfCovariances = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + standard(this,standard), + logNormal(this,logNormal), + confidenceIntervals(this,confidenceIntervals), + pdf(this,pdf), + XYs1d(this,XYs1d), + polynomial1d(this,polynomial1d), + covariance(this,covariance), + listOfCovariances(this,listOfCovariances) + { + Component::finish(); + } + + // from node + explicit Uncertainty(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Uncertainty(const Uncertainty &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + standard(this,other.standard), + logNormal(this,other.logNormal), + confidenceIntervals(this,other.confidenceIntervals), + pdf(this,other.pdf), + XYs1d(this,other.XYs1d), + polynomial1d(this,other.polynomial1d), + covariance(this,other.covariance), + listOfCovariances(this,other.listOfCovariances) + { + Component::finish(other); + } + + // move + Uncertainty(Uncertainty &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + standard(this,std::move(other.standard)), + logNormal(this,std::move(other.logNormal)), + confidenceIntervals(this,std::move(other.confidenceIntervals)), + pdf(this,std::move(other.pdf)), + XYs1d(this,std::move(other.XYs1d)), + polynomial1d(this,std::move(other.polynomial1d)), + covariance(this,std::move(other.covariance)), + listOfCovariances(this,std::move(other.listOfCovariances)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Uncertainty &operator=(const Uncertainty &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + standard = other.standard; + logNormal = other.logNormal; + confidenceIntervals = other.confidenceIntervals; + pdf = other.pdf; + XYs1d = other.XYs1d; + polynomial1d = other.polynomial1d; + covariance = other.covariance; + listOfCovariances = other.listOfCovariances; + } + return *this; + } + + // move + Uncertainty &operator=(Uncertainty &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + standard = std::move(other.standard); + logNormal = std::move(other.logNormal); + confidenceIntervals = std::move(other.confidenceIntervals); + pdf = std::move(other.pdf); + XYs1d = std::move(other.XYs1d); + polynomial1d = std::move(other.polynomial1d); + covariance = std::move(other.covariance); + listOfCovariances = std::move(other.listOfCovariances); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Uncertainty/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Uncertainty + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Uncertainty/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Uncertainty/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Uncertainty/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Values.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Values.hpp new file mode 100644 index 000000000..e460751b1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Values.hpp @@ -0,0 +1,265 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_VALUES +#define TEST_V2_0_CONTAINERS_VALUES + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +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{"Float64"} + / Meta<>("valueType") | + Defaulted{0} + / Meta<>("start") | + std::optional{} + / Meta<>("length") | + std::optional{} + / Meta<>("href") | + std::optional{} + / Meta<>("startIndex") | + std::optional{} + / Meta<>("count") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "href", + "startIndex", + "count" + }; + 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", + "href", + "start_index", + "count" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const UTF8Text valueType = "Float64"; + static inline const Integer32 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}; + Field> + href{this}; + Field> + startIndex{this}; + Field> + count{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->valueType, \ + this->start, \ + this->length, \ + this->href, \ + this->startIndex, \ + this->count \ + ) + + // default + Values() : + 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 = {}, + const wrapper> + &href = {}, + const wrapper> + &startIndex = {}, + const wrapper> + &count = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + valueType(this,defaults.valueType,valueType), + start(this,defaults.start,start), + length(this,length), + href(this,href), + startIndex(this,startIndex), + count(this,count) + { + Component::finish(); + } + + // from node + explicit Values(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Values(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Values(const Values &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + valueType(this,other.valueType), + start(this,other.start), + length(this,other.length), + href(this,other.href), + startIndex(this,other.startIndex), + count(this,other.count) + { + Component::finish(other); + } + + // move + Values(Values &&other) : + 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)), + href(this,std::move(other.href)), + startIndex(this,std::move(other.startIndex)), + count(this,std::move(other.count)) + { + 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; + href = other.href; + startIndex = other.startIndex; + count = other.count; + } + 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); + href = std::move(other.href); + startIndex = std::move(other.startIndex); + count = std::move(other.count); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Values/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Values + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Values/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Values/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Values/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/XYs1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs1d.hpp new file mode 100644 index 000000000..6f10ac6e5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs1d.hpp @@ -0,0 +1,275 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_XYS1D +#define TEST_V2_0_CONTAINERS_XYS1D + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/extra/Uncertainty.hpp" +#include "test/v2.0/containers/Values.hpp" + +namespace test { +namespace v2_0 { +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{enums::Interpolation::linlin} + / Meta<>("interpolation") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("outerDomainValue") | + + // children + --Child> + ("axes") | + --Child> + ("uncertainty") | + --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", + "uncertainty", + "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", + "uncertainty", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const enums::Interpolation interpolation = 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> + uncertainty{this}; + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->interpolation, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->uncertainty, \ + this->values \ + ) + + // default + XYs1d() : + 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> + &uncertainty = {}, + const wrapper + &values = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + interpolation(this,defaults.interpolation,interpolation), + label(this,label), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + uncertainty(this,uncertainty), + values(this,values) + { + Component::finish(); + } + + // from node + explicit XYs1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs1d(const XYs1d &other) : + 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), + uncertainty(this,other.uncertainty), + values(this,other.values) + { + Component::finish(other); + } + + // move + XYs1d(XYs1d &&other) : + 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)), + uncertainty(this,std::move(other.uncertainty)), + 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; + uncertainty = other.uncertainty; + 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); + uncertainty = std::move(other.uncertainty); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/XYs1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class XYs1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/XYs1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/XYs2d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs2d.hpp new file mode 100644 index 000000000..cbe056e8c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs2d.hpp @@ -0,0 +1,275 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_XYS2D +#define TEST_V2_0_CONTAINERS_XYS2D + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/containers/Function1ds.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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") | + Defaulted{enums::Interpolation::linlin} + / 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; + + // defaults + static inline const struct Defaults { + static inline const enums::Interpolation interpolation = enums::Interpolation::linlin; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + index{this}; + Field> + interpolation{this,defaults.interpolation}; + Field> + interpolationQualifier{this}; + Field> + outerDomainValue{this}; + + // children + Field> + axes{this}; + Field + function1ds{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->interpolation, \ + this->interpolationQualifier, \ + this->outerDomainValue, \ + this->axes, \ + this->function1ds, \ + this->uncertainty \ + ) + + // default + XYs2d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit XYs2d( + const wrapper> + &index, + const wrapper> + &interpolation = {}, + const wrapper> + &interpolationQualifier = {}, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper + &function1ds = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + interpolation(this,defaults.interpolation,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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs2d(const XYs2d &other) : + 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) : + 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 "test/v2.0/containers/XYs2d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class XYs2d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/XYs2d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/XYs3d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs3d.hpp new file mode 100644 index 000000000..7f86910b1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs3d.hpp @@ -0,0 +1,247 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_XYS3D +#define TEST_V2_0_CONTAINERS_XYS3D + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/containers/Function2ds.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// 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 "containers"; } + 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 + Defaulted{enums::Interpolation::linlin} + / Meta<>("interpolation") | + std::optional{} + / Meta<>("interpolationQualifier") | + + // 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", + "interpolation", + "interpolationQualifier", + "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", + "interpolation", + "interpolation_qualifier", + "axes", + "function2ds", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const enums::Interpolation interpolation = enums::Interpolation::linlin; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + interpolation{this,defaults.interpolation}; + Field> + interpolationQualifier{this}; + + // children + Field> + axes{this}; + Field + function2ds{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->interpolation, \ + this->interpolationQualifier, \ + this->axes, \ + this->function2ds, \ + this->uncertainty \ + ) + + // default + XYs3d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit XYs3d( + const wrapper> + &interpolation, + const wrapper> + &interpolationQualifier = {}, + const wrapper> + &axes = {}, + const wrapper + &function2ds = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + interpolation(this,defaults.interpolation,interpolation), + interpolationQualifier(this,interpolationQualifier), + axes(this,axes), + function2ds(this,function2ds), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit XYs3d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs3d(const XYs3d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + interpolation(this,other.interpolation), + interpolationQualifier(this,other.interpolationQualifier), + axes(this,other.axes), + function2ds(this,other.function2ds), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + XYs3d(XYs3d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + interpolation(this,std::move(other.interpolation)), + interpolationQualifier(this,std::move(other.interpolationQualifier)), + axes(this,std::move(other.axes)), + function2ds(this,std::move(other.function2ds)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + XYs3d &operator=(const XYs3d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + interpolation = other.interpolation; + interpolationQualifier = other.interpolationQualifier; + axes = other.axes; + function2ds = other.function2ds; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + XYs3d &operator=(XYs3d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + interpolation = std::move(other.interpolation); + interpolationQualifier = std::move(other.interpolationQualifier); + axes = std::move(other.axes); + function2ds = std::move(other.function2ds); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/XYs3d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class XYs3d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/XYs3d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/XYs3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_in_xs_pdf_cdf1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_in_xs_pdf_cdf1d.hpp new file mode 100644 index 000000000..58085d099 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_in_xs_pdf_cdf1d.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_XS_IN_XS_PDF_CDF1D +#define TEST_V2_0_CONTAINERS_XS_IN_XS_PDF_CDF1D + +#include "test/v2.0/containers/Values.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Xs_in_xs_pdf_cdf1d +// ----------------------------------------------------------------------------- + +class Xs_in_xs_pdf_cdf1d : + 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 "Xs_in_xs_pdf_cdf1d"; } + static auto NODENAME() { return "xs"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // 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", + "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", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->values \ + ) + + // default + Xs_in_xs_pdf_cdf1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Xs_in_xs_pdf_cdf1d( + const wrapper + &values + ) : + GNDSTK_COMPONENT(BlockData{}), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Xs_in_xs_pdf_cdf1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Xs_in_xs_pdf_cdf1d(const Xs_in_xs_pdf_cdf1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + values(this,other.values) + { + Component::finish(other); + } + + // move + Xs_in_xs_pdf_cdf1d(Xs_in_xs_pdf_cdf1d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Xs_in_xs_pdf_cdf1d &operator=(const Xs_in_xs_pdf_cdf1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + values = other.values; + } + return *this; + } + + // move + Xs_in_xs_pdf_cdf1d &operator=(Xs_in_xs_pdf_cdf1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Xs_in_xs_pdf_cdf1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_in_xs_pdf_cdf1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_pdf_cdf1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_pdf_cdf1d.hpp new file mode 100644 index 000000000..7741c1ccd --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_pdf_cdf1d.hpp @@ -0,0 +1,233 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_XS_PDF_CDF1D +#define TEST_V2_0_CONTAINERS_XS_PDF_CDF1D + +#include "test/v2.0/containers/Xs_in_xs_pdf_cdf1d.hpp" +#include "test/v2.0/containers/Pdf.hpp" +#include "test/v2.0/containers/Cdf_in_xs_pdf_cdf1d.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Xs_pdf_cdf1d +// ----------------------------------------------------------------------------- + +class Xs_pdf_cdf1d : + 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 "Xs_pdf_cdf1d"; } + static auto NODENAME() { return "xs_pdf_cdf1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("outerDomainValue") | + + // children + --Child + ("xs") | + --Child + ("pdf") | + --Child + ("cdf") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "xs_in_xs_pdf_cdf1d", + "pdf", + "cdf_in_xs_pdf_cdf1d" + }; + 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", + "xs_in_xs_pdf_cdf1d", + "pdf", + "cdf_in_xs_pdf_cdf1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + outerDomainValue{this}; + + // children + Field + xs_in_xs_pdf_cdf1d{this}; + Field + pdf{this}; + Field + cdf_in_xs_pdf_cdf1d{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(pdf(),XYs1d); + GNDSTK_SHORTCUT(pdf(),regions1d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->outerDomainValue, \ + this->xs_in_xs_pdf_cdf1d, \ + this->pdf, \ + this->cdf_in_xs_pdf_cdf1d \ + ) + + // default + Xs_pdf_cdf1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Xs_pdf_cdf1d( + const wrapper> + &outerDomainValue, + const wrapper + &xs_in_xs_pdf_cdf1d = {}, + const wrapper + &pdf = {}, + const wrapper + &cdf_in_xs_pdf_cdf1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + outerDomainValue(this,outerDomainValue), + xs_in_xs_pdf_cdf1d(this,xs_in_xs_pdf_cdf1d), + pdf(this,pdf), + cdf_in_xs_pdf_cdf1d(this,cdf_in_xs_pdf_cdf1d) + { + Component::finish(); + } + + // from node + explicit Xs_pdf_cdf1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Xs_pdf_cdf1d(const Xs_pdf_cdf1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + outerDomainValue(this,other.outerDomainValue), + xs_in_xs_pdf_cdf1d(this,other.xs_in_xs_pdf_cdf1d), + pdf(this,other.pdf), + cdf_in_xs_pdf_cdf1d(this,other.cdf_in_xs_pdf_cdf1d) + { + Component::finish(other); + } + + // move + Xs_pdf_cdf1d(Xs_pdf_cdf1d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + outerDomainValue(this,std::move(other.outerDomainValue)), + xs_in_xs_pdf_cdf1d(this,std::move(other.xs_in_xs_pdf_cdf1d)), + pdf(this,std::move(other.pdf)), + cdf_in_xs_pdf_cdf1d(this,std::move(other.cdf_in_xs_pdf_cdf1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Xs_pdf_cdf1d &operator=(const Xs_pdf_cdf1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + outerDomainValue = other.outerDomainValue; + xs_in_xs_pdf_cdf1d = other.xs_in_xs_pdf_cdf1d; + pdf = other.pdf; + cdf_in_xs_pdf_cdf1d = other.cdf_in_xs_pdf_cdf1d; + } + return *this; + } + + // move + Xs_pdf_cdf1d &operator=(Xs_pdf_cdf1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + outerDomainValue = std::move(other.outerDomainValue); + xs_in_xs_pdf_cdf1d = std::move(other.xs_in_xs_pdf_cdf1d); + pdf = std::move(other.pdf); + cdf_in_xs_pdf_cdf1d = std::move(other.cdf_in_xs_pdf_cdf1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Xs_pdf_cdf1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Xs_pdf_cdf1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_pdf_cdf1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_pdf_cdf1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Xs_pdf_cdf1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Ys1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Ys1d.hpp new file mode 100644 index 000000000..075e1b571 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Ys1d.hpp @@ -0,0 +1,238 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CONTAINERS_YS1D +#define TEST_V2_0_CONTAINERS_YS1D + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/containers/Values.hpp" + +namespace test { +namespace v2_0 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Ys1d +// ----------------------------------------------------------------------------- + +class Ys1d : + 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 "Ys1d"; } + static auto NODENAME() { return "Ys1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{enums::Interpolation::linlin} + / Meta<>("interpolation") | + std::optional{} + / Meta<>("label") | + + // 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", + "interpolation", + "label", + "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", + "interpolation", + "label", + "axes", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const enums::Interpolation interpolation = enums::Interpolation::linlin; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + interpolation{this,defaults.interpolation}; + Field> + label{this}; + + // children + Field + axes{this}; + Field + values{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->interpolation, \ + this->label, \ + this->axes, \ + this->values \ + ) + + // default + Ys1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Ys1d( + const wrapper> + &interpolation, + const wrapper> + &label = {}, + const wrapper + &axes = {}, + const wrapper + &values = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + interpolation(this,defaults.interpolation,interpolation), + label(this,label), + axes(this,axes), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Ys1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Ys1d(const Ys1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + interpolation(this,other.interpolation), + label(this,other.label), + axes(this,other.axes), + values(this,other.values) + { + Component::finish(other); + } + + // move + Ys1d(Ys1d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + interpolation(this,std::move(other.interpolation)), + label(this,std::move(other.label)), + axes(this,std::move(other.axes)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Ys1d &operator=(const Ys1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + interpolation = other.interpolation; + label = other.label; + axes = other.axes; + values = other.values; + } + return *this; + } + + // move + Ys1d &operator=(Ys1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + interpolation = std::move(other.interpolation); + label = std::move(other.label); + axes = std::move(other.axes); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/containers/Ys1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Ys1d + +} // namespace containers +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/containers/Ys1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/containers/Ys1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/containers/Ys1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/AverageParameterCovariance.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/AverageParameterCovariance.hpp new file mode 100644 index 000000000..6f4416ae4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/AverageParameterCovariance.hpp @@ -0,0 +1,248 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_AVERAGEPARAMETERCOVARIANCE +#define TEST_V2_0_COVARIANCE_AVERAGEPARAMETERCOVARIANCE + +#include "test/v2.0/covariance/ColumnData.hpp" +#include "test/v2.0/covariance/RowData.hpp" +#include "test/v2.0/covariance/CovarianceMatrix.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// class AverageParameterCovariance +// ----------------------------------------------------------------------------- + +class AverageParameterCovariance : + public Component +{ + friend class Component; + + using _t = std::variant< + covariance::CovarianceMatrix + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "covariance"; } + 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::optional{} + / Meta<>("crossTerm") | + std::optional{} + / Meta<>("label") | + + // children + --Child> + ("columnData") | + --Child> + ("rowData") | + _t{} + / --(Child<>("covarianceMatrix")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "crossTerm", + "label", + "columnData", + "rowData", + "_covarianceMatrix" + }; + 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_term", + "label", + "column_data", + "row_data", + "_covariance_matrix" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + crossTerm{this}; + Field> + label{this}; + + // children + Field> + columnData{this}; + Field> + rowData{this}; + + // children - variant + Field<_t> + _covarianceMatrix{this}; + FieldPart covarianceMatrix{_covarianceMatrix}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->crossTerm, \ + this->label, \ + this->columnData, \ + this->rowData, \ + this->_covarianceMatrix \ + ) + + // default + AverageParameterCovariance() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageParameterCovariance( + const wrapper> + &crossTerm, + const wrapper> + &label = {}, + const wrapper> + &columnData = {}, + const wrapper> + &rowData = {}, + const wrapper<_t> + &_covarianceMatrix = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + crossTerm(this,crossTerm), + label(this,label), + columnData(this,columnData), + rowData(this,rowData), + _covarianceMatrix(this,_covarianceMatrix) + { + Component::finish(); + } + + // from node + explicit AverageParameterCovariance(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageParameterCovariance(const AverageParameterCovariance &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + crossTerm(this,other.crossTerm), + label(this,other.label), + columnData(this,other.columnData), + rowData(this,other.rowData), + _covarianceMatrix(this,other._covarianceMatrix) + { + Component::finish(other); + } + + // move + AverageParameterCovariance(AverageParameterCovariance &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + crossTerm(this,std::move(other.crossTerm)), + label(this,std::move(other.label)), + columnData(this,std::move(other.columnData)), + rowData(this,std::move(other.rowData)), + _covarianceMatrix(this,std::move(other._covarianceMatrix)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AverageParameterCovariance &operator=(const AverageParameterCovariance &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + crossTerm = other.crossTerm; + label = other.label; + columnData = other.columnData; + rowData = other.rowData; + _covarianceMatrix = other._covarianceMatrix; + } + return *this; + } + + // move + AverageParameterCovariance &operator=(AverageParameterCovariance &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + crossTerm = std::move(other.crossTerm); + label = std::move(other.label); + columnData = std::move(other.columnData); + rowData = std::move(other.rowData); + _covarianceMatrix = std::move(other._covarianceMatrix); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/AverageParameterCovariance/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageParameterCovariance + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/AverageParameterCovariance/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/AverageParameterCovariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/AverageParameterCovariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnData.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnData.hpp new file mode 100644 index 000000000..07a458cc5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnData.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_COLUMNDATA +#define TEST_V2_0_COVARIANCE_COLUMNDATA + +#include "test/v2.0/covariance/Slices.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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::optional{} + / Meta<>("href") | + std::optional{} + / Meta<>("dimension") | + + // 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", + "dimension", + "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", + "dimension", + "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}; + Field> + dimension{this}; + + // children + Field> + slices{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MFMT, \ + this->href, \ + this->dimension, \ + this->slices \ + ) + + // default + ColumnData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ColumnData( + const wrapper> + &ENDF_MFMT, + const wrapper> + &href = {}, + const wrapper> + &dimension = {}, + const wrapper> + &slices = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MFMT(this,ENDF_MFMT), + href(this,href), + dimension(this,dimension), + slices(this,slices) + { + Component::finish(); + } + + // from node + explicit ColumnData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ColumnData(const ColumnData &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MFMT(this,other.ENDF_MFMT), + href(this,other.href), + dimension(this,other.dimension), + slices(this,other.slices) + { + Component::finish(other); + } + + // move + ColumnData(ColumnData &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MFMT(this,std::move(other.ENDF_MFMT)), + href(this,std::move(other.href)), + dimension(this,std::move(other.dimension)), + 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; + dimension = other.dimension; + 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); + dimension = std::move(other.dimension); + slices = std::move(other.slices); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/ColumnData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ColumnData + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnData/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnSensitivity.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnSensitivity.hpp new file mode 100644 index 000000000..3f0b72bc1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnSensitivity.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_COLUMNSENSITIVITY +#define TEST_V2_0_COVARIANCE_COLUMNSENSITIVITY + +#include "test/v2.0/containers/Array.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// class ColumnSensitivity +// ----------------------------------------------------------------------------- + +class ColumnSensitivity : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "covariance"; } + static auto CLASS() { return "ColumnSensitivity"; } + static auto NODENAME() { return "columnSensitivity"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // 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", + "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", + "array" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + array{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->array \ + ) + + // default + ColumnSensitivity() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ColumnSensitivity( + const wrapper + &array + ) : + GNDSTK_COMPONENT(BlockData{}), + array(this,array) + { + Component::finish(); + } + + // from node + explicit ColumnSensitivity(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ColumnSensitivity(const ColumnSensitivity &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + array(this,other.array) + { + Component::finish(other); + } + + // move + ColumnSensitivity(ColumnSensitivity &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + array(this,std::move(other.array)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ColumnSensitivity &operator=(const ColumnSensitivity &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + array = other.array; + } + return *this; + } + + // move + ColumnSensitivity &operator=(ColumnSensitivity &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + array = std::move(other.array); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/ColumnSensitivity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ColumnSensitivity + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnSensitivity/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnSensitivity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ColumnSensitivity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Covariance.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Covariance.hpp new file mode 100644 index 000000000..3ff47a88e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Covariance.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_COVARIANCE +#define TEST_V2_0_COVARIANCE_COVARIANCE + +#include "test/v2.0/containers/Array.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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{} | + + // 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", + "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", + "array" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + array{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->array \ + ) + + // default + Covariance() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Covariance( + const wrapper + &array + ) : + GNDSTK_COMPONENT(BlockData{}), + array(this,array) + { + Component::finish(); + } + + // from node + explicit Covariance(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Covariance(const Covariance &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + array(this,other.array) + { + Component::finish(other); + } + + // move + Covariance(Covariance &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + 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; + array = other.array; + } + return *this; + } + + // move + Covariance &operator=(Covariance &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + array = std::move(other.array); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/Covariance/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Covariance + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Covariance/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Covariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Covariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceMatrix.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceMatrix.hpp new file mode 100644 index 000000000..d72b1c00c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceMatrix.hpp @@ -0,0 +1,233 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_COVARIANCEMATRIX +#define TEST_V2_0_COVARIANCE_COVARIANCEMATRIX + +#include "test/v2.0/containers/Gridded2d.hpp" +#include "test/v2.0/covariance/SandwichProduct.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// class CovarianceMatrix +// ----------------------------------------------------------------------------- + +class CovarianceMatrix : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::Gridded2d, + covariance::SandwichProduct + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "covariance"; } + 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::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("productFrame") | + XMLName{} + / Meta<>("type") | + + // children + _t{} + / --(Child<>("gridded2d") || Child<>("sandwichProduct")) + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "type", + "_gridded2dsandwichProduct" + }; + 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", + "type", + "_gridded2dsandwich_product" + }; + 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}; + Field + type{this}; + + // children - variant + Field<_t> + _gridded2dsandwichProduct{this}; + FieldPart gridded2d{_gridded2dsandwichProduct}; + FieldPart sandwichProduct{_gridded2dsandwichProduct}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->type, \ + this->_gridded2dsandwichProduct \ + ) + + // default + CovarianceMatrix() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CovarianceMatrix( + const wrapper> + &label, + const wrapper> + &productFrame = {}, + const wrapper + &type = {}, + const wrapper<_t> + &_gridded2dsandwichProduct = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + type(this,type), + _gridded2dsandwichProduct(this,_gridded2dsandwichProduct) + { + Component::finish(); + } + + // from node + explicit CovarianceMatrix(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceMatrix(const CovarianceMatrix &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + type(this,other.type), + _gridded2dsandwichProduct(this,other._gridded2dsandwichProduct) + { + Component::finish(other); + } + + // move + CovarianceMatrix(CovarianceMatrix &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + type(this,std::move(other.type)), + _gridded2dsandwichProduct(this,std::move(other._gridded2dsandwichProduct)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CovarianceMatrix &operator=(const CovarianceMatrix &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + type = other.type; + _gridded2dsandwichProduct = other._gridded2dsandwichProduct; + } + 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); + productFrame = std::move(other.productFrame); + type = std::move(other.type); + _gridded2dsandwichProduct = std::move(other._gridded2dsandwichProduct); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/CovarianceMatrix/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CovarianceMatrix + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceMatrix/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSection.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSection.hpp new file mode 100644 index 000000000..eee605d53 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSection.hpp @@ -0,0 +1,260 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_COVARIANCESECTION +#define TEST_V2_0_COVARIANCE_COVARIANCESECTION + +#include "test/v2.0/covariance/RowData.hpp" +#include "test/v2.0/covariance/ColumnData.hpp" +#include "test/v2.0/covariance/CovarianceMatrix.hpp" +#include "test/v2.0/covariance/Sum.hpp" +#include "test/v2.0/covariance/Mixed.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// class CovarianceSection +// ----------------------------------------------------------------------------- + +class CovarianceSection : + public Component +{ + friend class Component; + + using _t = std::variant< + covariance::CovarianceMatrix, + covariance::Sum, + covariance::Mixed + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "covariance"; } + 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 + Defaulted{false} + / Meta<>("crossTerm") | + std::optional{} + / Meta<>("label") | + + // children + --Child + ("rowData") | + --Child> + ("columnData") | + _t{} + / --(Child<>("covarianceMatrix") || Child<>("sum") || Child<>("mixed")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "crossTerm", + "label", + "rowData", + "columnData", + "_covarianceMatrixsummixed" + }; + 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_term", + "label", + "row_data", + "column_data", + "_covariance_matrixsummixed" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const bool crossTerm = false; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + crossTerm{this,defaults.crossTerm}; + Field> + label{this}; + + // children + Field + rowData{this}; + Field> + columnData{this}; + + // children - variant + Field<_t> + _covarianceMatrixsummixed{this}; + FieldPart covarianceMatrix{_covarianceMatrixsummixed}; + FieldPart sum{_covarianceMatrixsummixed}; + FieldPart mixed{_covarianceMatrixsummixed}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->crossTerm, \ + this->label, \ + this->rowData, \ + this->columnData, \ + this->_covarianceMatrixsummixed \ + ) + + // default + CovarianceSection() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit CovarianceSection( + const wrapper> + &crossTerm, + const wrapper> + &label = {}, + const wrapper + &rowData = {}, + const wrapper> + &columnData = {}, + const wrapper<_t> + &_covarianceMatrixsummixed = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + crossTerm(this,defaults.crossTerm,crossTerm), + label(this,label), + rowData(this,rowData), + columnData(this,columnData), + _covarianceMatrixsummixed(this,_covarianceMatrixsummixed) + { + Component::finish(); + } + + // from node + explicit CovarianceSection(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceSection(const CovarianceSection &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + crossTerm(this,other.crossTerm), + label(this,other.label), + rowData(this,other.rowData), + columnData(this,other.columnData), + _covarianceMatrixsummixed(this,other._covarianceMatrixsummixed) + { + Component::finish(other); + } + + // move + CovarianceSection(CovarianceSection &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + crossTerm(this,std::move(other.crossTerm)), + label(this,std::move(other.label)), + rowData(this,std::move(other.rowData)), + columnData(this,std::move(other.columnData)), + _covarianceMatrixsummixed(this,std::move(other._covarianceMatrixsummixed)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CovarianceSection &operator=(const CovarianceSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + crossTerm = other.crossTerm; + label = other.label; + rowData = other.rowData; + columnData = other.columnData; + _covarianceMatrixsummixed = other._covarianceMatrixsummixed; + } + return *this; + } + + // move + CovarianceSection &operator=(CovarianceSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + crossTerm = std::move(other.crossTerm); + label = std::move(other.label); + rowData = std::move(other.rowData); + columnData = std::move(other.columnData); + _covarianceMatrixsummixed = std::move(other._covarianceMatrixsummixed); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/CovarianceSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CovarianceSection + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSection/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSections.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSections.hpp new file mode 100644 index 000000000..28a2e3725 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSections.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_COVARIANCESECTIONS +#define TEST_V2_0_COVARIANCE_COVARIANCESECTIONS + +#include "test/v2.0/covariance/CovarianceSection.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->covarianceSection \ + ) + + // default + CovarianceSections() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CovarianceSections( + const wrapper>> + &covarianceSection + ) : + GNDSTK_COMPONENT(BlockData{}), + covarianceSection(this,covarianceSection) + { + Component::finish(); + } + + // from node + explicit CovarianceSections(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceSections(const CovarianceSections &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + covarianceSection(this,other.covarianceSection) + { + Component::finish(other); + } + + // move + CovarianceSections(CovarianceSections &&other) : + 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 "test/v2.0/covariance/CovarianceSections/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CovarianceSections + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSections/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSections/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSections/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSuite.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSuite.hpp new file mode 100644 index 000000000..7a76e673a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSuite.hpp @@ -0,0 +1,298 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_COVARIANCESUITE +#define TEST_V2_0_COVARIANCE_COVARIANCESUITE + +#include "test/v2.0/common/ExternalFiles.hpp" +#include "test/v2.0/styles/Styles.hpp" +#include "test/v2.0/covariance/CovarianceSections.hpp" +#include "test/v2.0/covariance/ParameterCovariances.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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::optional{} + / Meta<>("evaluation") | + std::optional{} + / Meta<>("projectile") | + std::optional{} + / Meta<>("target") | + enums::Interaction{} + / Meta<>("interaction") | + std::optional{} + / Meta<>("version") | + + // 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", + "evaluation", + "projectile", + "target", + "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", + "evaluation", + "projectile", + "target", + "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> + evaluation{this}; + Field> + projectile{this}; + Field> + target{this}; + Field + interaction{this}; + Field> + format{this}; + + // children + Field> + externalFiles{this}; + Field> + styles{this}; + Field> + covarianceSections{this}; + Field> + parameterCovariances{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->evaluation, \ + this->projectile, \ + this->target, \ + this->interaction, \ + this->format, \ + this->externalFiles, \ + this->styles, \ + this->covarianceSections, \ + this->parameterCovariances \ + ) + + // default + CovarianceSuite() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CovarianceSuite( + const wrapper> + &evaluation, + const wrapper> + &projectile = {}, + const wrapper> + &target = {}, + const wrapper + &interaction = {}, + const wrapper> + &format = {}, + const wrapper> + &externalFiles = {}, + const wrapper> + &styles = {}, + const wrapper> + &covarianceSections = {}, + const wrapper> + ¶meterCovariances = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + evaluation(this,evaluation), + projectile(this,projectile), + target(this,target), + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceSuite(const CovarianceSuite &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + evaluation(this,other.evaluation), + projectile(this,other.projectile), + target(this,other.target), + 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) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + evaluation(this,std::move(other.evaluation)), + projectile(this,std::move(other.projectile)), + target(this,std::move(other.target)), + 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; + evaluation = other.evaluation; + projectile = other.projectile; + target = other.target; + 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); + evaluation = std::move(other.evaluation); + projectile = std::move(other.projectile); + target = std::move(other.target); + 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 "test/v2.0/covariance/CovarianceSuite/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CovarianceSuite + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSuite/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSuite/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/CovarianceSuite/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Mixed.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Mixed.hpp new file mode 100644 index 000000000..d1bdef803 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Mixed.hpp @@ -0,0 +1,227 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_MIXED +#define TEST_V2_0_COVARIANCE_MIXED + +#include "test/v2.0/covariance/CovarianceMatrix.hpp" +#include "test/v2.0/covariance/ShortRangeSelfScalingVariance.hpp" +#include "test/v2.0/covariance/Sum.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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 + XMLName{} + / Meta<>("label") | + + // children + ++Child> + ("covarianceMatrix") | + ++Child> + ("shortRangeSelfScalingVariance") | + ++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", + "covarianceMatrix", + "shortRangeSelfScalingVariance", + "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", + "covariance_matrix", + "short_range_self_scaling_variance", + "sum" + }; + 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>> + shortRangeSelfScalingVariance{this}; + Field>> + sum{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->covarianceMatrix, \ + this->shortRangeSelfScalingVariance, \ + this->sum \ + ) + + // default + Mixed() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Mixed( + const wrapper + &label, + const wrapper>> + &covarianceMatrix = {}, + const wrapper>> + &shortRangeSelfScalingVariance = {}, + const wrapper>> + &sum = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + covarianceMatrix(this,covarianceMatrix), + shortRangeSelfScalingVariance(this,shortRangeSelfScalingVariance), + sum(this,sum) + { + Component::finish(); + } + + // from node + explicit Mixed(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Mixed(const Mixed &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + covarianceMatrix(this,other.covarianceMatrix), + shortRangeSelfScalingVariance(this,other.shortRangeSelfScalingVariance), + sum(this,other.sum) + { + Component::finish(other); + } + + // move + Mixed(Mixed &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + covarianceMatrix(this,std::move(other.covarianceMatrix)), + shortRangeSelfScalingVariance(this,std::move(other.shortRangeSelfScalingVariance)), + sum(this,std::move(other.sum)) + { + 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; + shortRangeSelfScalingVariance = other.shortRangeSelfScalingVariance; + sum = other.sum; + } + 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); + shortRangeSelfScalingVariance = std::move(other.shortRangeSelfScalingVariance); + sum = std::move(other.sum); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/Mixed/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Mixed + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Mixed/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Mixed/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Mixed/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariance.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariance.hpp new file mode 100644 index 000000000..bcc3f3637 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariance.hpp @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCE +#define TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCE + +#include "test/v2.0/covariance/RowData.hpp" +#include "test/v2.0/covariance/ParameterCovarianceMatrix.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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::optional{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(rowData(),slices); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->rowData, \ + this->parameterCovarianceMatrix \ + ) + + // default + ParameterCovariance() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterCovariance( + const wrapper> + &label, + const wrapper + &rowData = {}, + const wrapper> + ¶meterCovarianceMatrix = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + rowData(this,rowData), + parameterCovarianceMatrix(this,parameterCovarianceMatrix) + { + Component::finish(); + } + + // from node + explicit ParameterCovariance(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterCovariance(const ParameterCovariance &other) : + 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) : + 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 "test/v2.0/covariance/ParameterCovariance/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ParameterCovariance + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariance/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovarianceMatrix.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovarianceMatrix.hpp new file mode 100644 index 000000000..5e3963cc2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovarianceMatrix.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCEMATRIX +#define TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCEMATRIX + +#include "test/v2.0/covariance/Parameters.hpp" +#include "test/v2.0/containers/Array.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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 + XMLName{} + / Meta<>("label") | + std::optional{} + / Meta<>("type") | + + // children + --Child + ("parameters") | + --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", + "type", + "parameters", + "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", + "type", + "parameters", + "array" + }; + 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 + parameters{this}; + Field + array{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(parameters(),parameterLink); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->type, \ + this->parameters, \ + this->array \ + ) + + // default + ParameterCovarianceMatrix() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterCovarianceMatrix( + const wrapper + &label, + const wrapper> + &type = {}, + const wrapper + ¶meters = {}, + const wrapper + &array = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + type(this,type), + parameters(this,parameters), + array(this,array) + { + Component::finish(); + } + + // from node + explicit ParameterCovarianceMatrix(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterCovarianceMatrix(const ParameterCovarianceMatrix &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + type(this,other.type), + parameters(this,other.parameters), + array(this,other.array) + { + Component::finish(other); + } + + // move + ParameterCovarianceMatrix(ParameterCovarianceMatrix &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + type(this,std::move(other.type)), + parameters(this,std::move(other.parameters)), + array(this,std::move(other.array)) + { + 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; + parameters = other.parameters; + array = other.array; + } + 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); + parameters = std::move(other.parameters); + array = std::move(other.array); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/ParameterCovarianceMatrix/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ParameterCovarianceMatrix + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovarianceMatrix/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovarianceMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovarianceMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariances.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariances.hpp new file mode 100644 index 000000000..9010b53e8 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariances.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCES +#define TEST_V2_0_COVARIANCE_PARAMETERCOVARIANCES + +#include "test/v2.0/covariance/AverageParameterCovariance.hpp" +#include "test/v2.0/covariance/ParameterCovariance.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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> + ("averageParameterCovariance") | + ++Child> + ("parameterCovariance") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "averageParameterCovariance", + "parameterCovariance" + }; + 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_parameter_covariance", + "parameter_covariance" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field>> + averageParameterCovariance{this}; + Field>> + parameterCovariance{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->averageParameterCovariance, \ + this->parameterCovariance \ + ) + + // default + ParameterCovariances() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterCovariances( + const wrapper>> + &averageParameterCovariance, + const wrapper>> + ¶meterCovariance = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + averageParameterCovariance(this,averageParameterCovariance), + parameterCovariance(this,parameterCovariance) + { + Component::finish(); + } + + // from node + explicit ParameterCovariances(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterCovariances(const ParameterCovariances &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + averageParameterCovariance(this,other.averageParameterCovariance), + parameterCovariance(this,other.parameterCovariance) + { + Component::finish(other); + } + + // move + ParameterCovariances(ParameterCovariances &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + averageParameterCovariance(this,std::move(other.averageParameterCovariance)), + parameterCovariance(this,std::move(other.parameterCovariance)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ParameterCovariances &operator=(const ParameterCovariances &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + averageParameterCovariance = other.averageParameterCovariance; + parameterCovariance = other.parameterCovariance; + } + return *this; + } + + // move + ParameterCovariances &operator=(ParameterCovariances &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + averageParameterCovariance = std::move(other.averageParameterCovariance); + parameterCovariance = std::move(other.parameterCovariance); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/ParameterCovariances/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ParameterCovariances + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariances/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariances/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterCovariances/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterLink.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterLink.hpp new file mode 100644 index 000000000..24b7b6409 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterLink.hpp @@ -0,0 +1,228 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_PARAMETERLINK +#define TEST_V2_0_COVARIANCE_PARAMETERLINK + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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::optional{} + / Meta<>("href") | + std::optional{} + / Meta<>("label") | + Defaulted{0} + / Meta<>("matrixStartIndex") | + Defaulted{1} + / Meta<>("nParameters") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "label", + "matrixStartIndex", + "nParameters" + }; + 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", + "label", + "matrix_start_index", + "n_parameters" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const Integer32 matrixStartIndex = 0; + static inline const Integer32 nParameters = 1; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + href{this}; + Field> + label{this}; + Field> + matrixStartIndex{this,defaults.matrixStartIndex}; + Field> + nParameters{this,defaults.nParameters}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->label, \ + this->matrixStartIndex, \ + this->nParameters \ + ) + + // default + ParameterLink() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit ParameterLink( + const wrapper> + &href, + const wrapper> + &label = {}, + const wrapper> + &matrixStartIndex = {}, + const wrapper> + &nParameters = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href), + label(this,label), + matrixStartIndex(this,defaults.matrixStartIndex,matrixStartIndex), + nParameters(this,defaults.nParameters,nParameters) + { + Component::finish(); + } + + // from node + explicit ParameterLink(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterLink(const ParameterLink &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href), + label(this,other.label), + matrixStartIndex(this,other.matrixStartIndex), + nParameters(this,other.nParameters) + { + Component::finish(other); + } + + // move + ParameterLink(ParameterLink &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)), + label(this,std::move(other.label)), + matrixStartIndex(this,std::move(other.matrixStartIndex)), + nParameters(this,std::move(other.nParameters)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ParameterLink &operator=(const ParameterLink &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + href = other.href; + label = other.label; + matrixStartIndex = other.matrixStartIndex; + nParameters = other.nParameters; + } + return *this; + } + + // move + ParameterLink &operator=(ParameterLink &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + label = std::move(other.label); + matrixStartIndex = std::move(other.matrixStartIndex); + nParameters = std::move(other.nParameters); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/ParameterLink/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ParameterLink + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterLink/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterLink/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ParameterLink/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Parameters.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Parameters.hpp new file mode 100644 index 000000000..985835716 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Parameters.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_PARAMETERS +#define TEST_V2_0_COVARIANCE_PARAMETERS + +#include "test/v2.0/covariance/ParameterLink.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->parameterLink \ + ) + + // default + Parameters() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Parameters( + const wrapper>> + ¶meterLink + ) : + GNDSTK_COMPONENT(BlockData{}), + parameterLink(this,parameterLink) + { + Component::finish(); + } + + // from node + explicit Parameters(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Parameters(const Parameters &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + parameterLink(this,other.parameterLink) + { + Component::finish(other); + } + + // move + Parameters(Parameters &&other) : + 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 "test/v2.0/covariance/Parameters/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Parameters + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Parameters/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Parameters/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Parameters/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/RowData.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/RowData.hpp new file mode 100644 index 000000000..29397ead3 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/RowData.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_ROWDATA +#define TEST_V2_0_COVARIANCE_ROWDATA + +#include "test/v2.0/covariance/Slices.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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<>("href") | + std::optional{} + / Meta<>("dimension") | + + // 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", + "dimension", + "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", + "dimension", + "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}; + Field> + dimension{this}; + + // children + Field> + slices{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MFMT, \ + this->href, \ + this->dimension, \ + this->slices \ + ) + + // default + RowData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RowData( + const wrapper> + &ENDF_MFMT, + const wrapper> + &href = {}, + const wrapper> + &dimension = {}, + const wrapper> + &slices = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MFMT(this,ENDF_MFMT), + href(this,href), + dimension(this,dimension), + slices(this,slices) + { + Component::finish(); + } + + // from node + explicit RowData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RowData(const RowData &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MFMT(this,other.ENDF_MFMT), + href(this,other.href), + dimension(this,other.dimension), + slices(this,other.slices) + { + Component::finish(other); + } + + // move + RowData(RowData &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MFMT(this,std::move(other.ENDF_MFMT)), + href(this,std::move(other.href)), + dimension(this,std::move(other.dimension)), + 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; + href = other.href; + dimension = other.dimension; + 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); + href = std::move(other.href); + dimension = std::move(other.dimension); + slices = std::move(other.slices); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/RowData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RowData + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/RowData/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/RowData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/RowData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/RowSensitivity.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/RowSensitivity.hpp new file mode 100644 index 000000000..6e743147c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/RowSensitivity.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_ROWSENSITIVITY +#define TEST_V2_0_COVARIANCE_ROWSENSITIVITY + +#include "test/v2.0/containers/Array.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// class RowSensitivity +// ----------------------------------------------------------------------------- + +class RowSensitivity : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "covariance"; } + static auto CLASS() { return "RowSensitivity"; } + static auto NODENAME() { return "rowSensitivity"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // 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", + "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", + "array" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + array{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->array \ + ) + + // default + RowSensitivity() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RowSensitivity( + const wrapper + &array + ) : + GNDSTK_COMPONENT(BlockData{}), + array(this,array) + { + Component::finish(); + } + + // from node + explicit RowSensitivity(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RowSensitivity(const RowSensitivity &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + array(this,other.array) + { + Component::finish(other); + } + + // move + RowSensitivity(RowSensitivity &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + array(this,std::move(other.array)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + RowSensitivity &operator=(const RowSensitivity &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + array = other.array; + } + return *this; + } + + // move + RowSensitivity &operator=(RowSensitivity &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + array = std::move(other.array); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/RowSensitivity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RowSensitivity + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/RowSensitivity/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/RowSensitivity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/RowSensitivity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/SandwichProduct.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/SandwichProduct.hpp new file mode 100644 index 000000000..cef2a6422 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/SandwichProduct.hpp @@ -0,0 +1,230 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_SANDWICHPRODUCT +#define TEST_V2_0_COVARIANCE_SANDWICHPRODUCT + +#include "test/v2.0/containers/Axes.hpp" +#include "test/v2.0/covariance/Covariance.hpp" +#include "test/v2.0/covariance/RowSensitivity.hpp" +#include "test/v2.0/covariance/ColumnSensitivity.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// class SandwichProduct +// ----------------------------------------------------------------------------- + +class SandwichProduct : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "covariance"; } + static auto CLASS() { return "SandwichProduct"; } + static auto NODENAME() { return "sandwichProduct"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("axes") | + --Child + ("covariance") | + --Child + ("rowSensitivity") | + --Child> + ("columnSensitivity") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "covariance", + "rowSensitivity", + "columnSensitivity" + }; + 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", + "covariance", + "row_sensitivity", + "column_sensitivity" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + axes{this}; + Field + covariance{this}; + Field + rowSensitivity{this}; + Field> + columnSensitivity{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(axes(),axis); + GNDSTK_SHORTCUT(axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->axes, \ + this->covariance, \ + this->rowSensitivity, \ + this->columnSensitivity \ + ) + + // default + SandwichProduct() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SandwichProduct( + const wrapper + &axes, + const wrapper + &covariance = {}, + const wrapper + &rowSensitivity = {}, + const wrapper> + &columnSensitivity = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + axes(this,axes), + covariance(this,covariance), + rowSensitivity(this,rowSensitivity), + columnSensitivity(this,columnSensitivity) + { + Component::finish(); + } + + // from node + explicit SandwichProduct(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SandwichProduct(const SandwichProduct &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + axes(this,other.axes), + covariance(this,other.covariance), + rowSensitivity(this,other.rowSensitivity), + columnSensitivity(this,other.columnSensitivity) + { + Component::finish(other); + } + + // move + SandwichProduct(SandwichProduct &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + axes(this,std::move(other.axes)), + covariance(this,std::move(other.covariance)), + rowSensitivity(this,std::move(other.rowSensitivity)), + columnSensitivity(this,std::move(other.columnSensitivity)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + SandwichProduct &operator=(const SandwichProduct &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + axes = other.axes; + covariance = other.covariance; + rowSensitivity = other.rowSensitivity; + columnSensitivity = other.columnSensitivity; + } + return *this; + } + + // move + SandwichProduct &operator=(SandwichProduct &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + axes = std::move(other.axes); + covariance = std::move(other.covariance); + rowSensitivity = std::move(other.rowSensitivity); + columnSensitivity = std::move(other.columnSensitivity); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/SandwichProduct/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SandwichProduct + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/SandwichProduct/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/SandwichProduct/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/SandwichProduct/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ShortRangeSelfScalingVariance.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ShortRangeSelfScalingVariance.hpp new file mode 100644 index 000000000..d48e46fdb --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ShortRangeSelfScalingVariance.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_SHORTRANGESELFSCALINGVARIANCE +#define TEST_V2_0_COVARIANCE_SHORTRANGESELFSCALINGVARIANCE + +#include "test/v2.0/containers/Gridded2d.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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::optional{} + / Meta<>("dependenceOnProcessedGroupWidth") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("type") | + + // 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", + "dependenceOnProcessedGroupWidth", + "label", + "type", + "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", + "dependence_on_processed_group_width", + "label", + "type", + "gridded2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + dependenceOnProcessedGroupWidth{this}; + Field> + label{this}; + Field> + type{this}; + + // children + Field> + gridded2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->dependenceOnProcessedGroupWidth, \ + this->label, \ + this->type, \ + this->gridded2d \ + ) + + // default + ShortRangeSelfScalingVariance() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ShortRangeSelfScalingVariance( + const wrapper> + &dependenceOnProcessedGroupWidth, + const wrapper> + &label = {}, + const wrapper> + &type = {}, + const wrapper> + &gridded2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + dependenceOnProcessedGroupWidth(this,dependenceOnProcessedGroupWidth), + label(this,label), + type(this,type), + gridded2d(this,gridded2d) + { + Component::finish(); + } + + // from node + explicit ShortRangeSelfScalingVariance(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ShortRangeSelfScalingVariance(const ShortRangeSelfScalingVariance &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + dependenceOnProcessedGroupWidth(this,other.dependenceOnProcessedGroupWidth), + label(this,other.label), + type(this,other.type), + gridded2d(this,other.gridded2d) + { + Component::finish(other); + } + + // move + ShortRangeSelfScalingVariance(ShortRangeSelfScalingVariance &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + dependenceOnProcessedGroupWidth(this,std::move(other.dependenceOnProcessedGroupWidth)), + label(this,std::move(other.label)), + type(this,std::move(other.type)), + 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; + dependenceOnProcessedGroupWidth = other.dependenceOnProcessedGroupWidth; + label = other.label; + type = other.type; + gridded2d = other.gridded2d; + } + return *this; + } + + // move + ShortRangeSelfScalingVariance &operator=(ShortRangeSelfScalingVariance &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + dependenceOnProcessedGroupWidth = std::move(other.dependenceOnProcessedGroupWidth); + label = std::move(other.label); + type = std::move(other.type); + gridded2d = std::move(other.gridded2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/ShortRangeSelfScalingVariance/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ShortRangeSelfScalingVariance + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/ShortRangeSelfScalingVariance/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/ShortRangeSelfScalingVariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/ShortRangeSelfScalingVariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Slice.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Slice.hpp new file mode 100644 index 000000000..e74061e7f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Slice.hpp @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_SLICE +#define TEST_V2_0_COVARIANCE_SLICE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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 + std::optional{} + / Meta<>("domainMin") | + std::optional{} + / Meta<>("domainMax") | + std::optional{} + / Meta<>("domainValue") | + std::optional{} + / Meta<>("domainUnit") | + Integer32{} + / Meta<>("dimension") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "domainValue", + "domainUnit", + "dimension" + }; + 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_value", + "domain_unit", + "dimension" + }; + 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> + domainValue{this}; + Field> + domainUnit{this}; + Field + dimension{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->domainValue, \ + this->domainUnit, \ + this->dimension \ + ) + + // default + Slice() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Slice( + const wrapper> + &domainMin, + const wrapper> + &domainMax = {}, + const wrapper> + &domainValue = {}, + const wrapper> + &domainUnit = {}, + const wrapper + &dimension = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainValue(this,domainValue), + domainUnit(this,domainUnit), + dimension(this,dimension) + { + Component::finish(); + } + + // from node + explicit Slice(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Slice(const Slice &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + domainValue(this,other.domainValue), + domainUnit(this,other.domainUnit), + dimension(this,other.dimension) + { + Component::finish(other); + } + + // move + Slice(Slice &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + domainValue(this,std::move(other.domainValue)), + domainUnit(this,std::move(other.domainUnit)), + dimension(this,std::move(other.dimension)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Slice &operator=(const Slice &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + domainMin = other.domainMin; + domainMax = other.domainMax; + domainValue = other.domainValue; + domainUnit = other.domainUnit; + dimension = other.dimension; + } + return *this; + } + + // move + Slice &operator=(Slice &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + domainValue = std::move(other.domainValue); + domainUnit = std::move(other.domainUnit); + dimension = std::move(other.dimension); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/Slice/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Slice + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Slice/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Slice/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Slice/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Slices.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Slices.hpp new file mode 100644 index 000000000..415cdd49f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Slices.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_SLICES +#define TEST_V2_0_COVARIANCE_SLICES + +#include "test/v2.0/covariance/Slice.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->slice \ + ) + + // default + Slices() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Slices( + const wrapper> + &slice + ) : + GNDSTK_COMPONENT(BlockData{}), + slice(this,slice) + { + Component::finish(); + } + + // from node + explicit Slices(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Slices(const Slices &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + slice(this,other.slice) + { + Component::finish(other); + } + + // move + Slices(Slices &&other) : + 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 "test/v2.0/covariance/Slices/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Slices + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Slices/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Slices/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Slices/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Sum.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Sum.hpp new file mode 100644 index 000000000..c2c31048c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Sum.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_SUM +#define TEST_V2_0_COVARIANCE_SUM + +#include "test/v2.0/covariance/Summand.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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 + Float64{} + / Meta<>("domainMin") | + Float64{} + / Meta<>("domainMax") | + XMLName{} + / Meta<>("domainUnit") | + std::optional{} + / Meta<>("label") | + + // 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", + "domainMin", + "domainMax", + "domainUnit", + "label", + "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", + "domain_min", + "domain_max", + "domain_unit", + "label", + "summand" + }; + 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}; + Field> + label{this}; + + // children + Field>> + summand{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->label, \ + this->summand \ + ) + + // default + Sum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Sum( + const wrapper + &domainMin, + const wrapper + &domainMax = {}, + const wrapper + &domainUnit = {}, + const wrapper> + &label = {}, + const wrapper>> + &summand = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainUnit(this,domainUnit), + label(this,label), + summand(this,summand) + { + Component::finish(); + } + + // from node + explicit Sum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Sum(const Sum &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + domainUnit(this,other.domainUnit), + label(this,other.label), + summand(this,other.summand) + { + Component::finish(other); + } + + // move + Sum(Sum &&other) : + 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)), + label(this,std::move(other.label)), + 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; + domainMin = other.domainMin; + domainMax = other.domainMax; + domainUnit = other.domainUnit; + label = other.label; + summand = other.summand; + } + return *this; + } + + // move + Sum &operator=(Sum &&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); + label = std::move(other.label); + summand = std::move(other.summand); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/covariance/Sum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Sum + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Sum/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Sum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Sum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Summand.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Summand.hpp new file mode 100644 index 000000000..11521a4f6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Summand.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_COVARIANCE_SUMMAND +#define TEST_V2_0_COVARIANCE_SUMMAND + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace covariance { + +// ----------------------------------------------------------------------------- +// covariance:: +// 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 "covariance"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MFMT, \ + this->coefficient, \ + this->href \ + ) + + // default + Summand() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Summand( + const wrapper> + &ENDF_MFMT, + const wrapper> + &coefficient = {}, + const wrapper> + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MFMT(this,ENDF_MFMT), + coefficient(this,coefficient), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Summand(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Summand(const Summand &other) : + 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) : + 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 "test/v2.0/covariance/Summand/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Summand + +} // namespace covariance +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/covariance/Summand/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/covariance/Summand/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/covariance/Summand/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp new file mode 100644 index 000000000..b526f0b85 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp @@ -0,0 +1,274 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CPTRANSPORT_COULOMBPLUSNUCLEARELASTIC +#define TEST_V2_0_CPTRANSPORT_COULOMBPLUSNUCLEARELASTIC + +#include "test/v2.0/cpTransport/RutherfordScattering.hpp" +#include "test/v2.0/cpTransport/NuclearAmplitudeExpansion.hpp" + +namespace test { +namespace v2_0 { +namespace cpTransport { + +// ----------------------------------------------------------------------------- +// cpTransport:: +// 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 "cpTransport"; } + 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::optional{} + / Meta<>("href") | + Defaulted{false} + / Meta<>("identicalParticles") | + XMLName{} + / Meta<>("label") | + std::optional{} + / Meta<>("pid") | + std::optional{} + / Meta<>("productFrame") | + + // children + --Child> + ("RutherfordScattering") | + --Child> + ("nuclearAmplitudeExpansion") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "identicalParticles", + "label", + "pid", + "productFrame", + "RutherfordScattering", + "nuclearAmplitudeExpansion" + }; + 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", + "identical_particles", + "label", + "pid", + "product_frame", + "rutherford_scattering", + "nuclear_amplitude_expansion" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const bool identicalParticles = false; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + href{this}; + Field> + identicalParticles{this,defaults.identicalParticles}; + Field + label{this}; + Field> + pid{this}; + Field> + productFrame{this}; + + // children + Field> + RutherfordScattering{this}; + Field> + nuclearAmplitudeExpansion{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->identicalParticles, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->RutherfordScattering, \ + this->nuclearAmplitudeExpansion \ + ) + + // default + CoulombPlusNuclearElastic() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit CoulombPlusNuclearElastic( + const wrapper> + &href, + const wrapper> + &identicalParticles = {}, + const wrapper + &label = {}, + const wrapper> + &pid = {}, + const wrapper> + &productFrame = {}, + const wrapper> + &RutherfordScattering = {}, + const wrapper> + &nuclearAmplitudeExpansion = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href), + identicalParticles(this,defaults.identicalParticles,identicalParticles), + label(this,label), + pid(this,pid), + productFrame(this,productFrame), + RutherfordScattering(this,RutherfordScattering), + nuclearAmplitudeExpansion(this,nuclearAmplitudeExpansion) + { + Component::finish(); + } + + // from node + explicit CoulombPlusNuclearElastic(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CoulombPlusNuclearElastic(const CoulombPlusNuclearElastic &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href), + identicalParticles(this,other.identicalParticles), + label(this,other.label), + pid(this,other.pid), + productFrame(this,other.productFrame), + RutherfordScattering(this,other.RutherfordScattering), + nuclearAmplitudeExpansion(this,other.nuclearAmplitudeExpansion) + { + Component::finish(other); + } + + // move + CoulombPlusNuclearElastic(CoulombPlusNuclearElastic &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)), + identicalParticles(this,std::move(other.identicalParticles)), + label(this,std::move(other.label)), + pid(this,std::move(other.pid)), + productFrame(this,std::move(other.productFrame)), + RutherfordScattering(this,std::move(other.RutherfordScattering)), + nuclearAmplitudeExpansion(this,std::move(other.nuclearAmplitudeExpansion)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CoulombPlusNuclearElastic &operator=(const CoulombPlusNuclearElastic &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + href = other.href; + identicalParticles = other.identicalParticles; + label = other.label; + pid = other.pid; + productFrame = other.productFrame; + RutherfordScattering = other.RutherfordScattering; + nuclearAmplitudeExpansion = other.nuclearAmplitudeExpansion; + } + return *this; + } + + // move + CoulombPlusNuclearElastic &operator=(CoulombPlusNuclearElastic &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + identicalParticles = std::move(other.identicalParticles); + label = std::move(other.label); + pid = std::move(other.pid); + productFrame = std::move(other.productFrame); + RutherfordScattering = std::move(other.RutherfordScattering); + nuclearAmplitudeExpansion = std::move(other.nuclearAmplitudeExpansion); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CoulombPlusNuclearElastic + +} // namespace cpTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/CoulombPlusNuclearElastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/ImaginaryInterferenceTerm.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/ImaginaryInterferenceTerm.hpp new file mode 100644 index 000000000..87bfeb249 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/ImaginaryInterferenceTerm.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CPTRANSPORT_IMAGINARYINTERFERENCETERM +#define TEST_V2_0_CPTRANSPORT_IMAGINARYINTERFERENCETERM + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" + +namespace test { +namespace v2_0 { +namespace cpTransport { + +// ----------------------------------------------------------------------------- +// cpTransport:: +// 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 "cpTransport"; } + 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> + ("XYs2d") | + --Child> + ("regions2d") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "regions2d" + }; + 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", + "regions2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs2d{this}; + Field> + regions2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d, \ + this->regions2d \ + ) + + // default + ImaginaryInterferenceTerm() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ImaginaryInterferenceTerm( + const wrapper> + &XYs2d, + const wrapper> + ®ions2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d), + regions2d(this,regions2d) + { + Component::finish(); + } + + // from node + explicit ImaginaryInterferenceTerm(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ImaginaryInterferenceTerm(const ImaginaryInterferenceTerm &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d), + regions2d(this,other.regions2d) + { + Component::finish(other); + } + + // move + ImaginaryInterferenceTerm(ImaginaryInterferenceTerm &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs2d(this,std::move(other.XYs2d)), + regions2d(this,std::move(other.regions2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ImaginaryInterferenceTerm &operator=(const ImaginaryInterferenceTerm &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs2d = other.XYs2d; + regions2d = other.regions2d; + } + return *this; + } + + // move + ImaginaryInterferenceTerm &operator=(ImaginaryInterferenceTerm &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs2d = std::move(other.XYs2d); + regions2d = std::move(other.regions2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ImaginaryInterferenceTerm + +} // namespace cpTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/ImaginaryInterferenceTerm/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearAmplitudeExpansion.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearAmplitudeExpansion.hpp new file mode 100644 index 000000000..1d8f29f27 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearAmplitudeExpansion.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CPTRANSPORT_NUCLEARAMPLITUDEEXPANSION +#define TEST_V2_0_CPTRANSPORT_NUCLEARAMPLITUDEEXPANSION + +#include "test/v2.0/cpTransport/NuclearTerm.hpp" +#include "test/v2.0/cpTransport/RealInterferenceTerm.hpp" +#include "test/v2.0/cpTransport/ImaginaryInterferenceTerm.hpp" + +namespace test { +namespace v2_0 { +namespace cpTransport { + +// ----------------------------------------------------------------------------- +// cpTransport:: +// 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 "cpTransport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclearTerm, \ + this->realInterferenceTerm, \ + this->imaginaryInterferenceTerm \ + ) + + // default + NuclearAmplitudeExpansion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NuclearAmplitudeExpansion( + const wrapper + &nuclearTerm, + const wrapper + &realInterferenceTerm = {}, + const wrapper + &imaginaryInterferenceTerm = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + nuclearTerm(this,nuclearTerm), + realInterferenceTerm(this,realInterferenceTerm), + imaginaryInterferenceTerm(this,imaginaryInterferenceTerm) + { + Component::finish(); + } + + // from node + explicit NuclearAmplitudeExpansion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NuclearAmplitudeExpansion(const NuclearAmplitudeExpansion &other) : + 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) : + 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 "test/v2.0/cpTransport/NuclearAmplitudeExpansion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NuclearAmplitudeExpansion + +} // namespace cpTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearAmplitudeExpansion/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearAmplitudeExpansion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearAmplitudeExpansion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearPlusInterference.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearPlusInterference.hpp new file mode 100644 index 000000000..2c3b13b67 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearPlusInterference.hpp @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CPTRANSPORT_NUCLEARPLUSINTERFERENCE +#define TEST_V2_0_CPTRANSPORT_NUCLEARPLUSINTERFERENCE + +#include "test/v2.0/transport/CrossSection.hpp" +#include "test/v2.0/transport/Distribution.hpp" + +namespace test { +namespace v2_0 { +namespace cpTransport { + +// ----------------------------------------------------------------------------- +// cpTransport:: +// 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 "cpTransport"; } + 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 + Float64{} + / 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->muCutoff, \ + this->crossSection, \ + this->distribution \ + ) + + // default + NuclearPlusInterference() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NuclearPlusInterference( + const wrapper + &muCutoff, + const wrapper + &crossSection = {}, + const wrapper + &distribution = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + muCutoff(this,muCutoff), + crossSection(this,crossSection), + distribution(this,distribution) + { + Component::finish(); + } + + // from node + explicit NuclearPlusInterference(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NuclearPlusInterference(const NuclearPlusInterference &other) : + 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) : + 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 "test/v2.0/cpTransport/NuclearPlusInterference/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NuclearPlusInterference + +} // namespace cpTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearPlusInterference/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearPlusInterference/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearPlusInterference/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearTerm.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearTerm.hpp new file mode 100644 index 000000000..35341867c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearTerm.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CPTRANSPORT_NUCLEARTERM +#define TEST_V2_0_CPTRANSPORT_NUCLEARTERM + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" + +namespace test { +namespace v2_0 { +namespace cpTransport { + +// ----------------------------------------------------------------------------- +// cpTransport:: +// 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 "cpTransport"; } + 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> + ("XYs2d") | + --Child> + ("regions2d") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "regions2d" + }; + 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", + "regions2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs2d{this}; + Field> + regions2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d, \ + this->regions2d \ + ) + + // default + NuclearTerm() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NuclearTerm( + const wrapper> + &XYs2d, + const wrapper> + ®ions2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d), + regions2d(this,regions2d) + { + Component::finish(); + } + + // from node + explicit NuclearTerm(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NuclearTerm(const NuclearTerm &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d), + regions2d(this,other.regions2d) + { + Component::finish(other); + } + + // move + NuclearTerm(NuclearTerm &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs2d(this,std::move(other.XYs2d)), + regions2d(this,std::move(other.regions2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + NuclearTerm &operator=(const NuclearTerm &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs2d = other.XYs2d; + regions2d = other.regions2d; + } + return *this; + } + + // move + NuclearTerm &operator=(NuclearTerm &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs2d = std::move(other.XYs2d); + regions2d = std::move(other.regions2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/cpTransport/NuclearTerm/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NuclearTerm + +} // namespace cpTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearTerm/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearTerm/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/NuclearTerm/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RealInterferenceTerm.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RealInterferenceTerm.hpp new file mode 100644 index 000000000..6925b0f38 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RealInterferenceTerm.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CPTRANSPORT_REALINTERFERENCETERM +#define TEST_V2_0_CPTRANSPORT_REALINTERFERENCETERM + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" + +namespace test { +namespace v2_0 { +namespace cpTransport { + +// ----------------------------------------------------------------------------- +// cpTransport:: +// 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 "cpTransport"; } + 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> + ("XYs2d") | + --Child> + ("regions2d") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "regions2d" + }; + 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", + "regions2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs2d{this}; + Field> + regions2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d, \ + this->regions2d \ + ) + + // default + RealInterferenceTerm() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RealInterferenceTerm( + const wrapper> + &XYs2d, + const wrapper> + ®ions2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d), + regions2d(this,regions2d) + { + Component::finish(); + } + + // from node + explicit RealInterferenceTerm(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RealInterferenceTerm(const RealInterferenceTerm &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d), + regions2d(this,other.regions2d) + { + Component::finish(other); + } + + // move + RealInterferenceTerm(RealInterferenceTerm &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs2d(this,std::move(other.XYs2d)), + regions2d(this,std::move(other.regions2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + RealInterferenceTerm &operator=(const RealInterferenceTerm &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs2d = other.XYs2d; + regions2d = other.regions2d; + } + return *this; + } + + // move + RealInterferenceTerm &operator=(RealInterferenceTerm &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs2d = std::move(other.XYs2d); + regions2d = std::move(other.regions2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/cpTransport/RealInterferenceTerm/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RealInterferenceTerm + +} // namespace cpTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RealInterferenceTerm/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RealInterferenceTerm/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RealInterferenceTerm/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RutherfordScattering.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RutherfordScattering.hpp new file mode 100644 index 000000000..1976adef4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RutherfordScattering.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_CPTRANSPORT_RUTHERFORDSCATTERING +#define TEST_V2_0_CPTRANSPORT_RUTHERFORDSCATTERING + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace cpTransport { + +// ----------------------------------------------------------------------------- +// cpTransport:: +// 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 "cpTransport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + RutherfordScattering() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit RutherfordScattering(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RutherfordScattering(const RutherfordScattering &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + RutherfordScattering(RutherfordScattering &&other) : + 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 "test/v2.0/cpTransport/RutherfordScattering/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RutherfordScattering + +} // namespace cpTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RutherfordScattering/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RutherfordScattering/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/cpTransport/RutherfordScattering/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Abstract.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Abstract.hpp new file mode 100644 index 000000000..9cfd9246b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Abstract.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_ABSTRACT +#define TEST_V2_0_DOCUMENTATION_ABSTRACT + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Abstract +// ----------------------------------------------------------------------------- + +class Abstract : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Abstract"; } + static auto NODENAME() { return "abstract"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label \ + ) + + // default + Abstract() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Abstract( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Abstract(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Abstract(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Abstract(const Abstract &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label) + { + Component::finish(other); + } + + // move + Abstract(Abstract &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Abstract &operator=(const Abstract &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + } + return *this; + } + + // move + Abstract &operator=(Abstract &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Abstract/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Abstract + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Abstract/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Abstract/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Abstract/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgement.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgement.hpp new file mode 100644 index 000000000..c2def734b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgement.hpp @@ -0,0 +1,237 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_ACKNOWLEDGEMENT +#define TEST_V2_0_DOCUMENTATION_ACKNOWLEDGEMENT + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Acknowledgement +// ----------------------------------------------------------------------------- + +class Acknowledgement : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Acknowledgement"; } + static auto NODENAME() { return "acknowledgement"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / Meta<>("label") | + XMLName{} + / Meta<>("type") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "type" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "type" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + Field + type{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label, \ + this->type \ + ) + + // default + Acknowledgement() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Acknowledgement( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {}, + const wrapper + &type = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label), + type(this,type) + { + Component::finish(); + } + + // from node + explicit Acknowledgement(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Acknowledgement(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Acknowledgement(const Acknowledgement &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label), + type(this,other.type) + { + Component::finish(other); + } + + // move + Acknowledgement(Acknowledgement &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)), + type(this,std::move(other.type)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Acknowledgement &operator=(const Acknowledgement &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + type = other.type; + } + return *this; + } + + // move + Acknowledgement &operator=(Acknowledgement &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + type = std::move(other.type); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Acknowledgement/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Acknowledgement + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgement/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgement/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgement/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgements.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgements.hpp new file mode 100644 index 000000000..5fc7d9c42 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgements.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_ACKNOWLEDGEMENTS +#define TEST_V2_0_DOCUMENTATION_ACKNOWLEDGEMENTS + +#include "test/v2.0/documentation/Acknowledgement.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Acknowledgements +// ----------------------------------------------------------------------------- + +class Acknowledgements : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Acknowledgements"; } + static auto NODENAME() { return "acknowledgements"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("acknowledgement") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "acknowledgement" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "acknowledgement" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + acknowledgement{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->acknowledgement \ + ) + + // default + Acknowledgements() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Acknowledgements( + const wrapper> + &acknowledgement + ) : + GNDSTK_COMPONENT(BlockData{}), + acknowledgement(this,acknowledgement) + { + Component::finish(); + } + + // from node + explicit Acknowledgements(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Acknowledgements(const Acknowledgements &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + acknowledgement(this,other.acknowledgement) + { + Component::finish(other); + } + + // move + Acknowledgements(Acknowledgements &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + acknowledgement(this,std::move(other.acknowledgement)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Acknowledgements &operator=(const Acknowledgements &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + acknowledgement = other.acknowledgement; + } + return *this; + } + + // move + Acknowledgements &operator=(Acknowledgements &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + acknowledgement = std::move(other.acknowledgement); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Acknowledgements/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Acknowledgements + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgements/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgements/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Acknowledgements/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliation.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliation.hpp new file mode 100644 index 000000000..090be00da --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliation.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_AFFILIATION +#define TEST_V2_0_DOCUMENTATION_AFFILIATION + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Affiliation +// ----------------------------------------------------------------------------- + +class Affiliation : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Affiliation"; } + static auto NODENAME() { return "affiliation"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + UTF8Text{} + / Meta<>("name") | + 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", + "name", + "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", + "name", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + name{this}; + Field> + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->href \ + ) + + // default + Affiliation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Affiliation( + const wrapper + &name, + const wrapper> + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Affiliation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Affiliation(const Affiliation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + href(this,other.href) + { + Component::finish(other); + } + + // move + Affiliation(Affiliation &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + name(this,std::move(other.name)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Affiliation &operator=(const Affiliation &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + name = other.name; + href = other.href; + } + return *this; + } + + // move + Affiliation &operator=(Affiliation &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + name = std::move(other.name); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Affiliation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Affiliation + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliation/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliations.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliations.hpp new file mode 100644 index 000000000..1d9a2e7b4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliations.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_AFFILIATIONS +#define TEST_V2_0_DOCUMENTATION_AFFILIATIONS + +#include "test/v2.0/documentation/Affiliation.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Affiliations +// ----------------------------------------------------------------------------- + +class Affiliations : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Affiliations"; } + static auto NODENAME() { return "affiliations"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("affiliation") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "affiliation" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "affiliation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + affiliation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->affiliation \ + ) + + // default + Affiliations() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Affiliations( + const wrapper> + &affiliation + ) : + GNDSTK_COMPONENT(BlockData{}), + affiliation(this,affiliation) + { + Component::finish(); + } + + // from node + explicit Affiliations(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Affiliations(const Affiliations &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + affiliation(this,other.affiliation) + { + Component::finish(other); + } + + // move + Affiliations(Affiliations &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + affiliation(this,std::move(other.affiliation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Affiliations &operator=(const Affiliations &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + affiliation = other.affiliation; + } + return *this; + } + + // move + Affiliations &operator=(Affiliations &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + affiliation = std::move(other.affiliation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Affiliations/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Affiliations + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliations/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliations/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Affiliations/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Author.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Author.hpp new file mode 100644 index 000000000..fced43e47 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Author.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_AUTHOR +#define TEST_V2_0_DOCUMENTATION_AUTHOR + +#include "test/v2.0/documentation/Affiliations.hpp" +#include "test/v2.0/documentation/Note.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// 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 "documentation"; } + 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 + UTF8Text{} + / Meta<>("name") | + std::optional{} + / Meta<>("orcid") | + std::optional{} + / Meta<>("email") | + + // children + --Child> + ("affiliations") | + --Child> + ("note") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "orcid", + "email", + "affiliations", + "note" + }; + 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", + "orcid", + "email", + "affiliations", + "note" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + name{this}; + Field> + orcid{this}; + Field> + email{this}; + + // children + Field> + affiliations{this}; + Field> + note{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->orcid, \ + this->email, \ + this->affiliations, \ + this->note \ + ) + + // default + Author() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Author( + const wrapper + &name, + const wrapper> + &orcid = {}, + const wrapper> + &email = {}, + const wrapper> + &affiliations = {}, + const wrapper> + ¬e = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name), + orcid(this,orcid), + email(this,email), + affiliations(this,affiliations), + note(this,note) + { + Component::finish(); + } + + // from node + explicit Author(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Author(const Author &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + orcid(this,other.orcid), + email(this,other.email), + affiliations(this,other.affiliations), + note(this,other.note) + { + Component::finish(other); + } + + // move + Author(Author &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + name(this,std::move(other.name)), + orcid(this,std::move(other.orcid)), + email(this,std::move(other.email)), + affiliations(this,std::move(other.affiliations)), + note(this,std::move(other.note)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Author &operator=(const Author &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + name = other.name; + orcid = other.orcid; + email = other.email; + affiliations = other.affiliations; + note = other.note; + } + 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); + orcid = std::move(other.orcid); + email = std::move(other.email); + affiliations = std::move(other.affiliations); + note = std::move(other.note); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Author/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Author + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Author/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Author/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Author/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Authors.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Authors.hpp new file mode 100644 index 000000000..1f9b34278 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Authors.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_AUTHORS +#define TEST_V2_0_DOCUMENTATION_AUTHORS + +#include "test/v2.0/documentation/Author.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// 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 "documentation"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->author \ + ) + + // default + Authors() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Authors( + const wrapper> + &author + ) : + GNDSTK_COMPONENT(BlockData{}), + author(this,author) + { + Component::finish(); + } + + // from node + explicit Authors(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Authors(const Authors &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + author(this,other.author) + { + Component::finish(other); + } + + // move + Authors(Authors &&other) : + 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 "test/v2.0/documentation/Authors/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Authors + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Authors/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Authors/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Authors/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibitem.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibitem.hpp new file mode 100644 index 000000000..fa47ffc3c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibitem.hpp @@ -0,0 +1,237 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_BIBITEM +#define TEST_V2_0_DOCUMENTATION_BIBITEM + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Bibitem +// ----------------------------------------------------------------------------- + +class Bibitem : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Bibitem"; } + static auto NODENAME() { return "bibitem"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / Meta<>("label") | + XMLName{} + / Meta<>("xref") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "xref" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "xref" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + Field + xref{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label, \ + this->xref \ + ) + + // default + Bibitem() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Bibitem( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {}, + const wrapper + &xref = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label), + xref(this,xref) + { + Component::finish(); + } + + // from node + explicit Bibitem(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Bibitem(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Bibitem(const Bibitem &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label), + xref(this,other.xref) + { + Component::finish(other); + } + + // move + Bibitem(Bibitem &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)), + xref(this,std::move(other.xref)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Bibitem &operator=(const Bibitem &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + xref = other.xref; + } + return *this; + } + + // move + Bibitem &operator=(Bibitem &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + xref = std::move(other.xref); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Bibitem/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Bibitem + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibitem/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibitem/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibitem/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibliography.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibliography.hpp new file mode 100644 index 000000000..4bf7eb1cd --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibliography.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_BIBLIOGRAPHY +#define TEST_V2_0_DOCUMENTATION_BIBLIOGRAPHY + +#include "test/v2.0/documentation/Bibitem.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Bibliography +// ----------------------------------------------------------------------------- + +class Bibliography : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Bibliography"; } + static auto NODENAME() { return "bibliography"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("bibitem") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "bibitem" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "bibitem" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + bibitem{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->bibitem \ + ) + + // default + Bibliography() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Bibliography( + const wrapper> + &bibitem + ) : + GNDSTK_COMPONENT(BlockData{}), + bibitem(this,bibitem) + { + Component::finish(); + } + + // from node + explicit Bibliography(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Bibliography(const Bibliography &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + bibitem(this,other.bibitem) + { + Component::finish(other); + } + + // move + Bibliography(Bibliography &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + bibitem(this,std::move(other.bibitem)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Bibliography &operator=(const Bibliography &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + bibitem = other.bibitem; + } + return *this; + } + + // move + Bibliography &operator=(Bibliography &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + bibitem = std::move(other.bibitem); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Bibliography/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Bibliography + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibliography/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibliography/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Bibliography/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Body.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Body.hpp new file mode 100644 index 000000000..ff4754b39 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Body.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_BODY +#define TEST_V2_0_DOCUMENTATION_BODY + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Body +// ----------------------------------------------------------------------------- + +class Body : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + 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{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label \ + ) + + // default + Body() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Body( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Body(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Body(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Body(const Body &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label) + { + Component::finish(other); + } + + // move + Body(Body &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Body &operator=(const Body &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + } + return *this; + } + + // move + Body &operator=(Body &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Body/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Body + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Body/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Body/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Body/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/CodeRepo.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/CodeRepo.hpp new file mode 100644 index 000000000..8be096faf --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/CodeRepo.hpp @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_CODEREPO +#define TEST_V2_0_DOCUMENTATION_CODEREPO + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class CodeRepo +// ----------------------------------------------------------------------------- + +class CodeRepo : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "CodeRepo"; } + static auto NODENAME() { return "codeRepo"; } + + // 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") | + XMLName{} + / Meta<>("revisionSystem") | + XMLName{} + / Meta<>("href") | + XMLName{} + / Meta<>("revisionID") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "revisionSystem", + "href", + "revisionID" + }; + 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", + "revision_system", + "href", + "revision_id" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field + revisionSystem{this}; + Field + href{this}; + Field + revisionID{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->revisionSystem, \ + this->href, \ + this->revisionID \ + ) + + // default + CodeRepo() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CodeRepo( + const wrapper> + &label, + const wrapper + &revisionSystem = {}, + const wrapper + &href = {}, + const wrapper + &revisionID = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + revisionSystem(this,revisionSystem), + href(this,href), + revisionID(this,revisionID) + { + Component::finish(); + } + + // from node + explicit CodeRepo(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CodeRepo(const CodeRepo &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + revisionSystem(this,other.revisionSystem), + href(this,other.href), + revisionID(this,other.revisionID) + { + Component::finish(other); + } + + // move + CodeRepo(CodeRepo &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + revisionSystem(this,std::move(other.revisionSystem)), + href(this,std::move(other.href)), + revisionID(this,std::move(other.revisionID)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CodeRepo &operator=(const CodeRepo &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + revisionSystem = other.revisionSystem; + href = other.href; + revisionID = other.revisionID; + } + return *this; + } + + // move + CodeRepo &operator=(CodeRepo &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + revisionSystem = std::move(other.revisionSystem); + href = std::move(other.href); + revisionID = std::move(other.revisionID); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/CodeRepo/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CodeRepo + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/CodeRepo/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/CodeRepo/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/CodeRepo/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaboration.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaboration.hpp new file mode 100644 index 000000000..b3acf62f4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaboration.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_COLLABORATION +#define TEST_V2_0_DOCUMENTATION_COLLABORATION + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Collaboration +// ----------------------------------------------------------------------------- + +class Collaboration : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Collaboration"; } + static auto NODENAME() { return "collaboration"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + UTF8Text{} + / Meta<>("name") | + 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", + "name", + "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", + "name", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + name{this}; + Field> + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->href \ + ) + + // default + Collaboration() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Collaboration( + const wrapper + &name, + const wrapper> + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Collaboration(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Collaboration(const Collaboration &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + href(this,other.href) + { + Component::finish(other); + } + + // move + Collaboration(Collaboration &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + name(this,std::move(other.name)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Collaboration &operator=(const Collaboration &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + name = other.name; + href = other.href; + } + return *this; + } + + // move + Collaboration &operator=(Collaboration &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + name = std::move(other.name); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Collaboration/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Collaboration + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaboration/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaboration/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaboration/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaborations.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaborations.hpp new file mode 100644 index 000000000..7d95e59e2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaborations.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_COLLABORATIONS +#define TEST_V2_0_DOCUMENTATION_COLLABORATIONS + +#include "test/v2.0/documentation/Collaboration.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Collaborations +// ----------------------------------------------------------------------------- + +class Collaborations : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Collaborations"; } + static auto NODENAME() { return "collaborations"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("collaboration") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "collaboration" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "collaboration" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + collaboration{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->collaboration \ + ) + + // default + Collaborations() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Collaborations( + const wrapper> + &collaboration + ) : + GNDSTK_COMPONENT(BlockData{}), + collaboration(this,collaboration) + { + Component::finish(); + } + + // from node + explicit Collaborations(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Collaborations(const Collaborations &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + collaboration(this,other.collaboration) + { + Component::finish(other); + } + + // move + Collaborations(Collaborations &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + collaboration(this,std::move(other.collaboration)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Collaborations &operator=(const Collaborations &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + collaboration = other.collaboration; + } + return *this; + } + + // move + Collaborations &operator=(Collaborations &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + collaboration = std::move(other.collaboration); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Collaborations/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Collaborations + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaborations/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaborations/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Collaborations/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCode.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCode.hpp new file mode 100644 index 000000000..da07206b9 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCode.hpp @@ -0,0 +1,285 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_COMPUTERCODE +#define TEST_V2_0_DOCUMENTATION_COMPUTERCODE + +#include "test/v2.0/documentation/ExecutionArguments.hpp" +#include "test/v2.0/documentation/CodeRepo.hpp" +#include "test/v2.0/documentation/Note.hpp" +#include "test/v2.0/documentation/InputDecks.hpp" +#include "test/v2.0/documentation/OutputDecks.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class ComputerCode +// ----------------------------------------------------------------------------- + +class ComputerCode : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "ComputerCode"; } + static auto NODENAME() { return "computerCode"; } + + // 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") | + UTF8Text{} + / Meta<>("name") | + XMLName{} + / Meta<>("version") | + + // children + --Child> + ("executionArguments") | + --Child> + ("codeRepo") | + --Child> + ("note") | + --Child> + ("inputDecks") | + --Child> + ("outputDecks") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "name", + "version", + "executionArguments", + "codeRepo", + "note", + "inputDecks", + "outputDecks" + }; + 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", + "name", + "version", + "execution_arguments", + "code_repo", + "note", + "input_decks", + "output_decks" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field + name{this}; + Field + version{this}; + + // children + Field> + executionArguments{this}; + Field> + codeRepo{this}; + Field> + note{this}; + Field> + inputDecks{this}; + Field> + outputDecks{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->name, \ + this->version, \ + this->executionArguments, \ + this->codeRepo, \ + this->note, \ + this->inputDecks, \ + this->outputDecks \ + ) + + // default + ComputerCode() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ComputerCode( + const wrapper> + &label, + const wrapper + &name = {}, + const wrapper + &version = {}, + const wrapper> + &executionArguments = {}, + const wrapper> + &codeRepo = {}, + const wrapper> + ¬e = {}, + const wrapper> + &inputDecks = {}, + const wrapper> + &outputDecks = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + name(this,name), + version(this,version), + executionArguments(this,executionArguments), + codeRepo(this,codeRepo), + note(this,note), + inputDecks(this,inputDecks), + outputDecks(this,outputDecks) + { + Component::finish(); + } + + // from node + explicit ComputerCode(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ComputerCode(const ComputerCode &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + name(this,other.name), + version(this,other.version), + executionArguments(this,other.executionArguments), + codeRepo(this,other.codeRepo), + note(this,other.note), + inputDecks(this,other.inputDecks), + outputDecks(this,other.outputDecks) + { + Component::finish(other); + } + + // move + ComputerCode(ComputerCode &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + name(this,std::move(other.name)), + version(this,std::move(other.version)), + executionArguments(this,std::move(other.executionArguments)), + codeRepo(this,std::move(other.codeRepo)), + note(this,std::move(other.note)), + inputDecks(this,std::move(other.inputDecks)), + outputDecks(this,std::move(other.outputDecks)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ComputerCode &operator=(const ComputerCode &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + name = other.name; + version = other.version; + executionArguments = other.executionArguments; + codeRepo = other.codeRepo; + note = other.note; + inputDecks = other.inputDecks; + outputDecks = other.outputDecks; + } + return *this; + } + + // move + ComputerCode &operator=(ComputerCode &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + name = std::move(other.name); + version = std::move(other.version); + executionArguments = std::move(other.executionArguments); + codeRepo = std::move(other.codeRepo); + note = std::move(other.note); + inputDecks = std::move(other.inputDecks); + outputDecks = std::move(other.outputDecks); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/ComputerCode/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ComputerCode + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCode/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCode/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCode/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCodes.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCodes.hpp new file mode 100644 index 000000000..7928c2be7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCodes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_COMPUTERCODES +#define TEST_V2_0_DOCUMENTATION_COMPUTERCODES + +#include "test/v2.0/documentation/ComputerCode.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class ComputerCodes +// ----------------------------------------------------------------------------- + +class ComputerCodes : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "ComputerCodes"; } + static auto NODENAME() { return "computerCodes"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("computerCode") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "computerCode" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "computer_code" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + computerCode{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->computerCode \ + ) + + // default + ComputerCodes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ComputerCodes( + const wrapper> + &computerCode + ) : + GNDSTK_COMPONENT(BlockData{}), + computerCode(this,computerCode) + { + Component::finish(); + } + + // from node + explicit ComputerCodes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ComputerCodes(const ComputerCodes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + computerCode(this,other.computerCode) + { + Component::finish(other); + } + + // move + ComputerCodes(ComputerCodes &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + computerCode(this,std::move(other.computerCode)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ComputerCodes &operator=(const ComputerCodes &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + computerCode = other.computerCode; + } + return *this; + } + + // move + ComputerCodes &operator=(ComputerCodes &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + computerCode = std::move(other.computerCode); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/ComputerCodes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ComputerCodes + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCodes/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCodes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ComputerCodes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributor.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributor.hpp new file mode 100644 index 000000000..8669e2cf5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributor.hpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_CONTRIBUTOR +#define TEST_V2_0_DOCUMENTATION_CONTRIBUTOR + +#include "test/v2.0/documentation/Affiliations.hpp" +#include "test/v2.0/documentation/Note.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Contributor +// ----------------------------------------------------------------------------- + +class Contributor : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Contributor"; } + static auto NODENAME() { return "contributor"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + UTF8Text{} + / Meta<>("name") | + enums::ContributorType{} + / Meta<>("contributorType") | + std::optional{} + / Meta<>("orcid") | + std::optional{} + / Meta<>("email") | + + // children + --Child> + ("affiliations") | + --Child> + ("note") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "contributorType", + "orcid", + "email", + "affiliations", + "note" + }; + 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", + "contributor_type", + "orcid", + "email", + "affiliations", + "note" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + name{this}; + Field + contributorType{this}; + Field> + orcid{this}; + Field> + email{this}; + + // children + Field> + affiliations{this}; + Field> + note{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->contributorType, \ + this->orcid, \ + this->email, \ + this->affiliations, \ + this->note \ + ) + + // default + Contributor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Contributor( + const wrapper + &name, + const wrapper + &contributorType = {}, + const wrapper> + &orcid = {}, + const wrapper> + &email = {}, + const wrapper> + &affiliations = {}, + const wrapper> + ¬e = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name), + contributorType(this,contributorType), + orcid(this,orcid), + email(this,email), + affiliations(this,affiliations), + note(this,note) + { + Component::finish(); + } + + // from node + explicit Contributor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Contributor(const Contributor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + contributorType(this,other.contributorType), + orcid(this,other.orcid), + email(this,other.email), + affiliations(this,other.affiliations), + note(this,other.note) + { + Component::finish(other); + } + + // move + Contributor(Contributor &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + name(this,std::move(other.name)), + contributorType(this,std::move(other.contributorType)), + orcid(this,std::move(other.orcid)), + email(this,std::move(other.email)), + affiliations(this,std::move(other.affiliations)), + note(this,std::move(other.note)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Contributor &operator=(const Contributor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + name = other.name; + contributorType = other.contributorType; + orcid = other.orcid; + email = other.email; + affiliations = other.affiliations; + note = other.note; + } + return *this; + } + + // move + Contributor &operator=(Contributor &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + name = std::move(other.name); + contributorType = std::move(other.contributorType); + orcid = std::move(other.orcid); + email = std::move(other.email); + affiliations = std::move(other.affiliations); + note = std::move(other.note); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Contributor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Contributor + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributor/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributors.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributors.hpp new file mode 100644 index 000000000..617c34b4e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributors.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_CONTRIBUTORS +#define TEST_V2_0_DOCUMENTATION_CONTRIBUTORS + +#include "test/v2.0/documentation/Author.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Contributors +// ----------------------------------------------------------------------------- + +class Contributors : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Contributors"; } + static auto NODENAME() { return "contributors"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("contributor") + ; + } + + // Data member names. Usually - but not necessarily - the same 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->author \ + ) + + // default + Contributors() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Contributors( + const wrapper> + &author + ) : + GNDSTK_COMPONENT(BlockData{}), + author(this,author) + { + Component::finish(); + } + + // from node + explicit Contributors(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Contributors(const Contributors &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + author(this,other.author) + { + Component::finish(other); + } + + // move + Contributors(Contributors &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + author(this,std::move(other.author)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Contributors &operator=(const Contributors &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + author = other.author; + } + return *this; + } + + // move + Contributors &operator=(Contributors &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + author = std::move(other.author); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Contributors/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Contributors + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributors/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributors/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Contributors/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Copyright.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Copyright.hpp new file mode 100644 index 000000000..8bf560b56 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Copyright.hpp @@ -0,0 +1,237 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_COPYRIGHT +#define TEST_V2_0_DOCUMENTATION_COPYRIGHT + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Copyright +// ----------------------------------------------------------------------------- + +class Copyright : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Copyright"; } + static auto NODENAME() { return "copyright"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / Meta<>("label") | + 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + Field> + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label, \ + this->href \ + ) + + // default + Copyright() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Copyright( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {}, + const wrapper> + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Copyright(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Copyright(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Copyright(const Copyright &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + Copyright(Copyright &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Copyright &operator=(const Copyright &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + href = other.href; + } + return *this; + } + + // move + Copyright &operator=(Copyright &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Copyright/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Copyright + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Copyright/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Copyright/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Copyright/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/CorrectionScript.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/CorrectionScript.hpp new file mode 100644 index 000000000..718a49de4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/CorrectionScript.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_CORRECTIONSCRIPT +#define TEST_V2_0_DOCUMENTATION_CORRECTIONSCRIPT + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class CorrectionScript +// ----------------------------------------------------------------------------- + +class CorrectionScript : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "CorrectionScript"; } + static auto NODENAME() { return "correctionScript"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label \ + ) + + // default + CorrectionScript() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit CorrectionScript( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label) + { + Component::finish(); + } + + // from node + explicit CorrectionScript(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit CorrectionScript(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + CorrectionScript(const CorrectionScript &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label) + { + Component::finish(other); + } + + // move + CorrectionScript(CorrectionScript &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CorrectionScript &operator=(const CorrectionScript &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + } + return *this; + } + + // move + CorrectionScript &operator=(CorrectionScript &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/CorrectionScript/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CorrectionScript + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/CorrectionScript/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/CorrectionScript/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/CorrectionScript/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/CovarianceScript.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/CovarianceScript.hpp new file mode 100644 index 000000000..90d71d815 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/CovarianceScript.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_COVARIANCESCRIPT +#define TEST_V2_0_DOCUMENTATION_COVARIANCESCRIPT + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class CovarianceScript +// ----------------------------------------------------------------------------- + +class CovarianceScript : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "CovarianceScript"; } + static auto NODENAME() { return "covarianceScript"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label \ + ) + + // default + CovarianceScript() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit CovarianceScript( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label) + { + Component::finish(); + } + + // from node + explicit CovarianceScript(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit CovarianceScript(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + CovarianceScript(const CovarianceScript &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label) + { + Component::finish(other); + } + + // move + CovarianceScript(CovarianceScript &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CovarianceScript &operator=(const CovarianceScript &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + } + return *this; + } + + // move + CovarianceScript &operator=(CovarianceScript &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/CovarianceScript/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CovarianceScript + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/CovarianceScript/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/CovarianceScript/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/CovarianceScript/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Date.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Date.hpp new file mode 100644 index 000000000..bf47ccb1c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Date.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_DATE +#define TEST_V2_0_DOCUMENTATION_DATE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// 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 "documentation"; } + 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 + enums::DateType{} + / Meta<>("dateType") | + std::string{} + / 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", + "dateType", + "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", + "date_type", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + dateType{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->dateType, \ + this->value \ + ) + + // default + Date() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Date( + const wrapper + &dateType, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + dateType(this,dateType), + value(this,value) + { + Component::finish(); + } + + // from node + explicit Date(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Date(const Date &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + dateType(this,other.dateType), + value(this,other.value) + { + Component::finish(other); + } + + // move + Date(Date &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + dateType(this,std::move(other.dateType)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Date &operator=(const Date &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + dateType = other.dateType; + value = other.value; + } + return *this; + } + + // move + Date &operator=(Date &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + dateType = std::move(other.dateType); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Date/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Date + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Date/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Date/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Date/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Dates.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Dates.hpp new file mode 100644 index 000000000..aa2b21eab --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Dates.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_DATES +#define TEST_V2_0_DOCUMENTATION_DATES + +#include "test/v2.0/documentation/Date.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// 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 "documentation"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date \ + ) + + // default + Dates() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Dates( + const wrapper> + &date + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date) + { + Component::finish(); + } + + // from node + explicit Dates(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Dates(const Dates &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date) + { + Component::finish(other); + } + + // move + Dates(Dates &&other) : + 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 "test/v2.0/documentation/Dates/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Dates + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Dates/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Dates/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Dates/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Documentation.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Documentation.hpp new file mode 100644 index 000000000..f06ddfb1a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Documentation.hpp @@ -0,0 +1,440 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_DOCUMENTATION +#define TEST_V2_0_DOCUMENTATION_DOCUMENTATION + +#include "test/v2.0/documentation/Authors.hpp" +#include "test/v2.0/documentation/Contributors.hpp" +#include "test/v2.0/documentation/Collaborations.hpp" +#include "test/v2.0/documentation/Dates.hpp" +#include "test/v2.0/documentation/Copyright.hpp" +#include "test/v2.0/documentation/Acknowledgements.hpp" +#include "test/v2.0/documentation/Keywords.hpp" +#include "test/v2.0/documentation/RelatedItems.hpp" +#include "test/v2.0/documentation/Title.hpp" +#include "test/v2.0/documentation/Abstract.hpp" +#include "test/v2.0/documentation/Body.hpp" +#include "test/v2.0/documentation/ComputerCodes.hpp" +#include "test/v2.0/documentation/ExperimentalDataSets.hpp" +#include "test/v2.0/documentation/Bibliography.hpp" +#include "test/v2.0/documentation/EndfCompatible.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// 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 "documentation"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("doi") | + std::optional{} + / Meta<>("publicationDate") | + std::optional{} + / Meta<>("version") | + + // children + --Child + ("authors") | + --Child> + ("contributors") | + --Child> + ("collaborations") | + --Child + ("dates") | + --Child> + ("copyright") | + --Child> + ("acknowledgements") | + --Child> + ("keywords") | + --Child> + ("relatedItems") | + --Child + ("title") | + --Child> + ("abstract") | + --Child + ("body") | + --Child> + ("computerCodes") | + --Child> + ("experimentalDataSets") | + --Child> + ("bibliography") | + --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", + "doi", + "publicationDate", + "version", + "authors", + "contributors", + "collaborations", + "dates", + "copyright", + "acknowledgements", + "keywords", + "relatedItems", + "title", + "abstract", + "body", + "computerCodes", + "experimentalDataSets", + "bibliography", + "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", + "doi", + "publication_date", + "version", + "authors", + "contributors", + "collaborations", + "dates", + "copyright", + "acknowledgements", + "keywords", + "related_items", + "title", + "abstract", + "body", + "computer_codes", + "experimental_data_sets", + "bibliography", + "endf_compatible" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + doi{this}; + Field> + publicationDate{this}; + Field> + version{this}; + + // children + Field + authors{this}; + Field> + contributors{this}; + Field> + collaborations{this}; + Field + dates{this}; + Field> + copyright{this}; + Field> + acknowledgements{this}; + Field> + keywords{this}; + Field> + relatedItems{this}; + Field + title{this}; + Field> + abstract{this}; + Field + body{this}; + Field> + computerCodes{this}; + Field> + experimentalDataSets{this}; + Field> + bibliography{this}; + Field> + endfCompatible{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(dates(),date); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->doi, \ + this->publicationDate, \ + this->version, \ + this->authors, \ + this->contributors, \ + this->collaborations, \ + this->dates, \ + this->copyright, \ + this->acknowledgements, \ + this->keywords, \ + this->relatedItems, \ + this->title, \ + this->abstract, \ + this->body, \ + this->computerCodes, \ + this->experimentalDataSets, \ + this->bibliography, \ + this->endfCompatible \ + ) + + // default + Documentation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Documentation( + const wrapper> + &doi, + const wrapper> + &publicationDate = {}, + const wrapper> + &version = {}, + const wrapper + &authors = {}, + const wrapper> + &contributors = {}, + const wrapper> + &collaborations = {}, + const wrapper + &dates = {}, + const wrapper> + ©right = {}, + const wrapper> + &acknowledgements = {}, + const wrapper> + &keywords = {}, + const wrapper> + &relatedItems = {}, + const wrapper + &title = {}, + const wrapper> + &abstract = {}, + const wrapper + &body = {}, + const wrapper> + &computerCodes = {}, + const wrapper> + &experimentalDataSets = {}, + const wrapper> + &bibliography = {}, + const wrapper> + &endfCompatible = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + doi(this,doi), + publicationDate(this,publicationDate), + version(this,version), + authors(this,authors), + contributors(this,contributors), + collaborations(this,collaborations), + dates(this,dates), + copyright(this,copyright), + acknowledgements(this,acknowledgements), + keywords(this,keywords), + relatedItems(this,relatedItems), + title(this,title), + abstract(this,abstract), + body(this,body), + computerCodes(this,computerCodes), + experimentalDataSets(this,experimentalDataSets), + bibliography(this,bibliography), + endfCompatible(this,endfCompatible) + { + Component::finish(); + } + + // from node + explicit Documentation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Documentation(const Documentation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + doi(this,other.doi), + publicationDate(this,other.publicationDate), + version(this,other.version), + authors(this,other.authors), + contributors(this,other.contributors), + collaborations(this,other.collaborations), + dates(this,other.dates), + copyright(this,other.copyright), + acknowledgements(this,other.acknowledgements), + keywords(this,other.keywords), + relatedItems(this,other.relatedItems), + title(this,other.title), + abstract(this,other.abstract), + body(this,other.body), + computerCodes(this,other.computerCodes), + experimentalDataSets(this,other.experimentalDataSets), + bibliography(this,other.bibliography), + endfCompatible(this,other.endfCompatible) + { + Component::finish(other); + } + + // move + Documentation(Documentation &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + doi(this,std::move(other.doi)), + publicationDate(this,std::move(other.publicationDate)), + version(this,std::move(other.version)), + authors(this,std::move(other.authors)), + contributors(this,std::move(other.contributors)), + collaborations(this,std::move(other.collaborations)), + dates(this,std::move(other.dates)), + copyright(this,std::move(other.copyright)), + acknowledgements(this,std::move(other.acknowledgements)), + keywords(this,std::move(other.keywords)), + relatedItems(this,std::move(other.relatedItems)), + title(this,std::move(other.title)), + abstract(this,std::move(other.abstract)), + body(this,std::move(other.body)), + computerCodes(this,std::move(other.computerCodes)), + experimentalDataSets(this,std::move(other.experimentalDataSets)), + bibliography(this,std::move(other.bibliography)), + 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; + doi = other.doi; + publicationDate = other.publicationDate; + version = other.version; + authors = other.authors; + contributors = other.contributors; + collaborations = other.collaborations; + dates = other.dates; + copyright = other.copyright; + acknowledgements = other.acknowledgements; + keywords = other.keywords; + relatedItems = other.relatedItems; + title = other.title; + abstract = other.abstract; + body = other.body; + computerCodes = other.computerCodes; + experimentalDataSets = other.experimentalDataSets; + bibliography = other.bibliography; + endfCompatible = other.endfCompatible; + } + return *this; + } + + // move + Documentation &operator=(Documentation &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + doi = std::move(other.doi); + publicationDate = std::move(other.publicationDate); + version = std::move(other.version); + authors = std::move(other.authors); + contributors = std::move(other.contributors); + collaborations = std::move(other.collaborations); + dates = std::move(other.dates); + copyright = std::move(other.copyright); + acknowledgements = std::move(other.acknowledgements); + keywords = std::move(other.keywords); + relatedItems = std::move(other.relatedItems); + title = std::move(other.title); + abstract = std::move(other.abstract); + body = std::move(other.body); + computerCodes = std::move(other.computerCodes); + experimentalDataSets = std::move(other.experimentalDataSets); + bibliography = std::move(other.bibliography); + endfCompatible = std::move(other.endfCompatible); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Documentation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Documentation + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Documentation/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Documentation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Documentation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/EndfCompatible.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/EndfCompatible.hpp new file mode 100644 index 000000000..38630c799 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/EndfCompatible.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_ENDFCOMPATIBLE +#define TEST_V2_0_DOCUMENTATION_ENDFCOMPATIBLE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class EndfCompatible +// ----------------------------------------------------------------------------- + +class EndfCompatible : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + 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{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label \ + ) + + // default + EndfCompatible() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit EndfCompatible( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label) + { + Component::finish(); + } + + // from node + explicit EndfCompatible(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit EndfCompatible(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + EndfCompatible(const EndfCompatible &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label) + { + Component::finish(other); + } + + // move + EndfCompatible(EndfCompatible &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EndfCompatible &operator=(const EndfCompatible &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + } + return *this; + } + + // move + EndfCompatible &operator=(EndfCompatible &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/EndfCompatible/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EndfCompatible + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/EndfCompatible/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/EndfCompatible/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/EndfCompatible/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ExecutionArguments.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExecutionArguments.hpp new file mode 100644 index 000000000..4162c46ba --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExecutionArguments.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_EXECUTIONARGUMENTS +#define TEST_V2_0_DOCUMENTATION_EXECUTIONARGUMENTS + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class ExecutionArguments +// ----------------------------------------------------------------------------- + +class ExecutionArguments : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "ExecutionArguments"; } + static auto NODENAME() { return "executionArguments"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label \ + ) + + // default + ExecutionArguments() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit ExecutionArguments( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label) + { + Component::finish(); + } + + // from node + explicit ExecutionArguments(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit ExecutionArguments(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + ExecutionArguments(const ExecutionArguments &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label) + { + Component::finish(other); + } + + // move + ExecutionArguments(ExecutionArguments &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ExecutionArguments &operator=(const ExecutionArguments &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + } + return *this; + } + + // move + ExecutionArguments &operator=(ExecutionArguments &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/ExecutionArguments/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ExecutionArguments + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ExecutionArguments/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExecutionArguments/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExecutionArguments/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSet.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSet.hpp new file mode 100644 index 000000000..81dd7b842 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSet.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_EXFORDATASET +#define TEST_V2_0_DOCUMENTATION_EXFORDATASET + +#include "test/v2.0/documentation/CovarianceScript.hpp" +#include "test/v2.0/documentation/CorrectionScript.hpp" +#include "test/v2.0/documentation/Note.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class ExforDataSet +// ----------------------------------------------------------------------------- + +class ExforDataSet : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "ExforDataSet"; } + static auto NODENAME() { return "exforDataSet"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("subentry") | + std::string{} + / Meta<>("retrievalDate") | + + // children + --Child> + ("covarianceScript") | + --Child> + ("correctionScript") | + --Child> + ("note") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "subentry", + "retrievalDate", + "covarianceScript", + "correctionScript", + "note" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "subentry", + "retrieval_date", + "covariance_script", + "correction_script", + "note" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + subentry{this}; + Field + retrievalDate{this}; + + // children + Field> + covarianceScript{this}; + Field> + correctionScript{this}; + Field> + note{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->subentry, \ + this->retrievalDate, \ + this->covarianceScript, \ + this->correctionScript, \ + this->note \ + ) + + // default + ExforDataSet() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ExforDataSet( + const wrapper + &subentry, + const wrapper + &retrievalDate = {}, + const wrapper> + &covarianceScript = {}, + const wrapper> + &correctionScript = {}, + const wrapper> + ¬e = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + subentry(this,subentry), + retrievalDate(this,retrievalDate), + covarianceScript(this,covarianceScript), + correctionScript(this,correctionScript), + note(this,note) + { + Component::finish(); + } + + // from node + explicit ExforDataSet(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExforDataSet(const ExforDataSet &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + subentry(this,other.subentry), + retrievalDate(this,other.retrievalDate), + covarianceScript(this,other.covarianceScript), + correctionScript(this,other.correctionScript), + note(this,other.note) + { + Component::finish(other); + } + + // move + ExforDataSet(ExforDataSet &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + subentry(this,std::move(other.subentry)), + retrievalDate(this,std::move(other.retrievalDate)), + covarianceScript(this,std::move(other.covarianceScript)), + correctionScript(this,std::move(other.correctionScript)), + note(this,std::move(other.note)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ExforDataSet &operator=(const ExforDataSet &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + subentry = other.subentry; + retrievalDate = other.retrievalDate; + covarianceScript = other.covarianceScript; + correctionScript = other.correctionScript; + note = other.note; + } + return *this; + } + + // move + ExforDataSet &operator=(ExforDataSet &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + subentry = std::move(other.subentry); + retrievalDate = std::move(other.retrievalDate); + covarianceScript = std::move(other.covarianceScript); + correctionScript = std::move(other.correctionScript); + note = std::move(other.note); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/ExforDataSet/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ExforDataSet + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSet/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSet/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSet/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSets.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSets.hpp new file mode 100644 index 000000000..5df4201c1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSets.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_EXFORDATASETS +#define TEST_V2_0_DOCUMENTATION_EXFORDATASETS + +#include "test/v2.0/documentation/ExforDataSet.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class ExforDataSets +// ----------------------------------------------------------------------------- + +class ExforDataSets : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "ExforDataSets"; } + static auto NODENAME() { return "exforDataSets"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("exforDataSet") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "exforDataSet" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "exfor_data_set" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + exforDataSet{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->exforDataSet \ + ) + + // default + ExforDataSets() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ExforDataSets( + const wrapper> + &exforDataSet + ) : + GNDSTK_COMPONENT(BlockData{}), + exforDataSet(this,exforDataSet) + { + Component::finish(); + } + + // from node + explicit ExforDataSets(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExforDataSets(const ExforDataSets &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + exforDataSet(this,other.exforDataSet) + { + Component::finish(other); + } + + // move + ExforDataSets(ExforDataSets &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + exforDataSet(this,std::move(other.exforDataSet)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ExforDataSets &operator=(const ExforDataSets &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + exforDataSet = other.exforDataSet; + } + return *this; + } + + // move + ExforDataSets &operator=(ExforDataSets &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + exforDataSet = std::move(other.exforDataSet); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/ExforDataSets/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ExforDataSets + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSets/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSets/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExforDataSets/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ExperimentalDataSets.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExperimentalDataSets.hpp new file mode 100644 index 000000000..e18c42275 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExperimentalDataSets.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_EXPERIMENTALDATASETS +#define TEST_V2_0_DOCUMENTATION_EXPERIMENTALDATASETS + +#include "test/v2.0/documentation/ExforDataSets.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class ExperimentalDataSets +// ----------------------------------------------------------------------------- + +class ExperimentalDataSets : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "ExperimentalDataSets"; } + static auto NODENAME() { return "experimentalDataSets"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("exforDataSets") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "exforDataSets" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "exfor_data_sets" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + exforDataSets{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(exforDataSets(),exforDataSet); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->exforDataSets \ + ) + + // default + ExperimentalDataSets() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ExperimentalDataSets( + const wrapper + &exforDataSets + ) : + GNDSTK_COMPONENT(BlockData{}), + exforDataSets(this,exforDataSets) + { + Component::finish(); + } + + // from node + explicit ExperimentalDataSets(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExperimentalDataSets(const ExperimentalDataSets &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + exforDataSets(this,other.exforDataSets) + { + Component::finish(other); + } + + // move + ExperimentalDataSets(ExperimentalDataSets &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + exforDataSets(this,std::move(other.exforDataSets)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ExperimentalDataSets &operator=(const ExperimentalDataSets &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + exforDataSets = other.exforDataSets; + } + return *this; + } + + // move + ExperimentalDataSets &operator=(ExperimentalDataSets &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + exforDataSets = std::move(other.exforDataSets); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/ExperimentalDataSets/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ExperimentalDataSets + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/ExperimentalDataSets/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExperimentalDataSets/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/ExperimentalDataSets/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDeck.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDeck.hpp new file mode 100644 index 000000000..f0c604d9e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDeck.hpp @@ -0,0 +1,237 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_INPUTDECK +#define TEST_V2_0_DOCUMENTATION_INPUTDECK + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class InputDeck +// ----------------------------------------------------------------------------- + +class InputDeck : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "InputDeck"; } + static auto NODENAME() { return "inputDeck"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("filename") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "filename" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "filename" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + Field> + filename{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label, \ + this->filename \ + ) + + // default + InputDeck() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit InputDeck( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {}, + const wrapper> + &filename = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label), + filename(this,filename) + { + Component::finish(); + } + + // from node + explicit InputDeck(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit InputDeck(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + InputDeck(const InputDeck &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label), + filename(this,other.filename) + { + Component::finish(other); + } + + // move + InputDeck(InputDeck &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)), + filename(this,std::move(other.filename)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + InputDeck &operator=(const InputDeck &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + filename = other.filename; + } + return *this; + } + + // move + InputDeck &operator=(InputDeck &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + filename = std::move(other.filename); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/InputDeck/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class InputDeck + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDeck/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDeck/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDeck/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDecks.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDecks.hpp new file mode 100644 index 000000000..e09841f2c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDecks.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_INPUTDECKS +#define TEST_V2_0_DOCUMENTATION_INPUTDECKS + +#include "test/v2.0/documentation/InputDeck.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class InputDecks +// ----------------------------------------------------------------------------- + +class InputDecks : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "InputDecks"; } + static auto NODENAME() { return "inputDecks"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("inputDeck") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "inputDeck" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "input_deck" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + inputDeck{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->inputDeck \ + ) + + // default + InputDecks() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit InputDecks( + const wrapper> + &inputDeck + ) : + GNDSTK_COMPONENT(BlockData{}), + inputDeck(this,inputDeck) + { + Component::finish(); + } + + // from node + explicit InputDecks(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + InputDecks(const InputDecks &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + inputDeck(this,other.inputDeck) + { + Component::finish(other); + } + + // move + InputDecks(InputDecks &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + inputDeck(this,std::move(other.inputDeck)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + InputDecks &operator=(const InputDecks &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + inputDeck = other.inputDeck; + } + return *this; + } + + // move + InputDecks &operator=(InputDecks &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + inputDeck = std::move(other.inputDeck); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/InputDecks/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class InputDecks + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDecks/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDecks/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/InputDecks/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Keyword.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Keyword.hpp new file mode 100644 index 000000000..21b4eb7dc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Keyword.hpp @@ -0,0 +1,237 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_KEYWORD +#define TEST_V2_0_DOCUMENTATION_KEYWORD + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Keyword +// ----------------------------------------------------------------------------- + +class Keyword : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Keyword"; } + static auto NODENAME() { return "keyword"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / Meta<>("label") | + XMLName{} + / Meta<>("type") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "type" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "type" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + Field + type{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label, \ + this->type \ + ) + + // default + Keyword() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Keyword( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {}, + const wrapper + &type = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label), + type(this,type) + { + Component::finish(); + } + + // from node + explicit Keyword(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Keyword(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Keyword(const Keyword &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label), + type(this,other.type) + { + Component::finish(other); + } + + // move + Keyword(Keyword &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)), + type(this,std::move(other.type)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Keyword &operator=(const Keyword &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + type = other.type; + } + return *this; + } + + // move + Keyword &operator=(Keyword &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + type = std::move(other.type); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Keyword/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Keyword + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Keyword/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Keyword/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Keyword/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Keywords.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Keywords.hpp new file mode 100644 index 000000000..3afc57c2d --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Keywords.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_KEYWORDS +#define TEST_V2_0_DOCUMENTATION_KEYWORDS + +#include "test/v2.0/documentation/Keyword.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Keywords +// ----------------------------------------------------------------------------- + +class Keywords : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Keywords"; } + static auto NODENAME() { return "keywords"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("keyword") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "keyword" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "keyword" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + keyword{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->keyword \ + ) + + // default + Keywords() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Keywords( + const wrapper> + &keyword + ) : + GNDSTK_COMPONENT(BlockData{}), + keyword(this,keyword) + { + Component::finish(); + } + + // from node + explicit Keywords(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Keywords(const Keywords &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + keyword(this,other.keyword) + { + Component::finish(other); + } + + // move + Keywords(Keywords &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + keyword(this,std::move(other.keyword)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Keywords &operator=(const Keywords &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + keyword = other.keyword; + } + return *this; + } + + // move + Keywords &operator=(Keywords &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + keyword = std::move(other.keyword); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Keywords/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Keywords + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Keywords/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Keywords/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Keywords/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Note.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Note.hpp new file mode 100644 index 000000000..0e61fa6a2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Note.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_NOTE +#define TEST_V2_0_DOCUMENTATION_NOTE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Note +// ----------------------------------------------------------------------------- + +class Note : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Note"; } + static auto NODENAME() { return "note"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label \ + ) + + // default + Note() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Note( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Note(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Note(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Note(const Note &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label) + { + Component::finish(other); + } + + // move + Note(Note &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Note &operator=(const Note &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + } + return *this; + } + + // move + Note &operator=(Note &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Note/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Note + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Note/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Note/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Note/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDeck.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDeck.hpp new file mode 100644 index 000000000..d2def2709 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDeck.hpp @@ -0,0 +1,237 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_OUTPUTDECK +#define TEST_V2_0_DOCUMENTATION_OUTPUTDECK + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class OutputDeck +// ----------------------------------------------------------------------------- + +class OutputDeck : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "OutputDeck"; } + static auto NODENAME() { return "outputDeck"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("filename") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "filename" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "encoding", + "markup", + "label", + "filename" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + Field> + filename{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label, \ + this->filename \ + ) + + // default + OutputDeck() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit OutputDeck( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {}, + const wrapper> + &filename = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label), + filename(this,filename) + { + Component::finish(); + } + + // from node + explicit OutputDeck(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit OutputDeck(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + OutputDeck(const OutputDeck &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label), + filename(this,other.filename) + { + Component::finish(other); + } + + // move + OutputDeck(OutputDeck &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)), + filename(this,std::move(other.filename)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + OutputDeck &operator=(const OutputDeck &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + filename = other.filename; + } + return *this; + } + + // move + OutputDeck &operator=(OutputDeck &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + filename = std::move(other.filename); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/OutputDeck/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class OutputDeck + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDeck/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDeck/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDeck/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDecks.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDecks.hpp new file mode 100644 index 000000000..399b96d69 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDecks.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_OUTPUTDECKS +#define TEST_V2_0_DOCUMENTATION_OUTPUTDECKS + +#include "test/v2.0/documentation/OutputDeck.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class OutputDecks +// ----------------------------------------------------------------------------- + +class OutputDecks : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "OutputDecks"; } + static auto NODENAME() { return "outputDecks"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("outputDeck") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "outputDeck" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "output_deck" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + outputDeck{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->outputDeck \ + ) + + // default + OutputDecks() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OutputDecks( + const wrapper> + &outputDeck + ) : + GNDSTK_COMPONENT(BlockData{}), + outputDeck(this,outputDeck) + { + Component::finish(); + } + + // from node + explicit OutputDecks(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OutputDecks(const OutputDecks &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + outputDeck(this,other.outputDeck) + { + Component::finish(other); + } + + // move + OutputDecks(OutputDecks &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + outputDeck(this,std::move(other.outputDeck)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + OutputDecks &operator=(const OutputDecks &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + outputDeck = other.outputDeck; + } + return *this; + } + + // move + OutputDecks &operator=(OutputDecks &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + outputDeck = std::move(other.outputDeck); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/OutputDecks/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class OutputDecks + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDecks/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDecks/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/OutputDecks/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItem.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItem.hpp new file mode 100644 index 000000000..1521500b4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItem.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_RELATEDITEM +#define TEST_V2_0_DOCUMENTATION_RELATEDITEM + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class RelatedItem +// ----------------------------------------------------------------------------- + +class RelatedItem : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "RelatedItem"; } + static auto NODENAME() { return "relatedItem"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + UTF8Text{} + / Meta<>("name") | + std::optional{} + / Meta<>("href") | + std::optional{} + / Meta<>("relationType") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "href", + "relationType" + }; + 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", + "href", + "relation_type" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + name{this}; + Field> + href{this}; + Field> + relationType{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->href, \ + this->relationType \ + ) + + // default + RelatedItem() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RelatedItem( + const wrapper + &name, + const wrapper> + &href = {}, + const wrapper> + &relationType = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name), + href(this,href), + relationType(this,relationType) + { + Component::finish(); + } + + // from node + explicit RelatedItem(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RelatedItem(const RelatedItem &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + href(this,other.href), + relationType(this,other.relationType) + { + Component::finish(other); + } + + // move + RelatedItem(RelatedItem &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + name(this,std::move(other.name)), + href(this,std::move(other.href)), + relationType(this,std::move(other.relationType)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + RelatedItem &operator=(const RelatedItem &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + name = other.name; + href = other.href; + relationType = other.relationType; + } + return *this; + } + + // move + RelatedItem &operator=(RelatedItem &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + name = std::move(other.name); + href = std::move(other.href); + relationType = std::move(other.relationType); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/RelatedItem/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RelatedItem + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItem/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItem/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItem/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItems.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItems.hpp new file mode 100644 index 000000000..db945df0e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItems.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_RELATEDITEMS +#define TEST_V2_0_DOCUMENTATION_RELATEDITEMS + +#include "test/v2.0/documentation/RelatedItem.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class RelatedItems +// ----------------------------------------------------------------------------- + +class RelatedItems : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "RelatedItems"; } + static auto NODENAME() { return "relatedItems"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("relatedItem") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "relatedItem" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "related_item" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + relatedItem{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->relatedItem \ + ) + + // default + RelatedItems() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RelatedItems( + const wrapper> + &relatedItem + ) : + GNDSTK_COMPONENT(BlockData{}), + relatedItem(this,relatedItem) + { + Component::finish(); + } + + // from node + explicit RelatedItems(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RelatedItems(const RelatedItems &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + relatedItem(this,other.relatedItem) + { + Component::finish(other); + } + + // move + RelatedItems(RelatedItems &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + relatedItem(this,std::move(other.relatedItem)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + RelatedItems &operator=(const RelatedItems &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + relatedItem = other.relatedItem; + } + return *this; + } + + // move + RelatedItems &operator=(RelatedItems &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + relatedItem = std::move(other.relatedItem); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/RelatedItems/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RelatedItems + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItems/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItems/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/RelatedItems/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Title.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Title.hpp new file mode 100644 index 000000000..bdbdf741c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Title.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_TITLE +#define TEST_V2_0_DOCUMENTATION_TITLE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Title +// ----------------------------------------------------------------------------- + +class Title : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + 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{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label \ + ) + + // default + Title() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Title( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Title(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Title(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Title(const Title &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label) + { + Component::finish(other); + } + + // move + Title(Title &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Title &operator=(const Title &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + } + return *this; + } + + // move + Title &operator=(Title &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Title/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Title + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Title/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Title/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Title/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Version.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Version.hpp new file mode 100644 index 000000000..6b2bcd199 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Version.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_DOCUMENTATION_VERSION +#define TEST_V2_0_DOCUMENTATION_VERSION + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace documentation { + +// ----------------------------------------------------------------------------- +// documentation:: +// class Version +// ----------------------------------------------------------------------------- + +class Version : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "documentation"; } + static auto CLASS() { return "Version"; } + static auto NODENAME() { return "version"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"ascii"} + / Meta<>("encoding") | + Defaulted{"enums::GridStyle::none"} + / Meta<>("markup") | + std::optional{} + / 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", + "encoding", + "markup", + "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", + "encoding", + "markup", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const XMLName encoding = "ascii"; + static inline const std::string markup = "enums::GridStyle::none"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + encoding{this,defaults.encoding}; + Field> + markup{this,defaults.markup}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->encoding, \ + this->markup, \ + this->label \ + ) + + // default + Version() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Version( + const wrapper> + &encoding, + const wrapper> + &markup = {}, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + encoding(this,defaults.encoding,encoding), + markup(this,defaults.markup,markup), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Version(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Version(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Version(const Version &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + encoding(this,other.encoding), + markup(this,other.markup), + label(this,other.label) + { + Component::finish(other); + } + + // move + Version(Version &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + encoding(this,std::move(other.encoding)), + markup(this,std::move(other.markup)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Version &operator=(const Version &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + encoding = other.encoding; + markup = other.markup; + label = other.label; + } + return *this; + } + + // move + Version &operator=(Version &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + encoding = std::move(other.encoding); + markup = std::move(other.markup); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/documentation/Version/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Version + +} // namespace documentation +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/documentation/Version/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/documentation/Version/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/documentation/Version/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/extra/Double.hpp b/standards/gnds-2.0/test/src/test/v2.0/extra/Double.hpp new file mode 100644 index 000000000..1251dd881 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/extra/Double.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_EXTRA_DOUBLE +#define TEST_V2_0_EXTRA_DOUBLE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace extra { + +// ----------------------------------------------------------------------------- +// extra:: +// 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 "extra"; } + 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::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + Float64{} + / 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", + "label", + "unit", + "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", + "label", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value \ + ) + + // default + Double() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Double( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit Double(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Double(const Double &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + Double(Double &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + 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; + label = other.label; + unit = other.unit; + value = other.value; + } + 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); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/extra/Double/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Double + +} // namespace extra +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/extra/Double/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/extra/Double/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/extra/Double/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/extra/Uncertainty.hpp b/standards/gnds-2.0/test/src/test/v2.0/extra/Uncertainty.hpp new file mode 100644 index 000000000..557e1f569 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/extra/Uncertainty.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_EXTRA_UNCERTAINTY +#define TEST_V2_0_EXTRA_UNCERTAINTY + +#include "test/v2.0/containers/Standard.hpp" +#include "test/v2.0/containers/LogNormal.hpp" +#include "test/v2.0/containers/ConfidenceIntervals.hpp" +#include "test/v2.0/containers/Covariance.hpp" +#include "test/v2.0/containers/ListOfCovariances.hpp" + +namespace test { +namespace v2_0 { +namespace extra { + +// ----------------------------------------------------------------------------- +// extra:: +// 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 "extra"; } + 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> + ("standard") | + --Child> + ("logNormal") | + --Child> + ("confidenceIntervals") | + --Child> + ("covariance") | + --Child> + ("listOfCovariances") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "standard", + "logNormal", + "confidenceIntervals", + "covariance", + "listOfCovariances" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "standard", + "log_normal", + "confidence_intervals", + "covariance", + "list_of_covariances" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + standard{this}; + Field> + logNormal{this}; + Field> + confidenceIntervals{this}; + Field> + covariance{this}; + Field> + listOfCovariances{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->standard, \ + this->logNormal, \ + this->confidenceIntervals, \ + this->covariance, \ + this->listOfCovariances \ + ) + + // default + Uncertainty() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Uncertainty( + const wrapper> + &standard, + const wrapper> + &logNormal = {}, + const wrapper> + &confidenceIntervals = {}, + const wrapper> + &covariance = {}, + const wrapper> + &listOfCovariances = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + standard(this,standard), + logNormal(this,logNormal), + confidenceIntervals(this,confidenceIntervals), + covariance(this,covariance), + listOfCovariances(this,listOfCovariances) + { + Component::finish(); + } + + // from node + explicit Uncertainty(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Uncertainty(const Uncertainty &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + standard(this,other.standard), + logNormal(this,other.logNormal), + confidenceIntervals(this,other.confidenceIntervals), + covariance(this,other.covariance), + listOfCovariances(this,other.listOfCovariances) + { + Component::finish(other); + } + + // move + Uncertainty(Uncertainty &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + standard(this,std::move(other.standard)), + logNormal(this,std::move(other.logNormal)), + confidenceIntervals(this,std::move(other.confidenceIntervals)), + covariance(this,std::move(other.covariance)), + listOfCovariances(this,std::move(other.listOfCovariances)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Uncertainty &operator=(const Uncertainty &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + standard = other.standard; + logNormal = other.logNormal; + confidenceIntervals = other.confidenceIntervals; + covariance = other.covariance; + listOfCovariances = other.listOfCovariances; + } + return *this; + } + + // move + Uncertainty &operator=(Uncertainty &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + standard = std::move(other.standard); + logNormal = std::move(other.logNormal); + confidenceIntervals = std::move(other.confidenceIntervals); + covariance = std::move(other.covariance); + listOfCovariances = std::move(other.listOfCovariances); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/extra/Uncertainty/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Uncertainty + +} // namespace extra +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/extra/Uncertainty/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/extra/Uncertainty/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/extra/Uncertainty/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutron.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutron.hpp new file mode 100644 index 000000000..c2d2601f2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutron.hpp @@ -0,0 +1,220 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONFRAGMENTDATA_DELAYEDNEUTRON +#define TEST_V2_0_FISSIONFRAGMENTDATA_DELAYEDNEUTRON + +#include "test/v2.0/fissionFragmentData/Rate.hpp" +#include "test/v2.0/common/Product.hpp" + +namespace test { +namespace v2_0 { +namespace fissionFragmentData { + +// ----------------------------------------------------------------------------- +// fissionFragmentData:: +// 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 "fissionFragmentData"; } + 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 + XMLName{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(rate(),Double); + GNDSTK_SHORTCUT(product(),distribution); + GNDSTK_SHORTCUT(product(),multiplicity); + GNDSTK_SHORTCUT(rate().Double(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->rate, \ + this->product \ + ) + + // default + DelayedNeutron() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedNeutron( + const wrapper + &label, + const wrapper + &rate = {}, + const wrapper + &product = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + rate(this,rate), + product(this,product) + { + Component::finish(); + } + + // from node + explicit DelayedNeutron(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedNeutron(const DelayedNeutron &other) : + 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) : + 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 "test/v2.0/fissionFragmentData/DelayedNeutron/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedNeutron + +} // namespace fissionFragmentData +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutron/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutron/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutron/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutrons.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutrons.hpp new file mode 100644 index 000000000..0246cb738 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutrons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONFRAGMENTDATA_DELAYEDNEUTRONS +#define TEST_V2_0_FISSIONFRAGMENTDATA_DELAYEDNEUTRONS + +#include "test/v2.0/fissionFragmentData/DelayedNeutron.hpp" + +namespace test { +namespace v2_0 { +namespace fissionFragmentData { + +// ----------------------------------------------------------------------------- +// fissionFragmentData:: +// 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 "fissionFragmentData"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->delayedNeutron \ + ) + + // default + DelayedNeutrons() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedNeutrons( + const wrapper> + &delayedNeutron + ) : + GNDSTK_COMPONENT(BlockData{}), + delayedNeutron(this,delayedNeutron) + { + Component::finish(); + } + + // from node + explicit DelayedNeutrons(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedNeutrons(const DelayedNeutrons &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + delayedNeutron(this,other.delayedNeutron) + { + Component::finish(other); + } + + // move + DelayedNeutrons(DelayedNeutrons &&other) : + 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 "test/v2.0/fissionFragmentData/DelayedNeutrons/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedNeutrons + +} // namespace fissionFragmentData +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutrons/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutrons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/DelayedNeutrons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/FissionFragmentData.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/FissionFragmentData.hpp new file mode 100644 index 000000000..a4f768d09 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/FissionFragmentData.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONFRAGMENTDATA_FISSIONFRAGMENTDATA +#define TEST_V2_0_FISSIONFRAGMENTDATA_FISSIONFRAGMENTDATA + +#include "test/v2.0/fissionFragmentData/DelayedNeutrons.hpp" +#include "test/v2.0/fissionTransport/FissionEnergyReleased.hpp" +#include "test/v2.0/fpy/ProductYields.hpp" + +namespace test { +namespace v2_0 { +namespace fissionFragmentData { + +// ----------------------------------------------------------------------------- +// fissionFragmentData:: +// 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 "fissionFragmentData"; } + 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> + ("delayedNeutrons") | + --Child> + ("fissionEnergyReleased") | + --Child> + ("productYields") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "delayedNeutrons", + "fissionEnergyReleased", + "productYields" + }; + 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_neutrons", + "fission_energy_released", + "product_yields" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + delayedNeutrons{this}; + Field> + fissionEnergyReleased{this}; + Field> + productYields{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->delayedNeutrons, \ + this->fissionEnergyReleased, \ + this->productYields \ + ) + + // default + FissionFragmentData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionFragmentData( + const wrapper> + &delayedNeutrons, + const wrapper> + &fissionEnergyReleased = {}, + const wrapper> + &productYields = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + delayedNeutrons(this,delayedNeutrons), + fissionEnergyReleased(this,fissionEnergyReleased), + productYields(this,productYields) + { + Component::finish(); + } + + // from node + explicit FissionFragmentData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionFragmentData(const FissionFragmentData &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + delayedNeutrons(this,other.delayedNeutrons), + fissionEnergyReleased(this,other.fissionEnergyReleased), + productYields(this,other.productYields) + { + Component::finish(other); + } + + // move + FissionFragmentData(FissionFragmentData &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + delayedNeutrons(this,std::move(other.delayedNeutrons)), + fissionEnergyReleased(this,std::move(other.fissionEnergyReleased)), + productYields(this,std::move(other.productYields)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FissionFragmentData &operator=(const FissionFragmentData &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + delayedNeutrons = other.delayedNeutrons; + fissionEnergyReleased = other.fissionEnergyReleased; + productYields = other.productYields; + } + return *this; + } + + // move + FissionFragmentData &operator=(FissionFragmentData &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + delayedNeutrons = std::move(other.delayedNeutrons); + fissionEnergyReleased = std::move(other.fissionEnergyReleased); + productYields = std::move(other.productYields); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionFragmentData/FissionFragmentData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FissionFragmentData + +} // namespace fissionFragmentData +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/FissionFragmentData/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/FissionFragmentData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/FissionFragmentData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/Rate.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/Rate.hpp new file mode 100644 index 000000000..092b24d9d --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/Rate.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONFRAGMENTDATA_RATE +#define TEST_V2_0_FISSIONFRAGMENTDATA_RATE + +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace fissionFragmentData { + +// ----------------------------------------------------------------------------- +// fissionFragmentData:: +// 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 "fissionFragmentData"; } + 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Double(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Rate() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Rate( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Rate(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Rate(const Rate &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Rate(Rate &&other) : + 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 "test/v2.0/fissionFragmentData/Rate/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Rate + +} // namespace fissionFragmentData +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/Rate/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/Rate/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionFragmentData/Rate/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/A.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/A.hpp new file mode 100644 index 000000000..cf4792b5e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/A.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_A +#define TEST_V2_0_FISSIONTRANSPORT_A + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// class A +// ----------------------------------------------------------------------------- + +class A : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "fissionTransport"; } + static auto CLASS() { return "A"; } + static auto NODENAME() { return "a"; } + + // 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + A() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit A(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + A(const A &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + A(A &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + A &operator=(const A &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + A &operator=(A &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/A/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class A + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/A/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/A/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/A/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/B.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/B.hpp new file mode 100644 index 000000000..8ce9c4223 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/B.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_B +#define TEST_V2_0_FISSIONTRANSPORT_B + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// class B +// ----------------------------------------------------------------------------- + +class B : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "fissionTransport"; } + static auto CLASS() { return "B"; } + static auto NODENAME() { return "b"; } + + // 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + B() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit B(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + B(const B &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + B(B &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + B &operator=(const B &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + B &operator=(B &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/B/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class B + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/B/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/B/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/B/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedBetaEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedBetaEnergy.hpp new file mode 100644 index 000000000..c0df0dc3e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedBetaEnergy.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_DELAYEDBETAENERGY +#define TEST_V2_0_FISSIONTRANSPORT_DELAYEDBETAENERGY + +#include "test/v2.0/containers/Polynomial1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + DelayedBetaEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedBetaEnergy( + const wrapper> + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit DelayedBetaEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedBetaEnergy(const DelayedBetaEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + DelayedBetaEnergy(DelayedBetaEnergy &&other) : + 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 "test/v2.0/fissionTransport/DelayedBetaEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedBetaEnergy + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedBetaEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedBetaEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedBetaEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedGammaEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedGammaEnergy.hpp new file mode 100644 index 000000000..58da6a69e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedGammaEnergy.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_DELAYEDGAMMAENERGY +#define TEST_V2_0_FISSIONTRANSPORT_DELAYEDGAMMAENERGY + +#include "test/v2.0/containers/Polynomial1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + DelayedGammaEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedGammaEnergy( + const wrapper> + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit DelayedGammaEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedGammaEnergy(const DelayedGammaEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + DelayedGammaEnergy(DelayedGammaEnergy &&other) : + 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 "test/v2.0/fissionTransport/DelayedGammaEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedGammaEnergy + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedGammaEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedGammaEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedGammaEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedNeutronKE.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedNeutronKE.hpp new file mode 100644 index 000000000..23120b448 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedNeutronKE.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_DELAYEDNEUTRONKE +#define TEST_V2_0_FISSIONTRANSPORT_DELAYEDNEUTRONKE + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Polynomial1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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> + ("XYs1d") | + --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", + "XYs1d", + "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", + "xys1d", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + polynomial1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->polynomial1d \ + ) + + // default + DelayedNeutronKE() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedNeutronKE( + const wrapper> + &XYs1d, + const wrapper> + &polynomial1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit DelayedNeutronKE(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedNeutronKE(const DelayedNeutronKE &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + DelayedNeutronKE(DelayedNeutronKE &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DelayedNeutronKE &operator=(const DelayedNeutronKE &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + DelayedNeutronKE &operator=(DelayedNeutronKE &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/DelayedNeutronKE/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DelayedNeutronKE + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedNeutronKE/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedNeutronKE/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/DelayedNeutronKE/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFH.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFH.hpp new file mode 100644 index 000000000..14b2112bf --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFH.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_EFH +#define TEST_V2_0_FISSIONTRANSPORT_EFH + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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 + XMLName{} + / Meta<>("unit") | + Float64{} + / 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", + "unit", + "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", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + unit{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unit, \ + this->value \ + ) + + // default + EFH() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EFH( + const wrapper + &unit, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit EFH(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EFH(const EFH &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + EFH(EFH &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EFH &operator=(const EFH &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + unit = other.unit; + value = other.value; + } + return *this; + } + + // move + EFH &operator=(EFH &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/EFH/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EFH + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFH/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFH/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFH/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFL.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFL.hpp new file mode 100644 index 000000000..7b0840470 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFL.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_EFL +#define TEST_V2_0_FISSIONTRANSPORT_EFL + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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 + XMLName{} + / Meta<>("unit") | + Float64{} + / 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", + "unit", + "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", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + unit{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unit, \ + this->value \ + ) + + // default + EFL() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EFL( + const wrapper + &unit, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit EFL(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EFL(const EFL &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + EFL(EFL &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EFL &operator=(const EFL &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + unit = other.unit; + value = other.value; + } + return *this; + } + + // move + EFL &operator=(EFL &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/EFL/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EFL + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFL/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFL/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/EFL/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponent.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponent.hpp new file mode 100644 index 000000000..7983901bd --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponent.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_FISSIONCOMPONENT +#define TEST_V2_0_FISSIONTRANSPORT_FISSIONCOMPONENT + +#include "test/v2.0/transport/CrossSection.hpp" +#include "test/v2.0/transport/OutputChannel.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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::optional{} + / Meta<>("ENDF_MT") | + XMLName{} + / Meta<>("fissionGenre") | + XMLName{} + / Meta<>("label") | + + // 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", + "ENDF_MT", + "fissionGenre", + "label", + "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", + "endf_mt", + "fission_genre", + "label", + "cross_section", + "output_channel" + }; + 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}; + Field> + outputChannel{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MT, \ + this->fissionGenre, \ + this->label, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + FissionComponent() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionComponent( + const wrapper> + &ENDF_MT, + const wrapper + &fissionGenre = {}, + const wrapper + &label = {}, + const wrapper> + &crossSection = {}, + const wrapper> + &outputChannel = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MT(this,ENDF_MT), + fissionGenre(this,fissionGenre), + label(this,label), + crossSection(this,crossSection), + outputChannel(this,outputChannel) + { + Component::finish(); + } + + // from node + explicit FissionComponent(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionComponent(const FissionComponent &other) : + 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), + outputChannel(this,other.outputChannel) + { + Component::finish(other); + } + + // move + FissionComponent(FissionComponent &&other) : + 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)), + 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; + ENDF_MT = other.ENDF_MT; + fissionGenre = other.fissionGenre; + label = other.label; + 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); + ENDF_MT = std::move(other.ENDF_MT); + fissionGenre = std::move(other.fissionGenre); + label = std::move(other.label); + crossSection = std::move(other.crossSection); + outputChannel = std::move(other.outputChannel); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/FissionComponent/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FissionComponent + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponent/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponent/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponent/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponents.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponents.hpp new file mode 100644 index 000000000..994d850b5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponents.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_FISSIONCOMPONENTS +#define TEST_V2_0_FISSIONTRANSPORT_FISSIONCOMPONENTS + +#include "test/v2.0/fissionTransport/FissionComponent.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->fissionComponent \ + ) + + // default + FissionComponents() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionComponents( + const wrapper>> + &fissionComponent + ) : + GNDSTK_COMPONENT(BlockData{}), + fissionComponent(this,fissionComponent) + { + Component::finish(); + } + + // from node + explicit FissionComponents(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionComponents(const FissionComponents &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + fissionComponent(this,other.fissionComponent) + { + Component::finish(other); + } + + // move + FissionComponents(FissionComponents &&other) : + 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 "test/v2.0/fissionTransport/FissionComponents/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FissionComponents + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponents/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponents/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionComponents/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionEnergyReleased.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionEnergyReleased.hpp new file mode 100644 index 000000000..9b9146116 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionEnergyReleased.hpp @@ -0,0 +1,317 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_FISSIONENERGYRELEASED +#define TEST_V2_0_FISSIONTRANSPORT_FISSIONENERGYRELEASED + +#include "test/v2.0/fissionTransport/DelayedBetaEnergy.hpp" +#include "test/v2.0/fissionTransport/DelayedGammaEnergy.hpp" +#include "test/v2.0/fissionTransport/DelayedNeutronKE.hpp" +#include "test/v2.0/fissionTransport/NeutrinoEnergy.hpp" +#include "test/v2.0/fissionTransport/NonNeutrinoEnergy.hpp" +#include "test/v2.0/fissionTransport/PromptGammaEnergy.hpp" +#include "test/v2.0/fissionTransport/PromptNeutronKE.hpp" +#include "test/v2.0/fissionTransport/PromptProductKE.hpp" +#include "test/v2.0/fissionTransport/TotalEnergy.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// class FissionEnergyReleased +// ----------------------------------------------------------------------------- + +class FissionEnergyReleased : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "fissionTransport"; } + static auto CLASS() { return "FissionEnergyReleased"; } + static auto NODENAME() { return "fissionEnergyReleased"; } + + // 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> + ("delayedBetaEnergy") | + --Child> + ("delayedGammaEnergy") | + --Child> + ("delayedNeutronKE") | + --Child> + ("neutrinoEnergy") | + --Child> + ("nonNeutrinoEnergy") | + --Child> + ("promptGammaEnergy") | + --Child> + ("promptNeutronKE") | + --Child> + ("promptProductKE") | + --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", + "delayedBetaEnergy", + "delayedGammaEnergy", + "delayedNeutronKE", + "neutrinoEnergy", + "nonNeutrinoEnergy", + "promptGammaEnergy", + "promptNeutronKE", + "promptProductKE", + "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", + "delayed_beta_energy", + "delayed_gamma_energy", + "delayed_neutron_ke", + "neutrino_energy", + "non_neutrino_energy", + "prompt_gamma_energy", + "prompt_neutron_ke", + "prompt_product_ke", + "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> + delayedBetaEnergy{this}; + Field> + delayedGammaEnergy{this}; + Field> + delayedNeutronKE{this}; + Field> + neutrinoEnergy{this}; + Field> + nonNeutrinoEnergy{this}; + Field> + promptGammaEnergy{this}; + Field> + promptNeutronKE{this}; + Field> + promptProductKE{this}; + Field> + totalEnergy{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->delayedBetaEnergy, \ + this->delayedGammaEnergy, \ + this->delayedNeutronKE, \ + this->neutrinoEnergy, \ + this->nonNeutrinoEnergy, \ + this->promptGammaEnergy, \ + this->promptNeutronKE, \ + this->promptProductKE, \ + this->totalEnergy \ + ) + + // default + FissionEnergyReleased() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionEnergyReleased( + const wrapper> + &label, + const wrapper> + &delayedBetaEnergy = {}, + const wrapper> + &delayedGammaEnergy = {}, + const wrapper> + &delayedNeutronKE = {}, + const wrapper> + &neutrinoEnergy = {}, + const wrapper> + &nonNeutrinoEnergy = {}, + const wrapper> + &promptGammaEnergy = {}, + const wrapper> + &promptNeutronKE = {}, + const wrapper> + &promptProductKE = {}, + const wrapper> + &totalEnergy = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + delayedBetaEnergy(this,delayedBetaEnergy), + delayedGammaEnergy(this,delayedGammaEnergy), + delayedNeutronKE(this,delayedNeutronKE), + neutrinoEnergy(this,neutrinoEnergy), + nonNeutrinoEnergy(this,nonNeutrinoEnergy), + promptGammaEnergy(this,promptGammaEnergy), + promptNeutronKE(this,promptNeutronKE), + promptProductKE(this,promptProductKE), + totalEnergy(this,totalEnergy) + { + Component::finish(); + } + + // from node + explicit FissionEnergyReleased(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionEnergyReleased(const FissionEnergyReleased &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + delayedBetaEnergy(this,other.delayedBetaEnergy), + delayedGammaEnergy(this,other.delayedGammaEnergy), + delayedNeutronKE(this,other.delayedNeutronKE), + neutrinoEnergy(this,other.neutrinoEnergy), + nonNeutrinoEnergy(this,other.nonNeutrinoEnergy), + promptGammaEnergy(this,other.promptGammaEnergy), + promptNeutronKE(this,other.promptNeutronKE), + promptProductKE(this,other.promptProductKE), + totalEnergy(this,other.totalEnergy) + { + Component::finish(other); + } + + // move + FissionEnergyReleased(FissionEnergyReleased &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + delayedBetaEnergy(this,std::move(other.delayedBetaEnergy)), + delayedGammaEnergy(this,std::move(other.delayedGammaEnergy)), + delayedNeutronKE(this,std::move(other.delayedNeutronKE)), + neutrinoEnergy(this,std::move(other.neutrinoEnergy)), + nonNeutrinoEnergy(this,std::move(other.nonNeutrinoEnergy)), + promptGammaEnergy(this,std::move(other.promptGammaEnergy)), + promptNeutronKE(this,std::move(other.promptNeutronKE)), + promptProductKE(this,std::move(other.promptProductKE)), + totalEnergy(this,std::move(other.totalEnergy)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FissionEnergyReleased &operator=(const FissionEnergyReleased &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + delayedBetaEnergy = other.delayedBetaEnergy; + delayedGammaEnergy = other.delayedGammaEnergy; + delayedNeutronKE = other.delayedNeutronKE; + neutrinoEnergy = other.neutrinoEnergy; + nonNeutrinoEnergy = other.nonNeutrinoEnergy; + promptGammaEnergy = other.promptGammaEnergy; + promptNeutronKE = other.promptNeutronKE; + promptProductKE = other.promptProductKE; + totalEnergy = other.totalEnergy; + } + return *this; + } + + // move + FissionEnergyReleased &operator=(FissionEnergyReleased &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + delayedBetaEnergy = std::move(other.delayedBetaEnergy); + delayedGammaEnergy = std::move(other.delayedGammaEnergy); + delayedNeutronKE = std::move(other.delayedNeutronKE); + neutrinoEnergy = std::move(other.neutrinoEnergy); + nonNeutrinoEnergy = std::move(other.nonNeutrinoEnergy); + promptGammaEnergy = std::move(other.promptGammaEnergy); + promptNeutronKE = std::move(other.promptNeutronKE); + promptProductKE = std::move(other.promptProductKE); + totalEnergy = std::move(other.totalEnergy); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/FissionEnergyReleased/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FissionEnergyReleased + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionEnergyReleased/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionEnergyReleased/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/FissionEnergyReleased/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/MadlandNix.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/MadlandNix.hpp new file mode 100644 index 000000000..b67f4ded1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/MadlandNix.hpp @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_MADLANDNIX +#define TEST_V2_0_FISSIONTRANSPORT_MADLANDNIX + +#include "test/v2.0/fissionTransport/EFH.hpp" +#include "test/v2.0/fissionTransport/EFL.hpp" +#include "test/v2.0/fissionTransport/T_M.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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 + ("EFH") | + --Child + ("EFL") | + --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", + "EFH", + "EFL", + "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", + "efh", + "efl", + "t_m" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + EFH{this}; + Field + EFL{this}; + Field + T_M{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(T_M(),XYs1d); + GNDSTK_SHORTCUT(T_M().XYs1d(),axes); + GNDSTK_SHORTCUT(T_M().XYs1d(),uncertainty); + GNDSTK_SHORTCUT(T_M().XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->EFH, \ + this->EFL, \ + this->T_M \ + ) + + // default + MadlandNix() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MadlandNix( + const wrapper + &EFH, + const wrapper + &EFL = {}, + const wrapper + &T_M = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + EFH(this,EFH), + EFL(this,EFL), + T_M(this,T_M) + { + Component::finish(); + } + + // from node + explicit MadlandNix(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MadlandNix(const MadlandNix &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + EFH(this,other.EFH), + EFL(this,other.EFL), + T_M(this,other.T_M) + { + Component::finish(other); + } + + // move + MadlandNix(MadlandNix &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + EFH(this,std::move(other.EFH)), + EFL(this,std::move(other.EFL)), + 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; + EFH = other.EFH; + EFL = other.EFL; + 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); + EFH = std::move(other.EFH); + EFL = std::move(other.EFL); + T_M = std::move(other.T_M); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/MadlandNix/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MadlandNix + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/MadlandNix/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/MadlandNix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/MadlandNix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NeutrinoEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NeutrinoEnergy.hpp new file mode 100644 index 000000000..072d10d59 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NeutrinoEnergy.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_NEUTRINOENERGY +#define TEST_V2_0_FISSIONTRANSPORT_NEUTRINOENERGY + +#include "test/v2.0/containers/Polynomial1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + NeutrinoEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NeutrinoEnergy( + const wrapper> + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit NeutrinoEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NeutrinoEnergy(const NeutrinoEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + NeutrinoEnergy(NeutrinoEnergy &&other) : + 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 "test/v2.0/fissionTransport/NeutrinoEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NeutrinoEnergy + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NeutrinoEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NeutrinoEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NeutrinoEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NonNeutrinoEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NonNeutrinoEnergy.hpp new file mode 100644 index 000000000..f18536898 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NonNeutrinoEnergy.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_NONNEUTRINOENERGY +#define TEST_V2_0_FISSIONTRANSPORT_NONNEUTRINOENERGY + +#include "test/v2.0/containers/Polynomial1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + NonNeutrinoEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NonNeutrinoEnergy( + const wrapper> + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit NonNeutrinoEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NonNeutrinoEnergy(const NonNeutrinoEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + NonNeutrinoEnergy(NonNeutrinoEnergy &&other) : + 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 "test/v2.0/fissionTransport/NonNeutrinoEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NonNeutrinoEnergy + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NonNeutrinoEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NonNeutrinoEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/NonNeutrinoEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptGammaEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptGammaEnergy.hpp new file mode 100644 index 000000000..44d8dedb6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptGammaEnergy.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_PROMPTGAMMAENERGY +#define TEST_V2_0_FISSIONTRANSPORT_PROMPTGAMMAENERGY + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Polynomial1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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> + ("XYs1d") | + --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", + "XYs1d", + "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", + "xys1d", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + polynomial1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->polynomial1d \ + ) + + // default + PromptGammaEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PromptGammaEnergy( + const wrapper> + &XYs1d, + const wrapper> + &polynomial1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit PromptGammaEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PromptGammaEnergy(const PromptGammaEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + PromptGammaEnergy(PromptGammaEnergy &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PromptGammaEnergy &operator=(const PromptGammaEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + PromptGammaEnergy &operator=(PromptGammaEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/PromptGammaEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PromptGammaEnergy + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptGammaEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptGammaEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptGammaEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptNeutronKE.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptNeutronKE.hpp new file mode 100644 index 000000000..a4e3c5168 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptNeutronKE.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_PROMPTNEUTRONKE +#define TEST_V2_0_FISSIONTRANSPORT_PROMPTNEUTRONKE + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Polynomial1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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> + ("XYs1d") | + --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", + "XYs1d", + "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", + "xys1d", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + polynomial1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->polynomial1d \ + ) + + // default + PromptNeutronKE() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PromptNeutronKE( + const wrapper> + &XYs1d, + const wrapper> + &polynomial1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit PromptNeutronKE(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PromptNeutronKE(const PromptNeutronKE &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + PromptNeutronKE(PromptNeutronKE &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PromptNeutronKE &operator=(const PromptNeutronKE &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + PromptNeutronKE &operator=(PromptNeutronKE &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/PromptNeutronKE/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PromptNeutronKE + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptNeutronKE/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptNeutronKE/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptNeutronKE/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptProductKE.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptProductKE.hpp new file mode 100644 index 000000000..71064c065 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptProductKE.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_PROMPTPRODUCTKE +#define TEST_V2_0_FISSIONTRANSPORT_PROMPTPRODUCTKE + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Polynomial1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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> + ("XYs1d") | + --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", + "XYs1d", + "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", + "xys1d", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + polynomial1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->polynomial1d \ + ) + + // default + PromptProductKE() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PromptProductKE( + const wrapper> + &XYs1d, + const wrapper> + &polynomial1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit PromptProductKE(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PromptProductKE(const PromptProductKE &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + PromptProductKE(PromptProductKE &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PromptProductKE &operator=(const PromptProductKE &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + PromptProductKE &operator=(PromptProductKE &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/PromptProductKE/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PromptProductKE + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptProductKE/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptProductKE/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/PromptProductKE/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/SimpleMaxwellianFission.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/SimpleMaxwellianFission.hpp new file mode 100644 index 000000000..ed553f240 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/SimpleMaxwellianFission.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_SIMPLEMAXWELLIANFISSION +#define TEST_V2_0_FISSIONTRANSPORT_SIMPLEMAXWELLIANFISSION + +#include "test/v2.0/transport/U.hpp" +#include "test/v2.0/transport/Theta.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->theta \ + ) + + // default + SimpleMaxwellianFission() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SimpleMaxwellianFission( + const wrapper> + &U, + const wrapper> + &theta = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + U(this,U), + theta(this,theta) + { + Component::finish(); + } + + // from node + explicit SimpleMaxwellianFission(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SimpleMaxwellianFission(const SimpleMaxwellianFission &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + U(this,other.U), + theta(this,other.theta) + { + Component::finish(other); + } + + // move + SimpleMaxwellianFission(SimpleMaxwellianFission &&other) : + 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 "test/v2.0/fissionTransport/SimpleMaxwellianFission/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SimpleMaxwellianFission + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/SimpleMaxwellianFission/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/SimpleMaxwellianFission/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/SimpleMaxwellianFission/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/T_M.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/T_M.hpp new file mode 100644 index 000000000..d1b426b68 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/T_M.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_T_M +#define TEST_V2_0_FISSIONTRANSPORT_T_M + +#include "test/v2.0/containers/XYs1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + T_M() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit T_M( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit T_M(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + T_M(const T_M &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + T_M(T_M &&other) : + 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 "test/v2.0/fissionTransport/T_M/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class T_M + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/T_M/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/T_M/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/T_M/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/TotalEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/TotalEnergy.hpp new file mode 100644 index 000000000..e36f8b85e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/TotalEnergy.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_TOTALENERGY +#define TEST_V2_0_FISSIONTRANSPORT_TOTALENERGY + +#include "test/v2.0/containers/Polynomial1d.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// 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 "fissionTransport"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + TotalEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit TotalEnergy( + const wrapper> + &polynomial1d + ) : + GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit TotalEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + TotalEnergy(const TotalEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + TotalEnergy(TotalEnergy &&other) : + 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 "test/v2.0/fissionTransport/TotalEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class TotalEnergy + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/TotalEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/TotalEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/TotalEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/Watt.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/Watt.hpp new file mode 100644 index 000000000..ac3122032 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/Watt.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FISSIONTRANSPORT_WATT +#define TEST_V2_0_FISSIONTRANSPORT_WATT + +#include "test/v2.0/transport/U.hpp" +#include "test/v2.0/fissionTransport/A.hpp" +#include "test/v2.0/fissionTransport/B.hpp" + +namespace test { +namespace v2_0 { +namespace fissionTransport { + +// ----------------------------------------------------------------------------- +// fissionTransport:: +// class Watt +// ----------------------------------------------------------------------------- + +class Watt : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "fissionTransport"; } + static auto CLASS() { return "Watt"; } + static auto NODENAME() { return "Watt"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("U") | + --Child + ("a") | + --Child + ("b") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "a", + "b" + }; + 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", + "a", + "b" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + U{this}; + Field + a{this}; + Field + b{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->a, \ + this->b \ + ) + + // default + Watt() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Watt( + const wrapper + &U, + const wrapper + &a = {}, + const wrapper + &b = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + U(this,U), + a(this,a), + b(this,b) + { + Component::finish(); + } + + // from node + explicit Watt(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Watt(const Watt &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + U(this,other.U), + a(this,other.a), + b(this,other.b) + { + Component::finish(other); + } + + // move + Watt(Watt &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + U(this,std::move(other.U)), + a(this,std::move(other.a)), + b(this,std::move(other.b)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Watt &operator=(const Watt &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + U = other.U; + a = other.a; + b = other.b; + } + return *this; + } + + // move + Watt &operator=(Watt &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + U = std::move(other.U); + a = std::move(other.a); + b = std::move(other.b); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fissionTransport/Watt/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Watt + +} // namespace fissionTransport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/Watt/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/Watt/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fissionTransport/Watt/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTime.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTime.hpp new file mode 100644 index 000000000..2427003da --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTime.hpp @@ -0,0 +1,222 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_ELAPSEDTIME +#define TEST_V2_0_FPY_ELAPSEDTIME + +#include "test/v2.0/fpy/Time.hpp" +#include "test/v2.0/fpy/Yields.hpp" +#include "test/v2.0/fpy/IncidentEnergies.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// class ElapsedTime +// ----------------------------------------------------------------------------- + +class ElapsedTime : + public Component +{ + friend class Component; + + using _t = std::variant< + fpy::Yields, + fpy::IncidentEnergies + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "fpy"; } + 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::optional{} + / Meta<>("label") | + + // children + --Child + ("time") | + _t{} + / --(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", + "_yieldsincidentEnergies" + }; + 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", + "_yieldsincident_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}; + + // children - variant + Field<_t> + _yieldsincidentEnergies{this}; + FieldPart yields{_yieldsincidentEnergies}; + FieldPart incidentEnergies{_yieldsincidentEnergies}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->time, \ + this->_yieldsincidentEnergies \ + ) + + // default + ElapsedTime() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ElapsedTime( + const wrapper> + &label, + const wrapper + &time = {}, + const wrapper<_t> + &_yieldsincidentEnergies = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + time(this,time), + _yieldsincidentEnergies(this,_yieldsincidentEnergies) + { + Component::finish(); + } + + // from node + explicit ElapsedTime(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ElapsedTime(const ElapsedTime &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + time(this,other.time), + _yieldsincidentEnergies(this,other._yieldsincidentEnergies) + { + Component::finish(other); + } + + // move + ElapsedTime(ElapsedTime &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + time(this,std::move(other.time)), + _yieldsincidentEnergies(this,std::move(other._yieldsincidentEnergies)) + { + 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; + _yieldsincidentEnergies = other._yieldsincidentEnergies; + } + 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); + _yieldsincidentEnergies = std::move(other._yieldsincidentEnergies); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fpy/ElapsedTime/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ElapsedTime + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTime/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTime/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTime/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTimes.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTimes.hpp new file mode 100644 index 000000000..2958ec200 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTimes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_ELAPSEDTIMES +#define TEST_V2_0_FPY_ELAPSEDTIMES + +#include "test/v2.0/fpy/ElapsedTime.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// 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 "fpy"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->elapsedTime \ + ) + + // default + ElapsedTimes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ElapsedTimes( + const wrapper> + &elapsedTime + ) : + GNDSTK_COMPONENT(BlockData{}), + elapsedTime(this,elapsedTime) + { + Component::finish(); + } + + // from node + explicit ElapsedTimes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ElapsedTimes(const ElapsedTimes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + elapsedTime(this,other.elapsedTime) + { + Component::finish(other); + } + + // move + ElapsedTimes(ElapsedTimes &&other) : + 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 "test/v2.0/fpy/ElapsedTimes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ElapsedTimes + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTimes/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTimes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/ElapsedTimes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/Energy.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/Energy.hpp new file mode 100644 index 000000000..29a640b2d --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/Energy.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_ENERGY +#define TEST_V2_0_FPY_ENERGY + +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// 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 "fpy"; } + 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{} | + + // 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Double(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Energy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Energy( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Energy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Energy(const Energy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Energy(Energy &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Energy &operator=(const Energy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Double = other.Double; + } + return *this; + } + + // move + Energy &operator=(Energy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fpy/Energy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Energy + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/Energy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/Energy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/Energy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergies.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergies.hpp new file mode 100644 index 000000000..d8e24ad1b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergies.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_INCIDENTENERGIES +#define TEST_V2_0_FPY_INCIDENTENERGIES + +#include "test/v2.0/fpy/IncidentEnergy.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// 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 "fpy"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->incidentEnergy \ + ) + + // default + IncidentEnergies() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncidentEnergies( + const wrapper> + &incidentEnergy + ) : + GNDSTK_COMPONENT(BlockData{}), + incidentEnergy(this,incidentEnergy) + { + Component::finish(); + } + + // from node + explicit IncidentEnergies(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncidentEnergies(const IncidentEnergies &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + incidentEnergy(this,other.incidentEnergy) + { + Component::finish(other); + } + + // move + IncidentEnergies(IncidentEnergies &&other) : + 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 "test/v2.0/fpy/IncidentEnergies/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class IncidentEnergies + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergies/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergies/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergies/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergy.hpp new file mode 100644 index 000000000..bae379385 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergy.hpp @@ -0,0 +1,219 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_INCIDENTENERGY +#define TEST_V2_0_FPY_INCIDENTENERGY + +#include "test/v2.0/fpy/Energy.hpp" +#include "test/v2.0/fpy/Yields.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// 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 "fpy"; } + 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 + XMLName{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(energy(),Double); + GNDSTK_SHORTCUT(yields(),nuclides); + GNDSTK_SHORTCUT(yields(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->energy, \ + this->yields \ + ) + + // default + IncidentEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncidentEnergy( + const wrapper + &label, + const wrapper + &energy = {}, + const wrapper + &yields = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + energy(this,energy), + yields(this,yields) + { + Component::finish(); + } + + // from node + explicit IncidentEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncidentEnergy(const IncidentEnergy &other) : + 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) : + 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 "test/v2.0/fpy/IncidentEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class IncidentEnergy + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/IncidentEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/Nuclides.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/Nuclides.hpp new file mode 100644 index 000000000..24ddb44b2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/Nuclides.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_NUCLIDES +#define TEST_V2_0_FPY_NUCLIDES + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// 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 "fpy"; } + 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 member names. Usually - but not necessarily - the same 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; + using BlockData::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Nuclides() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nuclides( + const wrapper> + &href + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Nuclides(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Nuclides(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Nuclides(const Nuclides &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Nuclides(Nuclides &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + 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); + comment = other.comment; + href = other.href; + } + return *this; + } + + // move + Nuclides &operator=(Nuclides &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fpy/Nuclides/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Nuclides + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/Nuclides/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/Nuclides/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/Nuclides/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYield.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYield.hpp new file mode 100644 index 000000000..986b267a8 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYield.hpp @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_PRODUCTYIELD +#define TEST_V2_0_FPY_PRODUCTYIELD + +#include "test/v2.0/fpy/Nuclides.hpp" +#include "test/v2.0/fpy/ElapsedTimes.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// 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 "fpy"; } + 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 + XMLName{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(elapsedTimes(),elapsedTime); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->nuclides, \ + this->elapsedTimes \ + ) + + // default + ProductYield() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ProductYield( + const wrapper + &label, + const wrapper> + &nuclides = {}, + const wrapper + &elapsedTimes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + nuclides(this,nuclides), + elapsedTimes(this,elapsedTimes) + { + Component::finish(); + } + + // from node + explicit ProductYield(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ProductYield(const ProductYield &other) : + 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) : + 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 "test/v2.0/fpy/ProductYield/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ProductYield + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYield/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYield/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYield/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYields.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYields.hpp new file mode 100644 index 000000000..0dbab383b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYields.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_PRODUCTYIELDS +#define TEST_V2_0_FPY_PRODUCTYIELDS + +#include "test/v2.0/fpy/ProductYield.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// 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 "fpy"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->productYield \ + ) + + // default + ProductYields() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ProductYields( + const wrapper> + &productYield + ) : + GNDSTK_COMPONENT(BlockData{}), + productYield(this,productYield) + { + Component::finish(); + } + + // from node + explicit ProductYields(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ProductYields(const ProductYields &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + productYield(this,other.productYield) + { + Component::finish(other); + } + + // move + ProductYields(ProductYields &&other) : + 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 "test/v2.0/fpy/ProductYields/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ProductYields + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYields/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYields/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/ProductYields/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/Time.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/Time.hpp new file mode 100644 index 000000000..254824640 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/Time.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_TIME +#define TEST_V2_0_FPY_TIME + +#include "test/v2.0/containers/Double.hpp" +#include "test/v2.0/containers/String.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// class Time +// ----------------------------------------------------------------------------- + +class Time : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::Double, + containers::String + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "fpy"; } + 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 + _t{} + / --(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", + "_Doublestring" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_doublestring" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _Doublestring{this}; + FieldPart Double{_Doublestring}; + FieldPart string{_Doublestring}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_Doublestring \ + ) + + // default + Time() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Time( + const wrapper<_t> + &_Doublestring + ) : + GNDSTK_COMPONENT(BlockData{}), + _Doublestring(this,_Doublestring) + { + Component::finish(); + } + + // from node + explicit Time(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Time(const Time &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _Doublestring(this,other._Doublestring) + { + Component::finish(other); + } + + // move + Time(Time &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _Doublestring(this,std::move(other._Doublestring)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Time &operator=(const Time &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _Doublestring = other._Doublestring; + } + return *this; + } + + // move + Time &operator=(Time &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _Doublestring = std::move(other._Doublestring); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/fpy/Time/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Time + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/Time/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/Time/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/Time/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/Yields.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/Yields.hpp new file mode 100644 index 000000000..14b02560f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/Yields.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_FPY_YIELDS +#define TEST_V2_0_FPY_YIELDS + +#include "test/v2.0/fpy/Nuclides.hpp" +#include "test/v2.0/containers/Values.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace fpy { + +// ----------------------------------------------------------------------------- +// fpy:: +// 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 "fpy"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclides, \ + this->values, \ + this->uncertainty \ + ) + + // default + Yields() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Yields( + const wrapper + &nuclides, + const wrapper + &values = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + nuclides(this,nuclides), + values(this,values), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Yields(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Yields(const Yields &other) : + 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) : + 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 "test/v2.0/fpy/Yields/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Yields + +} // namespace fpy +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/fpy/Yields/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/fpy/Yields/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/fpy/Yields/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/key.hpp b/standards/gnds-2.0/test/src/test/v2.0/key.hpp new file mode 100644 index 000000000..b3cc07b82 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/key.hpp @@ -0,0 +1,810 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_KEY +#define TEST_V2_0_KEY + +// GNDStk Core Interface +#include "GNDStk.hpp" + +namespace test { +namespace v2_0 { + +using namespace njoy; +using namespace GNDStk; + + +// ----------------------------------------------------------------------------- +// meta:: +// ----------------------------------------------------------------------------- + +namespace meta { + +#define GNDSTK_MAKE_LOOKUP(nameField,nameGNDS) \ + inline const auto nameField = makeLookup( \ + #nameGNDS, \ + [](const auto &obj) -> decltype(obj.nameField()) \ + { return obj.nameField(); } \ + ) +// nameField vs. nameGNDS: for, e.g., Double vs. double in GNDS + +GNDSTK_MAKE_LOOKUP(A,A); +GNDSTK_MAKE_LOOKUP(ENDF_MFMT,ENDF_MFMT); +GNDSTK_MAKE_LOOKUP(ENDF_MT,ENDF_MT); +GNDSTK_MAKE_LOOKUP(L,L); +GNDSTK_MAKE_LOOKUP(Z,Z); +GNDSTK_MAKE_LOOKUP(algorithm,algorithm); +GNDSTK_MAKE_LOOKUP(approximation,approximation); +GNDSTK_MAKE_LOOKUP(boundaryCondition,boundaryCondition); +GNDSTK_MAKE_LOOKUP(boundaryConditionValue,boundaryConditionValue); +GNDSTK_MAKE_LOOKUP(calculateChannelRadius,calculateChannelRadius); +GNDSTK_MAKE_LOOKUP(calculatePenetrability,calculatePenetrability); +GNDSTK_MAKE_LOOKUP(calculatedAtThermal,calculatedAtThermal); +GNDSTK_MAKE_LOOKUP(channelSpin,channelSpin); +GNDSTK_MAKE_LOOKUP(checksum,checksum); +GNDSTK_MAKE_LOOKUP(coefficient,coefficient); +GNDSTK_MAKE_LOOKUP(columnIndex,columnIndex); +GNDSTK_MAKE_LOOKUP(columns,columns); +GNDSTK_MAKE_LOOKUP(complete,complete); +GNDSTK_MAKE_LOOKUP(compression,compression); +GNDSTK_MAKE_LOOKUP(confidence,confidence); +GNDSTK_MAKE_LOOKUP(conserve,conserve); +GNDSTK_MAKE_LOOKUP(contributorType,contributorType); +GNDSTK_MAKE_LOOKUP(count,count); +GNDSTK_MAKE_LOOKUP(crossTerm,crossTerm); +GNDSTK_MAKE_LOOKUP(date,date); +GNDSTK_MAKE_LOOKUP(dateType,dateType); +GNDSTK_MAKE_LOOKUP(degreesOfFreedom,degreesOfFreedom); +GNDSTK_MAKE_LOOKUP(dependenceOnProcessedGroupWidth,dependenceOnProcessedGroupWidth); +GNDSTK_MAKE_LOOKUP(derivedFrom,derivedFrom); +GNDSTK_MAKE_LOOKUP(dimension,dimension); +GNDSTK_MAKE_LOOKUP(doi,doi); +GNDSTK_MAKE_LOOKUP(domainMax,domainMax); +GNDSTK_MAKE_LOOKUP(domainMin,domainMin); +GNDSTK_MAKE_LOOKUP(domainUnit,domainUnit); +GNDSTK_MAKE_LOOKUP(domainValue,domainValue); +GNDSTK_MAKE_LOOKUP(ejectile,ejectile); +GNDSTK_MAKE_LOOKUP(electronNumber,electronNumber); +GNDSTK_MAKE_LOOKUP(eliminated,eliminated); +GNDSTK_MAKE_LOOKUP(email,email); +GNDSTK_MAKE_LOOKUP(encoding,encoding); +GNDSTK_MAKE_LOOKUP(evaluation,evaluation); +GNDSTK_MAKE_LOOKUP(filename,filename); +GNDSTK_MAKE_LOOKUP(finalState,finalState); +GNDSTK_MAKE_LOOKUP(fissionGenre,fissionGenre); +GNDSTK_MAKE_LOOKUP(flags,flags); +GNDSTK_MAKE_LOOKUP(format,format); +GNDSTK_MAKE_LOOKUP(format,version); +GNDSTK_MAKE_LOOKUP(generation,generation); +GNDSTK_MAKE_LOOKUP(genre,genre); +GNDSTK_MAKE_LOOKUP(href,href); +GNDSTK_MAKE_LOOKUP(id,id); +GNDSTK_MAKE_LOOKUP(identicalParticles,identicalParticles); +GNDSTK_MAKE_LOOKUP(incoherentApproximation,incoherentApproximation); +GNDSTK_MAKE_LOOKUP(index,index); +GNDSTK_MAKE_LOOKUP(interaction,interaction); +GNDSTK_MAKE_LOOKUP(interpolation,interpolation); +GNDSTK_MAKE_LOOKUP(interpolationQualifier,interpolationQualifier); +GNDSTK_MAKE_LOOKUP(label,label); +GNDSTK_MAKE_LOOKUP(length,length); +GNDSTK_MAKE_LOOKUP(library,library); +GNDSTK_MAKE_LOOKUP(lower,lower); +GNDSTK_MAKE_LOOKUP(lowerIndex,lowerIndex); +GNDSTK_MAKE_LOOKUP(markup,markup); +GNDSTK_MAKE_LOOKUP(matrixStartIndex,matrixStartIndex); +GNDSTK_MAKE_LOOKUP(max,max); +GNDSTK_MAKE_LOOKUP(metaStableIndex,metaStableIndex); +GNDSTK_MAKE_LOOKUP(min,min); +GNDSTK_MAKE_LOOKUP(mode,mode); +GNDSTK_MAKE_LOOKUP(muCutoff,muCutoff); +GNDSTK_MAKE_LOOKUP(nParameters,nParameters); +GNDSTK_MAKE_LOOKUP(name,name); +GNDSTK_MAKE_LOOKUP(numberOfBands,numberOfBands); +GNDSTK_MAKE_LOOKUP(numberOfBins,numberOfBins); +GNDSTK_MAKE_LOOKUP(numberOfProducts,numberOfProducts); +GNDSTK_MAKE_LOOKUP(numberPerMolecule,numberPerMolecule); +GNDSTK_MAKE_LOOKUP(offset,offset); +GNDSTK_MAKE_LOOKUP(orcid,orcid); +GNDSTK_MAKE_LOOKUP(outerDomainValue,outerDomainValue); +GNDSTK_MAKE_LOOKUP(parity,parity); +GNDSTK_MAKE_LOOKUP(path,path); +GNDSTK_MAKE_LOOKUP(permutation,permutation); +GNDSTK_MAKE_LOOKUP(pid,pid); +GNDSTK_MAKE_LOOKUP(primaryScatterer,primaryScatterer); +GNDSTK_MAKE_LOOKUP(process,process); +GNDSTK_MAKE_LOOKUP(productFrame,productFrame); +GNDSTK_MAKE_LOOKUP(projectile,projectile); +GNDSTK_MAKE_LOOKUP(projectileFrame,projectileFrame); +GNDSTK_MAKE_LOOKUP(publicationDate,publicationDate); +GNDSTK_MAKE_LOOKUP(relationType,relationType); +GNDSTK_MAKE_LOOKUP(resonanceReaction,resonanceReaction); +GNDSTK_MAKE_LOOKUP(retrievalDate,retrievalDate); +GNDSTK_MAKE_LOOKUP(revisionID,revisionID); +GNDSTK_MAKE_LOOKUP(revisionSystem,revisionSystem); +GNDSTK_MAKE_LOOKUP(rows,rows); +GNDSTK_MAKE_LOOKUP(sep,sep); +GNDSTK_MAKE_LOOKUP(shape,shape); +GNDSTK_MAKE_LOOKUP(spin,spin); +GNDSTK_MAKE_LOOKUP(standardEvaluation,standardEvaluation); +GNDSTK_MAKE_LOOKUP(standardTarget,standardTarget); +GNDSTK_MAKE_LOOKUP(start,start); +GNDSTK_MAKE_LOOKUP(startIndex,startIndex); +GNDSTK_MAKE_LOOKUP(storageOrder,storageOrder); +GNDSTK_MAKE_LOOKUP(style,style); +GNDSTK_MAKE_LOOKUP(subentry,subentry); +GNDSTK_MAKE_LOOKUP(subshell,subshell); +GNDSTK_MAKE_LOOKUP(supportsAngularReconstruction,supportsAngularReconstruction); +GNDSTK_MAKE_LOOKUP(symbol,symbol); +GNDSTK_MAKE_LOOKUP(symmetric,symmetric); +GNDSTK_MAKE_LOOKUP(symmetry,symmetry); +GNDSTK_MAKE_LOOKUP(target,target); +GNDSTK_MAKE_LOOKUP(type,type); +GNDSTK_MAKE_LOOKUP(types,types); +GNDSTK_MAKE_LOOKUP(unit,unit); +GNDSTK_MAKE_LOOKUP(upper,upper); +GNDSTK_MAKE_LOOKUP(upperCalculatedGroup,upperCalculatedGroup); +GNDSTK_MAKE_LOOKUP(useForSelfShieldingOnly,useForSelfShieldingOnly); +GNDSTK_MAKE_LOOKUP(value,value); +GNDSTK_MAKE_LOOKUP(valueType,valueType); +GNDSTK_MAKE_LOOKUP(version,version); +GNDSTK_MAKE_LOOKUP(xref,xref); + +#undef GNDSTK_MAKE_LOOKUP + +} // namespace meta + + +// ----------------------------------------------------------------------------- +// appData::child:: +// ----------------------------------------------------------------------------- + +namespace appData { +namespace child { + +inline const Child<> ENDFconversionFlags("ENDFconversionFlags"); +inline const Child<> applicationData("applicationData"); +inline const Child<> conversion("conversion"); +inline const Child<> institution("institution"); + +} // namespace child +using namespace child; +} // namespace appData + + +// ----------------------------------------------------------------------------- +// atomic::child:: +// ----------------------------------------------------------------------------- + +namespace atomic { +namespace child { + +inline const Child<> coherentPhotonScattering("coherentPhotonScattering"); +inline const Child<> formFactor("formFactor"); +inline const Child<> imaginaryAnomalousFactor("imaginaryAnomalousFactor"); +inline const Child<> incoherentPhotonScattering("incoherentPhotonScattering"); +inline const Child<> realAnomalousFactor("realAnomalousFactor"); +inline const Child<> scatteringFactor("scatteringFactor"); + +} // namespace child +using namespace child; +} // namespace atomic + + +// ----------------------------------------------------------------------------- +// common::child:: +// ----------------------------------------------------------------------------- + +namespace common { +namespace child { + +inline const Child<> Q("Q"); +inline const Child<> energy("energy"); +inline const Child<> externalFile("externalFile"); +inline const Child<> externalFiles("externalFiles"); +inline const Child<> mass("mass"); +inline const Child<> probability("probability"); +inline const Child<> product("product"); +inline const Child<> products("products"); +inline const Child<> temperature("temperature"); + +} // namespace child +using namespace child; +} // namespace common + + +// ----------------------------------------------------------------------------- +// containers::child:: +// ----------------------------------------------------------------------------- + +namespace containers { +namespace child { + +inline const Child<> Double("double"); +inline const Child<> Legendre("Legendre"); +inline const Child<> XYs1d("XYs1d"); +inline const Child<> XYs2d("XYs2d"); +inline const Child<> XYs3d("XYs3d"); +inline const Child<> Ys1d("Ys1d"); +inline const Child<> array("array"); +inline const Child<> axes("axes"); +inline const Child<> axis("axis"); +inline const Child<> cdf_in_xs_pdf_cdf1d("cdf"); +inline const Child<> column("column"); +inline const Child<> columnHeaders("columnHeaders"); +inline const Child<> confidenceIntervals("confidenceIntervals"); +inline const Child<> constant1d("constant1d"); +inline const Child<> covariance("covariance"); +inline const Child<> data("data"); +inline const Child<> fraction("fraction"); +inline const Child<> function1ds("function1ds"); +inline const Child<> function2ds("function2ds"); +inline const Child<> function3ds("function3ds"); +inline const Child<> grid("grid"); +inline const Child<> gridded1d("gridded1d"); +inline const Child<> gridded2d("gridded2d"); +inline const Child<> gridded3d("gridded3d"); +inline const Child<> integer("integer"); +inline const Child<> interval("interval"); +inline const Child<> link("link"); +inline const Child<> listOfCovariances("listOfCovariances"); +inline const Child<> logNormal("logNormal"); +inline const Child<> pdf("pdf"); +inline const Child<> pdf_in_xs_pdf_cdf1d("pdf"); +inline const Child<> polynomial1d("polynomial1d"); +inline const Child<> regions1d("regions1d"); +inline const Child<> regions2d("regions2d"); +inline const Child<> regions3d("regions3d"); +inline const Child<> standard("standard"); +inline const Child<> string("string"); +inline const Child<> table("table"); +inline const Child<> uncertainty("uncertainty"); +inline const Child<> values("values"); +inline const Child<> xs_in_xs_pdf_cdf1d("xs"); +inline const Child<> xs_pdf_cdf1d("xs_pdf_cdf1d"); + +} // namespace child +using namespace child; +} // namespace containers + + +// ----------------------------------------------------------------------------- +// covariance::child:: +// ----------------------------------------------------------------------------- + +namespace covariance { +namespace child { + +inline const Child<> averageParameterCovariance("averageParameterCovariance"); +inline const Child<> columnData("columnData"); +inline const Child<> columnSensitivity("columnSensitivity"); +inline const Child<> covariance("covariance"); +inline const Child<> covarianceMatrix("covarianceMatrix"); +inline const Child<> covarianceSection("covarianceSection"); +inline const Child<> covarianceSections("covarianceSections"); +inline const Child<> covarianceSuite("covarianceSuite"); +inline const Child<> mixed("mixed"); +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<> rowData("rowData"); +inline const Child<> rowSensitivity("rowSensitivity"); +inline const Child<> sandwichProduct("sandwichProduct"); +inline const Child<> shortRangeSelfScalingVariance("shortRangeSelfScalingVariance"); +inline const Child<> slice("slice"); +inline const Child<> slices("slices"); +inline const Child<> sum("sum"); +inline const Child<> summand("summand"); + +} // namespace child +using namespace child; +} // namespace covariance + + +// ----------------------------------------------------------------------------- +// cpTransport::child:: +// ----------------------------------------------------------------------------- + +namespace cpTransport { +namespace child { + +inline const Child<> CoulombPlusNuclearElastic("CoulombPlusNuclearElastic"); +inline const Child<> RutherfordScattering("RutherfordScattering"); +inline const Child<> imaginaryInterferenceTerm("imaginaryInterferenceTerm"); +inline const Child<> nuclearAmplitudeExpansion("nuclearAmplitudeExpansion"); +inline const Child<> nuclearPlusInterference("nuclearPlusInterference"); +inline const Child<> nuclearTerm("nuclearTerm"); +inline const Child<> realInterferenceTerm("realInterferenceTerm"); + +} // namespace child +using namespace child; +} // namespace cpTransport + + +// ----------------------------------------------------------------------------- +// documentation::child:: +// ----------------------------------------------------------------------------- + +namespace documentation { +namespace child { + +inline const Child<> abstract("abstract"); +inline const Child<> acknowledgement("acknowledgement"); +inline const Child<> acknowledgements("acknowledgements"); +inline const Child<> affiliation("affiliation"); +inline const Child<> affiliations("affiliations"); +inline const Child<> author("author"); +inline const Child<> authors("authors"); +inline const Child<> bibitem("bibitem"); +inline const Child<> bibliography("bibliography"); +inline const Child<> body("body"); +inline const Child<> codeRepo("codeRepo"); +inline const Child<> collaboration("collaboration"); +inline const Child<> collaborations("collaborations"); +inline const Child<> computerCode("computerCode"); +inline const Child<> computerCodes("computerCodes"); +inline const Child<> contributor("contributor"); +inline const Child<> contributors("contributors"); +inline const Child<> copyright("copyright"); +inline const Child<> correctionScript("correctionScript"); +inline const Child<> covarianceScript("covarianceScript"); +inline const Child<> date("date"); +inline const Child<> dates("dates"); +inline const Child<> documentation("documentation"); +inline const Child<> endfCompatible("endfCompatible"); +inline const Child<> executionArguments("executionArguments"); +inline const Child<> exforDataSet("exforDataSet"); +inline const Child<> exforDataSets("exforDataSets"); +inline const Child<> experimentalDataSets("experimentalDataSets"); +inline const Child<> inputDeck("inputDeck"); +inline const Child<> inputDecks("inputDecks"); +inline const Child<> keyword("keyword"); +inline const Child<> keywords("keywords"); +inline const Child<> note("note"); +inline const Child<> outputDeck("outputDeck"); +inline const Child<> outputDecks("outputDecks"); +inline const Child<> relatedItem("relatedItem"); +inline const Child<> relatedItems("relatedItems"); +inline const Child<> title("title"); +inline const Child<> version("version"); + +} // namespace child +using namespace child; +} // namespace documentation + + +// ----------------------------------------------------------------------------- +// extra::child:: +// ----------------------------------------------------------------------------- + +namespace extra { +namespace child { + +inline const Child<> Double("double"); +inline const Child<> uncertainty("uncertainty"); + +} // namespace child +using namespace child; +} // namespace extra + + +// ----------------------------------------------------------------------------- +// fissionFragmentData::child:: +// ----------------------------------------------------------------------------- + +namespace fissionFragmentData { +namespace child { + +inline const Child<> delayedNeutron("delayedNeutron"); +inline const Child<> delayedNeutrons("delayedNeutrons"); +inline const Child<> fissionFragmentData("fissionFragmentData"); +inline const Child<> rate("rate"); + +} // namespace child +using namespace child; +} // namespace fissionFragmentData + + +// ----------------------------------------------------------------------------- +// fissionTransport::child:: +// ----------------------------------------------------------------------------- + +namespace fissionTransport { +namespace child { + +inline const Child<> EFH("EFH"); +inline const Child<> EFL("EFL"); +inline const Child<> MadlandNix("MadlandNix"); +inline const Child<> T_M("T_M"); +inline const Child<> Watt("Watt"); +inline const Child<> a("a"); +inline const Child<> b("b"); +inline const Child<> delayedBetaEnergy("delayedBetaEnergy"); +inline const Child<> delayedGammaEnergy("delayedGammaEnergy"); +inline const Child<> delayedNeutronKE("delayedNeutronKE"); +inline const Child<> fissionComponent("fissionComponent"); +inline const Child<> fissionComponents("fissionComponents"); +inline const Child<> fissionEnergyReleased("fissionEnergyReleased"); +inline const Child<> neutrinoEnergy("neutrinoEnergy"); +inline const Child<> nonNeutrinoEnergy("nonNeutrinoEnergy"); +inline const Child<> promptGammaEnergy("promptGammaEnergy"); +inline const Child<> promptNeutronKE("promptNeutronKE"); +inline const Child<> promptProductKE("promptProductKE"); +inline const Child<> simpleMaxwellianFission("simpleMaxwellianFission"); +inline const Child<> totalEnergy("totalEnergy"); + +} // namespace child +using namespace child; +} // namespace fissionTransport + + +// ----------------------------------------------------------------------------- +// fpy::child:: +// ----------------------------------------------------------------------------- + +namespace fpy { +namespace child { + +inline const Child<> elapsedTime("elapsedTime"); +inline const Child<> elapsedTimes("elapsedTimes"); +inline const Child<> energy("energy"); +inline const Child<> incidentEnergies("incidentEnergies"); +inline const Child<> incidentEnergy("incidentEnergy"); +inline const Child<> nuclides("nuclides"); +inline const Child<> productYield("productYield"); +inline const Child<> productYields("productYields"); +inline const Child<> time("time"); +inline const Child<> yields("yields"); + +} // namespace child +using namespace child; +} // namespace fpy + + +// ----------------------------------------------------------------------------- +// map::child:: +// ----------------------------------------------------------------------------- + +namespace map { +namespace child { + +inline const Child<> TNSL("TNSL"); +inline const Child<> import("import"); +inline const Child<> map("map"); +inline const Child<> protare("protare"); + +} // namespace child +using namespace child; +} // namespace map + + +// ----------------------------------------------------------------------------- +// pops::child:: +// ----------------------------------------------------------------------------- + +namespace pops { +namespace child { + +inline const Child<> PoPs_database("PoPs"); +inline const Child<> Q("Q"); +inline const Child<> alias("alias"); +inline const Child<> aliases("aliases"); +inline const Child<> atomic("atomic"); +inline const Child<> averageEnergies("averageEnergies"); +inline const Child<> averageEnergy("averageEnergy"); +inline const Child<> baryon("baryon"); +inline const Child<> baryons("baryons"); +inline const Child<> bindingEnergy("bindingEnergy"); +inline const Child<> charge("charge"); +inline const Child<> chemicalElement("chemicalElement"); +inline const Child<> chemicalElements("chemicalElements"); +inline const Child<> confidenceIntervals("confidenceIntervals"); +inline const Child<> configuration("configuration"); +inline const Child<> configurations("configurations"); +inline const Child<> continuum("continuum"); +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<> discrete("discrete"); +inline const Child<> discreteEnergy("discreteEnergy"); +inline const Child<> energy("energy"); +inline const Child<> gaugeBoson("gaugeBoson"); +inline const Child<> gaugeBosons("gaugeBosons"); +inline const Child<> halflife("halflife"); +inline const Child<> intensity("intensity"); +inline const Child<> internalConversionCoefficients("internalConversionCoefficients"); +inline const Child<> internalPairFormationCoefficient("internalPairFormationCoefficient"); +inline const Child<> interval("interval"); +inline const Child<> isotope("isotope"); +inline const Child<> isotopes("isotopes"); +inline const Child<> lepton("lepton"); +inline const Child<> leptons("leptons"); +inline const Child<> logNormal("logNormal"); +inline const Child<> mass("mass"); +inline const Child<> metaStable("metaStable"); +inline const Child<> nucleus("nucleus"); +inline const Child<> nuclide("nuclide"); +inline const Child<> nuclides("nuclides"); +inline const Child<> parity("parity"); +inline const Child<> pdf("pdf"); +inline const Child<> photonEmissionProbabilities("photonEmissionProbabilities"); +inline const Child<> positronEmissionIntensity("positronEmissionIntensity"); +inline const Child<> probability("probability"); +inline const Child<> product("product"); +inline const Child<> products("products"); +inline const Child<> shell("shell"); +inline const Child<> spectra("spectra"); +inline const Child<> spectrum("spectrum"); +inline const Child<> spin("spin"); +inline const Child<> standard("standard"); +inline const Child<> uncertainty("uncertainty"); +inline const Child<> unorthodox("unorthodox"); +inline const Child<> unorthodoxes("unorthodoxes"); + +} // namespace child +using namespace child; +} // namespace pops + + +// ----------------------------------------------------------------------------- +// processed::child:: +// ----------------------------------------------------------------------------- + +namespace processed { +namespace child { + +inline const Child<> angularEnergyMC("angularEnergyMC"); +inline const Child<> availableEnergy("availableEnergy"); +inline const Child<> availableMomentum("availableMomentum"); +inline const Child<> averageProductEnergy("averageProductEnergy"); +inline const Child<> averageProductMomentum("averageProductMomentum"); +inline const Child<> energyAngularMC("energyAngularMC"); +inline const Child<> multiGroup3d("multiGroup3d"); + +} // namespace child +using namespace child; +} // namespace processed + + +// ----------------------------------------------------------------------------- +// resonances::child:: +// ----------------------------------------------------------------------------- + +namespace resonances { +namespace child { + +inline const Child<> BreitWigner("BreitWigner"); +inline const Child<> J("J"); +inline const Child<> Js("Js"); +inline const Child<> L("L"); +inline const Child<> Ls("Ls"); +inline const Child<> RMatrix("RMatrix"); +inline const Child<> channel("channel"); +inline const Child<> channels("channels"); +inline const Child<> energyInterval("energyInterval"); +inline const Child<> energyIntervals("energyIntervals"); +inline const Child<> externalRMatrix("externalRMatrix"); +inline const Child<> hardSphereRadius("hardSphereRadius"); +inline const Child<> levelSpacing("levelSpacing"); +inline const Child<> resolved("resolved"); +inline const Child<> resonanceParameters("resonanceParameters"); +inline const Child<> resonanceReaction("resonanceReaction"); +inline const Child<> resonanceReactions("resonanceReactions"); +inline const Child<> resonances("resonances"); +inline const Child<> scatteringRadius("scatteringRadius"); +inline const Child<> spinGroup("spinGroup"); +inline const Child<> spinGroups("spinGroups"); +inline const Child<> tabulatedWidths("tabulatedWidths"); +inline const Child<> unresolved("unresolved"); +inline const Child<> width("width"); +inline const Child<> widths("widths"); + +} // namespace child +using namespace child; +} // namespace resonances + + +// ----------------------------------------------------------------------------- +// styles::child:: +// ----------------------------------------------------------------------------- + +namespace styles { +namespace child { + +inline const Child<> Bondarenko("Bondarenko"); +inline const Child<> CoulombPlusNuclearElasticMuCutoff("CoulombPlusNuclearElasticMuCutoff"); +inline const Child<> MonteCarlo_cdf("MonteCarlo_cdf"); +inline const Child<> SnElasticUpScatter("SnElasticUpScatter"); +inline const Child<> URR_probabilityTables("URR_probabilityTables"); +inline const Child<> angularDistributionReconstructed("angularDistributionReconstructed"); +inline const Child<> averageProductData("averageProductData"); +inline const Child<> crossSectionReconstructed("crossSectionReconstructed"); +inline const Child<> equalProbableBins("equalProbableBins"); +inline const Child<> evaluated("evaluated"); +inline const Child<> flux("flux"); +inline const Child<> griddedCrossSection("griddedCrossSection"); +inline const Child<> heated("heated"); +inline const Child<> heatedMultiGroup("heatedMultiGroup"); +inline const Child<> inverseSpeed("inverseSpeed"); +inline const Child<> multiBand("multiBand"); +inline const Child<> multiGroup("multiGroup"); +inline const Child<> projectileEnergyDomain("projectileEnergyDomain"); +inline const Child<> realization("realization"); +inline const Child<> sigmaZeros("sigmaZeros"); +inline const Child<> styles("styles"); +inline const Child<> temperature("temperature"); +inline const Child<> transportable("transportable"); +inline const Child<> transportables("transportables"); + +} // namespace child +using namespace child; +} // namespace styles + + +// ----------------------------------------------------------------------------- +// transport::child:: +// ----------------------------------------------------------------------------- + +namespace transport { +namespace child { + +inline const Child<> KalbachMann("KalbachMann"); +inline const Child<> NBodyPhaseSpace("NBodyPhaseSpace"); +inline const Child<> U("U"); +inline const Child<> URR_probabilityTables1d("URR_probabilityTables1d"); +inline const Child<> a("a"); +inline const Child<> add("add"); +inline const Child<> angularEnergy("angularEnergy"); +inline const Child<> angularTwoBody("angularTwoBody"); +inline const Child<> angular_uncorrelated("angular"); +inline const Child<> background("background"); +inline const Child<> branching1d("branching1d"); +inline const Child<> branching3d("branching3d"); +inline const Child<> coherentPhoton("coherentPhoton"); +inline const Child<> crossSection("crossSection"); +inline const Child<> crossSectionSum("crossSectionSum"); +inline const Child<> crossSectionSums("crossSectionSums"); +inline const Child<> discreteGamma("discreteGamma"); +inline const Child<> distribution("distribution"); +inline const Child<> doubleDifferentialCrossSection("doubleDifferentialCrossSection"); +inline const Child<> energyAngular("energyAngular"); +inline const Child<> energy_uncorrelated("energy"); +inline const Child<> evaporation("evaporation"); +inline const Child<> f("f"); +inline const Child<> fastRegion("fastRegion"); +inline const Child<> forward("forward"); +inline const Child<> g("g"); +inline const Child<> generalEvaporation("generalEvaporation"); +inline const Child<> incoherentPhoton("incoherentPhoton"); +inline const Child<> incompleteReactions("incompleteReactions"); +inline const Child<> isotropic2d("isotropic2d"); +inline const Child<> multiGroup3d("scatteringMatrix"); +inline const Child<> multiplicity("multiplicity"); +inline const Child<> multiplicitySum("multiplicitySum"); +inline const Child<> multiplicitySums("multiplicitySums"); +inline const Child<> orphanProduct("orphanProduct"); +inline const Child<> orphanProducts("orphanProducts"); +inline const Child<> outputChannel("outputChannel"); +inline const Child<> photonEmissionProbabilities("photonEmissionProbabilities"); +inline const Child<> primaryGamma("primaryGamma"); +inline const Child<> production("production"); +inline const Child<> productions("productions"); +inline const Child<> r("r"); +inline const Child<> reaction("reaction"); +inline const Child<> reactionSuite("reactionSuite"); +inline const Child<> reactions("reactions"); +inline const Child<> recoil("recoil"); +inline const Child<> reference("reference"); +inline const Child<> resolvedRegion("resolvedRegion"); +inline const Child<> resonancesLink("resonances"); +inline const Child<> resonancesWithBackground("resonancesWithBackground"); +inline const Child<> summands("summands"); +inline const Child<> sums("sums"); +inline const Child<> theta("theta"); +inline const Child<> uncorrelated("uncorrelated"); +inline const Child<> unresolvedRegion("unresolvedRegion"); +inline const Child<> unspecified("unspecified"); +inline const Child<> weighted("weighted"); +inline const Child<> weightedFunctionals("weightedFunctionals"); + +} // namespace child +using namespace child; +} // namespace transport + + +// ----------------------------------------------------------------------------- +// tsl::child:: +// ----------------------------------------------------------------------------- + +namespace tsl { +namespace child { + +inline const Child<> BraggEdge("BraggEdge"); +inline const Child<> BraggEdges("BraggEdges"); +inline const Child<> BraggEnergy("BraggEnergy"); +inline const Child<> DebyeWallerIntegral("DebyeWallerIntegral"); +inline const Child<> GaussianApproximation("GaussianApproximation"); +inline const Child<> SCTApproximation("SCTApproximation"); +inline const Child<> S_table("S_table"); +inline const Child<> T_effective("T_effective"); +inline const Child<> boundAtomCrossSection("boundAtomCrossSection"); +inline const Child<> coherentAtomCrossSection("coherentAtomCrossSection"); +inline const Child<> distinctScatteringKernel("distinctScatteringKernel"); +inline const Child<> e_critical("e_critical"); +inline const Child<> e_max("e_max"); +inline const Child<> freeGasApproximation("freeGasApproximation"); +inline const Child<> mass("mass"); +inline const Child<> phononSpectrum("phononSpectrum"); +inline const Child<> scatteringAtom("scatteringAtom"); +inline const Child<> scatteringAtoms("scatteringAtoms"); +inline const Child<> selfScatteringKernel("selfScatteringKernel"); +inline const Child<> structureFactor("structureFactor"); +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"); + +} // namespace child +using namespace child; +} // namespace tsl + + +// ----------------------------------------------------------------------------- +// For convenience: using directives +// ----------------------------------------------------------------------------- + +namespace key { + using namespace meta; + using namespace appData::child; + using namespace atomic::child; + using namespace common::child; + using namespace containers::child; + using namespace covariance::child; + using namespace cpTransport::child; + using namespace documentation::child; + using namespace extra::child; + using namespace fissionFragmentData::child; + using namespace fissionTransport::child; + using namespace fpy::child; + using namespace map::child; + using namespace pops::child; + using namespace processed::child; + using namespace resonances::child; + using namespace styles::child; + using namespace transport::child; + using namespace tsl::child; +} // namespace key + +using namespace key; +using namespace appData; +using namespace atomic; +using namespace common; +using namespace containers; +using namespace covariance; +using namespace cpTransport; +using namespace documentation; +using namespace extra; +using namespace fissionFragmentData; +using namespace fissionTransport; +using namespace fpy; +using namespace map; +using namespace pops; +using namespace processed; +using namespace resonances; +using namespace styles; +using namespace transport; +using namespace tsl; + + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/map/Import.hpp b/standards/gnds-2.0/test/src/test/v2.0/map/Import.hpp new file mode 100644 index 000000000..e3186da8a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/map/Import.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_MAP_IMPORT +#define TEST_V2_0_MAP_IMPORT + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace map { + +// ----------------------------------------------------------------------------- +// map:: +// class Import +// ----------------------------------------------------------------------------- + +class Import : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "map"; } + static auto CLASS() { return "Import"; } + static auto NODENAME() { return "import"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("path") | + std::string{} + / 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", + "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", + "path", + "checksum", + "algorithm" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + path{this}; + Field + checksum{this}; + Field> + algorithm{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->path, \ + this->checksum, \ + this->algorithm \ + ) + + // default + Import() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Import( + const wrapper + &path, + const wrapper + &checksum = {}, + const wrapper> + &algorithm = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + path(this,path), + checksum(this,checksum), + algorithm(this,algorithm) + { + Component::finish(); + } + + // from node + explicit Import(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Import(const Import &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + path(this,other.path), + checksum(this,other.checksum), + algorithm(this,other.algorithm) + { + Component::finish(other); + } + + // move + Import(Import &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + path(this,std::move(other.path)), + checksum(this,std::move(other.checksum)), + algorithm(this,std::move(other.algorithm)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Import &operator=(const Import &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + path = other.path; + checksum = other.checksum; + algorithm = other.algorithm; + } + return *this; + } + + // move + Import &operator=(Import &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + path = std::move(other.path); + checksum = std::move(other.checksum); + algorithm = std::move(other.algorithm); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/map/Import/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Import + +} // namespace map +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/map/Import/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/map/Import/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/map/Import/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/map/Map.hpp b/standards/gnds-2.0/test/src/test/v2.0/map/Map.hpp new file mode 100644 index 000000000..8fd5ba138 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/map/Map.hpp @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_MAP_MAP +#define TEST_V2_0_MAP_MAP + +#include "test/v2.0/map/Import.hpp" +#include "test/v2.0/map/Protare.hpp" +#include "test/v2.0/map/TNSL.hpp" + +namespace test { +namespace v2_0 { +namespace map { + +// ----------------------------------------------------------------------------- +// map:: +// class Map +// ----------------------------------------------------------------------------- + +class Map : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "map"; } + static auto CLASS() { return "Map"; } + static auto NODENAME() { return "map"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("library") | + XMLName{} + / Meta<>("format") | + std::string{} + / Meta<>("checksum") | + enums::HashAlgorithm{} + / Meta<>("algorithm") | + + // children + ++Child> + ("import") | + ++Child> + ("protare") | + ++Child> + ("TNSL") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "library", + "format", + "checksum", + "algorithm", + "import", + "protare", + "TNSL" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "library", + "format", + "checksum", + "algorithm", + "import", + "protare", + "tnsl" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + library{this}; + Field + format{this}; + Field + checksum{this}; + Field + algorithm{this}; + + // children + Field>> + import{this}; + Field>> + protare{this}; + Field>> + TNSL{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->library, \ + this->format, \ + this->checksum, \ + this->algorithm, \ + this->import, \ + this->protare, \ + this->TNSL \ + ) + + // default + Map() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Map( + const wrapper + &library, + const wrapper + &format = {}, + const wrapper + &checksum = {}, + const wrapper + &algorithm = {}, + const wrapper>> + &import = {}, + const wrapper>> + &protare = {}, + const wrapper>> + &TNSL = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + library(this,library), + format(this,format), + checksum(this,checksum), + algorithm(this,algorithm), + import(this,import), + protare(this,protare), + TNSL(this,TNSL) + { + Component::finish(); + } + + // from node + explicit Map(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Map(const Map &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + library(this,other.library), + format(this,other.format), + checksum(this,other.checksum), + algorithm(this,other.algorithm), + import(this,other.import), + protare(this,other.protare), + TNSL(this,other.TNSL) + { + Component::finish(other); + } + + // move + Map(Map &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + library(this,std::move(other.library)), + format(this,std::move(other.format)), + checksum(this,std::move(other.checksum)), + algorithm(this,std::move(other.algorithm)), + import(this,std::move(other.import)), + protare(this,std::move(other.protare)), + TNSL(this,std::move(other.TNSL)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Map &operator=(const Map &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + library = other.library; + format = other.format; + checksum = other.checksum; + algorithm = other.algorithm; + import = other.import; + protare = other.protare; + TNSL = other.TNSL; + } + return *this; + } + + // move + Map &operator=(Map &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + library = std::move(other.library); + format = std::move(other.format); + checksum = std::move(other.checksum); + algorithm = std::move(other.algorithm); + import = std::move(other.import); + protare = std::move(other.protare); + TNSL = std::move(other.TNSL); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/map/Map/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Map + +} // namespace map +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/map/Map/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/map/Map/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/map/Map/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/map/Protare.hpp b/standards/gnds-2.0/test/src/test/v2.0/map/Protare.hpp new file mode 100644 index 000000000..730cb27d6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/map/Protare.hpp @@ -0,0 +1,263 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_MAP_PROTARE +#define TEST_V2_0_MAP_PROTARE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace map { + +// ----------------------------------------------------------------------------- +// map:: +// class Protare +// ----------------------------------------------------------------------------- + +class Protare : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "map"; } + static auto CLASS() { return "Protare"; } + static auto NODENAME() { return "protare"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("projectile") | + XMLName{} + / Meta<>("target") | + XMLName{} + / Meta<>("evaluation") | + XMLName{} + / Meta<>("path") | + XMLName{} + / Meta<>("interaction") | + std::string{} + / 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", + "projectile", + "target", + "evaluation", + "path", + "interaction", + "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", + "projectile", + "target", + "evaluation", + "path", + "interaction", + "checksum", + "algorithm" + }; + 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 + path{this}; + Field + interaction{this}; + Field + checksum{this}; + Field> + algorithm{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->projectile, \ + this->target, \ + this->evaluation, \ + this->path, \ + this->interaction, \ + this->checksum, \ + this->algorithm \ + ) + + // default + Protare() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Protare( + const wrapper + &projectile, + const wrapper + &target = {}, + const wrapper + &evaluation = {}, + const wrapper + &path = {}, + const wrapper + &interaction = {}, + const wrapper + &checksum = {}, + const wrapper> + &algorithm = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + projectile(this,projectile), + target(this,target), + evaluation(this,evaluation), + path(this,path), + interaction(this,interaction), + checksum(this,checksum), + algorithm(this,algorithm) + { + Component::finish(); + } + + // from node + explicit Protare(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Protare(const Protare &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + projectile(this,other.projectile), + target(this,other.target), + evaluation(this,other.evaluation), + path(this,other.path), + interaction(this,other.interaction), + checksum(this,other.checksum), + algorithm(this,other.algorithm) + { + Component::finish(other); + } + + // move + Protare(Protare &&other) : + 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)), + path(this,std::move(other.path)), + interaction(this,std::move(other.interaction)), + checksum(this,std::move(other.checksum)), + algorithm(this,std::move(other.algorithm)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Protare &operator=(const Protare &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + projectile = other.projectile; + target = other.target; + evaluation = other.evaluation; + path = other.path; + interaction = other.interaction; + checksum = other.checksum; + algorithm = other.algorithm; + } + return *this; + } + + // move + Protare &operator=(Protare &&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); + path = std::move(other.path); + interaction = std::move(other.interaction); + checksum = std::move(other.checksum); + algorithm = std::move(other.algorithm); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/map/Protare/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Protare + +} // namespace map +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/map/Protare/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/map/Protare/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/map/Protare/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/map/TNSL.hpp b/standards/gnds-2.0/test/src/test/v2.0/map/TNSL.hpp new file mode 100644 index 000000000..985001e73 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/map/TNSL.hpp @@ -0,0 +1,291 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_MAP_TNSL +#define TEST_V2_0_MAP_TNSL + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace map { + +// ----------------------------------------------------------------------------- +// map:: +// class TNSL +// ----------------------------------------------------------------------------- + +class TNSL : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "map"; } + static auto CLASS() { return "TNSL"; } + static auto NODENAME() { return "TNSL"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("projectile") | + XMLName{} + / Meta<>("target") | + XMLName{} + / Meta<>("evaluation") | + XMLName{} + / Meta<>("path") | + std::optional{} + / Meta<>("interaction") | + std::string{} + / Meta<>("checksum") | + std::optional{} + / Meta<>("algorithm") | + XMLName{} + / Meta<>("standardTarget") | + XMLName{} + / Meta<>("standardEvaluation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "path", + "interaction", + "checksum", + "algorithm", + "standardTarget", + "standardEvaluation" + }; + 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", + "path", + "interaction", + "checksum", + "algorithm", + "standard_target", + "standard_evaluation" + }; + 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 + path{this}; + Field> + interaction{this}; + Field + checksum{this}; + Field> + algorithm{this}; + Field + standardTarget{this}; + Field + standardEvaluation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->projectile, \ + this->target, \ + this->evaluation, \ + this->path, \ + this->interaction, \ + this->checksum, \ + this->algorithm, \ + this->standardTarget, \ + this->standardEvaluation \ + ) + + // default + TNSL() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit TNSL( + const wrapper + &projectile, + const wrapper + &target = {}, + const wrapper + &evaluation = {}, + const wrapper + &path = {}, + const wrapper> + &interaction = {}, + const wrapper + &checksum = {}, + const wrapper> + &algorithm = {}, + const wrapper + &standardTarget = {}, + const wrapper + &standardEvaluation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + projectile(this,projectile), + target(this,target), + evaluation(this,evaluation), + path(this,path), + interaction(this,interaction), + checksum(this,checksum), + algorithm(this,algorithm), + standardTarget(this,standardTarget), + standardEvaluation(this,standardEvaluation) + { + Component::finish(); + } + + // from node + explicit TNSL(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + TNSL(const TNSL &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + projectile(this,other.projectile), + target(this,other.target), + evaluation(this,other.evaluation), + path(this,other.path), + interaction(this,other.interaction), + checksum(this,other.checksum), + algorithm(this,other.algorithm), + standardTarget(this,other.standardTarget), + standardEvaluation(this,other.standardEvaluation) + { + Component::finish(other); + } + + // move + TNSL(TNSL &&other) : + 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)), + path(this,std::move(other.path)), + interaction(this,std::move(other.interaction)), + checksum(this,std::move(other.checksum)), + algorithm(this,std::move(other.algorithm)), + standardTarget(this,std::move(other.standardTarget)), + standardEvaluation(this,std::move(other.standardEvaluation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + TNSL &operator=(const TNSL &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + projectile = other.projectile; + target = other.target; + evaluation = other.evaluation; + path = other.path; + interaction = other.interaction; + checksum = other.checksum; + algorithm = other.algorithm; + standardTarget = other.standardTarget; + standardEvaluation = other.standardEvaluation; + } + return *this; + } + + // move + TNSL &operator=(TNSL &&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); + path = std::move(other.path); + interaction = std::move(other.interaction); + checksum = std::move(other.checksum); + algorithm = std::move(other.algorithm); + standardTarget = std::move(other.standardTarget); + standardEvaluation = std::move(other.standardEvaluation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/map/TNSL/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class TNSL + +} // namespace map +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/map/TNSL/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/map/TNSL/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/map/TNSL/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Alias.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Alias.hpp new file mode 100644 index 000000000..eb4339bd1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Alias.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_ALIAS +#define TEST_V2_0_POPS_ALIAS + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("id") | + XMLName{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->pid \ + ) + + // default + Alias() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Alias( + const wrapper + &id, + const wrapper + &pid = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + pid(this,pid) + { + Component::finish(); + } + + // from node + explicit Alias(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Alias(const Alias &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + pid(this,other.pid) + { + Component::finish(other); + } + + // move + Alias(Alias &&other) : + 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 "test/v2.0/pops/Alias/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Alias + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Alias/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Alias/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Alias/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Aliases.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Aliases.hpp new file mode 100644 index 000000000..72ed5143f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Aliases.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_ALIASES +#define TEST_V2_0_POPS_ALIASES + +#include "test/v2.0/pops/Alias.hpp" +#include "test/v2.0/pops/MetaStable.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->alias, \ + this->metaStable \ + ) + + // default + Aliases() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Aliases( + const wrapper>> + &alias, + const wrapper>> + &metaStable = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + alias(this,alias), + metaStable(this,metaStable) + { + Component::finish(); + } + + // from node + explicit Aliases(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Aliases(const Aliases &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + alias(this,other.alias), + metaStable(this,other.metaStable) + { + Component::finish(other); + } + + // move + Aliases(Aliases &&other) : + 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 "test/v2.0/pops/Aliases/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Aliases + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Aliases/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Aliases/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Aliases/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Atomic.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Atomic.hpp new file mode 100644 index 000000000..62c0b7f45 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Atomic.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_ATOMIC +#define TEST_V2_0_POPS_ATOMIC + +#include "test/v2.0/pops/Configurations.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->configurations \ + ) + + // default + Atomic() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Atomic( + const wrapper> + &configurations + ) : + GNDSTK_COMPONENT(BlockData{}), + configurations(this,configurations) + { + Component::finish(); + } + + // from node + explicit Atomic(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Atomic(const Atomic &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + configurations(this,other.configurations) + { + Component::finish(other); + } + + // move + Atomic(Atomic &&other) : + 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 "test/v2.0/pops/Atomic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Atomic + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Atomic/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Atomic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Atomic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergies.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergies.hpp new file mode 100644 index 000000000..a2ab88e9f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergies.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_AVERAGEENERGIES +#define TEST_V2_0_POPS_AVERAGEENERGIES + +#include "test/v2.0/pops/AverageEnergy.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->averageEnergy \ + ) + + // default + AverageEnergies() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageEnergies( + const wrapper> + &averageEnergy + ) : + GNDSTK_COMPONENT(BlockData{}), + averageEnergy(this,averageEnergy) + { + Component::finish(); + } + + // from node + explicit AverageEnergies(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageEnergies(const AverageEnergies &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + averageEnergy(this,other.averageEnergy) + { + Component::finish(other); + } + + // move + AverageEnergies(AverageEnergies &&other) : + 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 "test/v2.0/pops/AverageEnergies/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageEnergies + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergies/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergies/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergies/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergy.hpp new file mode 100644 index 000000000..636bd44d3 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergy.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_AVERAGEENERGY +#define TEST_V2_0_POPS_AVERAGEENERGY + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("label") | + Float64{} + / Meta<>("value") | + XMLName{} + / Meta<>("unit") | + + // children + --Child> + ("documentation") | + --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", + "documentation", + "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", + "documentation", + "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> + documentation{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit, \ + this->documentation, \ + this->uncertainty \ + ) + + // default + AverageEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageEnergy( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &unit = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit), + documentation(this,documentation), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit AverageEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageEnergy(const AverageEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + AverageEnergy(AverageEnergy &&other) : + 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)), + documentation(this,std::move(other.documentation)), + 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; + documentation = other.documentation; + 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); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/AverageEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageEnergy + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/AverageEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Baryon.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Baryon.hpp new file mode 100644 index 000000000..05060e44b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Baryon.hpp @@ -0,0 +1,272 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_BARYON +#define TEST_V2_0_POPS_BARYON + +#include "test/v2.0/pops/Charge.hpp" +#include "test/v2.0/pops/Halflife.hpp" +#include "test/v2.0/pops/Mass.hpp" +#include "test/v2.0/pops/Spin.hpp" +#include "test/v2.0/pops/Parity.hpp" +#include "test/v2.0/pops/DecayData.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("id") | + + // children + --Child> + ("charge") | + --Child> + ("halflife") | + --Child> + ("mass") | + --Child> + ("spin") | + --Child> + ("parity") | + --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", + "charge", + "halflife", + "mass", + "spin", + "parity", + "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", + "charge", + "halflife", + "mass", + "spin", + "parity", + "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> + charge{this}; + Field> + halflife{this}; + Field> + mass{this}; + Field> + spin{this}; + Field> + parity{this}; + Field> + decayData{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->charge, \ + this->halflife, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->decayData \ + ) + + // default + Baryon() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Baryon( + const wrapper + &id, + const wrapper> + &charge = {}, + const wrapper> + &halflife = {}, + const wrapper> + &mass = {}, + const wrapper> + &spin = {}, + const wrapper> + &parity = {}, + const wrapper> + &decayData = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + charge(this,charge), + halflife(this,halflife), + mass(this,mass), + spin(this,spin), + parity(this,parity), + decayData(this,decayData) + { + Component::finish(); + } + + // from node + explicit Baryon(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Baryon(const Baryon &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + charge(this,other.charge), + halflife(this,other.halflife), + mass(this,other.mass), + spin(this,other.spin), + parity(this,other.parity), + decayData(this,other.decayData) + { + Component::finish(other); + } + + // move + Baryon(Baryon &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + charge(this,std::move(other.charge)), + halflife(this,std::move(other.halflife)), + mass(this,std::move(other.mass)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + 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; + charge = other.charge; + halflife = other.halflife; + mass = other.mass; + spin = other.spin; + parity = other.parity; + 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); + charge = std::move(other.charge); + halflife = std::move(other.halflife); + mass = std::move(other.mass); + spin = std::move(other.spin); + parity = std::move(other.parity); + decayData = std::move(other.decayData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Baryon/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Baryon + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Baryon/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Baryon/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Baryon/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Baryons.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Baryons.hpp new file mode 100644 index 000000000..21318313e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Baryons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_BARYONS +#define TEST_V2_0_POPS_BARYONS + +#include "test/v2.0/pops/Baryon.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->baryon \ + ) + + // default + Baryons() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Baryons( + const wrapper>> + &baryon + ) : + GNDSTK_COMPONENT(BlockData{}), + baryon(this,baryon) + { + Component::finish(); + } + + // from node + explicit Baryons(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Baryons(const Baryons &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + baryon(this,other.baryon) + { + Component::finish(other); + } + + // move + Baryons(Baryons &&other) : + 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 "test/v2.0/pops/Baryons/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Baryons + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Baryons/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Baryons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Baryons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/BindingEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/BindingEnergy.hpp new file mode 100644 index 000000000..f075cf475 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/BindingEnergy.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_BINDINGENERGY +#define TEST_V2_0_POPS_BINDINGENERGY + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + XMLName{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + ++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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + Field>> + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->Double \ + ) + + // default + BindingEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BindingEnergy( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper>> + &Double = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit BindingEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BindingEnergy(const BindingEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + BindingEnergy(BindingEnergy &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + 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; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + Double = other.Double; + } + return *this; + } + + // move + BindingEnergy &operator=(BindingEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/BindingEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BindingEnergy + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/BindingEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/BindingEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/BindingEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Charge.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Charge.hpp new file mode 100644 index 000000000..cf86a4541 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Charge.hpp @@ -0,0 +1,265 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_CHARGE +#define TEST_V2_0_POPS_CHARGE + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" +#include "test/v2.0/containers/Integer.hpp" +#include "test/v2.0/containers/Fraction.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// class Charge +// ----------------------------------------------------------------------------- + +class Charge : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::Integer, + containers::Fraction + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "pops"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + _t{} + / --(Child<>("integer") || 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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "_integerfraction" + }; + 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", + "unit", + "value", + "documentation", + "uncertainty", + "_integerfraction" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + + // children - variant + Field<_t> + _integerfraction{this}; + FieldPart integer{_integerfraction}; + FieldPart fraction{_integerfraction}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->_integerfraction \ + ) + + // default + Charge() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Charge( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper<_t> + &_integerfraction = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + _integerfraction(this,_integerfraction) + { + Component::finish(); + } + + // from node + explicit Charge(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Charge(const Charge &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + _integerfraction(this,other._integerfraction) + { + Component::finish(other); + } + + // move + Charge(Charge &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + _integerfraction(this,std::move(other._integerfraction)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Charge &operator=(const Charge &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + _integerfraction = other._integerfraction; + } + return *this; + } + + // move + Charge &operator=(Charge &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + _integerfraction = std::move(other._integerfraction); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Charge/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Charge + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Charge/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Charge/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Charge/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElement.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElement.hpp new file mode 100644 index 000000000..367e7b7c8 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElement.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_CHEMICALELEMENT +#define TEST_V2_0_POPS_CHEMICALELEMENT + +#include "test/v2.0/pops/Atomic.hpp" +#include "test/v2.0/pops/Isotopes.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("symbol") | + Integer32{} + / Meta<>("Z") | + std::optional{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symbol, \ + this->Z, \ + this->name, \ + this->atomic, \ + this->isotopes \ + ) + + // default + ChemicalElement() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ChemicalElement(const ChemicalElement &other) : + 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) : + 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 "test/v2.0/pops/ChemicalElement/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ChemicalElement + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElement/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElement/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElement/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElements.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElements.hpp new file mode 100644 index 000000000..c55d9c275 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElements.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_CHEMICALELEMENTS +#define TEST_V2_0_POPS_CHEMICALELEMENTS + +#include "test/v2.0/pops/ChemicalElement.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->chemicalElement \ + ) + + // default + ChemicalElements() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ChemicalElements( + const wrapper>> + &chemicalElement + ) : + GNDSTK_COMPONENT(BlockData{}), + chemicalElement(this,chemicalElement) + { + Component::finish(); + } + + // from node + explicit ChemicalElements(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ChemicalElements(const ChemicalElements &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + chemicalElement(this,other.chemicalElement) + { + Component::finish(other); + } + + // move + ChemicalElements(ChemicalElements &&other) : + 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 "test/v2.0/pops/ChemicalElements/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ChemicalElements + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElements/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElements/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/ChemicalElements/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/ConfidenceIntervals.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/ConfidenceIntervals.hpp new file mode 100644 index 000000000..e21d03a2c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/ConfidenceIntervals.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_CONFIDENCEINTERVALS +#define TEST_V2_0_POPS_CONFIDENCEINTERVALS + +#include "test/v2.0/pops/Interval.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// class ConfidenceIntervals +// ----------------------------------------------------------------------------- + +class ConfidenceIntervals : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "pops"; } + static auto CLASS() { return "ConfidenceIntervals"; } + static auto NODENAME() { return "confidenceIntervals"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("interval") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "interval" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "interval" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + interval{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->interval \ + ) + + // default + ConfidenceIntervals() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ConfidenceIntervals( + const wrapper> + &interval + ) : + GNDSTK_COMPONENT(BlockData{}), + interval(this,interval) + { + Component::finish(); + } + + // from node + explicit ConfidenceIntervals(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ConfidenceIntervals(const ConfidenceIntervals &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + interval(this,other.interval) + { + Component::finish(other); + } + + // move + ConfidenceIntervals(ConfidenceIntervals &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + interval(this,std::move(other.interval)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ConfidenceIntervals &operator=(const ConfidenceIntervals &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + interval = other.interval; + } + return *this; + } + + // move + ConfidenceIntervals &operator=(ConfidenceIntervals &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + interval = std::move(other.interval); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/ConfidenceIntervals/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ConfidenceIntervals + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/ConfidenceIntervals/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/ConfidenceIntervals/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/ConfidenceIntervals/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Configuration.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Configuration.hpp new file mode 100644 index 000000000..d50d5df73 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Configuration.hpp @@ -0,0 +1,232 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_CONFIGURATION +#define TEST_V2_0_POPS_CONFIGURATION + +#include "test/v2.0/pops/BindingEnergy.hpp" +#include "test/v2.0/pops/DecayData.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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") | + Float64{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(bindingEnergy(),Double); + GNDSTK_SHORTCUT(bindingEnergy(),documentation); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->subshell, \ + this->electronNumber, \ + this->bindingEnergy, \ + this->decayData \ + ) + + // default + Configuration() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Configuration( + const wrapper + &subshell, + const wrapper + &electronNumber = {}, + const wrapper + &bindingEnergy = {}, + const wrapper> + &decayData = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + subshell(this,subshell), + electronNumber(this,electronNumber), + bindingEnergy(this,bindingEnergy), + decayData(this,decayData) + { + Component::finish(); + } + + // from node + explicit Configuration(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Configuration(const Configuration &other) : + 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) : + 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 "test/v2.0/pops/Configuration/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Configuration + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Configuration/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Configuration/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Configuration/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Configurations.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Configurations.hpp new file mode 100644 index 000000000..8f641c095 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Configurations.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_CONFIGURATIONS +#define TEST_V2_0_POPS_CONFIGURATIONS + +#include "test/v2.0/pops/Configuration.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->configuration \ + ) + + // default + Configurations() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Configurations( + const wrapper> + &configuration + ) : + GNDSTK_COMPONENT(BlockData{}), + configuration(this,configuration) + { + Component::finish(); + } + + // from node + explicit Configurations(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Configurations(const Configurations &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + configuration(this,other.configuration) + { + Component::finish(other); + } + + // move + Configurations(Configurations &&other) : + 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 "test/v2.0/pops/Configurations/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Configurations + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Configurations/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Configurations/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Configurations/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Continuum.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Continuum.hpp new file mode 100644 index 000000000..b884ea538 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Continuum.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_CONTINUUM +#define TEST_V2_0_POPS_CONTINUUM + +#include "test/v2.0/containers/XYs1d.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + Continuum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Continuum( + const wrapper> + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit Continuum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Continuum(const Continuum &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + Continuum(Continuum &&other) : + 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 "test/v2.0/pops/Continuum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Continuum + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Continuum/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Continuum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Continuum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Decay.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Decay.hpp new file mode 100644 index 000000000..249698b2f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Decay.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_DECAY +#define TEST_V2_0_POPS_DECAY + +#include "test/v2.0/pops/Products.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + Integer32{} + / Meta<>("index") | + std::optional{} + / Meta<>("mode") | + Defaulted{false} + / 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; + + // defaults + static inline const struct Defaults { + static inline const bool complete = false; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + index{this}; + Field> + mode{this}; + Field> + complete{this,defaults.complete}; + + // children + Field> + products{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->mode, \ + this->complete, \ + this->products \ + ) + + // default + Decay() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Decay( + const wrapper + &index, + const wrapper> + &mode = {}, + const wrapper> + &complete = {}, + const wrapper> + &products = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + mode(this,mode), + complete(this,defaults.complete,complete), + products(this,products) + { + Component::finish(); + } + + // from node + explicit Decay(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Decay(const Decay &other) : + 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) : + 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 "test/v2.0/pops/Decay/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Decay + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Decay/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Decay/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Decay/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DecayData.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayData.hpp new file mode 100644 index 000000000..4cc92ad7c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayData.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_DECAYDATA +#define TEST_V2_0_POPS_DECAYDATA + +#include "test/v2.0/pops/DecayModes.hpp" +#include "test/v2.0/pops/AverageEnergies.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->decayModes, \ + this->averageEnergies \ + ) + + // default + DecayData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayData( + const wrapper> + &decayModes, + const wrapper> + &averageEnergies = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + decayModes(this,decayModes), + averageEnergies(this,averageEnergies) + { + Component::finish(); + } + + // from node + explicit DecayData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayData(const DecayData &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + decayModes(this,other.decayModes), + averageEnergies(this,other.averageEnergies) + { + Component::finish(other); + } + + // move + DecayData(DecayData &&other) : + 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 "test/v2.0/pops/DecayData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DecayData + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DecayData/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DecayMode.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayMode.hpp new file mode 100644 index 000000000..5aa3902ed --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayMode.hpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_DECAYMODE +#define TEST_V2_0_POPS_DECAYMODE + +#include "test/v2.0/pops/Probability.hpp" +#include "test/v2.0/pops/InternalConversionCoefficients.hpp" +#include "test/v2.0/pops/PhotonEmissionProbabilities.hpp" +#include "test/v2.0/pops/Q.hpp" +#include "test/v2.0/pops/DecayPath.hpp" +#include "test/v2.0/pops/Spectra.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("label") | + enums::DecayType{} + / Meta<>("mode") | + + // children + --Child + ("probability") | + --Child> + ("internalConversionCoefficients") | + --Child> + ("photonEmissionProbabilities") | + --Child> + ("Q") | + --Child> + ("decayPath") | + --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", + "internalConversionCoefficients", + "photonEmissionProbabilities", + "Q", + "decayPath", + "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", + "internal_conversion_coefficients", + "photon_emission_probabilities", + "q", + "decay_path", + "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> + internalConversionCoefficients{this}; + Field> + photonEmissionProbabilities{this}; + Field> + Q{this}; + Field> + decayPath{this}; + Field> + spectra{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->mode, \ + this->probability, \ + this->internalConversionCoefficients, \ + this->photonEmissionProbabilities, \ + this->Q, \ + this->decayPath, \ + this->spectra \ + ) + + // default + DecayMode() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayMode( + const wrapper + &label, + const wrapper + &mode = {}, + const wrapper + &probability = {}, + const wrapper> + &internalConversionCoefficients = {}, + const wrapper> + &photonEmissionProbabilities = {}, + const wrapper> + &Q = {}, + const wrapper> + &decayPath = {}, + const wrapper> + &spectra = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + mode(this,mode), + probability(this,probability), + internalConversionCoefficients(this,internalConversionCoefficients), + photonEmissionProbabilities(this,photonEmissionProbabilities), + Q(this,Q), + decayPath(this,decayPath), + spectra(this,spectra) + { + Component::finish(); + } + + // from node + explicit DecayMode(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayMode(const DecayMode &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + mode(this,other.mode), + probability(this,other.probability), + internalConversionCoefficients(this,other.internalConversionCoefficients), + photonEmissionProbabilities(this,other.photonEmissionProbabilities), + Q(this,other.Q), + decayPath(this,other.decayPath), + spectra(this,other.spectra) + { + Component::finish(other); + } + + // move + DecayMode(DecayMode &&other) : + 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)), + internalConversionCoefficients(this,std::move(other.internalConversionCoefficients)), + photonEmissionProbabilities(this,std::move(other.photonEmissionProbabilities)), + Q(this,std::move(other.Q)), + decayPath(this,std::move(other.decayPath)), + 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; + internalConversionCoefficients = other.internalConversionCoefficients; + photonEmissionProbabilities = other.photonEmissionProbabilities; + Q = other.Q; + decayPath = other.decayPath; + 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); + internalConversionCoefficients = std::move(other.internalConversionCoefficients); + photonEmissionProbabilities = std::move(other.photonEmissionProbabilities); + Q = std::move(other.Q); + decayPath = std::move(other.decayPath); + spectra = std::move(other.spectra); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/DecayMode/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DecayMode + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DecayMode/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayMode/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayMode/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DecayModes.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayModes.hpp new file mode 100644 index 000000000..efa278dd7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayModes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_DECAYMODES +#define TEST_V2_0_POPS_DECAYMODES + +#include "test/v2.0/pops/DecayMode.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->decayMode \ + ) + + // default + DecayModes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayModes( + const wrapper> + &decayMode + ) : + GNDSTK_COMPONENT(BlockData{}), + decayMode(this,decayMode) + { + Component::finish(); + } + + // from node + explicit DecayModes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayModes(const DecayModes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + decayMode(this,other.decayMode) + { + Component::finish(other); + } + + // move + DecayModes(DecayModes &&other) : + 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 "test/v2.0/pops/DecayModes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DecayModes + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DecayModes/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayModes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayModes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DecayPath.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayPath.hpp new file mode 100644 index 000000000..ce168fb92 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayPath.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_DECAYPATH +#define TEST_V2_0_POPS_DECAYPATH + +#include "test/v2.0/pops/Decay.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->decay \ + ) + + // default + DecayPath() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayPath( + const wrapper> + &decay + ) : + GNDSTK_COMPONENT(BlockData{}), + decay(this,decay) + { + Component::finish(); + } + + // from node + explicit DecayPath(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayPath(const DecayPath &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + decay(this,other.decay) + { + Component::finish(other); + } + + // move + DecayPath(DecayPath &&other) : + 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 "test/v2.0/pops/DecayPath/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DecayPath + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DecayPath/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayPath/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DecayPath/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Discrete.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Discrete.hpp new file mode 100644 index 000000000..90067c866 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Discrete.hpp @@ -0,0 +1,272 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_DISCRETE +#define TEST_V2_0_POPS_DISCRETE + +#include "test/v2.0/pops/DiscreteEnergy.hpp" +#include "test/v2.0/pops/Intensity.hpp" +#include "test/v2.0/pops/InternalConversionCoefficients.hpp" +#include "test/v2.0/pops/InternalPairFormationCoefficient.hpp" +#include "test/v2.0/pops/PhotonEmissionProbabilities.hpp" +#include "test/v2.0/pops/PositronEmissionIntensity.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + ("energy") | + --Child + ("intensity") | + --Child> + ("internalConversionCoefficients") | + --Child> + ("internalPairFormationCoefficient") | + --Child> + ("photonEmissionProbabilities") | + --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", + "discreteEnergy", + "intensity", + "internalConversionCoefficients", + "internalPairFormationCoefficient", + "photonEmissionProbabilities", + "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", + "discrete_energy", + "intensity", + "internal_conversion_coefficients", + "internal_pair_formation_coefficient", + "photon_emission_probabilities", + "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 + discreteEnergy{this}; + Field + intensity{this}; + Field> + internalConversionCoefficients{this}; + Field> + internalPairFormationCoefficient{this}; + Field> + photonEmissionProbabilities{this}; + Field> + positronEmissionIntensity{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->type, \ + this->discreteEnergy, \ + this->intensity, \ + this->internalConversionCoefficients, \ + this->internalPairFormationCoefficient, \ + this->photonEmissionProbabilities, \ + this->positronEmissionIntensity \ + ) + + // default + Discrete() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Discrete( + const wrapper> + &type, + const wrapper + &discreteEnergy = {}, + const wrapper + &intensity = {}, + const wrapper> + &internalConversionCoefficients = {}, + const wrapper> + &internalPairFormationCoefficient = {}, + const wrapper> + &photonEmissionProbabilities = {}, + const wrapper> + &positronEmissionIntensity = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + type(this,type), + discreteEnergy(this,discreteEnergy), + intensity(this,intensity), + internalConversionCoefficients(this,internalConversionCoefficients), + internalPairFormationCoefficient(this,internalPairFormationCoefficient), + photonEmissionProbabilities(this,photonEmissionProbabilities), + positronEmissionIntensity(this,positronEmissionIntensity) + { + Component::finish(); + } + + // from node + explicit Discrete(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Discrete(const Discrete &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + type(this,other.type), + discreteEnergy(this,other.discreteEnergy), + intensity(this,other.intensity), + internalConversionCoefficients(this,other.internalConversionCoefficients), + internalPairFormationCoefficient(this,other.internalPairFormationCoefficient), + photonEmissionProbabilities(this,other.photonEmissionProbabilities), + positronEmissionIntensity(this,other.positronEmissionIntensity) + { + Component::finish(other); + } + + // move + Discrete(Discrete &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + type(this,std::move(other.type)), + discreteEnergy(this,std::move(other.discreteEnergy)), + intensity(this,std::move(other.intensity)), + internalConversionCoefficients(this,std::move(other.internalConversionCoefficients)), + internalPairFormationCoefficient(this,std::move(other.internalPairFormationCoefficient)), + photonEmissionProbabilities(this,std::move(other.photonEmissionProbabilities)), + 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; + discreteEnergy = other.discreteEnergy; + intensity = other.intensity; + internalConversionCoefficients = other.internalConversionCoefficients; + internalPairFormationCoefficient = other.internalPairFormationCoefficient; + photonEmissionProbabilities = other.photonEmissionProbabilities; + 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); + discreteEnergy = std::move(other.discreteEnergy); + intensity = std::move(other.intensity); + internalConversionCoefficients = std::move(other.internalConversionCoefficients); + internalPairFormationCoefficient = std::move(other.internalPairFormationCoefficient); + photonEmissionProbabilities = std::move(other.photonEmissionProbabilities); + positronEmissionIntensity = std::move(other.positronEmissionIntensity); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Discrete/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Discrete + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Discrete/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Discrete/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Discrete/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DiscreteEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DiscreteEnergy.hpp new file mode 100644 index 000000000..263da0b01 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DiscreteEnergy.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_DISCRETEENERGY +#define TEST_V2_0_POPS_DISCRETEENERGY + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// class DiscreteEnergy +// ----------------------------------------------------------------------------- + +class DiscreteEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "pops"; } + static auto CLASS() { return "DiscreteEnergy"; } + static auto NODENAME() { return "discreteEnergy"; } + + // 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") | + Float64{} + / Meta<>("value") | + XMLName{} + / Meta<>("unit") | + + // children + --Child> + ("documentation") | + --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", + "documentation", + "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", + "documentation", + "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> + documentation{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit, \ + this->documentation, \ + this->uncertainty \ + ) + + // default + DiscreteEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DiscreteEnergy( + const wrapper> + &label, + const wrapper + &value = {}, + const wrapper + &unit = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit), + documentation(this,documentation), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit DiscreteEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DiscreteEnergy(const DiscreteEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + DiscreteEnergy(DiscreteEnergy &&other) : + 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)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DiscreteEnergy &operator=(const DiscreteEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + documentation = other.documentation; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + DiscreteEnergy &operator=(DiscreteEnergy &&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); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/DiscreteEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DiscreteEnergy + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/DiscreteEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/DiscreteEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/DiscreteEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Energy.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Energy.hpp new file mode 100644 index 000000000..d33e487a8 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Energy.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_ENERGY +#define TEST_V2_0_POPS_ENERGY + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + ++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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + Field>> + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->Double \ + ) + + // default + Energy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Energy( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper>> + &Double = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Energy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Energy(const Energy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Energy(Energy &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Energy &operator=(const Energy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + Double = other.Double; + } + return *this; + } + + // move + Energy &operator=(Energy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Energy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Energy + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Energy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Energy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Energy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBoson.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBoson.hpp new file mode 100644 index 000000000..83346a602 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBoson.hpp @@ -0,0 +1,272 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_GAUGEBOSON +#define TEST_V2_0_POPS_GAUGEBOSON + +#include "test/v2.0/pops/Charge.hpp" +#include "test/v2.0/pops/Halflife.hpp" +#include "test/v2.0/pops/Mass.hpp" +#include "test/v2.0/pops/Spin.hpp" +#include "test/v2.0/pops/Parity.hpp" +#include "test/v2.0/pops/DecayData.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("id") | + + // children + --Child> + ("charge") | + --Child> + ("halflife") | + --Child> + ("mass") | + --Child> + ("spin") | + --Child> + ("parity") | + --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", + "charge", + "halflife", + "mass", + "spin", + "parity", + "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", + "charge", + "halflife", + "mass", + "spin", + "parity", + "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> + charge{this}; + Field> + halflife{this}; + Field> + mass{this}; + Field> + spin{this}; + Field> + parity{this}; + Field> + decayData{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->charge, \ + this->halflife, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->decayData \ + ) + + // default + GaugeBoson() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GaugeBoson( + const wrapper + &id, + const wrapper> + &charge = {}, + const wrapper> + &halflife = {}, + const wrapper> + &mass = {}, + const wrapper> + &spin = {}, + const wrapper> + &parity = {}, + const wrapper> + &decayData = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + charge(this,charge), + halflife(this,halflife), + mass(this,mass), + spin(this,spin), + parity(this,parity), + decayData(this,decayData) + { + Component::finish(); + } + + // from node + explicit GaugeBoson(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GaugeBoson(const GaugeBoson &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + charge(this,other.charge), + halflife(this,other.halflife), + mass(this,other.mass), + spin(this,other.spin), + parity(this,other.parity), + decayData(this,other.decayData) + { + Component::finish(other); + } + + // move + GaugeBoson(GaugeBoson &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + charge(this,std::move(other.charge)), + halflife(this,std::move(other.halflife)), + mass(this,std::move(other.mass)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + decayData(this,std::move(other.decayData)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + GaugeBoson &operator=(const GaugeBoson &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + charge = other.charge; + halflife = other.halflife; + mass = other.mass; + spin = other.spin; + parity = other.parity; + decayData = other.decayData; + } + 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); + charge = std::move(other.charge); + halflife = std::move(other.halflife); + mass = std::move(other.mass); + spin = std::move(other.spin); + parity = std::move(other.parity); + decayData = std::move(other.decayData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/GaugeBoson/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class GaugeBoson + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBoson/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBoson/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBoson/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBosons.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBosons.hpp new file mode 100644 index 000000000..e0a688926 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBosons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_GAUGEBOSONS +#define TEST_V2_0_POPS_GAUGEBOSONS + +#include "test/v2.0/pops/GaugeBoson.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->gaugeBoson \ + ) + + // default + GaugeBosons() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GaugeBosons( + const wrapper>> + &gaugeBoson + ) : + GNDSTK_COMPONENT(BlockData{}), + gaugeBoson(this,gaugeBoson) + { + Component::finish(); + } + + // from node + explicit GaugeBosons(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GaugeBosons(const GaugeBosons &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + gaugeBoson(this,other.gaugeBoson) + { + Component::finish(other); + } + + // move + GaugeBosons(GaugeBosons &&other) : + 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 "test/v2.0/pops/GaugeBosons/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class GaugeBosons + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBosons/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBosons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/GaugeBosons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Halflife.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Halflife.hpp new file mode 100644 index 000000000..9d5a962dc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Halflife.hpp @@ -0,0 +1,265 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_HALFLIFE +#define TEST_V2_0_POPS_HALFLIFE + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" +#include "test/v2.0/containers/String.hpp" +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// class Halflife +// ----------------------------------------------------------------------------- + +class Halflife : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::String, + containers::Double + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "pops"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + _t{} + / --(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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "_stringDouble" + }; + 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", + "unit", + "value", + "documentation", + "uncertainty", + "_string_double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + + // children - variant + Field<_t> + _stringDouble{this}; + FieldPart string{_stringDouble}; + FieldPart Double{_stringDouble}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->_stringDouble \ + ) + + // default + Halflife() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Halflife( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper<_t> + &_stringDouble = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + _stringDouble(this,_stringDouble) + { + Component::finish(); + } + + // from node + explicit Halflife(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Halflife(const Halflife &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + _stringDouble(this,other._stringDouble) + { + Component::finish(other); + } + + // move + Halflife(Halflife &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + _stringDouble(this,std::move(other._stringDouble)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Halflife &operator=(const Halflife &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + _stringDouble = other._stringDouble; + } + return *this; + } + + // move + Halflife &operator=(Halflife &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + _stringDouble = std::move(other._stringDouble); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Halflife/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Halflife + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Halflife/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Halflife/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Halflife/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Intensity.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Intensity.hpp new file mode 100644 index 000000000..3feda5cce --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Intensity.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_INTENSITY +#define TEST_V2_0_POPS_INTENSITY + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --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", + "unit", + "value", + "documentation", + "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", + "unit", + "value", + "documentation", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty \ + ) + + // default + Intensity() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Intensity( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Intensity(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Intensity(const Intensity &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Intensity(Intensity &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + 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; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Intensity &operator=(Intensity &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Intensity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Intensity + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Intensity/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Intensity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Intensity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/InternalConversionCoefficients.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/InternalConversionCoefficients.hpp new file mode 100644 index 000000000..371ff54a4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/InternalConversionCoefficients.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_INTERNALCONVERSIONCOEFFICIENTS +#define TEST_V2_0_POPS_INTERNALCONVERSIONCOEFFICIENTS + +#include "test/v2.0/pops/Shell.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shell \ + ) + + // default + InternalConversionCoefficients() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit InternalConversionCoefficients( + const wrapper> + &shell + ) : + GNDSTK_COMPONENT(BlockData{}), + shell(this,shell) + { + Component::finish(); + } + + // from node + explicit InternalConversionCoefficients(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + InternalConversionCoefficients(const InternalConversionCoefficients &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shell(this,other.shell) + { + Component::finish(other); + } + + // move + InternalConversionCoefficients(InternalConversionCoefficients &&other) : + 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 "test/v2.0/pops/InternalConversionCoefficients/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class InternalConversionCoefficients + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/InternalConversionCoefficients/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/InternalConversionCoefficients/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/InternalConversionCoefficients/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/InternalPairFormationCoefficient.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/InternalPairFormationCoefficient.hpp new file mode 100644 index 000000000..dde6e4f15 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/InternalPairFormationCoefficient.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_INTERNALPAIRFORMATIONCOEFFICIENT +#define TEST_V2_0_POPS_INTERNALPAIRFORMATIONCOEFFICIENT + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// class InternalPairFormationCoefficient +// ----------------------------------------------------------------------------- + +class InternalPairFormationCoefficient : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "pops"; } + static auto CLASS() { return "InternalPairFormationCoefficient"; } + static auto NODENAME() { return "internalPairFormationCoefficient"; } + + // 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") | + Float64{} + / Meta<>("value") | + XMLName{} + / Meta<>("unit") | + + // children + --Child> + ("documentation") | + --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", + "documentation", + "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", + "documentation", + "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> + documentation{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit, \ + this->documentation, \ + this->uncertainty \ + ) + + // default + InternalPairFormationCoefficient() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit InternalPairFormationCoefficient( + const wrapper> + &label, + const wrapper + &value = {}, + const wrapper + &unit = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit), + documentation(this,documentation), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit InternalPairFormationCoefficient(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + InternalPairFormationCoefficient(const InternalPairFormationCoefficient &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + InternalPairFormationCoefficient(InternalPairFormationCoefficient &&other) : + 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)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + InternalPairFormationCoefficient &operator=(const InternalPairFormationCoefficient &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + documentation = other.documentation; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + InternalPairFormationCoefficient &operator=(InternalPairFormationCoefficient &&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); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/InternalPairFormationCoefficient/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class InternalPairFormationCoefficient + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/InternalPairFormationCoefficient/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/InternalPairFormationCoefficient/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/InternalPairFormationCoefficient/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Interval.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Interval.hpp new file mode 100644 index 000000000..764275fa2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Interval.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_INTERVAL +#define TEST_V2_0_POPS_INTERVAL + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// class Interval +// ----------------------------------------------------------------------------- + +class Interval : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "pops"; } + static auto CLASS() { return "Interval"; } + static auto NODENAME() { return "interval"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Float64{} + / Meta<>("confidence") | + Float64{} + / Meta<>("lower") | + Float64{} + / Meta<>("upper") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "confidence", + "lower", + "upper" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "confidence", + "lower", + "upper" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + confidence{this}; + Field + lower{this}; + Field + upper{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->confidence, \ + this->lower, \ + this->upper \ + ) + + // default + Interval() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Interval( + const wrapper + &confidence, + const wrapper + &lower = {}, + const wrapper + &upper = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + confidence(this,confidence), + lower(this,lower), + upper(this,upper) + { + Component::finish(); + } + + // from node + explicit Interval(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Interval(const Interval &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + confidence(this,other.confidence), + lower(this,other.lower), + upper(this,other.upper) + { + Component::finish(other); + } + + // move + Interval(Interval &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + confidence(this,std::move(other.confidence)), + lower(this,std::move(other.lower)), + upper(this,std::move(other.upper)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Interval &operator=(const Interval &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + confidence = other.confidence; + lower = other.lower; + upper = other.upper; + } + return *this; + } + + // move + Interval &operator=(Interval &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + confidence = std::move(other.confidence); + lower = std::move(other.lower); + upper = std::move(other.upper); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Interval/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Interval + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Interval/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Interval/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Interval/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Isotope.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Isotope.hpp new file mode 100644 index 000000000..cb46e85fd --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Isotope.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_ISOTOPE +#define TEST_V2_0_POPS_ISOTOPE + +#include "test/v2.0/pops/Nuclides.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + Integer32{} + / Meta<>("A") | + XMLName{} + / Meta<>("symbol") | + + // 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", + "A", + "symbol", + "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", + "a", + "symbol", + "nuclides" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + A{this}; + Field + symbol{this}; + + // children + Field> + nuclides{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->A, \ + this->symbol, \ + this->nuclides \ + ) + + // default + Isotope() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Isotope( + const wrapper + &A, + const wrapper + &symbol = {}, + const wrapper> + &nuclides = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + A(this,A), + symbol(this,symbol), + nuclides(this,nuclides) + { + Component::finish(); + } + + // from node + explicit Isotope(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotope(const Isotope &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + A(this,other.A), + symbol(this,other.symbol), + nuclides(this,other.nuclides) + { + Component::finish(other); + } + + // move + Isotope(Isotope &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + A(this,std::move(other.A)), + symbol(this,std::move(other.symbol)), + 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; + A = other.A; + symbol = other.symbol; + nuclides = other.nuclides; + } + return *this; + } + + // move + Isotope &operator=(Isotope &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + A = std::move(other.A); + symbol = std::move(other.symbol); + nuclides = std::move(other.nuclides); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Isotope/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Isotope + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Isotope/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Isotope/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Isotope/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Isotopes.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Isotopes.hpp new file mode 100644 index 000000000..e3233c492 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Isotopes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_ISOTOPES +#define TEST_V2_0_POPS_ISOTOPES + +#include "test/v2.0/pops/Isotope.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->isotope \ + ) + + // default + Isotopes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Isotopes( + const wrapper> + &isotope + ) : + GNDSTK_COMPONENT(BlockData{}), + isotope(this,isotope) + { + Component::finish(); + } + + // from node + explicit Isotopes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotopes(const Isotopes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + isotope(this,other.isotope) + { + Component::finish(other); + } + + // move + Isotopes(Isotopes &&other) : + 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 "test/v2.0/pops/Isotopes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Isotopes + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Isotopes/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Isotopes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Isotopes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Lepton.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Lepton.hpp new file mode 100644 index 000000000..edea1917b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Lepton.hpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_LEPTON +#define TEST_V2_0_POPS_LEPTON + +#include "test/v2.0/pops/Charge.hpp" +#include "test/v2.0/pops/Halflife.hpp" +#include "test/v2.0/pops/Mass.hpp" +#include "test/v2.0/pops/Spin.hpp" +#include "test/v2.0/pops/Parity.hpp" +#include "test/v2.0/pops/DecayData.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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::optional{} + / Meta<>("generation") | + XMLName{} + / Meta<>("id") | + + // children + --Child> + ("charge") | + --Child> + ("halflife") | + --Child> + ("mass") | + --Child> + ("spin") | + --Child> + ("parity") | + --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", + "generation", + "id", + "charge", + "halflife", + "mass", + "spin", + "parity", + "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", + "generation", + "id", + "charge", + "halflife", + "mass", + "spin", + "parity", + "decay_data" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + generation{this}; + Field + id{this}; + + // children + Field> + charge{this}; + Field> + halflife{this}; + Field> + mass{this}; + Field> + spin{this}; + Field> + parity{this}; + Field> + decayData{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->generation, \ + this->id, \ + this->charge, \ + this->halflife, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->decayData \ + ) + + // default + Lepton() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Lepton( + const wrapper> + &generation, + const wrapper + &id = {}, + const wrapper> + &charge = {}, + const wrapper> + &halflife = {}, + const wrapper> + &mass = {}, + const wrapper> + &spin = {}, + const wrapper> + &parity = {}, + const wrapper> + &decayData = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + generation(this,generation), + id(this,id), + charge(this,charge), + halflife(this,halflife), + mass(this,mass), + spin(this,spin), + parity(this,parity), + decayData(this,decayData) + { + Component::finish(); + } + + // from node + explicit Lepton(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Lepton(const Lepton &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + generation(this,other.generation), + id(this,other.id), + charge(this,other.charge), + halflife(this,other.halflife), + mass(this,other.mass), + spin(this,other.spin), + parity(this,other.parity), + decayData(this,other.decayData) + { + Component::finish(other); + } + + // move + Lepton(Lepton &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + generation(this,std::move(other.generation)), + id(this,std::move(other.id)), + charge(this,std::move(other.charge)), + halflife(this,std::move(other.halflife)), + mass(this,std::move(other.mass)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + decayData(this,std::move(other.decayData)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Lepton &operator=(const Lepton &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + generation = other.generation; + id = other.id; + charge = other.charge; + halflife = other.halflife; + mass = other.mass; + spin = other.spin; + parity = other.parity; + decayData = other.decayData; + } + return *this; + } + + // move + Lepton &operator=(Lepton &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + generation = std::move(other.generation); + id = std::move(other.id); + charge = std::move(other.charge); + halflife = std::move(other.halflife); + mass = std::move(other.mass); + spin = std::move(other.spin); + parity = std::move(other.parity); + decayData = std::move(other.decayData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Lepton/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Lepton + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Lepton/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Lepton/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Lepton/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Leptons.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Leptons.hpp new file mode 100644 index 000000000..904e92b7c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Leptons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_LEPTONS +#define TEST_V2_0_POPS_LEPTONS + +#include "test/v2.0/pops/Lepton.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->lepton \ + ) + + // default + Leptons() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Leptons( + const wrapper> + &lepton + ) : + GNDSTK_COMPONENT(BlockData{}), + lepton(this,lepton) + { + Component::finish(); + } + + // from node + explicit Leptons(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Leptons(const Leptons &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + lepton(this,other.lepton) + { + Component::finish(other); + } + + // move + Leptons(Leptons &&other) : + 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 "test/v2.0/pops/Leptons/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Leptons + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Leptons/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Leptons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Leptons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/LogNormal.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/LogNormal.hpp new file mode 100644 index 000000000..09e614eeb --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/LogNormal.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_LOGNORMAL +#define TEST_V2_0_POPS_LOGNORMAL + +#include "test/v2.0/extra/Double.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// class LogNormal +// ----------------------------------------------------------------------------- + +class LogNormal : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "pops"; } + static auto CLASS() { return "LogNormal"; } + static auto NODENAME() { return "logNormal"; } + + // 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + LogNormal() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit LogNormal( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit LogNormal(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + LogNormal(const LogNormal &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + LogNormal(LogNormal &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + LogNormal &operator=(const LogNormal &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Double = other.Double; + } + return *this; + } + + // move + LogNormal &operator=(LogNormal &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/LogNormal/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class LogNormal + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/LogNormal/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/LogNormal/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/LogNormal/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Mass.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Mass.hpp new file mode 100644 index 000000000..af2c01be3 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Mass.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_MASS +#define TEST_V2_0_POPS_MASS + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + --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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + Field> + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->Double \ + ) + + // default + Mass() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Mass( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper> + &Double = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Mass(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Mass(const Mass &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Mass(Mass &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + 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; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + Double = other.Double; + } + return *this; + } + + // move + Mass &operator=(Mass &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Mass/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Mass + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Mass/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Mass/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Mass/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/MetaStable.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/MetaStable.hpp new file mode 100644 index 000000000..0241dba26 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/MetaStable.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_METASTABLE +#define TEST_V2_0_POPS_METASTABLE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("id") | + Integer32{} + / Meta<>("metaStableIndex") | + XMLName{} + / 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", + "metaStableIndex", + "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", + "meta_stable_index", + "pid" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + id{this}; + Field + metaStableIndex{this}; + Field + pid{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->metaStableIndex, \ + this->pid \ + ) + + // default + MetaStable() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MetaStable( + const wrapper + &id, + const wrapper + &metaStableIndex = {}, + const wrapper + &pid = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + metaStableIndex(this,metaStableIndex), + pid(this,pid) + { + Component::finish(); + } + + // from node + explicit MetaStable(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MetaStable(const MetaStable &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + metaStableIndex(this,other.metaStableIndex), + pid(this,other.pid) + { + Component::finish(other); + } + + // move + MetaStable(MetaStable &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + metaStableIndex(this,std::move(other.metaStableIndex)), + pid(this,std::move(other.pid)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MetaStable &operator=(const MetaStable &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + metaStableIndex = other.metaStableIndex; + pid = other.pid; + } + 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); + metaStableIndex = std::move(other.metaStableIndex); + pid = std::move(other.pid); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/MetaStable/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MetaStable + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/MetaStable/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/MetaStable/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/MetaStable/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Nucleus.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Nucleus.hpp new file mode 100644 index 000000000..acb168b32 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Nucleus.hpp @@ -0,0 +1,301 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_NUCLEUS +#define TEST_V2_0_POPS_NUCLEUS + +#include "test/v2.0/pops/Charge.hpp" +#include "test/v2.0/pops/Energy.hpp" +#include "test/v2.0/pops/Halflife.hpp" +#include "test/v2.0/pops/Spin.hpp" +#include "test/v2.0/pops/Parity.hpp" +#include "test/v2.0/pops/DecayData.hpp" +#include "test/v2.0/fissionFragmentData/FissionFragmentData.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("id") | + Integer32{} + / Meta<>("index") | + + // children + --Child> + ("charge") | + --Child> + ("energy") | + --Child> + ("halflife") | + --Child> + ("spin") | + --Child> + ("parity") | + --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", + "index", + "charge", + "energy", + "halflife", + "spin", + "parity", + "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", + "index", + "charge", + "energy", + "halflife", + "spin", + "parity", + "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}; + Field + index{this}; + + // children + Field> + charge{this}; + Field> + energy{this}; + Field> + halflife{this}; + Field> + spin{this}; + Field> + parity{this}; + Field> + decayData{this}; + Field> + fissionFragmentData{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->index, \ + this->charge, \ + this->energy, \ + this->halflife, \ + this->spin, \ + this->parity, \ + this->decayData, \ + this->fissionFragmentData \ + ) + + // default + Nucleus() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nucleus( + const wrapper + &id, + const wrapper + &index = {}, + const wrapper> + &charge = {}, + const wrapper> + &energy = {}, + const wrapper> + &halflife = {}, + const wrapper> + &spin = {}, + const wrapper> + &parity = {}, + const wrapper> + &decayData = {}, + const wrapper> + &fissionFragmentData = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + index(this,index), + charge(this,charge), + energy(this,energy), + halflife(this,halflife), + spin(this,spin), + parity(this,parity), + decayData(this,decayData), + fissionFragmentData(this,fissionFragmentData) + { + Component::finish(); + } + + // from node + explicit Nucleus(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Nucleus(const Nucleus &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + index(this,other.index), + charge(this,other.charge), + energy(this,other.energy), + halflife(this,other.halflife), + spin(this,other.spin), + parity(this,other.parity), + decayData(this,other.decayData), + fissionFragmentData(this,other.fissionFragmentData) + { + Component::finish(other); + } + + // move + Nucleus(Nucleus &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + index(this,std::move(other.index)), + charge(this,std::move(other.charge)), + energy(this,std::move(other.energy)), + halflife(this,std::move(other.halflife)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + decayData(this,std::move(other.decayData)), + fissionFragmentData(this,std::move(other.fissionFragmentData)) + { + 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; + charge = other.charge; + energy = other.energy; + halflife = other.halflife; + spin = other.spin; + parity = other.parity; + decayData = other.decayData; + fissionFragmentData = other.fissionFragmentData; + } + 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); + charge = std::move(other.charge); + energy = std::move(other.energy); + halflife = std::move(other.halflife); + spin = std::move(other.spin); + parity = std::move(other.parity); + decayData = std::move(other.decayData); + fissionFragmentData = std::move(other.fissionFragmentData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Nucleus/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Nucleus + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Nucleus/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Nucleus/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Nucleus/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclide.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclide.hpp new file mode 100644 index 000000000..ccdb2bea7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclide.hpp @@ -0,0 +1,287 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_NUCLIDE +#define TEST_V2_0_POPS_NUCLIDE + +#include "test/v2.0/pops/Charge.hpp" +#include "test/v2.0/pops/Mass.hpp" +#include "test/v2.0/pops/Spin.hpp" +#include "test/v2.0/pops/Parity.hpp" +#include "test/v2.0/pops/Nucleus.hpp" +#include "test/v2.0/pops/DecayData.hpp" +#include "test/v2.0/fissionFragmentData/FissionFragmentData.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("id") | + + // children + --Child> + ("charge") | + --Child> + ("mass") | + --Child> + ("spin") | + --Child> + ("parity") | + --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", + "charge", + "mass", + "spin", + "parity", + "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", + "charge", + "mass", + "spin", + "parity", + "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> + charge{this}; + Field> + mass{this}; + Field> + spin{this}; + Field> + parity{this}; + Field> + nucleus{this}; + Field> + decayData{this}; + Field> + fissionFragmentData{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->charge, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->nucleus, \ + this->decayData, \ + this->fissionFragmentData \ + ) + + // default + Nuclide() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nuclide( + const wrapper + &id, + const wrapper> + &charge = {}, + const wrapper> + &mass = {}, + const wrapper> + &spin = {}, + const wrapper> + &parity = {}, + const wrapper> + &nucleus = {}, + const wrapper> + &decayData = {}, + const wrapper> + &fissionFragmentData = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + charge(this,charge), + mass(this,mass), + spin(this,spin), + parity(this,parity), + nucleus(this,nucleus), + decayData(this,decayData), + fissionFragmentData(this,fissionFragmentData) + { + Component::finish(); + } + + // from node + explicit Nuclide(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Nuclide(const Nuclide &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + charge(this,other.charge), + mass(this,other.mass), + spin(this,other.spin), + parity(this,other.parity), + nucleus(this,other.nucleus), + decayData(this,other.decayData), + fissionFragmentData(this,other.fissionFragmentData) + { + Component::finish(other); + } + + // move + Nuclide(Nuclide &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + charge(this,std::move(other.charge)), + mass(this,std::move(other.mass)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + 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; + charge = other.charge; + mass = other.mass; + spin = other.spin; + parity = other.parity; + 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); + charge = std::move(other.charge); + mass = std::move(other.mass); + spin = std::move(other.spin); + parity = std::move(other.parity); + nucleus = std::move(other.nucleus); + decayData = std::move(other.decayData); + fissionFragmentData = std::move(other.fissionFragmentData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Nuclide/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Nuclide + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclide/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclide/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclide/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclides.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclides.hpp new file mode 100644 index 000000000..f1cc5e0c0 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclides.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_NUCLIDES +#define TEST_V2_0_POPS_NUCLIDES + +#include "test/v2.0/pops/Nuclide.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclide \ + ) + + // default + Nuclides() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nuclides( + const wrapper> + &nuclide + ) : + GNDSTK_COMPONENT(BlockData{}), + nuclide(this,nuclide) + { + Component::finish(); + } + + // from node + explicit Nuclides(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Nuclides(const Nuclides &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + nuclide(this,other.nuclide) + { + Component::finish(other); + } + + // move + Nuclides(Nuclides &&other) : + 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 "test/v2.0/pops/Nuclides/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Nuclides + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclides/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclides/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Nuclides/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Parity.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Parity.hpp new file mode 100644 index 000000000..40b71e5f1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Parity.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_PARITY +#define TEST_V2_0_POPS_PARITY + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" +#include "test/v2.0/containers/Integer.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + ++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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "integer" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + Field>> + integer{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->integer \ + ) + + // default + Parity() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Parity( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper>> + &integer = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + integer(this,integer) + { + Component::finish(); + } + + // from node + explicit Parity(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Parity(const Parity &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + integer(this,other.integer) + { + Component::finish(other); + } + + // move + Parity(Parity &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + 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; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + integer = other.integer; + } + return *this; + } + + // move + Parity &operator=(Parity &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + integer = std::move(other.integer); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Parity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Parity + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Parity/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Parity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Parity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Pdf.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Pdf.hpp new file mode 100644 index 000000000..773e23829 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Pdf.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_PDF +#define TEST_V2_0_POPS_PDF + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// class Pdf +// ----------------------------------------------------------------------------- + +class Pdf : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "pops"; } + static auto CLASS() { return "Pdf"; } + static auto NODENAME() { return "pdf"; } + + // 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + Pdf() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Pdf( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit Pdf(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Pdf(const Pdf &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + Pdf(Pdf &&other) : + 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 + Pdf &operator=(const Pdf &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + Pdf &operator=(Pdf &&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 "test/v2.0/pops/Pdf/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Pdf + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Pdf/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Pdf/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Pdf/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/PhotonEmissionProbabilities.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/PhotonEmissionProbabilities.hpp new file mode 100644 index 000000000..e86ab12b4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/PhotonEmissionProbabilities.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_PHOTONEMISSIONPROBABILITIES +#define TEST_V2_0_POPS_PHOTONEMISSIONPROBABILITIES + +#include "test/v2.0/pops/Shell.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shell \ + ) + + // default + PhotonEmissionProbabilities() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PhotonEmissionProbabilities( + const wrapper> + &shell + ) : + GNDSTK_COMPONENT(BlockData{}), + shell(this,shell) + { + Component::finish(); + } + + // from node + explicit PhotonEmissionProbabilities(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PhotonEmissionProbabilities(const PhotonEmissionProbabilities &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shell(this,other.shell) + { + Component::finish(other); + } + + // move + PhotonEmissionProbabilities(PhotonEmissionProbabilities &&other) : + 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 "test/v2.0/pops/PhotonEmissionProbabilities/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PhotonEmissionProbabilities + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/PhotonEmissionProbabilities/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/PhotonEmissionProbabilities/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/PhotonEmissionProbabilities/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/PoPs_database.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/PoPs_database.hpp new file mode 100644 index 000000000..61fcd5ab1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/PoPs_database.hpp @@ -0,0 +1,330 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_POPS_DATABASE +#define TEST_V2_0_POPS_POPS_DATABASE + +#include "test/v2.0/styles/Styles.hpp" +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Aliases.hpp" +#include "test/v2.0/pops/GaugeBosons.hpp" +#include "test/v2.0/pops/Leptons.hpp" +#include "test/v2.0/pops/Baryons.hpp" +#include "test/v2.0/pops/ChemicalElements.hpp" +#include "test/v2.0/pops/Unorthodoxes.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// class PoPs_database +// ----------------------------------------------------------------------------- + +class PoPs_database : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "pops"; } + static auto CLASS() { return "PoPs_database"; } + 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 + XMLName{} + / Meta<>("name") | + XMLName{} + / Meta<>("version") | + XMLName{} + / Meta<>("format") | + + // children + --Child> + ("styles") | + --Child> + ("documentation") | + --Child> + ("aliases") | + --Child> + ("gaugeBosons") | + --Child> + ("leptons") | + --Child> + ("baryons") | + --Child> + ("chemicalElements") | + --Child> + ("unorthodoxes") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "styles", + "documentation", + "aliases", + "gaugeBosons", + "leptons", + "baryons", + "chemicalElements", + "unorthodoxes" + }; + 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", + "styles", + "documentation", + "aliases", + "gauge_bosons", + "leptons", + "baryons", + "chemical_elements", + "unorthodoxes" + }; + 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> + styles{this}; + Field> + documentation{this}; + Field> + aliases{this}; + Field> + gaugeBosons{this}; + Field> + leptons{this}; + Field> + baryons{this}; + Field> + chemicalElements{this}; + Field> + unorthodoxes{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->version, \ + this->format, \ + this->styles, \ + this->documentation, \ + this->aliases, \ + this->gaugeBosons, \ + this->leptons, \ + this->baryons, \ + this->chemicalElements, \ + this->unorthodoxes \ + ) + + // default + PoPs_database() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PoPs_database( + const wrapper + &name, + const wrapper + &version = {}, + const wrapper + &format = {}, + const wrapper> + &styles = {}, + const wrapper> + &documentation = {}, + const wrapper> + &aliases = {}, + const wrapper> + &gaugeBosons = {}, + const wrapper> + &leptons = {}, + const wrapper> + &baryons = {}, + const wrapper> + &chemicalElements = {}, + const wrapper> + &unorthodoxes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name), + version(this,version), + format(this,format), + styles(this,styles), + documentation(this,documentation), + aliases(this,aliases), + gaugeBosons(this,gaugeBosons), + leptons(this,leptons), + baryons(this,baryons), + chemicalElements(this,chemicalElements), + unorthodoxes(this,unorthodoxes) + { + Component::finish(); + } + + // from node + explicit PoPs_database(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PoPs_database(const PoPs_database &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + version(this,other.version), + format(this,other.format), + styles(this,other.styles), + documentation(this,other.documentation), + aliases(this,other.aliases), + gaugeBosons(this,other.gaugeBosons), + leptons(this,other.leptons), + baryons(this,other.baryons), + chemicalElements(this,other.chemicalElements), + unorthodoxes(this,other.unorthodoxes) + { + Component::finish(other); + } + + // move + PoPs_database(PoPs_database &&other) : + 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)), + styles(this,std::move(other.styles)), + documentation(this,std::move(other.documentation)), + aliases(this,std::move(other.aliases)), + gaugeBosons(this,std::move(other.gaugeBosons)), + leptons(this,std::move(other.leptons)), + baryons(this,std::move(other.baryons)), + chemicalElements(this,std::move(other.chemicalElements)), + unorthodoxes(this,std::move(other.unorthodoxes)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PoPs_database &operator=(const PoPs_database &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + name = other.name; + version = other.version; + format = other.format; + styles = other.styles; + documentation = other.documentation; + aliases = other.aliases; + gaugeBosons = other.gaugeBosons; + leptons = other.leptons; + baryons = other.baryons; + chemicalElements = other.chemicalElements; + unorthodoxes = other.unorthodoxes; + } + return *this; + } + + // move + PoPs_database &operator=(PoPs_database &&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); + styles = std::move(other.styles); + documentation = std::move(other.documentation); + aliases = std::move(other.aliases); + gaugeBosons = std::move(other.gaugeBosons); + leptons = std::move(other.leptons); + baryons = std::move(other.baryons); + chemicalElements = std::move(other.chemicalElements); + unorthodoxes = std::move(other.unorthodoxes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/PoPs_database/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PoPs_database + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/PoPs_database/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/PoPs_database/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/PoPs_database/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/PositronEmissionIntensity.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/PositronEmissionIntensity.hpp new file mode 100644 index 000000000..c04f77792 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/PositronEmissionIntensity.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_POSITRONEMISSIONINTENSITY +#define TEST_V2_0_POPS_POSITRONEMISSIONINTENSITY + +#include "test/v2.0/pops/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + Float64{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->uncertainty \ + ) + + // default + PositronEmissionIntensity() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PositronEmissionIntensity( + const wrapper + &value, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit PositronEmissionIntensity(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PositronEmissionIntensity(const PositronEmissionIntensity &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + PositronEmissionIntensity(PositronEmissionIntensity &&other) : + 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 "test/v2.0/pops/PositronEmissionIntensity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PositronEmissionIntensity + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/PositronEmissionIntensity/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/PositronEmissionIntensity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/PositronEmissionIntensity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Probability.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Probability.hpp new file mode 100644 index 000000000..d569d33f0 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Probability.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_PROBABILITY +#define TEST_V2_0_POPS_PROBABILITY + +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Probability() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Probability( + const wrapper> + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Probability(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Probability(const Probability &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Probability(Probability &&other) : + 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 "test/v2.0/pops/Probability/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Probability + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Probability/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Probability/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Probability/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Product.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Product.hpp new file mode 100644 index 000000000..276bb3f1b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Product.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_PRODUCT +#define TEST_V2_0_POPS_PRODUCT + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / 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", + "label", + "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", + "label", + "pid" + }; + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid \ + ) + + // default + Product() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Product( + const wrapper + &label, + const wrapper + &pid = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid) + { + Component::finish(); + } + + // from node + explicit Product(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Product(const Product &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid) + { + Component::finish(other); + } + + // move + Product(Product &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + pid(this,std::move(other.pid)) + { + 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; + } + 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); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Product/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Product + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Product/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Product/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Product/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Products.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Products.hpp new file mode 100644 index 000000000..af4535dd8 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Products.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_PRODUCTS +#define TEST_V2_0_POPS_PRODUCTS + +#include "test/v2.0/pops/Product.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->product \ + ) + + // default + Products() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Products( + const wrapper> + &product + ) : + GNDSTK_COMPONENT(BlockData{}), + product(this,product) + { + Component::finish(); + } + + // from node + explicit Products(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Products(const Products &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + product(this,other.product) + { + Component::finish(other); + } + + // move + Products(Products &&other) : + 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 "test/v2.0/pops/Products/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Products + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Products/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Products/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Products/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Q.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Q.hpp new file mode 100644 index 000000000..8ad6a895c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Q.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_Q +#define TEST_V2_0_POPS_Q + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + XMLName{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + ++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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + Field> + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->Double \ + ) + + // default + Q() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Q( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper> + &Double = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Q(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Q(const Q &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Q(Q &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Q &operator=(const Q &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + Double = other.Double; + } + return *this; + } + + // move + Q &operator=(Q &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Q/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Q + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Q/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Q/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Q/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Shell.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Shell.hpp new file mode 100644 index 000000000..153a17a8c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Shell.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_SHELL +#define TEST_V2_0_POPS_SHELL + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("label") | + Float64{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit \ + ) + + // default + Shell() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Shell( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper> + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Shell(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Shell(const Shell &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + Shell(Shell &&other) : + 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 + Shell &operator=(const Shell &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + } + 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); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Shell/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Shell + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Shell/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Shell/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Shell/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Spectra.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Spectra.hpp new file mode 100644 index 000000000..a738db6e8 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Spectra.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_SPECTRA +#define TEST_V2_0_POPS_SPECTRA + +#include "test/v2.0/pops/Spectrum.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->spectrum \ + ) + + // default + Spectra() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Spectra( + const wrapper> + &spectrum + ) : + GNDSTK_COMPONENT(BlockData{}), + spectrum(this,spectrum) + { + Component::finish(); + } + + // from node + explicit Spectra(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Spectra(const Spectra &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + spectrum(this,other.spectrum) + { + Component::finish(other); + } + + // move + Spectra(Spectra &&other) : + 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 "test/v2.0/pops/Spectra/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Spectra + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Spectra/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Spectra/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Spectra/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Spectrum.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Spectrum.hpp new file mode 100644 index 000000000..d1b865703 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Spectrum.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_SPECTRUM +#define TEST_V2_0_POPS_SPECTRUM + +#include "test/v2.0/pops/Continuum.hpp" +#include "test/v2.0/pops/Discrete.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("pid") | + + // children + --Child> + ("continuum") | + ++Child> + ("discrete") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "continuum", + "discrete" + }; + 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", + "continuum", + "discrete" + }; + 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> + continuum{this}; + Field>> + discrete{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->continuum, \ + this->discrete \ + ) + + // default + Spectrum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Spectrum( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper> + &continuum = {}, + const wrapper>> + &discrete = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + continuum(this,continuum), + discrete(this,discrete) + { + Component::finish(); + } + + // from node + explicit Spectrum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Spectrum(const Spectrum &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid), + continuum(this,other.continuum), + discrete(this,other.discrete) + { + Component::finish(other); + } + + // move + Spectrum(Spectrum &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + pid(this,std::move(other.pid)), + continuum(this,std::move(other.continuum)), + discrete(this,std::move(other.discrete)) + { + 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; + continuum = other.continuum; + discrete = other.discrete; + } + 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); + continuum = std::move(other.continuum); + discrete = std::move(other.discrete); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Spectrum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Spectrum + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Spectrum/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Spectrum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Spectrum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Spin.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Spin.hpp new file mode 100644 index 000000000..f86b67942 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Spin.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_SPIN +#define TEST_V2_0_POPS_SPIN + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" +#include "test/v2.0/containers/Fraction.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") | + std::optional{} + / Meta<>("value") | + + // children + --Child> + ("documentation") | + --Child> + ("uncertainty") | + ++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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "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", + "label", + "unit", + "value", + "documentation", + "uncertainty", + "fraction" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + unit{this}; + Field> + value{this}; + + // children + Field> + documentation{this}; + Field> + uncertainty{this}; + Field>> + fraction{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->unit, \ + this->value, \ + this->documentation, \ + this->uncertainty, \ + this->fraction \ + ) + + // default + Spin() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Spin( + const wrapper> + &label, + const wrapper> + &unit = {}, + const wrapper> + &value = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {}, + const wrapper>> + &fraction = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + unit(this,unit), + value(this,value), + documentation(this,documentation), + uncertainty(this,uncertainty), + fraction(this,fraction) + { + Component::finish(); + } + + // from node + explicit Spin(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Spin(const Spin &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + unit(this,other.unit), + value(this,other.value), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty), + fraction(this,other.fraction) + { + Component::finish(other); + } + + // move + Spin(Spin &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)), + 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; + label = other.label; + unit = other.unit; + value = other.value; + documentation = other.documentation; + uncertainty = other.uncertainty; + fraction = other.fraction; + } + return *this; + } + + // move + Spin &operator=(Spin &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + unit = std::move(other.unit); + value = std::move(other.value); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + fraction = std::move(other.fraction); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Spin/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Spin + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Spin/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Spin/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Spin/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Standard.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Standard.hpp new file mode 100644 index 000000000..a97f37f34 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Standard.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_STANDARD +#define TEST_V2_0_POPS_STANDARD + +#include "test/v2.0/extra/Double.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Standard() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Standard( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Standard(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Standard(const Standard &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Standard(Standard &&other) : + 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 "test/v2.0/pops/Standard/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Standard + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Standard/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Standard/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Standard/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Uncertainty.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Uncertainty.hpp new file mode 100644 index 000000000..4d2cbaeef --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Uncertainty.hpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_UNCERTAINTY +#define TEST_V2_0_POPS_UNCERTAINTY + +#include "test/v2.0/pops/Standard.hpp" +#include "test/v2.0/pops/LogNormal.hpp" +#include "test/v2.0/pops/ConfidenceIntervals.hpp" +#include "test/v2.0/pops/Pdf.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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> + ("standard") | + --Child> + ("logNormal") | + --Child> + ("confidenceIntervals") | + --Child> + ("pdf") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "standard", + "logNormal", + "confidenceIntervals", + "pdf" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "standard", + "log_normal", + "confidence_intervals", + "pdf" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + standard{this}; + Field> + logNormal{this}; + Field> + confidenceIntervals{this}; + Field> + pdf{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->standard, \ + this->logNormal, \ + this->confidenceIntervals, \ + this->pdf \ + ) + + // default + Uncertainty() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Uncertainty( + const wrapper> + &standard, + const wrapper> + &logNormal = {}, + const wrapper> + &confidenceIntervals = {}, + const wrapper> + &pdf = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + standard(this,standard), + logNormal(this,logNormal), + confidenceIntervals(this,confidenceIntervals), + pdf(this,pdf) + { + Component::finish(); + } + + // from node + explicit Uncertainty(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Uncertainty(const Uncertainty &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + standard(this,other.standard), + logNormal(this,other.logNormal), + confidenceIntervals(this,other.confidenceIntervals), + pdf(this,other.pdf) + { + Component::finish(other); + } + + // move + Uncertainty(Uncertainty &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + standard(this,std::move(other.standard)), + logNormal(this,std::move(other.logNormal)), + confidenceIntervals(this,std::move(other.confidenceIntervals)), + pdf(this,std::move(other.pdf)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Uncertainty &operator=(const Uncertainty &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + standard = other.standard; + logNormal = other.logNormal; + confidenceIntervals = other.confidenceIntervals; + pdf = other.pdf; + } + return *this; + } + + // move + Uncertainty &operator=(Uncertainty &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + standard = std::move(other.standard); + logNormal = std::move(other.logNormal); + confidenceIntervals = std::move(other.confidenceIntervals); + pdf = std::move(other.pdf); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Uncertainty/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Uncertainty + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Uncertainty/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Uncertainty/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Uncertainty/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodox.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodox.hpp new file mode 100644 index 000000000..b39d58cbc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodox.hpp @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_UNORTHODOX +#define TEST_V2_0_POPS_UNORTHODOX + +#include "test/v2.0/pops/Charge.hpp" +#include "test/v2.0/pops/Mass.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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 + XMLName{} + / Meta<>("id") | + + // children + --Child> + ("charge") | + --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", + "charge", + "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", + "charge", + "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> + charge{this}; + Field> + mass{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->charge, \ + this->mass \ + ) + + // default + Unorthodox() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unorthodox( + const wrapper + &id, + const wrapper> + &charge = {}, + const wrapper> + &mass = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + id(this,id), + charge(this,charge), + mass(this,mass) + { + Component::finish(); + } + + // from node + explicit Unorthodox(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unorthodox(const Unorthodox &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + charge(this,other.charge), + mass(this,other.mass) + { + Component::finish(other); + } + + // move + Unorthodox(Unorthodox &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + charge(this,std::move(other.charge)), + 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; + charge = other.charge; + 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); + charge = std::move(other.charge); + mass = std::move(other.mass); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Unorthodox/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Unorthodox + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodox/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodox/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodox/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodoxes.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodoxes.hpp new file mode 100644 index 000000000..d0e91c3bc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodoxes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_POPS_UNORTHODOXES +#define TEST_V2_0_POPS_UNORTHODOXES + +#include "test/v2.0/pops/Nuclide.hpp" + +namespace test { +namespace v2_0 { +namespace pops { + +// ----------------------------------------------------------------------------- +// pops:: +// 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 "pops"; } + 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", + "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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclide \ + ) + + // default + Unorthodoxes() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unorthodoxes( + const wrapper> + &nuclide + ) : + GNDSTK_COMPONENT(BlockData{}), + nuclide(this,nuclide) + { + Component::finish(); + } + + // from node + explicit Unorthodoxes(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unorthodoxes(const Unorthodoxes &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + nuclide(this,other.nuclide) + { + Component::finish(other); + } + + // move + Unorthodoxes(Unorthodoxes &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + nuclide(this,std::move(other.nuclide)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Unorthodoxes &operator=(const Unorthodoxes &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + nuclide = other.nuclide; + } + return *this; + } + + // move + Unorthodoxes &operator=(Unorthodoxes &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + nuclide = std::move(other.nuclide); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/pops/Unorthodoxes/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Unorthodoxes + +} // namespace pops +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodoxes/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodoxes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/pops/Unorthodoxes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AngularEnergyMC.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AngularEnergyMC.hpp new file mode 100644 index 000000000..04eba5ee7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AngularEnergyMC.hpp @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_PROCESSED_ANGULARENERGYMC +#define TEST_V2_0_PROCESSED_ANGULARENERGYMC + +#include "test/v2.0/transport/Angular_uncorrelated.hpp" +#include "test/v2.0/transport/AngularEnergy.hpp" + +namespace test { +namespace v2_0 { +namespace processed { + +// ----------------------------------------------------------------------------- +// processed:: +// class AngularEnergyMC +// ----------------------------------------------------------------------------- + +class AngularEnergyMC : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "processed"; } + static auto CLASS() { return "AngularEnergyMC"; } + static auto NODENAME() { return "angularEnergyMC"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("productFrame") | + + // children + --Child + ("angular") | + --Child + ("angularEnergy") + ; + } + + // Data member names. Usually - but not necessarily - the same 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_uncorrelated", + "angularEnergy" + }; + 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_uncorrelated", + "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_uncorrelated{this}; + Field + angularEnergy{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(angular_uncorrelated(),XYs2d); + GNDSTK_SHORTCUT(angularEnergy(),XYs3d); + GNDSTK_SHORTCUT(angular_uncorrelated(),forward); + GNDSTK_SHORTCUT(angularEnergy().XYs3d(),function2ds); + GNDSTK_SHORTCUT(angular_uncorrelated(),isotropic2d); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->angular_uncorrelated, \ + this->angularEnergy \ + ) + + // default + AngularEnergyMC() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AngularEnergyMC( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper + &angular_uncorrelated = {}, + const wrapper + &angularEnergy = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + angular_uncorrelated(this,angular_uncorrelated), + angularEnergy(this,angularEnergy) + { + Component::finish(); + } + + // from node + explicit AngularEnergyMC(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AngularEnergyMC(const AngularEnergyMC &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + angular_uncorrelated(this,other.angular_uncorrelated), + angularEnergy(this,other.angularEnergy) + { + Component::finish(other); + } + + // move + AngularEnergyMC(AngularEnergyMC &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + angular_uncorrelated(this,std::move(other.angular_uncorrelated)), + angularEnergy(this,std::move(other.angularEnergy)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AngularEnergyMC &operator=(const AngularEnergyMC &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + angular_uncorrelated = other.angular_uncorrelated; + angularEnergy = other.angularEnergy; + } + return *this; + } + + // move + AngularEnergyMC &operator=(AngularEnergyMC &&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_uncorrelated = std::move(other.angular_uncorrelated); + angularEnergy = std::move(other.angularEnergy); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/processed/AngularEnergyMC/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AngularEnergyMC + +} // namespace processed +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AngularEnergyMC/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AngularEnergyMC/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AngularEnergyMC/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableEnergy.hpp new file mode 100644 index 000000000..a697951da --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableEnergy.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_PROCESSED_AVAILABLEENERGY +#define TEST_V2_0_PROCESSED_AVAILABLEENERGY + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Gridded1d.hpp" + +namespace test { +namespace v2_0 { +namespace processed { + +// ----------------------------------------------------------------------------- +// processed:: +// class AvailableEnergy +// ----------------------------------------------------------------------------- + +class AvailableEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "processed"; } + static auto CLASS() { return "AvailableEnergy"; } + static auto NODENAME() { return "availableEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("gridded1d") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "gridded1d" + }; + 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", + "gridded1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + gridded1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->gridded1d \ + ) + + // default + AvailableEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AvailableEnergy( + const wrapper> + &XYs1d, + const wrapper> + &gridded1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + gridded1d(this,gridded1d) + { + Component::finish(); + } + + // from node + explicit AvailableEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AvailableEnergy(const AvailableEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + gridded1d(this,other.gridded1d) + { + Component::finish(other); + } + + // move + AvailableEnergy(AvailableEnergy &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + gridded1d(this,std::move(other.gridded1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AvailableEnergy &operator=(const AvailableEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + gridded1d = other.gridded1d; + } + return *this; + } + + // move + AvailableEnergy &operator=(AvailableEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + gridded1d = std::move(other.gridded1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/processed/AvailableEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AvailableEnergy + +} // namespace processed +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableMomentum.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableMomentum.hpp new file mode 100644 index 000000000..002294e30 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableMomentum.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_PROCESSED_AVAILABLEMOMENTUM +#define TEST_V2_0_PROCESSED_AVAILABLEMOMENTUM + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Gridded1d.hpp" + +namespace test { +namespace v2_0 { +namespace processed { + +// ----------------------------------------------------------------------------- +// processed:: +// class AvailableMomentum +// ----------------------------------------------------------------------------- + +class AvailableMomentum : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "processed"; } + static auto CLASS() { return "AvailableMomentum"; } + static auto NODENAME() { return "availableMomentum"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("gridded1d") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "gridded1d" + }; + 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", + "gridded1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + gridded1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->gridded1d \ + ) + + // default + AvailableMomentum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AvailableMomentum( + const wrapper> + &XYs1d, + const wrapper> + &gridded1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + gridded1d(this,gridded1d) + { + Component::finish(); + } + + // from node + explicit AvailableMomentum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AvailableMomentum(const AvailableMomentum &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + gridded1d(this,other.gridded1d) + { + Component::finish(other); + } + + // move + AvailableMomentum(AvailableMomentum &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + gridded1d(this,std::move(other.gridded1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AvailableMomentum &operator=(const AvailableMomentum &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + gridded1d = other.gridded1d; + } + return *this; + } + + // move + AvailableMomentum &operator=(AvailableMomentum &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + gridded1d = std::move(other.gridded1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/processed/AvailableMomentum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AvailableMomentum + +} // namespace processed +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableMomentum/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableMomentum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AvailableMomentum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductEnergy.hpp new file mode 100644 index 000000000..b9acc0cdd --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductEnergy.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_PROCESSED_AVERAGEPRODUCTENERGY +#define TEST_V2_0_PROCESSED_AVERAGEPRODUCTENERGY + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Gridded1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace processed { + +// ----------------------------------------------------------------------------- +// processed:: +// 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 "processed"; } + 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") | + --Child> + ("gridded1d") | + --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", + "gridded1d", + "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", + "gridded1d", + "regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + Field> + gridded1d{this}; + Field> + regions1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->gridded1d, \ + this->regions1d \ + ) + + // default + AverageProductEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageProductEnergy( + const wrapper + &XYs1d, + const wrapper> + &gridded1d = {}, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + gridded1d(this,gridded1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit AverageProductEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageProductEnergy(const AverageProductEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + gridded1d(this,other.gridded1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + AverageProductEnergy(AverageProductEnergy &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + gridded1d(this,std::move(other.gridded1d)), + regions1d(this,std::move(other.regions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AverageProductEnergy &operator=(const AverageProductEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + gridded1d = other.gridded1d; + regions1d = other.regions1d; + } + 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); + gridded1d = std::move(other.gridded1d); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/processed/AverageProductEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageProductEnergy + +} // namespace processed +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductMomentum.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductMomentum.hpp new file mode 100644 index 000000000..0979b2dac --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductMomentum.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_PROCESSED_AVERAGEPRODUCTMOMENTUM +#define TEST_V2_0_PROCESSED_AVERAGEPRODUCTMOMENTUM + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Gridded1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace processed { + +// ----------------------------------------------------------------------------- +// processed:: +// class AverageProductMomentum +// ----------------------------------------------------------------------------- + +class AverageProductMomentum : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "processed"; } + static auto CLASS() { return "AverageProductMomentum"; } + static auto NODENAME() { return "averageProductMomentum"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("gridded1d") | + --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", + "gridded1d", + "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", + "gridded1d", + "regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + gridded1d{this}; + Field> + regions1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->gridded1d, \ + this->regions1d \ + ) + + // default + AverageProductMomentum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageProductMomentum( + const wrapper> + &XYs1d, + const wrapper> + &gridded1d = {}, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + gridded1d(this,gridded1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit AverageProductMomentum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageProductMomentum(const AverageProductMomentum &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + gridded1d(this,other.gridded1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + AverageProductMomentum(AverageProductMomentum &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + gridded1d(this,std::move(other.gridded1d)), + regions1d(this,std::move(other.regions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AverageProductMomentum &operator=(const AverageProductMomentum &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + gridded1d = other.gridded1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + AverageProductMomentum &operator=(AverageProductMomentum &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + gridded1d = std::move(other.gridded1d); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/processed/AverageProductMomentum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageProductMomentum + +} // namespace processed +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductMomentum/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductMomentum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/AverageProductMomentum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/EnergyAngularMC.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/EnergyAngularMC.hpp new file mode 100644 index 000000000..68719edb1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/EnergyAngularMC.hpp @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_PROCESSED_ENERGYANGULARMC +#define TEST_V2_0_PROCESSED_ENERGYANGULARMC + +#include "test/v2.0/common/Energy.hpp" +#include "test/v2.0/transport/EnergyAngular.hpp" + +namespace test { +namespace v2_0 { +namespace processed { + +// ----------------------------------------------------------------------------- +// processed:: +// class EnergyAngularMC +// ----------------------------------------------------------------------------- + +class EnergyAngularMC : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "processed"; } + static auto CLASS() { return "EnergyAngularMC"; } + static auto NODENAME() { return "energyAngularMC"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("productFrame") | + + // children + --Child + ("energy") | + --Child + ("energyAngular") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "energy", + "energyAngular" + }; + 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", + "energy", + "energy_angular" + }; + 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 + energy{this}; + Field + energyAngular{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(energy(),Double); + GNDSTK_SHORTCUT(energyAngular(),XYs3d); + GNDSTK_SHORTCUT(energyAngular().XYs3d(),axes); + GNDSTK_SHORTCUT(energy(),documentation); + GNDSTK_SHORTCUT(energyAngular().XYs3d(),function2ds); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->energy, \ + this->energyAngular \ + ) + + // default + EnergyAngularMC() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EnergyAngularMC( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper + &energy = {}, + const wrapper + &energyAngular = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + energy(this,energy), + energyAngular(this,energyAngular) + { + Component::finish(); + } + + // from node + explicit EnergyAngularMC(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EnergyAngularMC(const EnergyAngularMC &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + energy(this,other.energy), + energyAngular(this,other.energyAngular) + { + Component::finish(other); + } + + // move + EnergyAngularMC(EnergyAngularMC &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + energy(this,std::move(other.energy)), + energyAngular(this,std::move(other.energyAngular)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EnergyAngularMC &operator=(const EnergyAngularMC &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + energy = other.energy; + energyAngular = other.energyAngular; + } + return *this; + } + + // move + EnergyAngularMC &operator=(EnergyAngularMC &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + energy = std::move(other.energy); + energyAngular = std::move(other.energyAngular); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/processed/EnergyAngularMC/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EnergyAngularMC + +} // namespace processed +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/EnergyAngularMC/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/EnergyAngularMC/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/EnergyAngularMC/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/MultiGroup3d.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/MultiGroup3d.hpp new file mode 100644 index 000000000..7e104830f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/MultiGroup3d.hpp @@ -0,0 +1,219 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_PROCESSED_MULTIGROUP3D +#define TEST_V2_0_PROCESSED_MULTIGROUP3D + +#include "test/v2.0/containers/Gridded3d.hpp" + +namespace test { +namespace v2_0 { +namespace processed { + +// ----------------------------------------------------------------------------- +// processed:: +// class MultiGroup3d +// ----------------------------------------------------------------------------- + +class MultiGroup3d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "processed"; } + static auto CLASS() { return "MultiGroup3d"; } + static auto NODENAME() { return "multiGroup3d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("productFrame") | + + // children + --Child + ("gridded3d") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "gridded3d" + }; + 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", + "gridded3d" + }; + 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 + gridded3d{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(gridded3d(),axes); + GNDSTK_SHORTCUT(gridded3d().axes(),axis); + GNDSTK_SHORTCUT(gridded3d().axes(),grid); + GNDSTK_SHORTCUT(gridded3d().array(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->gridded3d \ + ) + + // default + MultiGroup3d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiGroup3d( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper + &gridded3d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + gridded3d(this,gridded3d) + { + Component::finish(); + } + + // from node + explicit MultiGroup3d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiGroup3d(const MultiGroup3d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + gridded3d(this,other.gridded3d) + { + Component::finish(other); + } + + // move + MultiGroup3d(MultiGroup3d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + gridded3d(this,std::move(other.gridded3d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MultiGroup3d &operator=(const MultiGroup3d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + gridded3d = other.gridded3d; + } + return *this; + } + + // move + MultiGroup3d &operator=(MultiGroup3d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + gridded3d = std::move(other.gridded3d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/processed/MultiGroup3d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MultiGroup3d + +} // namespace processed +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/processed/MultiGroup3d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/processed/MultiGroup3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/processed/MultiGroup3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/BreitWigner.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/BreitWigner.hpp new file mode 100644 index 000000000..6646cc122 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/BreitWigner.hpp @@ -0,0 +1,291 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_BREITWIGNER +#define TEST_V2_0_RESONANCES_BREITWIGNER + +#include "test/v2.0/pops/PoPs_database.hpp" +#include "test/v2.0/resonances/ScatteringRadius.hpp" +#include "test/v2.0/resonances/HardSphereRadius.hpp" +#include "test/v2.0/resonances/ResonanceParameters.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("approximation") | + Defaulted{false} + / Meta<>("calculateChannelRadius") | + Defaulted{false} + / Meta<>("useForSelfShieldingOnly") | + + // children + --Child> + ("PoPs") | + --Child> + ("scatteringRadius") | + --Child> + ("hardSphereRadius") | + --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", + "approximation", + "calculateChannelRadius", + "useForSelfShieldingOnly", + "PoPs_database", + "scatteringRadius", + "hardSphereRadius", + "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", + "approximation", + "calculate_channel_radius", + "use_for_self_shielding_only", + "po_ps_database", + "scattering_radius", + "hard_sphere_radius", + "resonance_parameters" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const bool calculateChannelRadius = false; + static inline const bool useForSelfShieldingOnly = false; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + approximation{this}; + Field> + calculateChannelRadius{this,defaults.calculateChannelRadius}; + Field> + useForSelfShieldingOnly{this,defaults.useForSelfShieldingOnly}; + + // children + Field> + PoPs_database{this}; + Field> + scatteringRadius{this}; + Field> + hardSphereRadius{this}; + Field> + resonanceParameters{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->approximation, \ + this->calculateChannelRadius, \ + this->useForSelfShieldingOnly, \ + this->PoPs_database, \ + this->scatteringRadius, \ + this->hardSphereRadius, \ + this->resonanceParameters \ + ) + + // default + BreitWigner() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit BreitWigner( + const wrapper + &label, + const wrapper + &approximation = {}, + const wrapper> + &calculateChannelRadius = {}, + const wrapper> + &useForSelfShieldingOnly = {}, + const wrapper> + &PoPs_database = {}, + const wrapper> + &scatteringRadius = {}, + const wrapper> + &hardSphereRadius = {}, + const wrapper> + &resonanceParameters = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + approximation(this,approximation), + calculateChannelRadius(this,defaults.calculateChannelRadius,calculateChannelRadius), + useForSelfShieldingOnly(this,defaults.useForSelfShieldingOnly,useForSelfShieldingOnly), + PoPs_database(this,PoPs_database), + scatteringRadius(this,scatteringRadius), + hardSphereRadius(this,hardSphereRadius), + resonanceParameters(this,resonanceParameters) + { + Component::finish(); + } + + // from node + explicit BreitWigner(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BreitWigner(const BreitWigner &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + approximation(this,other.approximation), + calculateChannelRadius(this,other.calculateChannelRadius), + useForSelfShieldingOnly(this,other.useForSelfShieldingOnly), + PoPs_database(this,other.PoPs_database), + scatteringRadius(this,other.scatteringRadius), + hardSphereRadius(this,other.hardSphereRadius), + resonanceParameters(this,other.resonanceParameters) + { + Component::finish(other); + } + + // move + BreitWigner(BreitWigner &&other) : + 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)), + useForSelfShieldingOnly(this,std::move(other.useForSelfShieldingOnly)), + PoPs_database(this,std::move(other.PoPs_database)), + scatteringRadius(this,std::move(other.scatteringRadius)), + hardSphereRadius(this,std::move(other.hardSphereRadius)), + resonanceParameters(this,std::move(other.resonanceParameters)) + { + 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; + useForSelfShieldingOnly = other.useForSelfShieldingOnly; + PoPs_database = other.PoPs_database; + scatteringRadius = other.scatteringRadius; + hardSphereRadius = other.hardSphereRadius; + resonanceParameters = other.resonanceParameters; + } + 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); + useForSelfShieldingOnly = std::move(other.useForSelfShieldingOnly); + PoPs_database = std::move(other.PoPs_database); + scatteringRadius = std::move(other.scatteringRadius); + hardSphereRadius = std::move(other.hardSphereRadius); + resonanceParameters = std::move(other.resonanceParameters); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/BreitWigner/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BreitWigner + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/BreitWigner/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/BreitWigner/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/BreitWigner/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Channel.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Channel.hpp new file mode 100644 index 000000000..b7827bed6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Channel.hpp @@ -0,0 +1,297 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_CHANNEL +#define TEST_V2_0_RESONANCES_CHANNEL + +#include "test/v2.0/resonances/ExternalRMatrix.hpp" +#include "test/v2.0/resonances/ScatteringRadius.hpp" +#include "test/v2.0/resonances/HardSphereRadius.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 + XMLName{} + / Meta<>("label") | + std::string{} + / Meta<>("resonanceReaction") | + Integer32{} + / Meta<>("L") | + Fraction32{} + / Meta<>("channelSpin") | + std::optional{} + / Meta<>("boundaryConditionValue") | + Integer32{} + / Meta<>("columnIndex") | + + // children + --Child> + ("externalRMatrix") | + --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", + "boundaryConditionValue", + "columnIndex", + "externalRMatrix", + "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", + "boundary_condition_value", + "column_index", + "external_rmatrix", + "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> + boundaryConditionValue{this}; + Field + columnIndex{this}; + + // children + Field> + externalRMatrix{this}; + Field> + scatteringRadius{this}; + Field> + hardSphereRadius{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->resonanceReaction, \ + this->L, \ + this->channelSpin, \ + this->boundaryConditionValue, \ + this->columnIndex, \ + this->externalRMatrix, \ + this->scatteringRadius, \ + this->hardSphereRadius \ + ) + + // default + Channel() : + 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> + &boundaryConditionValue = {}, + const wrapper + &columnIndex = {}, + const wrapper> + &externalRMatrix = {}, + const wrapper> + &scatteringRadius = {}, + const wrapper> + &hardSphereRadius = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + resonanceReaction(this,resonanceReaction), + L(this,L), + channelSpin(this,channelSpin), + boundaryConditionValue(this,boundaryConditionValue), + columnIndex(this,columnIndex), + externalRMatrix(this,externalRMatrix), + scatteringRadius(this,scatteringRadius), + hardSphereRadius(this,hardSphereRadius) + { + Component::finish(); + } + + // from node + explicit Channel(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Channel(const Channel &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + resonanceReaction(this,other.resonanceReaction), + L(this,other.L), + channelSpin(this,other.channelSpin), + boundaryConditionValue(this,other.boundaryConditionValue), + columnIndex(this,other.columnIndex), + externalRMatrix(this,other.externalRMatrix), + scatteringRadius(this,other.scatteringRadius), + hardSphereRadius(this,other.hardSphereRadius) + { + Component::finish(other); + } + + // move + Channel(Channel &&other) : + 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)), + boundaryConditionValue(this,std::move(other.boundaryConditionValue)), + columnIndex(this,std::move(other.columnIndex)), + externalRMatrix(this,std::move(other.externalRMatrix)), + 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; + boundaryConditionValue = other.boundaryConditionValue; + columnIndex = other.columnIndex; + externalRMatrix = other.externalRMatrix; + 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); + boundaryConditionValue = std::move(other.boundaryConditionValue); + columnIndex = std::move(other.columnIndex); + externalRMatrix = std::move(other.externalRMatrix); + scatteringRadius = std::move(other.scatteringRadius); + hardSphereRadius = std::move(other.hardSphereRadius); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/Channel/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Channel + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Channel/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Channel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Channel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Channels.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Channels.hpp new file mode 100644 index 000000000..ded8ceb03 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Channels.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_CHANNELS +#define TEST_V2_0_RESONANCES_CHANNELS + +#include "test/v2.0/resonances/Channel.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->channel \ + ) + + // default + Channels() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Channels( + const wrapper> + &channel + ) : + GNDSTK_COMPONENT(BlockData{}), + channel(this,channel) + { + Component::finish(); + } + + // from node + explicit Channels(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Channels(const Channels &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + channel(this,other.channel) + { + Component::finish(other); + } + + // move + Channels(Channels &&other) : + 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 "test/v2.0/resonances/Channels/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Channels + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Channels/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Channels/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Channels/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyInterval.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyInterval.hpp new file mode 100644 index 000000000..645972d1e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyInterval.hpp @@ -0,0 +1,247 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_ENERGYINTERVAL +#define TEST_V2_0_RESONANCES_ENERGYINTERVAL + +#include "test/v2.0/resonances/RMatrix.hpp" +#include "test/v2.0/resonances/BreitWigner.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// class EnergyInterval +// ----------------------------------------------------------------------------- + +class EnergyInterval : + public Component +{ + friend class Component; + + using _t = std::variant< + resonances::RMatrix, + resonances::BreitWigner + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "resonances"; } + static auto CLASS() { return "EnergyInterval"; } + static auto NODENAME() { return "energyInterval"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Integer32{} + / Meta<>("index") | + Float64{} + / Meta<>("domainMin") | + Float64{} + / Meta<>("domainMax") | + XMLName{} + / Meta<>("domainUnit") | + + // children + _t{} + / --(Child<>("RMatrix") || Child<>("BreitWigner")) + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "domainMin", + "domainMax", + "domainUnit", + "_RMatrixBreitWigner" + }; + 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", + "domain_min", + "domain_max", + "domain_unit", + "_rmatrix_breit_wigner" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + index{this}; + Field + domainMin{this}; + Field + domainMax{this}; + Field + domainUnit{this}; + + // children - variant + Field<_t> + _RMatrixBreitWigner{this}; + FieldPart RMatrix{_RMatrixBreitWigner}; + FieldPart BreitWigner{_RMatrixBreitWigner}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->_RMatrixBreitWigner \ + ) + + // default + EnergyInterval() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EnergyInterval( + const wrapper + &index, + const wrapper + &domainMin = {}, + const wrapper + &domainMax = {}, + const wrapper + &domainUnit = {}, + const wrapper<_t> + &_RMatrixBreitWigner = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + index(this,index), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainUnit(this,domainUnit), + _RMatrixBreitWigner(this,_RMatrixBreitWigner) + { + Component::finish(); + } + + // from node + explicit EnergyInterval(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EnergyInterval(const EnergyInterval &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + domainUnit(this,other.domainUnit), + _RMatrixBreitWigner(this,other._RMatrixBreitWigner) + { + Component::finish(other); + } + + // move + EnergyInterval(EnergyInterval &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + index(this,std::move(other.index)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + domainUnit(this,std::move(other.domainUnit)), + _RMatrixBreitWigner(this,std::move(other._RMatrixBreitWigner)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EnergyInterval &operator=(const EnergyInterval &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + index = other.index; + domainMin = other.domainMin; + domainMax = other.domainMax; + domainUnit = other.domainUnit; + _RMatrixBreitWigner = other._RMatrixBreitWigner; + } + return *this; + } + + // move + EnergyInterval &operator=(EnergyInterval &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + index = std::move(other.index); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + domainUnit = std::move(other.domainUnit); + _RMatrixBreitWigner = std::move(other._RMatrixBreitWigner); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/EnergyInterval/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EnergyInterval + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyInterval/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyInterval/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyInterval/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyIntervals.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyIntervals.hpp new file mode 100644 index 000000000..e1ba351c7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyIntervals.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_ENERGYINTERVALS +#define TEST_V2_0_RESONANCES_ENERGYINTERVALS + +#include "test/v2.0/resonances/EnergyInterval.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// class EnergyIntervals +// ----------------------------------------------------------------------------- + +class EnergyIntervals : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "resonances"; } + static auto CLASS() { return "EnergyIntervals"; } + static auto NODENAME() { return "energyIntervals"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("label") | + + // children + ++Child + ("energyInterval") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "energyInterval" + }; + 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_interval" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field> + energyInterval{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->energyInterval \ + ) + + // default + EnergyIntervals() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EnergyIntervals( + const wrapper + &label, + const wrapper> + &energyInterval = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + energyInterval(this,energyInterval) + { + Component::finish(); + } + + // from node + explicit EnergyIntervals(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EnergyIntervals(const EnergyIntervals &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + energyInterval(this,other.energyInterval) + { + Component::finish(other); + } + + // move + EnergyIntervals(EnergyIntervals &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + energyInterval(this,std::move(other.energyInterval)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EnergyIntervals &operator=(const EnergyIntervals &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + energyInterval = other.energyInterval; + } + return *this; + } + + // move + EnergyIntervals &operator=(EnergyIntervals &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + energyInterval = std::move(other.energyInterval); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/EnergyIntervals/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EnergyIntervals + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyIntervals/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyIntervals/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/EnergyIntervals/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ExternalRMatrix.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ExternalRMatrix.hpp new file mode 100644 index 000000000..02a0beffc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ExternalRMatrix.hpp @@ -0,0 +1,203 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_EXTERNALRMATRIX +#define TEST_V2_0_RESONANCES_EXTERNALRMATRIX + +#include "test/v2.0/containers/Double.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// class ExternalRMatrix +// ----------------------------------------------------------------------------- + +class ExternalRMatrix : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "resonances"; } + static auto CLASS() { return "ExternalRMatrix"; } + static auto NODENAME() { return "externalRMatrix"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"Froehner"} + / Meta<>("type") | + + // 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", + "type", + "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", + "type", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const XMLName type = "Froehner"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + type{this,defaults.type}; + + // children + Field> + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->type, \ + this->Double \ + ) + + // default + ExternalRMatrix() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit ExternalRMatrix( + const wrapper> + &type, + const wrapper> + &Double = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + type(this,defaults.type,type), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit ExternalRMatrix(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExternalRMatrix(const ExternalRMatrix &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + type(this,other.type), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + ExternalRMatrix(ExternalRMatrix &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + type(this,std::move(other.type)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ExternalRMatrix &operator=(const ExternalRMatrix &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + type = other.type; + Double = other.Double; + } + return *this; + } + + // move + ExternalRMatrix &operator=(ExternalRMatrix &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + type = std::move(other.type); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/ExternalRMatrix/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ExternalRMatrix + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ExternalRMatrix/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ExternalRMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ExternalRMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/HardSphereRadius.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/HardSphereRadius.hpp new file mode 100644 index 000000000..0b8583e83 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/HardSphereRadius.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_HARDSPHERERADIUS +#define TEST_V2_0_RESONANCES_HARDSPHERERADIUS + +#include "test/v2.0/containers/Constant1d.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(constant1d(),axes); + GNDSTK_SHORTCUT(constant1d().axes(),axis); + GNDSTK_SHORTCUT(constant1d().axes(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->constant1d \ + ) + + // default + HardSphereRadius() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit HardSphereRadius( + const wrapper + &constant1d + ) : + GNDSTK_COMPONENT(BlockData{}), + constant1d(this,constant1d) + { + Component::finish(); + } + + // from node + explicit HardSphereRadius(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + HardSphereRadius(const HardSphereRadius &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + constant1d(this,other.constant1d) + { + Component::finish(other); + } + + // move + HardSphereRadius(HardSphereRadius &&other) : + 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 "test/v2.0/resonances/HardSphereRadius/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class HardSphereRadius + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/HardSphereRadius/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/HardSphereRadius/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/HardSphereRadius/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/J.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/J.hpp new file mode 100644 index 000000000..418ac5b71 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/J.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_J +#define TEST_V2_0_RESONANCES_J + +#include "test/v2.0/resonances/LevelSpacing.hpp" +#include "test/v2.0/resonances/Widths.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 + XMLName{} + / Meta<>("label") | + Fraction32{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(widths(),width); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->levelSpacing, \ + this->widths \ + ) + + // default + J() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit J( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &levelSpacing = {}, + const wrapper + &widths = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + levelSpacing(this,levelSpacing), + widths(this,widths) + { + Component::finish(); + } + + // from node + explicit J(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + J(const J &other) : + 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) : + 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 "test/v2.0/resonances/J/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class J + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/J/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/J/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/J/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Js.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Js.hpp new file mode 100644 index 000000000..ce10fa616 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Js.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_JS +#define TEST_V2_0_RESONANCES_JS + +#include "test/v2.0/resonances/J.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->J \ + ) + + // default + Js() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Js( + const wrapper> + &J + ) : + GNDSTK_COMPONENT(BlockData{}), + J(this,J) + { + Component::finish(); + } + + // from node + explicit Js(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Js(const Js &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + J(this,other.J) + { + Component::finish(other); + } + + // move + Js(Js &&other) : + 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 "test/v2.0/resonances/Js/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Js + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Js/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Js/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Js/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/L.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/L.hpp new file mode 100644 index 000000000..09e6d4af8 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/L.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_L +#define TEST_V2_0_RESONANCES_L + +#include "test/v2.0/resonances/Js.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 + XMLName{} + / Meta<>("label") | + Integer32{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Js(),J); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->Js \ + ) + + // default + L() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit L( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &Js = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + Js(this,Js) + { + Component::finish(); + } + + // from node + explicit L(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + L(const L &other) : + 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) : + 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 "test/v2.0/resonances/L/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class L + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/L/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/L/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/L/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/LevelSpacing.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/LevelSpacing.hpp new file mode 100644 index 000000000..35500e53e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/LevelSpacing.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_LEVELSPACING +#define TEST_V2_0_RESONANCES_LEVELSPACING + +#include "test/v2.0/containers/Constant1d.hpp" +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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> + ("constant1d") | + --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", + "constant1d", + "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", + "constant1d", + "xys1d", + "regions1d" + }; + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->constant1d, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + LevelSpacing() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit LevelSpacing( + const wrapper> + &constant1d, + const wrapper> + &XYs1d = {}, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + constant1d(this,constant1d), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit LevelSpacing(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + LevelSpacing(const LevelSpacing &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + constant1d(this,other.constant1d), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + LevelSpacing(LevelSpacing &&other) : + 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)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + LevelSpacing &operator=(const LevelSpacing &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + constant1d = other.constant1d; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + LevelSpacing &operator=(LevelSpacing &&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); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/LevelSpacing/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class LevelSpacing + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/LevelSpacing/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/LevelSpacing/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/LevelSpacing/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Ls.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Ls.hpp new file mode 100644 index 000000000..18d3f649a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Ls.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_LS +#define TEST_V2_0_RESONANCES_LS + +#include "test/v2.0/resonances/L.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->L \ + ) + + // default + Ls() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Ls( + const wrapper> + &L + ) : + GNDSTK_COMPONENT(BlockData{}), + L(this,L) + { + Component::finish(); + } + + // from node + explicit Ls(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Ls(const Ls &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + L(this,other.L) + { + Component::finish(other); + } + + // move + Ls(Ls &&other) : + 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 "test/v2.0/resonances/Ls/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Ls + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Ls/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Ls/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Ls/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/RMatrix.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/RMatrix.hpp new file mode 100644 index 000000000..71da88137 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/RMatrix.hpp @@ -0,0 +1,341 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_RMATRIX +#define TEST_V2_0_RESONANCES_RMATRIX + +#include "test/v2.0/pops/PoPs_database.hpp" +#include "test/v2.0/resonances/ResonanceReactions.hpp" +#include "test/v2.0/resonances/SpinGroups.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("approximation") | + Defaulted{enums::BoundaryCondition::EliminateShiftFunction} + / Meta<>("boundaryCondition") | + std::optional{} + / Meta<>("boundaryConditionValue") | + Defaulted{false} + / Meta<>("calculateChannelRadius") | + Defaulted{true} + / Meta<>("calculatePenetrability") | + Defaulted{false} + / Meta<>("useForSelfShieldingOnly") | + Defaulted{false} + / 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", + "boundaryConditionValue", + "calculateChannelRadius", + "calculatePenetrability", + "useForSelfShieldingOnly", + "supportsAngularReconstruction", + "PoPs_database", + "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", + "boundary_condition_value", + "calculate_channel_radius", + "calculate_penetrability", + "use_for_self_shielding_only", + "supports_angular_reconstruction", + "po_ps_database", + "resonance_reactions", + "spin_groups" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const enums::BoundaryCondition boundaryCondition = enums::BoundaryCondition::EliminateShiftFunction; + static inline const bool calculateChannelRadius = false; + static inline const bool calculatePenetrability = true; + static inline const bool useForSelfShieldingOnly = false; + static inline const bool supportsAngularReconstruction = false; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + approximation{this}; + Field> + boundaryCondition{this,defaults.boundaryCondition}; + Field> + boundaryConditionValue{this}; + Field> + calculateChannelRadius{this,defaults.calculateChannelRadius}; + Field> + calculatePenetrability{this,defaults.calculatePenetrability}; + Field> + useForSelfShieldingOnly{this,defaults.useForSelfShieldingOnly}; + Field> + supportsAngularReconstruction{this,defaults.supportsAngularReconstruction}; + + // children + Field> + PoPs_database{this}; + Field + resonanceReactions{this}; + Field + spinGroups{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(resonanceReactions(),resonanceReaction); + GNDSTK_SHORTCUT(spinGroups(),spinGroup); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->approximation, \ + this->boundaryCondition, \ + this->boundaryConditionValue, \ + this->calculateChannelRadius, \ + this->calculatePenetrability, \ + this->useForSelfShieldingOnly, \ + this->supportsAngularReconstruction, \ + this->PoPs_database, \ + this->resonanceReactions, \ + this->spinGroups \ + ) + + // default + RMatrix() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit RMatrix( + const wrapper + &label, + const wrapper + &approximation = {}, + const wrapper> + &boundaryCondition = {}, + const wrapper> + &boundaryConditionValue = {}, + const wrapper> + &calculateChannelRadius = {}, + const wrapper> + &calculatePenetrability = {}, + const wrapper> + &useForSelfShieldingOnly = {}, + const wrapper> + &supportsAngularReconstruction = {}, + const wrapper> + &PoPs_database = {}, + const wrapper + &resonanceReactions = {}, + const wrapper + &spinGroups = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + approximation(this,approximation), + boundaryCondition(this,defaults.boundaryCondition,boundaryCondition), + boundaryConditionValue(this,boundaryConditionValue), + calculateChannelRadius(this,defaults.calculateChannelRadius,calculateChannelRadius), + calculatePenetrability(this,defaults.calculatePenetrability,calculatePenetrability), + useForSelfShieldingOnly(this,defaults.useForSelfShieldingOnly,useForSelfShieldingOnly), + supportsAngularReconstruction(this,defaults.supportsAngularReconstruction,supportsAngularReconstruction), + PoPs_database(this,PoPs_database), + resonanceReactions(this,resonanceReactions), + spinGroups(this,spinGroups) + { + Component::finish(); + } + + // from node + explicit RMatrix(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RMatrix(const RMatrix &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + approximation(this,other.approximation), + boundaryCondition(this,other.boundaryCondition), + boundaryConditionValue(this,other.boundaryConditionValue), + calculateChannelRadius(this,other.calculateChannelRadius), + calculatePenetrability(this,other.calculatePenetrability), + useForSelfShieldingOnly(this,other.useForSelfShieldingOnly), + supportsAngularReconstruction(this,other.supportsAngularReconstruction), + PoPs_database(this,other.PoPs_database), + resonanceReactions(this,other.resonanceReactions), + spinGroups(this,other.spinGroups) + { + Component::finish(other); + } + + // move + RMatrix(RMatrix &&other) : + 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)), + boundaryConditionValue(this,std::move(other.boundaryConditionValue)), + calculateChannelRadius(this,std::move(other.calculateChannelRadius)), + calculatePenetrability(this,std::move(other.calculatePenetrability)), + useForSelfShieldingOnly(this,std::move(other.useForSelfShieldingOnly)), + supportsAngularReconstruction(this,std::move(other.supportsAngularReconstruction)), + PoPs_database(this,std::move(other.PoPs_database)), + 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; + boundaryConditionValue = other.boundaryConditionValue; + calculateChannelRadius = other.calculateChannelRadius; + calculatePenetrability = other.calculatePenetrability; + useForSelfShieldingOnly = other.useForSelfShieldingOnly; + supportsAngularReconstruction = other.supportsAngularReconstruction; + PoPs_database = other.PoPs_database; + 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); + boundaryConditionValue = std::move(other.boundaryConditionValue); + calculateChannelRadius = std::move(other.calculateChannelRadius); + calculatePenetrability = std::move(other.calculatePenetrability); + useForSelfShieldingOnly = std::move(other.useForSelfShieldingOnly); + supportsAngularReconstruction = std::move(other.supportsAngularReconstruction); + PoPs_database = std::move(other.PoPs_database); + resonanceReactions = std::move(other.resonanceReactions); + spinGroups = std::move(other.spinGroups); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/RMatrix/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class RMatrix + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/RMatrix/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/RMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/RMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Resolved.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Resolved.hpp new file mode 100644 index 000000000..f8ff7b189 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Resolved.hpp @@ -0,0 +1,236 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_RESOLVED +#define TEST_V2_0_RESONANCES_RESOLVED + +#include "test/v2.0/resonances/RMatrix.hpp" +#include "test/v2.0/resonances/BreitWigner.hpp" +#include "test/v2.0/resonances/EnergyIntervals.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// class Resolved +// ----------------------------------------------------------------------------- + +class Resolved : + public Component +{ + friend class Component; + + using _t = std::variant< + resonances::RMatrix, + resonances::BreitWigner, + resonances::EnergyIntervals + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "resonances"; } + 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 + Float64{} + / Meta<>("domainMin") | + Float64{} + / Meta<>("domainMax") | + XMLName{} + / Meta<>("domainUnit") | + + // children + _t{} + / --(Child<>("RMatrix") || Child<>("BreitWigner") || Child<>("energyIntervals")) + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "_RMatrixBreitWignerenergyIntervals" + }; + 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", + "_rmatrix_breit_wignerenergy_intervals" + }; + 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 - variant + Field<_t> + _RMatrixBreitWignerenergyIntervals{this}; + FieldPart RMatrix{_RMatrixBreitWignerenergyIntervals}; + FieldPart BreitWigner{_RMatrixBreitWignerenergyIntervals}; + FieldPart energyIntervals{_RMatrixBreitWignerenergyIntervals}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->_RMatrixBreitWignerenergyIntervals \ + ) + + // default + Resolved() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Resolved( + const wrapper + &domainMin, + const wrapper + &domainMax = {}, + const wrapper + &domainUnit = {}, + const wrapper<_t> + &_RMatrixBreitWignerenergyIntervals = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainUnit(this,domainUnit), + _RMatrixBreitWignerenergyIntervals(this,_RMatrixBreitWignerenergyIntervals) + { + Component::finish(); + } + + // from node + explicit Resolved(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Resolved(const Resolved &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + domainUnit(this,other.domainUnit), + _RMatrixBreitWignerenergyIntervals(this,other._RMatrixBreitWignerenergyIntervals) + { + Component::finish(other); + } + + // move + Resolved(Resolved &&other) : + 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)), + _RMatrixBreitWignerenergyIntervals(this,std::move(other._RMatrixBreitWignerenergyIntervals)) + { + 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; + _RMatrixBreitWignerenergyIntervals = other._RMatrixBreitWignerenergyIntervals; + } + 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); + _RMatrixBreitWignerenergyIntervals = std::move(other._RMatrixBreitWignerenergyIntervals); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/Resolved/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Resolved + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Resolved/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Resolved/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Resolved/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceParameters.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceParameters.hpp new file mode 100644 index 000000000..8e36765de --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceParameters.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_RESONANCEPARAMETERS +#define TEST_V2_0_RESONANCES_RESONANCEPARAMETERS + +#include "test/v2.0/containers/Table.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(table().columnHeaders(),column); + GNDSTK_SHORTCUT(table(),columnHeaders); + GNDSTK_SHORTCUT(table(),data); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->table \ + ) + + // default + ResonanceParameters() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonanceParameters( + const wrapper + &table + ) : + GNDSTK_COMPONENT(BlockData{}), + table(this,table) + { + Component::finish(); + } + + // from node + explicit ResonanceParameters(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonanceParameters(const ResonanceParameters &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + table(this,other.table) + { + Component::finish(other); + } + + // move + ResonanceParameters(ResonanceParameters &&other) : + 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 "test/v2.0/resonances/ResonanceParameters/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResonanceParameters + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceParameters/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceParameters/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceParameters/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReaction.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReaction.hpp new file mode 100644 index 000000000..54de8ac4f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReaction.hpp @@ -0,0 +1,290 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_RESONANCEREACTION +#define TEST_V2_0_RESONANCES_RESONANCEREACTION + +#include "test/v2.0/common/Q.hpp" +#include "test/v2.0/resonances/ScatteringRadius.hpp" +#include "test/v2.0/resonances/HardSphereRadius.hpp" +#include "test/v2.0/containers/Link.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("ejectile") | + std::optional{} + / Meta<>("boundaryConditionValue") | + Defaulted{false} + / Meta<>("eliminated") | + + // children + --Child> + ("Q") | + --Child> + ("scatteringRadius") | + --Child> + ("hardSphereRadius") | + --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", + "label", + "ejectile", + "boundaryConditionValue", + "eliminated", + "Q", + "scatteringRadius", + "hardSphereRadius", + "link" + }; + 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", + "boundary_condition_value", + "eliminated", + "q", + "scattering_radius", + "hard_sphere_radius", + "link" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const bool eliminated = false; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + ejectile{this}; + Field> + boundaryConditionValue{this}; + Field> + eliminated{this,defaults.eliminated}; + + // children + Field> + Q{this}; + Field> + scatteringRadius{this}; + Field> + hardSphereRadius{this}; + Field + link{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ejectile, \ + this->boundaryConditionValue, \ + this->eliminated, \ + this->Q, \ + this->scatteringRadius, \ + this->hardSphereRadius, \ + this->link \ + ) + + // default + ResonanceReaction() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit ResonanceReaction( + const wrapper + &label, + const wrapper + &ejectile = {}, + const wrapper> + &boundaryConditionValue = {}, + const wrapper> + &eliminated = {}, + const wrapper> + &Q = {}, + const wrapper> + &scatteringRadius = {}, + const wrapper> + &hardSphereRadius = {}, + const wrapper + &link = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ejectile(this,ejectile), + boundaryConditionValue(this,boundaryConditionValue), + eliminated(this,defaults.eliminated,eliminated), + Q(this,Q), + scatteringRadius(this,scatteringRadius), + hardSphereRadius(this,hardSphereRadius), + link(this,link) + { + Component::finish(); + } + + // from node + explicit ResonanceReaction(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonanceReaction(const ResonanceReaction &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ejectile(this,other.ejectile), + boundaryConditionValue(this,other.boundaryConditionValue), + eliminated(this,other.eliminated), + Q(this,other.Q), + scatteringRadius(this,other.scatteringRadius), + hardSphereRadius(this,other.hardSphereRadius), + link(this,other.link) + { + Component::finish(other); + } + + // move + ResonanceReaction(ResonanceReaction &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + ejectile(this,std::move(other.ejectile)), + boundaryConditionValue(this,std::move(other.boundaryConditionValue)), + eliminated(this,std::move(other.eliminated)), + Q(this,std::move(other.Q)), + scatteringRadius(this,std::move(other.scatteringRadius)), + hardSphereRadius(this,std::move(other.hardSphereRadius)), + link(this,std::move(other.link)) + { + 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; + boundaryConditionValue = other.boundaryConditionValue; + eliminated = other.eliminated; + Q = other.Q; + scatteringRadius = other.scatteringRadius; + hardSphereRadius = other.hardSphereRadius; + link = other.link; + } + 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); + boundaryConditionValue = std::move(other.boundaryConditionValue); + eliminated = std::move(other.eliminated); + Q = std::move(other.Q); + scatteringRadius = std::move(other.scatteringRadius); + hardSphereRadius = std::move(other.hardSphereRadius); + link = std::move(other.link); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/ResonanceReaction/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResonanceReaction + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReaction/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReaction/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReaction/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReactions.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReactions.hpp new file mode 100644 index 000000000..b95802920 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_RESONANCEREACTIONS +#define TEST_V2_0_RESONANCES_RESONANCEREACTIONS + +#include "test/v2.0/resonances/ResonanceReaction.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->resonanceReaction \ + ) + + // default + ResonanceReactions() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonanceReactions( + const wrapper> + &resonanceReaction + ) : + GNDSTK_COMPONENT(BlockData{}), + resonanceReaction(this,resonanceReaction) + { + Component::finish(); + } + + // from node + explicit ResonanceReactions(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonanceReactions(const ResonanceReactions &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + resonanceReaction(this,other.resonanceReaction) + { + Component::finish(other); + } + + // move + ResonanceReactions(ResonanceReactions &&other) : + 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 "test/v2.0/resonances/ResonanceReactions/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResonanceReactions + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReactions/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReactions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ResonanceReactions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Resonances.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Resonances.hpp new file mode 100644 index 000000000..ca8d4570e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Resonances.hpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_RESONANCES +#define TEST_V2_0_RESONANCES_RESONANCES + +#include "test/v2.0/resonances/ScatteringRadius.hpp" +#include "test/v2.0/resonances/HardSphereRadius.hpp" +#include "test/v2.0/resonances/Resolved.hpp" +#include "test/v2.0/resonances/Unresolved.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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> + ("hardSphereRadius") | + ++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", + "hardSphereRadius", + "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", + "hard_sphere_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> + hardSphereRadius{this}; + Field>> + resolved{this}; + Field>> + unresolved{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->scatteringRadius, \ + this->hardSphereRadius, \ + this->resolved, \ + this->unresolved \ + ) + + // default + Resonances() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Resonances( + const wrapper> + &href, + const wrapper + &scatteringRadius = {}, + const wrapper> + &hardSphereRadius = {}, + const wrapper>> + &resolved = {}, + const wrapper>> + &unresolved = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href), + scatteringRadius(this,scatteringRadius), + hardSphereRadius(this,hardSphereRadius), + resolved(this,resolved), + unresolved(this,unresolved) + { + Component::finish(); + } + + // from node + explicit Resonances(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Resonances(const Resonances &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href), + scatteringRadius(this,other.scatteringRadius), + hardSphereRadius(this,other.hardSphereRadius), + resolved(this,other.resolved), + unresolved(this,other.unresolved) + { + Component::finish(other); + } + + // move + Resonances(Resonances &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)), + scatteringRadius(this,std::move(other.scatteringRadius)), + hardSphereRadius(this,std::move(other.hardSphereRadius)), + 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; + hardSphereRadius = other.hardSphereRadius; + 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); + hardSphereRadius = std::move(other.hardSphereRadius); + resolved = std::move(other.resolved); + unresolved = std::move(other.unresolved); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/Resonances/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Resonances + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Resonances/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Resonances/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Resonances/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ScatteringRadius.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ScatteringRadius.hpp new file mode 100644 index 000000000..f2893567f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ScatteringRadius.hpp @@ -0,0 +1,190 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_SCATTERINGRADIUS +#define TEST_V2_0_RESONANCES_SCATTERINGRADIUS + +#include "test/v2.0/containers/Constant1d.hpp" +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// class ScatteringRadius +// ----------------------------------------------------------------------------- + +class ScatteringRadius : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::Constant1d, + containers::XYs1d, + containers::Regions1d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "resonances"; } + 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 + _t{} + / --(Child<>("constant1d") || 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", + "_constant1dXYs1dregions1d" + }; + 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_xys1dregions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _constant1dXYs1dregions1d{this}; + FieldPart constant1d{_constant1dXYs1dregions1d}; + FieldPart XYs1d{_constant1dXYs1dregions1d}; + FieldPart regions1d{_constant1dXYs1dregions1d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_constant1dXYs1dregions1d \ + ) + + // default + ScatteringRadius() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringRadius( + const wrapper<_t> + &_constant1dXYs1dregions1d + ) : + GNDSTK_COMPONENT(BlockData{}), + _constant1dXYs1dregions1d(this,_constant1dXYs1dregions1d) + { + Component::finish(); + } + + // from node + explicit ScatteringRadius(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringRadius(const ScatteringRadius &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _constant1dXYs1dregions1d(this,other._constant1dXYs1dregions1d) + { + Component::finish(other); + } + + // move + ScatteringRadius(ScatteringRadius &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _constant1dXYs1dregions1d(this,std::move(other._constant1dXYs1dregions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ScatteringRadius &operator=(const ScatteringRadius &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _constant1dXYs1dregions1d = other._constant1dXYs1dregions1d; + } + return *this; + } + + // move + ScatteringRadius &operator=(ScatteringRadius &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _constant1dXYs1dregions1d = std::move(other._constant1dXYs1dregions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/ScatteringRadius/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ScatteringRadius + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/ScatteringRadius/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/ScatteringRadius/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/ScatteringRadius/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroup.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroup.hpp new file mode 100644 index 000000000..888a4a70f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroup.hpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_SPINGROUP +#define TEST_V2_0_RESONANCES_SPINGROUP + +#include "test/v2.0/resonances/Channels.hpp" +#include "test/v2.0/resonances/ResonanceParameters.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 + XMLName{} + / Meta<>("label") | + Fraction32{} + / Meta<>("spin") | + Defaulted{1} + / 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; + + // defaults + static inline const struct Defaults { + static inline const Integer32 parity = 1; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + spin{this}; + Field> + parity{this,defaults.parity}; + + // children + Field + channels{this}; + Field + resonanceParameters{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(channels(),channel); + GNDSTK_SHORTCUT(resonanceParameters().table(),columnHeaders); + GNDSTK_SHORTCUT(resonanceParameters().table(),data); + GNDSTK_SHORTCUT(resonanceParameters(),table); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->spin, \ + this->parity, \ + this->channels, \ + this->resonanceParameters \ + ) + + // default + SpinGroup() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit SpinGroup( + const wrapper + &label, + const wrapper + &spin = {}, + const wrapper> + &parity = {}, + const wrapper + &channels = {}, + const wrapper + &resonanceParameters = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + spin(this,spin), + parity(this,defaults.parity,parity), + channels(this,channels), + resonanceParameters(this,resonanceParameters) + { + Component::finish(); + } + + // from node + explicit SpinGroup(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SpinGroup(const SpinGroup &other) : + 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) : + 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 "test/v2.0/resonances/SpinGroup/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SpinGroup + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroup/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroup/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroup/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroups.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroups.hpp new file mode 100644 index 000000000..73eb28feb --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroups.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_SPINGROUPS +#define TEST_V2_0_RESONANCES_SPINGROUPS + +#include "test/v2.0/resonances/SpinGroup.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->spinGroup \ + ) + + // default + SpinGroups() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SpinGroups( + const wrapper> + &spinGroup + ) : + GNDSTK_COMPONENT(BlockData{}), + spinGroup(this,spinGroup) + { + Component::finish(); + } + + // from node + explicit SpinGroups(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SpinGroups(const SpinGroups &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + spinGroup(this,other.spinGroup) + { + Component::finish(other); + } + + // move + SpinGroups(SpinGroups &&other) : + 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 "test/v2.0/resonances/SpinGroups/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SpinGroups + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroups/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroups/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/SpinGroups/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/TabulatedWidths.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/TabulatedWidths.hpp new file mode 100644 index 000000000..9b3c74a1e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/TabulatedWidths.hpp @@ -0,0 +1,297 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_TABULATEDWIDTHS +#define TEST_V2_0_RESONANCES_TABULATEDWIDTHS + +#include "test/v2.0/pops/PoPs_database.hpp" +#include "test/v2.0/resonances/ScatteringRadius.hpp" +#include "test/v2.0/resonances/HardSphereRadius.hpp" +#include "test/v2.0/resonances/ResonanceReactions.hpp" +#include "test/v2.0/resonances/Ls.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("approximation") | + Defaulted{false} + / Meta<>("useForSelfShieldingOnly") | + + // children + --Child> + ("PoPs") | + --Child> + ("scatteringRadius") | + --Child> + ("hardSphereRadius") | + --Child + ("resonanceReactions") | + --Child + ("Ls") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "PoPs_database", + "scatteringRadius", + "hardSphereRadius", + "resonanceReactions", + "Ls" + }; + 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", + "po_ps_database", + "scattering_radius", + "hard_sphere_radius", + "resonance_reactions", + "ls" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const bool useForSelfShieldingOnly = false; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + approximation{this}; + Field> + useForSelfShieldingOnly{this,defaults.useForSelfShieldingOnly}; + + // children + Field> + PoPs_database{this}; + Field> + scatteringRadius{this}; + Field> + hardSphereRadius{this}; + Field + resonanceReactions{this}; + Field + Ls{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(Ls(),L); + GNDSTK_SHORTCUT(resonanceReactions(),resonanceReaction); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->approximation, \ + this->useForSelfShieldingOnly, \ + this->PoPs_database, \ + this->scatteringRadius, \ + this->hardSphereRadius, \ + this->resonanceReactions, \ + this->Ls \ + ) + + // default + TabulatedWidths() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit TabulatedWidths( + const wrapper + &label, + const wrapper + &approximation = {}, + const wrapper> + &useForSelfShieldingOnly = {}, + const wrapper> + &PoPs_database = {}, + const wrapper> + &scatteringRadius = {}, + const wrapper> + &hardSphereRadius = {}, + const wrapper + &resonanceReactions = {}, + const wrapper + &Ls = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + approximation(this,approximation), + useForSelfShieldingOnly(this,defaults.useForSelfShieldingOnly,useForSelfShieldingOnly), + PoPs_database(this,PoPs_database), + scatteringRadius(this,scatteringRadius), + hardSphereRadius(this,hardSphereRadius), + resonanceReactions(this,resonanceReactions), + Ls(this,Ls) + { + Component::finish(); + } + + // from node + explicit TabulatedWidths(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + TabulatedWidths(const TabulatedWidths &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + approximation(this,other.approximation), + useForSelfShieldingOnly(this,other.useForSelfShieldingOnly), + PoPs_database(this,other.PoPs_database), + scatteringRadius(this,other.scatteringRadius), + hardSphereRadius(this,other.hardSphereRadius), + resonanceReactions(this,other.resonanceReactions), + Ls(this,other.Ls) + { + Component::finish(other); + } + + // move + TabulatedWidths(TabulatedWidths &&other) : + 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)), + PoPs_database(this,std::move(other.PoPs_database)), + scatteringRadius(this,std::move(other.scatteringRadius)), + hardSphereRadius(this,std::move(other.hardSphereRadius)), + resonanceReactions(this,std::move(other.resonanceReactions)), + Ls(this,std::move(other.Ls)) + { + 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; + PoPs_database = other.PoPs_database; + scatteringRadius = other.scatteringRadius; + hardSphereRadius = other.hardSphereRadius; + resonanceReactions = other.resonanceReactions; + Ls = other.Ls; + } + 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); + PoPs_database = std::move(other.PoPs_database); + scatteringRadius = std::move(other.scatteringRadius); + hardSphereRadius = std::move(other.hardSphereRadius); + resonanceReactions = std::move(other.resonanceReactions); + Ls = std::move(other.Ls); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/TabulatedWidths/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class TabulatedWidths + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/TabulatedWidths/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/TabulatedWidths/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/TabulatedWidths/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Unresolved.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Unresolved.hpp new file mode 100644 index 000000000..2842abebe --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Unresolved.hpp @@ -0,0 +1,230 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_UNRESOLVED +#define TEST_V2_0_RESONANCES_UNRESOLVED + +#include "test/v2.0/resonances/TabulatedWidths.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// class Unresolved +// ----------------------------------------------------------------------------- + +class Unresolved : + public Component +{ + friend class Component; + + using _t = std::variant< + resonances::TabulatedWidths + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "resonances"; } + 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 + Float64{} + / Meta<>("domainMin") | + Float64{} + / Meta<>("domainMax") | + XMLName{} + / Meta<>("domainUnit") | + + // children + _t{} + / --(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 - variant + Field<_t> + _tabulatedWidths{this}; + FieldPart tabulatedWidths{_tabulatedWidths}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->_tabulatedWidths \ + ) + + // default + Unresolved() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unresolved( + const wrapper + &domainMin, + const wrapper + &domainMax = {}, + const wrapper + &domainUnit = {}, + const wrapper<_t> + &_tabulatedWidths = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainUnit(this,domainUnit), + _tabulatedWidths(this,_tabulatedWidths) + { + Component::finish(); + } + + // from node + explicit Unresolved(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unresolved(const Unresolved &other) : + 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) : + 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 "test/v2.0/resonances/Unresolved/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Unresolved + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Unresolved/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Unresolved/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Unresolved/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Width.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Width.hpp new file mode 100644 index 000000000..5779e088e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Width.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_WIDTH +#define TEST_V2_0_RESONANCES_WIDTH + +#include "test/v2.0/containers/Constant1d.hpp" +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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<>("resonanceReaction") | + Float64{} + / Meta<>("degreesOfFreedom") | + + // children + --Child> + ("constant1d") | + --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", + "resonanceReaction", + "degreesOfFreedom", + "constant1d", + "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", + "resonance_reaction", + "degrees_of_freedom", + "constant1d", + "xys1d", + "regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + resonanceReaction{this}; + Field + degreesOfFreedom{this}; + + // children + Field> + constant1d{this}; + Field> + XYs1d{this}; + Field> + regions1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->resonanceReaction, \ + this->degreesOfFreedom, \ + this->constant1d, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + Width() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Width( + const wrapper + &resonanceReaction, + const wrapper + °reesOfFreedom = {}, + const wrapper> + &constant1d = {}, + const wrapper> + &XYs1d = {}, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + resonanceReaction(this,resonanceReaction), + degreesOfFreedom(this,degreesOfFreedom), + constant1d(this,constant1d), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit Width(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Width(const Width &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + resonanceReaction(this,other.resonanceReaction), + degreesOfFreedom(this,other.degreesOfFreedom), + constant1d(this,other.constant1d), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + Width(Width &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + resonanceReaction(this,std::move(other.resonanceReaction)), + degreesOfFreedom(this,std::move(other.degreesOfFreedom)), + constant1d(this,std::move(other.constant1d)), + XYs1d(this,std::move(other.XYs1d)), + 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; + resonanceReaction = other.resonanceReaction; + degreesOfFreedom = other.degreesOfFreedom; + constant1d = other.constant1d; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + Width &operator=(Width &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + resonanceReaction = std::move(other.resonanceReaction); + degreesOfFreedom = std::move(other.degreesOfFreedom); + constant1d = std::move(other.constant1d); + XYs1d = std::move(other.XYs1d); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/resonances/Width/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Width + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Width/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Width/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Width/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Widths.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Widths.hpp new file mode 100644 index 000000000..52d24c512 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Widths.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_RESONANCES_WIDTHS +#define TEST_V2_0_RESONANCES_WIDTHS + +#include "test/v2.0/resonances/Width.hpp" + +namespace test { +namespace v2_0 { +namespace resonances { + +// ----------------------------------------------------------------------------- +// resonances:: +// 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 "resonances"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->width \ + ) + + // default + Widths() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Widths( + const wrapper> + &width + ) : + GNDSTK_COMPONENT(BlockData{}), + width(this,width) + { + Component::finish(); + } + + // from node + explicit Widths(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Widths(const Widths &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + width(this,other.width) + { + Component::finish(other); + } + + // move + Widths(Widths &&other) : + 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 "test/v2.0/resonances/Widths/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Widths + +} // namespace resonances +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/resonances/Widths/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/resonances/Widths/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/resonances/Widths/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/AngularDistributionReconstructed.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/AngularDistributionReconstructed.hpp new file mode 100644 index 000000000..3e216e84c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/AngularDistributionReconstructed.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_ANGULARDISTRIBUTIONRECONSTRUCTED +#define TEST_V2_0_STYLES_ANGULARDISTRIBUTIONRECONSTRUCTED + +#include "test/v2.0/styles/Temperature.hpp" +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class AngularDistributionReconstructed +// ----------------------------------------------------------------------------- + +class AngularDistributionReconstructed : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "AngularDistributionReconstructed"; } + static auto NODENAME() { return "angularDistributionReconstructed"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("label") | + std::optional{} + / Meta<>("derivedFrom") | + + // children + --Child> + ("temperature") | + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "label", + "derivedFrom", + "temperature", + "documentation" + }; + 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", + "label", + "derived_from", + "temperature", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + label{this}; + Field> + derivedFrom{this}; + + // children + Field> + temperature{this}; + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->label, \ + this->derivedFrom, \ + this->temperature, \ + this->documentation \ + ) + + // default + AngularDistributionReconstructed() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AngularDistributionReconstructed( + const wrapper + &date, + const wrapper + &label = {}, + const wrapper> + &derivedFrom = {}, + const wrapper> + &temperature = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + label(this,label), + derivedFrom(this,derivedFrom), + temperature(this,temperature), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit AngularDistributionReconstructed(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AngularDistributionReconstructed(const AngularDistributionReconstructed &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + label(this,other.label), + derivedFrom(this,other.derivedFrom), + temperature(this,other.temperature), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + AngularDistributionReconstructed(AngularDistributionReconstructed &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + label(this,std::move(other.label)), + derivedFrom(this,std::move(other.derivedFrom)), + temperature(this,std::move(other.temperature)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AngularDistributionReconstructed &operator=(const AngularDistributionReconstructed &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + label = other.label; + derivedFrom = other.derivedFrom; + temperature = other.temperature; + documentation = other.documentation; + } + return *this; + } + + // move + AngularDistributionReconstructed &operator=(AngularDistributionReconstructed &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + label = std::move(other.label); + derivedFrom = std::move(other.derivedFrom); + temperature = std::move(other.temperature); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/AngularDistributionReconstructed/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AngularDistributionReconstructed + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/AngularDistributionReconstructed/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/AngularDistributionReconstructed/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/AngularDistributionReconstructed/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/AverageProductData.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/AverageProductData.hpp new file mode 100644 index 000000000..12bc0997e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/AverageProductData.hpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_AVERAGEPRODUCTDATA +#define TEST_V2_0_STYLES_AVERAGEPRODUCTDATA + +#include "test/v2.0/styles/Temperature.hpp" +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class AverageProductData +// ----------------------------------------------------------------------------- + +class AverageProductData : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "AverageProductData"; } + static auto NODENAME() { return "averageProductData"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("label") | + std::optional{} + / Meta<>("derivedFrom") | + + // children + --Child + ("temperature") | + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "label", + "derivedFrom", + "temperature", + "documentation" + }; + 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", + "label", + "derived_from", + "temperature", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + label{this}; + Field> + derivedFrom{this}; + + // children + Field + temperature{this}; + Field> + documentation{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(temperature(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->label, \ + this->derivedFrom, \ + this->temperature, \ + this->documentation \ + ) + + // default + AverageProductData() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageProductData( + const wrapper + &date, + const wrapper + &label = {}, + const wrapper> + &derivedFrom = {}, + const wrapper + &temperature = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + label(this,label), + derivedFrom(this,derivedFrom), + temperature(this,temperature), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit AverageProductData(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageProductData(const AverageProductData &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + label(this,other.label), + derivedFrom(this,other.derivedFrom), + temperature(this,other.temperature), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + AverageProductData(AverageProductData &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + label(this,std::move(other.label)), + derivedFrom(this,std::move(other.derivedFrom)), + temperature(this,std::move(other.temperature)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AverageProductData &operator=(const AverageProductData &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + label = other.label; + derivedFrom = other.derivedFrom; + temperature = other.temperature; + documentation = other.documentation; + } + return *this; + } + + // move + AverageProductData &operator=(AverageProductData &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + label = std::move(other.label); + derivedFrom = std::move(other.derivedFrom); + temperature = std::move(other.temperature); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/AverageProductData/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AverageProductData + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/AverageProductData/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/AverageProductData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/AverageProductData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Bondarenko.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Bondarenko.hpp new file mode 100644 index 000000000..8ec3fddd3 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Bondarenko.hpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_BONDARENKO +#define TEST_V2_0_STYLES_BONDARENKO + +#include "test/v2.0/styles/SigmaZeros.hpp" +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class Bondarenko +// ----------------------------------------------------------------------------- + +class Bondarenko : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "Bondarenko"; } + static auto NODENAME() { return "Bondarenko"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + + // children + --Child + ("sigmaZeros") | + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "sigmaZeros", + "documentation" + }; + 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", + "derived_from", + "label", + "sigma_zeros", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + + // children + Field + sigmaZeros{this}; + Field> + documentation{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(sigmaZeros(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->sigmaZeros, \ + this->documentation \ + ) + + // default + Bondarenko() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Bondarenko( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper + &sigmaZeros = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + sigmaZeros(this,sigmaZeros), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit Bondarenko(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Bondarenko(const Bondarenko &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + sigmaZeros(this,other.sigmaZeros), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + Bondarenko(Bondarenko &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + sigmaZeros(this,std::move(other.sigmaZeros)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Bondarenko &operator=(const Bondarenko &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + sigmaZeros = other.sigmaZeros; + documentation = other.documentation; + } + return *this; + } + + // move + Bondarenko &operator=(Bondarenko &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + sigmaZeros = std::move(other.sigmaZeros); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/Bondarenko/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Bondarenko + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Bondarenko/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Bondarenko/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Bondarenko/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.hpp new file mode 100644 index 000000000..a6e71a0bd --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_COULOMBPLUSNUCLEARELASTICMUCUTOFF +#define TEST_V2_0_STYLES_COULOMBPLUSNUCLEARELASTICMUCUTOFF + +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class CoulombPlusNuclearElasticMuCutoff +// ----------------------------------------------------------------------------- + +class CoulombPlusNuclearElasticMuCutoff : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "CoulombPlusNuclearElasticMuCutoff"; } + static auto NODENAME() { return "CoulombPlusNuclearElasticMuCutoff"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + Float64{} + / Meta<>("muCutoff") | + + // children + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "muCutoff", + "documentation" + }; + 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", + "derived_from", + "label", + "mu_cutoff", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + Field + muCutoff{this}; + + // children + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->muCutoff, \ + this->documentation \ + ) + + // default + CoulombPlusNuclearElasticMuCutoff() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CoulombPlusNuclearElasticMuCutoff( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper + &muCutoff = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + muCutoff(this,muCutoff), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit CoulombPlusNuclearElasticMuCutoff(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CoulombPlusNuclearElasticMuCutoff(const CoulombPlusNuclearElasticMuCutoff &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + muCutoff(this,other.muCutoff), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + CoulombPlusNuclearElasticMuCutoff(CoulombPlusNuclearElasticMuCutoff &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + muCutoff(this,std::move(other.muCutoff)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CoulombPlusNuclearElasticMuCutoff &operator=(const CoulombPlusNuclearElasticMuCutoff &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + muCutoff = other.muCutoff; + documentation = other.documentation; + } + return *this; + } + + // move + CoulombPlusNuclearElasticMuCutoff &operator=(CoulombPlusNuclearElasticMuCutoff &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + muCutoff = std::move(other.muCutoff); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CoulombPlusNuclearElasticMuCutoff + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/CrossSectionReconstructed.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/CrossSectionReconstructed.hpp new file mode 100644 index 000000000..54874c9ea --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/CrossSectionReconstructed.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_CROSSSECTIONRECONSTRUCTED +#define TEST_V2_0_STYLES_CROSSSECTIONRECONSTRUCTED + +#include "test/v2.0/styles/Temperature.hpp" +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// 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 "styles"; } + 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<>("date") | + XMLName{} + / Meta<>("label") | + std::optional{} + / Meta<>("derivedFrom") | + + // children + --Child> + ("temperature") | + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "label", + "derivedFrom", + "temperature", + "documentation" + }; + 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", + "label", + "derived_from", + "temperature", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + label{this}; + Field> + derivedFrom{this}; + + // children + Field> + temperature{this}; + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->label, \ + this->derivedFrom, \ + this->temperature, \ + this->documentation \ + ) + + // default + CrossSectionReconstructed() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSectionReconstructed( + const wrapper + &date, + const wrapper + &label = {}, + const wrapper> + &derivedFrom = {}, + const wrapper> + &temperature = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + label(this,label), + derivedFrom(this,derivedFrom), + temperature(this,temperature), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit CrossSectionReconstructed(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSectionReconstructed(const CrossSectionReconstructed &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + label(this,other.label), + derivedFrom(this,other.derivedFrom), + temperature(this,other.temperature), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + CrossSectionReconstructed(CrossSectionReconstructed &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + label(this,std::move(other.label)), + derivedFrom(this,std::move(other.derivedFrom)), + temperature(this,std::move(other.temperature)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CrossSectionReconstructed &operator=(const CrossSectionReconstructed &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + label = other.label; + derivedFrom = other.derivedFrom; + temperature = other.temperature; + documentation = other.documentation; + } + return *this; + } + + // move + CrossSectionReconstructed &operator=(CrossSectionReconstructed &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + label = std::move(other.label); + derivedFrom = std::move(other.derivedFrom); + temperature = std::move(other.temperature); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/CrossSectionReconstructed/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CrossSectionReconstructed + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/CrossSectionReconstructed/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/CrossSectionReconstructed/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/CrossSectionReconstructed/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/EqualProbableBins.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/EqualProbableBins.hpp new file mode 100644 index 000000000..3a5c9d796 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/EqualProbableBins.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_EQUALPROBABLEBINS +#define TEST_V2_0_STYLES_EQUALPROBABLEBINS + +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class EqualProbableBins +// ----------------------------------------------------------------------------- + +class EqualProbableBins : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "EqualProbableBins"; } + static auto NODENAME() { return "equalProbableBins"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + Integer32{} + / Meta<>("numberOfBins") | + + // children + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "numberOfBins", + "documentation" + }; + 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", + "derived_from", + "label", + "number_of_bins", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + Field + numberOfBins{this}; + + // children + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->numberOfBins, \ + this->documentation \ + ) + + // default + EqualProbableBins() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EqualProbableBins( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper + &numberOfBins = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + numberOfBins(this,numberOfBins), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit EqualProbableBins(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EqualProbableBins(const EqualProbableBins &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + numberOfBins(this,other.numberOfBins), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + EqualProbableBins(EqualProbableBins &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + numberOfBins(this,std::move(other.numberOfBins)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EqualProbableBins &operator=(const EqualProbableBins &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + numberOfBins = other.numberOfBins; + documentation = other.documentation; + } + return *this; + } + + // move + EqualProbableBins &operator=(EqualProbableBins &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + numberOfBins = std::move(other.numberOfBins); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/EqualProbableBins/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EqualProbableBins + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/EqualProbableBins/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/EqualProbableBins/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/EqualProbableBins/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Evaluated.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Evaluated.hpp new file mode 100644 index 000000000..9b97415a4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Evaluated.hpp @@ -0,0 +1,288 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_EVALUATED +#define TEST_V2_0_STYLES_EVALUATED + +#include "test/v2.0/styles/ProjectileEnergyDomain.hpp" +#include "test/v2.0/styles/Temperature.hpp" +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// 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 "styles"; } + 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<>("date") | + XMLName{} + / Meta<>("label") | + std::optional{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("library") | + XMLName{} + / Meta<>("version") | + + // children + --Child + ("projectileEnergyDomain") | + --Child + ("temperature") | + --Child + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "label", + "derivedFrom", + "library", + "version", + "projectileEnergyDomain", + "temperature", + "documentation" + }; + 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", + "label", + "derived_from", + "library", + "version", + "projectile_energy_domain", + "temperature", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + label{this}; + Field> + derivedFrom{this}; + Field + library{this}; + Field + version{this}; + + // children + Field + projectileEnergyDomain{this}; + Field + temperature{this}; + Field + documentation{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(temperature(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->label, \ + this->derivedFrom, \ + this->library, \ + this->version, \ + this->projectileEnergyDomain, \ + this->temperature, \ + this->documentation \ + ) + + // default + Evaluated() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Evaluated( + const wrapper + &date, + const wrapper + &label = {}, + const wrapper> + &derivedFrom = {}, + const wrapper + &library = {}, + const wrapper + &version = {}, + const wrapper + &projectileEnergyDomain = {}, + const wrapper + &temperature = {}, + const wrapper + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + label(this,label), + derivedFrom(this,derivedFrom), + library(this,library), + version(this,version), + projectileEnergyDomain(this,projectileEnergyDomain), + temperature(this,temperature), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit Evaluated(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Evaluated(const Evaluated &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + label(this,other.label), + derivedFrom(this,other.derivedFrom), + library(this,other.library), + version(this,other.version), + projectileEnergyDomain(this,other.projectileEnergyDomain), + temperature(this,other.temperature), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + Evaluated(Evaluated &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + label(this,std::move(other.label)), + derivedFrom(this,std::move(other.derivedFrom)), + library(this,std::move(other.library)), + version(this,std::move(other.version)), + projectileEnergyDomain(this,std::move(other.projectileEnergyDomain)), + temperature(this,std::move(other.temperature)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Evaluated &operator=(const Evaluated &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + label = other.label; + derivedFrom = other.derivedFrom; + library = other.library; + version = other.version; + projectileEnergyDomain = other.projectileEnergyDomain; + temperature = other.temperature; + documentation = other.documentation; + } + return *this; + } + + // move + Evaluated &operator=(Evaluated &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + label = std::move(other.label); + derivedFrom = std::move(other.derivedFrom); + library = std::move(other.library); + version = std::move(other.version); + projectileEnergyDomain = std::move(other.projectileEnergyDomain); + temperature = std::move(other.temperature); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/Evaluated/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Evaluated + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Evaluated/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Evaluated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Evaluated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Flux.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Flux.hpp new file mode 100644 index 000000000..fe9005c92 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Flux.hpp @@ -0,0 +1,204 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_FLUX +#define TEST_V2_0_STYLES_FLUX + +#include "test/v2.0/containers/XYs2d.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class Flux +// ----------------------------------------------------------------------------- + +class Flux : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "Flux"; } + static auto NODENAME() { return "flux"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("label") | + + // 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", + "label", + "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", + "label", + "xys2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field + XYs2d{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs2d(),axes); + GNDSTK_SHORTCUT(XYs2d(),function1ds); + GNDSTK_SHORTCUT(XYs2d(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->XYs2d \ + ) + + // default + Flux() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Flux( + const wrapper + &label, + const wrapper + &XYs2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit Flux(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Flux(const Flux &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + Flux(Flux &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + XYs2d(this,std::move(other.XYs2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Flux &operator=(const Flux &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + XYs2d = other.XYs2d; + } + return *this; + } + + // move + Flux &operator=(Flux &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + XYs2d = std::move(other.XYs2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/Flux/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Flux + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Flux/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Flux/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Flux/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/GriddedCrossSection.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/GriddedCrossSection.hpp new file mode 100644 index 000000000..684e75f84 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/GriddedCrossSection.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_GRIDDEDCROSSSECTION +#define TEST_V2_0_STYLES_GRIDDEDCROSSSECTION + +#include "test/v2.0/containers/Grid.hpp" +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class GriddedCrossSection +// ----------------------------------------------------------------------------- + +class GriddedCrossSection : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "GriddedCrossSection"; } + static auto NODENAME() { return "griddedCrossSection"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + + // children + --Child + ("grid") | + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "grid", + "documentation" + }; + 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", + "derived_from", + "label", + "grid", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + + // children + Field + grid{this}; + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->grid, \ + this->documentation \ + ) + + // default + GriddedCrossSection() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GriddedCrossSection( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper + &grid = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + grid(this,grid), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit GriddedCrossSection(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GriddedCrossSection(const GriddedCrossSection &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + grid(this,other.grid), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + GriddedCrossSection(GriddedCrossSection &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + grid(this,std::move(other.grid)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + GriddedCrossSection &operator=(const GriddedCrossSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + grid = other.grid; + documentation = other.documentation; + } + return *this; + } + + // move + GriddedCrossSection &operator=(GriddedCrossSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + grid = std::move(other.grid); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/GriddedCrossSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class GriddedCrossSection + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/GriddedCrossSection/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/GriddedCrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/GriddedCrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Heated.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Heated.hpp new file mode 100644 index 000000000..c1b340995 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Heated.hpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_HEATED +#define TEST_V2_0_STYLES_HEATED + +#include "test/v2.0/styles/Temperature.hpp" +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class Heated +// ----------------------------------------------------------------------------- + +class Heated : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "Heated"; } + static auto NODENAME() { return "heated"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + + // children + --Child + ("temperature") | + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "temperature", + "documentation" + }; + 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", + "derived_from", + "label", + "temperature", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + + // children + Field + temperature{this}; + Field> + documentation{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(temperature(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->temperature, \ + this->documentation \ + ) + + // default + Heated() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Heated( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper + &temperature = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + temperature(this,temperature), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit Heated(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Heated(const Heated &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + temperature(this,other.temperature), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + Heated(Heated &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + temperature(this,std::move(other.temperature)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Heated &operator=(const Heated &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + temperature = other.temperature; + documentation = other.documentation; + } + return *this; + } + + // move + Heated &operator=(Heated &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + temperature = std::move(other.temperature); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/Heated/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Heated + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Heated/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Heated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Heated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/HeatedMultiGroup.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/HeatedMultiGroup.hpp new file mode 100644 index 000000000..34e138bc9 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/HeatedMultiGroup.hpp @@ -0,0 +1,280 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_HEATEDMULTIGROUP +#define TEST_V2_0_STYLES_HEATEDMULTIGROUP + +#include "test/v2.0/styles/Transportables.hpp" +#include "test/v2.0/styles/Flux.hpp" +#include "test/v2.0/styles/InverseSpeed.hpp" +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class HeatedMultiGroup +// ----------------------------------------------------------------------------- + +class HeatedMultiGroup : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "HeatedMultiGroup"; } + static auto NODENAME() { return "heatedMultiGroup"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + + // children + --Child + ("transportables") | + --Child + ("flux") | + --Child + ("inverseSpeed") | + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "transportables", + "flux", + "inverseSpeed", + "documentation" + }; + 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", + "derived_from", + "label", + "transportables", + "flux", + "inverse_speed", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + + // children + Field + transportables{this}; + Field + flux{this}; + Field + inverseSpeed{this}; + Field> + documentation{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(flux(),XYs2d); + GNDSTK_SHORTCUT(inverseSpeed().gridded1d(),array); + GNDSTK_SHORTCUT(flux().XYs2d(),function1ds); + GNDSTK_SHORTCUT(inverseSpeed(),gridded1d); + GNDSTK_SHORTCUT(transportables(),transportable); + GNDSTK_SHORTCUT(flux().XYs2d(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->transportables, \ + this->flux, \ + this->inverseSpeed, \ + this->documentation \ + ) + + // default + HeatedMultiGroup() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit HeatedMultiGroup( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper + &transportables = {}, + const wrapper + &flux = {}, + const wrapper + &inverseSpeed = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + transportables(this,transportables), + flux(this,flux), + inverseSpeed(this,inverseSpeed), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit HeatedMultiGroup(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + HeatedMultiGroup(const HeatedMultiGroup &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + transportables(this,other.transportables), + flux(this,other.flux), + inverseSpeed(this,other.inverseSpeed), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + HeatedMultiGroup(HeatedMultiGroup &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + transportables(this,std::move(other.transportables)), + flux(this,std::move(other.flux)), + inverseSpeed(this,std::move(other.inverseSpeed)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + HeatedMultiGroup &operator=(const HeatedMultiGroup &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + transportables = other.transportables; + flux = other.flux; + inverseSpeed = other.inverseSpeed; + documentation = other.documentation; + } + return *this; + } + + // move + HeatedMultiGroup &operator=(HeatedMultiGroup &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + transportables = std::move(other.transportables); + flux = std::move(other.flux); + inverseSpeed = std::move(other.inverseSpeed); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/HeatedMultiGroup/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class HeatedMultiGroup + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/HeatedMultiGroup/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/HeatedMultiGroup/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/HeatedMultiGroup/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/InverseSpeed.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/InverseSpeed.hpp new file mode 100644 index 000000000..b42a99db5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/InverseSpeed.hpp @@ -0,0 +1,205 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_INVERSESPEED +#define TEST_V2_0_STYLES_INVERSESPEED + +#include "test/v2.0/containers/Gridded1d.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class InverseSpeed +// ----------------------------------------------------------------------------- + +class InverseSpeed : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "InverseSpeed"; } + static auto NODENAME() { return "inverseSpeed"; } + + // 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 + ("gridded1d") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "gridded1d" + }; + 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", + "gridded1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + + // children + Field + gridded1d{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(gridded1d(),axes); + GNDSTK_SHORTCUT(gridded1d().axes(),axis); + GNDSTK_SHORTCUT(gridded1d().axes(),grid); + GNDSTK_SHORTCUT(gridded1d().array(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->gridded1d \ + ) + + // default + InverseSpeed() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit InverseSpeed( + const wrapper> + &label, + const wrapper + &gridded1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + gridded1d(this,gridded1d) + { + Component::finish(); + } + + // from node + explicit InverseSpeed(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + InverseSpeed(const InverseSpeed &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + gridded1d(this,other.gridded1d) + { + Component::finish(other); + } + + // move + InverseSpeed(InverseSpeed &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + gridded1d(this,std::move(other.gridded1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + InverseSpeed &operator=(const InverseSpeed &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + gridded1d = other.gridded1d; + } + return *this; + } + + // move + InverseSpeed &operator=(InverseSpeed &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + gridded1d = std::move(other.gridded1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/InverseSpeed/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class InverseSpeed + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/InverseSpeed/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/InverseSpeed/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/InverseSpeed/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/MonteCarlo_cdf.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/MonteCarlo_cdf.hpp new file mode 100644 index 000000000..ea8ab4041 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/MonteCarlo_cdf.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_MONTECARLO_CDF +#define TEST_V2_0_STYLES_MONTECARLO_CDF + +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class MonteCarlo_cdf +// ----------------------------------------------------------------------------- + +class MonteCarlo_cdf : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "MonteCarlo_cdf"; } + static auto NODENAME() { return "MonteCarlo_cdf"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + + // children + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "documentation" + }; + 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", + "derived_from", + "label", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + + // children + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->documentation \ + ) + + // default + MonteCarlo_cdf() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MonteCarlo_cdf( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit MonteCarlo_cdf(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MonteCarlo_cdf(const MonteCarlo_cdf &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + MonteCarlo_cdf(MonteCarlo_cdf &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MonteCarlo_cdf &operator=(const MonteCarlo_cdf &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + documentation = other.documentation; + } + return *this; + } + + // move + MonteCarlo_cdf &operator=(MonteCarlo_cdf &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/MonteCarlo_cdf/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MonteCarlo_cdf + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/MonteCarlo_cdf/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/MonteCarlo_cdf/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/MonteCarlo_cdf/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/MultiBand.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/MultiBand.hpp new file mode 100644 index 000000000..c715981a2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/MultiBand.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_MULTIBAND +#define TEST_V2_0_STYLES_MULTIBAND + +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class MultiBand +// ----------------------------------------------------------------------------- + +class MultiBand : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "MultiBand"; } + static auto NODENAME() { return "multiBand"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + Integer32{} + / Meta<>("numberOfBands") | + + // children + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "numberOfBands", + "documentation" + }; + 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", + "derived_from", + "label", + "number_of_bands", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + Field + numberOfBands{this}; + + // children + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->numberOfBands, \ + this->documentation \ + ) + + // default + MultiBand() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiBand( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper + &numberOfBands = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + numberOfBands(this,numberOfBands), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit MultiBand(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiBand(const MultiBand &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + numberOfBands(this,other.numberOfBands), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + MultiBand(MultiBand &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + numberOfBands(this,std::move(other.numberOfBands)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MultiBand &operator=(const MultiBand &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + numberOfBands = other.numberOfBands; + documentation = other.documentation; + } + return *this; + } + + // move + MultiBand &operator=(MultiBand &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + numberOfBands = std::move(other.numberOfBands); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/MultiBand/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MultiBand + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/MultiBand/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/MultiBand/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/MultiBand/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/MultiGroup.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/MultiGroup.hpp new file mode 100644 index 000000000..68596b0d7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/MultiGroup.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_MULTIGROUP +#define TEST_V2_0_STYLES_MULTIGROUP + +#include "test/v2.0/containers/Grid.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// 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 "styles"; } + 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 + XMLName{} + / Meta<>("label") | + + // children + --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", + "label", + "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", + "label", + "grid" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field + grid{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->grid \ + ) + + // default + MultiGroup() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiGroup( + const wrapper + &label, + const wrapper + &grid = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + grid(this,grid) + { + Component::finish(); + } + + // from node + explicit MultiGroup(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiGroup(const MultiGroup &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + grid(this,other.grid) + { + Component::finish(other); + } + + // move + MultiGroup(MultiGroup &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + grid(this,std::move(other.grid)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MultiGroup &operator=(const MultiGroup &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + grid = other.grid; + } + return *this; + } + + // move + MultiGroup &operator=(MultiGroup &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + grid = std::move(other.grid); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/MultiGroup/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MultiGroup + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/MultiGroup/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/MultiGroup/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/MultiGroup/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/ProjectileEnergyDomain.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/ProjectileEnergyDomain.hpp new file mode 100644 index 000000000..79408c079 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/ProjectileEnergyDomain.hpp @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_PROJECTILEENERGYDOMAIN +#define TEST_V2_0_STYLES_PROJECTILEENERGYDOMAIN + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// 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 "styles"; } + 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 + std::optional{} + / Meta<>("label") | + Float64{} + / Meta<>("max") | + Float64{} + / Meta<>("min") | + XMLName{} + / 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", + "max", + "min", + "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", + "max", + "min", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field + max{this}; + Field + min{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->max, \ + this->min, \ + this->unit \ + ) + + // default + ProjectileEnergyDomain() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ProjectileEnergyDomain( + const wrapper> + &label, + const wrapper + &max = {}, + const wrapper + &min = {}, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + max(this,max), + min(this,min), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit ProjectileEnergyDomain(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ProjectileEnergyDomain(const ProjectileEnergyDomain &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + max(this,other.max), + min(this,other.min), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + ProjectileEnergyDomain(ProjectileEnergyDomain &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + max(this,std::move(other.max)), + min(this,std::move(other.min)), + 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; + label = other.label; + max = other.max; + min = other.min; + unit = other.unit; + } + return *this; + } + + // move + ProjectileEnergyDomain &operator=(ProjectileEnergyDomain &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + max = std::move(other.max); + min = std::move(other.min); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/ProjectileEnergyDomain/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ProjectileEnergyDomain + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/ProjectileEnergyDomain/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/ProjectileEnergyDomain/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/ProjectileEnergyDomain/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Realization.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Realization.hpp new file mode 100644 index 000000000..3626efee1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Realization.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_REALIZATION +#define TEST_V2_0_STYLES_REALIZATION + +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class Realization +// ----------------------------------------------------------------------------- + +class Realization : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "Realization"; } + static auto NODENAME() { return "realization"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + + // children + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "documentation" + }; + 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", + "derived_from", + "label", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + + // children + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->documentation \ + ) + + // default + Realization() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Realization( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit Realization(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Realization(const Realization &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + Realization(Realization &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Realization &operator=(const Realization &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + documentation = other.documentation; + } + return *this; + } + + // move + Realization &operator=(Realization &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/Realization/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Realization + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Realization/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Realization/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Realization/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/SigmaZeros.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/SigmaZeros.hpp new file mode 100644 index 000000000..c8ef445d6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/SigmaZeros.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_SIGMAZEROS +#define TEST_V2_0_STYLES_SIGMAZEROS + +#include "test/v2.0/containers/Values.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class SigmaZeros +// ----------------------------------------------------------------------------- + +class SigmaZeros : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "SigmaZeros"; } + static auto NODENAME() { return "sigmaZeros"; } + + // 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 + ("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", + "label", + "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", + "label", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + + // children + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->values \ + ) + + // default + SigmaZeros() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SigmaZeros( + const wrapper> + &label, + const wrapper + &values = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + values(this,values) + { + Component::finish(); + } + + // from node + explicit SigmaZeros(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SigmaZeros(const SigmaZeros &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + values(this,other.values) + { + Component::finish(other); + } + + // move + SigmaZeros(SigmaZeros &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + SigmaZeros &operator=(const SigmaZeros &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + values = other.values; + } + return *this; + } + + // move + SigmaZeros &operator=(SigmaZeros &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/SigmaZeros/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SigmaZeros + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/SigmaZeros/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/SigmaZeros/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/SigmaZeros/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/SnElasticUpScatter.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/SnElasticUpScatter.hpp new file mode 100644 index 000000000..7c6dfb5db --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/SnElasticUpScatter.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_SNELASTICUPSCATTER +#define TEST_V2_0_STYLES_SNELASTICUPSCATTER + +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class SnElasticUpScatter +// ----------------------------------------------------------------------------- + +class SnElasticUpScatter : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "SnElasticUpScatter"; } + static auto NODENAME() { return "SnElasticUpScatter"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + std::optional{} + / Meta<>("upperCalculatedGroup") | + + // children + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "upperCalculatedGroup", + "documentation" + }; + 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", + "derived_from", + "label", + "upper_calculated_group", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + Field> + upperCalculatedGroup{this}; + + // children + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->upperCalculatedGroup, \ + this->documentation \ + ) + + // default + SnElasticUpScatter() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SnElasticUpScatter( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper> + &upperCalculatedGroup = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + upperCalculatedGroup(this,upperCalculatedGroup), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit SnElasticUpScatter(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SnElasticUpScatter(const SnElasticUpScatter &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + upperCalculatedGroup(this,other.upperCalculatedGroup), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + SnElasticUpScatter(SnElasticUpScatter &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + upperCalculatedGroup(this,std::move(other.upperCalculatedGroup)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + SnElasticUpScatter &operator=(const SnElasticUpScatter &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + upperCalculatedGroup = other.upperCalculatedGroup; + documentation = other.documentation; + } + return *this; + } + + // move + SnElasticUpScatter &operator=(SnElasticUpScatter &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + upperCalculatedGroup = std::move(other.upperCalculatedGroup); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/SnElasticUpScatter/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SnElasticUpScatter + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/SnElasticUpScatter/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/SnElasticUpScatter/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/SnElasticUpScatter/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Styles.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Styles.hpp new file mode 100644 index 000000000..b44156b64 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Styles.hpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_STYLES +#define TEST_V2_0_STYLES_STYLES + +#include "test/v2.0/styles/Evaluated.hpp" +#include "test/v2.0/styles/CrossSectionReconstructed.hpp" +#include "test/v2.0/styles/AngularDistributionReconstructed.hpp" +#include "test/v2.0/styles/CoulombPlusNuclearElasticMuCutoff.hpp" +#include "test/v2.0/styles/Heated.hpp" +#include "test/v2.0/styles/AverageProductData.hpp" +#include "test/v2.0/styles/MonteCarlo_cdf.hpp" +#include "test/v2.0/styles/GriddedCrossSection.hpp" +#include "test/v2.0/styles/URR_probabilityTables.hpp" +#include "test/v2.0/styles/HeatedMultiGroup.hpp" +#include "test/v2.0/styles/SnElasticUpScatter.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// 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 "styles"; } + 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") | + ++Child> + ("angularDistributionReconstructed") | + ++Child> + ("CoulombPlusNuclearElasticMuCutoff") | + ++Child> + ("heated") | + ++Child> + ("averageProductData") | + ++Child> + ("MonteCarlo_cdf") | + ++Child> + ("griddedCrossSection") | + ++Child> + ("URR_probabilityTables") | + ++Child> + ("heatedMultiGroup") | + ++Child> + ("SnElasticUpScatter") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "angularDistributionReconstructed", + "CoulombPlusNuclearElasticMuCutoff", + "heated", + "averageProductData", + "MonteCarlo_cdf", + "griddedCrossSection", + "URR_probabilityTables", + "heatedMultiGroup", + "SnElasticUpScatter" + }; + 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", + "angular_distribution_reconstructed", + "coulomb_plus_nuclear_elastic_mu_cutoff", + "heated", + "average_product_data", + "monte_carlo_cdf", + "gridded_cross_section", + "urr_probability_tables", + "heated_multi_group", + "sn_elastic_up_scatter" + }; + 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}; + Field>> + angularDistributionReconstructed{this}; + Field>> + CoulombPlusNuclearElasticMuCutoff{this}; + Field>> + heated{this}; + Field>> + averageProductData{this}; + Field>> + MonteCarlo_cdf{this}; + Field>> + griddedCrossSection{this}; + Field>> + URR_probabilityTables{this}; + Field>> + heatedMultiGroup{this}; + Field>> + SnElasticUpScatter{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->evaluated, \ + this->crossSectionReconstructed, \ + this->angularDistributionReconstructed, \ + this->CoulombPlusNuclearElasticMuCutoff, \ + this->heated, \ + this->averageProductData, \ + this->MonteCarlo_cdf, \ + this->griddedCrossSection, \ + this->URR_probabilityTables, \ + this->heatedMultiGroup, \ + this->SnElasticUpScatter \ + ) + + // default + Styles() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Styles( + const wrapper>> + &evaluated, + const wrapper>> + &crossSectionReconstructed = {}, + const wrapper>> + &angularDistributionReconstructed = {}, + const wrapper>> + &CoulombPlusNuclearElasticMuCutoff = {}, + const wrapper>> + &heated = {}, + const wrapper>> + &averageProductData = {}, + const wrapper>> + &MonteCarlo_cdf = {}, + const wrapper>> + &griddedCrossSection = {}, + const wrapper>> + &URR_probabilityTables = {}, + const wrapper>> + &heatedMultiGroup = {}, + const wrapper>> + &SnElasticUpScatter = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + evaluated(this,evaluated), + crossSectionReconstructed(this,crossSectionReconstructed), + angularDistributionReconstructed(this,angularDistributionReconstructed), + CoulombPlusNuclearElasticMuCutoff(this,CoulombPlusNuclearElasticMuCutoff), + heated(this,heated), + averageProductData(this,averageProductData), + MonteCarlo_cdf(this,MonteCarlo_cdf), + griddedCrossSection(this,griddedCrossSection), + URR_probabilityTables(this,URR_probabilityTables), + heatedMultiGroup(this,heatedMultiGroup), + SnElasticUpScatter(this,SnElasticUpScatter) + { + Component::finish(); + } + + // from node + explicit Styles(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Styles(const Styles &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + evaluated(this,other.evaluated), + crossSectionReconstructed(this,other.crossSectionReconstructed), + angularDistributionReconstructed(this,other.angularDistributionReconstructed), + CoulombPlusNuclearElasticMuCutoff(this,other.CoulombPlusNuclearElasticMuCutoff), + heated(this,other.heated), + averageProductData(this,other.averageProductData), + MonteCarlo_cdf(this,other.MonteCarlo_cdf), + griddedCrossSection(this,other.griddedCrossSection), + URR_probabilityTables(this,other.URR_probabilityTables), + heatedMultiGroup(this,other.heatedMultiGroup), + SnElasticUpScatter(this,other.SnElasticUpScatter) + { + Component::finish(other); + } + + // move + Styles(Styles &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + evaluated(this,std::move(other.evaluated)), + crossSectionReconstructed(this,std::move(other.crossSectionReconstructed)), + angularDistributionReconstructed(this,std::move(other.angularDistributionReconstructed)), + CoulombPlusNuclearElasticMuCutoff(this,std::move(other.CoulombPlusNuclearElasticMuCutoff)), + heated(this,std::move(other.heated)), + averageProductData(this,std::move(other.averageProductData)), + MonteCarlo_cdf(this,std::move(other.MonteCarlo_cdf)), + griddedCrossSection(this,std::move(other.griddedCrossSection)), + URR_probabilityTables(this,std::move(other.URR_probabilityTables)), + heatedMultiGroup(this,std::move(other.heatedMultiGroup)), + SnElasticUpScatter(this,std::move(other.SnElasticUpScatter)) + { + 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; + angularDistributionReconstructed = other.angularDistributionReconstructed; + CoulombPlusNuclearElasticMuCutoff = other.CoulombPlusNuclearElasticMuCutoff; + heated = other.heated; + averageProductData = other.averageProductData; + MonteCarlo_cdf = other.MonteCarlo_cdf; + griddedCrossSection = other.griddedCrossSection; + URR_probabilityTables = other.URR_probabilityTables; + heatedMultiGroup = other.heatedMultiGroup; + SnElasticUpScatter = other.SnElasticUpScatter; + } + 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); + angularDistributionReconstructed = std::move(other.angularDistributionReconstructed); + CoulombPlusNuclearElasticMuCutoff = std::move(other.CoulombPlusNuclearElasticMuCutoff); + heated = std::move(other.heated); + averageProductData = std::move(other.averageProductData); + MonteCarlo_cdf = std::move(other.MonteCarlo_cdf); + griddedCrossSection = std::move(other.griddedCrossSection); + URR_probabilityTables = std::move(other.URR_probabilityTables); + heatedMultiGroup = std::move(other.heatedMultiGroup); + SnElasticUpScatter = std::move(other.SnElasticUpScatter); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/Styles/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Styles + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Styles/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Styles/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Styles/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Temperature.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Temperature.hpp new file mode 100644 index 000000000..3e25cf3a6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Temperature.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_TEMPERATURE +#define TEST_V2_0_STYLES_TEMPERATURE + +#include "test/v2.0/documentation/Documentation.hpp" +#include "test/v2.0/pops/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// 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 "styles"; } + 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 + std::optional{} + / Meta<>("label") | + Float64{} + / Meta<>("value") | + XMLName{} + / Meta<>("unit") | + + // children + --Child> + ("documentation") | + --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", + "documentation", + "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", + "documentation", + "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> + documentation{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit, \ + this->documentation, \ + this->uncertainty \ + ) + + // default + Temperature() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Temperature( + const wrapper> + &label, + const wrapper + &value = {}, + const wrapper + &unit = {}, + const wrapper> + &documentation = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit), + documentation(this,documentation), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Temperature(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Temperature(const Temperature &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit), + documentation(this,other.documentation), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Temperature(Temperature &&other) : + 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)), + documentation(this,std::move(other.documentation)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Temperature &operator=(const Temperature &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + documentation = other.documentation; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Temperature &operator=(Temperature &&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); + documentation = std::move(other.documentation); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/Temperature/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Temperature + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Temperature/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Temperature/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Temperature/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Transportable.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Transportable.hpp new file mode 100644 index 000000000..a9081aaa5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Transportable.hpp @@ -0,0 +1,222 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_TRANSPORTABLE +#define TEST_V2_0_STYLES_TRANSPORTABLE + +#include "test/v2.0/styles/MultiGroup.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class Transportable +// ----------------------------------------------------------------------------- + +class Transportable : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "Transportable"; } + static auto NODENAME() { return "transportable"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"number"} + / Meta<>("conserve") | + XMLName{} + / Meta<>("label") | + + // children + --Child + ("multiGroup") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "conserve", + "label", + "multiGroup" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "conserve", + "label", + "multi_group" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const XMLName conserve = "number"; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + conserve{this,defaults.conserve}; + Field + label{this}; + + // children + Field + multiGroup{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(multiGroup(),grid); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->conserve, \ + this->label, \ + this->multiGroup \ + ) + + // default + Transportable() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Transportable( + const wrapper> + &conserve, + const wrapper + &label = {}, + const wrapper + &multiGroup = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + conserve(this,defaults.conserve,conserve), + label(this,label), + multiGroup(this,multiGroup) + { + Component::finish(); + } + + // from node + explicit Transportable(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Transportable(const Transportable &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + conserve(this,other.conserve), + label(this,other.label), + multiGroup(this,other.multiGroup) + { + Component::finish(other); + } + + // move + Transportable(Transportable &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + conserve(this,std::move(other.conserve)), + label(this,std::move(other.label)), + multiGroup(this,std::move(other.multiGroup)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Transportable &operator=(const Transportable &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + conserve = other.conserve; + label = other.label; + multiGroup = other.multiGroup; + } + return *this; + } + + // move + Transportable &operator=(Transportable &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + conserve = std::move(other.conserve); + label = std::move(other.label); + multiGroup = std::move(other.multiGroup); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/Transportable/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Transportable + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Transportable/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Transportable/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Transportable/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Transportables.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Transportables.hpp new file mode 100644 index 000000000..26c3fa9f4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Transportables.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_TRANSPORTABLES +#define TEST_V2_0_STYLES_TRANSPORTABLES + +#include "test/v2.0/styles/Transportable.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class Transportables +// ----------------------------------------------------------------------------- + +class Transportables : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "Transportables"; } + static auto NODENAME() { return "transportables"; } + + // 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 + ("transportable") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "transportable" + }; + 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", + "transportable" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + + // children + Field> + transportable{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->transportable \ + ) + + // default + Transportables() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Transportables( + const wrapper> + &label, + const wrapper> + &transportable = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + transportable(this,transportable) + { + Component::finish(); + } + + // from node + explicit Transportables(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Transportables(const Transportables &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + transportable(this,other.transportable) + { + Component::finish(other); + } + + // move + Transportables(Transportables &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + transportable(this,std::move(other.transportable)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Transportables &operator=(const Transportables &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + transportable = other.transportable; + } + return *this; + } + + // move + Transportables &operator=(Transportables &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + transportable = std::move(other.transportable); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/Transportables/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Transportables + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/Transportables/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/Transportables/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/Transportables/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/URR_probabilityTables.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/URR_probabilityTables.hpp new file mode 100644 index 000000000..09ff3ef2f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/URR_probabilityTables.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_STYLES_URR_PROBABILITYTABLES +#define TEST_V2_0_STYLES_URR_PROBABILITYTABLES + +#include "test/v2.0/documentation/Documentation.hpp" + +namespace test { +namespace v2_0 { +namespace styles { + +// ----------------------------------------------------------------------------- +// styles:: +// class URR_probabilityTables +// ----------------------------------------------------------------------------- + +class URR_probabilityTables : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "styles"; } + static auto CLASS() { return "URR_probabilityTables"; } + static auto NODENAME() { return "URR_probabilityTables"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("date") | + XMLName{} + / Meta<>("derivedFrom") | + XMLName{} + / Meta<>("label") | + + // children + --Child> + ("documentation") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "derivedFrom", + "label", + "documentation" + }; + 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", + "derived_from", + "label", + "documentation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + date{this}; + Field + derivedFrom{this}; + Field + label{this}; + + // children + Field> + documentation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date, \ + this->derivedFrom, \ + this->label, \ + this->documentation \ + ) + + // default + URR_probabilityTables() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit URR_probabilityTables( + const wrapper + &date, + const wrapper + &derivedFrom = {}, + const wrapper + &label = {}, + const wrapper> + &documentation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date), + derivedFrom(this,derivedFrom), + label(this,label), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit URR_probabilityTables(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + URR_probabilityTables(const URR_probabilityTables &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date), + derivedFrom(this,other.derivedFrom), + label(this,other.label), + documentation(this,other.documentation) + { + Component::finish(other); + } + + // move + URR_probabilityTables(URR_probabilityTables &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)), + derivedFrom(this,std::move(other.derivedFrom)), + label(this,std::move(other.label)), + documentation(this,std::move(other.documentation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + URR_probabilityTables &operator=(const URR_probabilityTables &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + derivedFrom = other.derivedFrom; + label = other.label; + documentation = other.documentation; + } + return *this; + } + + // move + URR_probabilityTables &operator=(URR_probabilityTables &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + derivedFrom = std::move(other.derivedFrom); + label = std::move(other.label); + documentation = std::move(other.documentation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/styles/URR_probabilityTables/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class URR_probabilityTables + +} // namespace styles +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/styles/URR_probabilityTables/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/styles/URR_probabilityTables/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/styles/URR_probabilityTables/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/A.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/A.hpp new file mode 100644 index 000000000..ef5903d47 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/A.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_A +#define TEST_V2_0_TRANSPORT_A + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class A +// ----------------------------------------------------------------------------- + +class A : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + static auto CLASS() { return "A"; } + static auto NODENAME() { return "a"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + _t{} + / --(Child<>("XYs2d") || Child<>("regions2d")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "_XYs2dregions2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys2dregions2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _XYs2dregions2d{this}; + FieldPart XYs2d{_XYs2dregions2d}; + FieldPart regions2d{_XYs2dregions2d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs2dregions2d \ + ) + + // default + A() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit A( + const wrapper<_t> + &_XYs2dregions2d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs2dregions2d(this,_XYs2dregions2d) + { + Component::finish(); + } + + // from node + explicit A(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + A(const A &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs2dregions2d(this,other._XYs2dregions2d) + { + Component::finish(other); + } + + // move + A(A &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs2dregions2d(this,std::move(other._XYs2dregions2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + A &operator=(const A &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs2dregions2d = other._XYs2dregions2d; + } + return *this; + } + + // move + A &operator=(A &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs2dregions2d = std::move(other._XYs2dregions2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/A/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class A + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/A/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/A/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/A/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Add.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Add.hpp new file mode 100644 index 000000000..aba3faf48 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Add.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_ADD +#define TEST_V2_0_TRANSPORT_ADD + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::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", + "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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Add() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Add( + const wrapper> + &href + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Add(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Add(const Add &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Add(Add &&other) : + 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 "test/v2.0/transport/Add/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Add + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Add/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Add/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Add/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/AngularEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/AngularEnergy.hpp new file mode 100644 index 000000000..642974343 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/AngularEnergy.hpp @@ -0,0 +1,218 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_ANGULARENERGY +#define TEST_V2_0_TRANSPORT_ANGULARENERGY + +#include "test/v2.0/containers/XYs3d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs3d(),axes); + GNDSTK_SHORTCUT(XYs3d(),function2ds); + GNDSTK_SHORTCUT(XYs3d(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->XYs3d \ + ) + + // default + AngularEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AngularEnergy( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper + &XYs3d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + XYs3d(this,XYs3d) + { + Component::finish(); + } + + // from node + explicit AngularEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AngularEnergy(const AngularEnergy &other) : + 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) : + 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 "test/v2.0/transport/AngularEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AngularEnergy + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/AngularEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/AngularEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/AngularEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/AngularTwoBody.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/AngularTwoBody.hpp new file mode 100644 index 000000000..e550c892f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/AngularTwoBody.hpp @@ -0,0 +1,256 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_ANGULARTWOBODY +#define TEST_V2_0_TRANSPORT_ANGULARTWOBODY + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" +#include "test/v2.0/transport/Isotropic2d.hpp" +#include "test/v2.0/transport/Recoil.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / Meta<>("label") | + XMLName{} + / Meta<>("productFrame") | + + // children + --Child> + ("XYs2d") | + --Child> + ("regions2d") | + --Child> + ("isotropic2d") | + --Child> + ("recoil") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "isotropic2d", + "recoil" + }; + 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", + "isotropic2d", + "recoil" + }; + 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> + isotropic2d{this}; + Field> + recoil{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->XYs2d, \ + this->regions2d, \ + this->isotropic2d, \ + this->recoil \ + ) + + // default + AngularTwoBody() : + 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> + &isotropic2d = {}, + const wrapper> + &recoil = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + XYs2d(this,XYs2d), + regions2d(this,regions2d), + isotropic2d(this,isotropic2d), + recoil(this,recoil) + { + Component::finish(); + } + + // from node + explicit AngularTwoBody(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AngularTwoBody(const AngularTwoBody &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + XYs2d(this,other.XYs2d), + regions2d(this,other.regions2d), + isotropic2d(this,other.isotropic2d), + recoil(this,other.recoil) + { + Component::finish(other); + } + + // move + AngularTwoBody(AngularTwoBody &&other) : + 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)), + isotropic2d(this,std::move(other.isotropic2d)), + recoil(this,std::move(other.recoil)) + { + 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; + isotropic2d = other.isotropic2d; + recoil = other.recoil; + } + 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); + isotropic2d = std::move(other.isotropic2d); + recoil = std::move(other.recoil); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/AngularTwoBody/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class AngularTwoBody + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/AngularTwoBody/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/AngularTwoBody/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/AngularTwoBody/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Angular_uncorrelated.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Angular_uncorrelated.hpp new file mode 100644 index 000000000..e3e1cea08 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Angular_uncorrelated.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_ANGULAR_UNCORRELATED +#define TEST_V2_0_TRANSPORT_ANGULAR_UNCORRELATED + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/transport/Isotropic2d.hpp" +#include "test/v2.0/transport/Forward.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class Angular_uncorrelated +// ----------------------------------------------------------------------------- + +class Angular_uncorrelated : + 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 "Angular_uncorrelated"; } + 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> + ("XYs2d") | + --Child> + ("isotropic2d") | + --Child> + ("forward") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "isotropic2d", + "forward" + }; + 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", + "isotropic2d", + "forward" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs2d{this}; + Field> + isotropic2d{this}; + Field> + forward{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d, \ + this->isotropic2d, \ + this->forward \ + ) + + // default + Angular_uncorrelated() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Angular_uncorrelated( + const wrapper> + &XYs2d, + const wrapper> + &isotropic2d = {}, + const wrapper> + &forward = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d), + isotropic2d(this,isotropic2d), + forward(this,forward) + { + Component::finish(); + } + + // from node + explicit Angular_uncorrelated(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Angular_uncorrelated(const Angular_uncorrelated &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d), + isotropic2d(this,other.isotropic2d), + forward(this,other.forward) + { + Component::finish(other); + } + + // move + Angular_uncorrelated(Angular_uncorrelated &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs2d(this,std::move(other.XYs2d)), + isotropic2d(this,std::move(other.isotropic2d)), + forward(this,std::move(other.forward)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Angular_uncorrelated &operator=(const Angular_uncorrelated &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs2d = other.XYs2d; + isotropic2d = other.isotropic2d; + forward = other.forward; + } + return *this; + } + + // move + Angular_uncorrelated &operator=(Angular_uncorrelated &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs2d = std::move(other.XYs2d); + isotropic2d = std::move(other.isotropic2d); + forward = std::move(other.forward); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Angular_uncorrelated/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Angular_uncorrelated + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Angular_uncorrelated/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Angular_uncorrelated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Angular_uncorrelated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Background.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Background.hpp new file mode 100644 index 000000000..4c2fb60dd --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Background.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_BACKGROUND +#define TEST_V2_0_TRANSPORT_BACKGROUND + +#include "test/v2.0/transport/ResolvedRegion.hpp" +#include "test/v2.0/transport/UnresolvedRegion.hpp" +#include "test/v2.0/transport/FastRegion.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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> + ("unresolvedRegion") | + --Child> + ("fastRegion") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "unresolvedRegion", + "fastRegion" + }; + 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", + "unresolved_region", + "fast_region" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + resolvedRegion{this}; + Field> + unresolvedRegion{this}; + Field> + fastRegion{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->resolvedRegion, \ + this->unresolvedRegion, \ + this->fastRegion \ + ) + + // default + Background() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Background( + const wrapper> + &resolvedRegion, + const wrapper> + &unresolvedRegion = {}, + const wrapper> + &fastRegion = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + resolvedRegion(this,resolvedRegion), + unresolvedRegion(this,unresolvedRegion), + fastRegion(this,fastRegion) + { + Component::finish(); + } + + // from node + explicit Background(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Background(const Background &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + resolvedRegion(this,other.resolvedRegion), + unresolvedRegion(this,other.unresolvedRegion), + fastRegion(this,other.fastRegion) + { + Component::finish(other); + } + + // move + Background(Background &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + resolvedRegion(this,std::move(other.resolvedRegion)), + unresolvedRegion(this,std::move(other.unresolvedRegion)), + fastRegion(this,std::move(other.fastRegion)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Background &operator=(const Background &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + resolvedRegion = other.resolvedRegion; + unresolvedRegion = other.unresolvedRegion; + fastRegion = other.fastRegion; + } + 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); + unresolvedRegion = std::move(other.unresolvedRegion); + fastRegion = std::move(other.fastRegion); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Background/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Background + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Background/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Background/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Background/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Branching1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Branching1d.hpp new file mode 100644 index 000000000..2f8801309 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Branching1d.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_BRANCHING1D +#define TEST_V2_0_TRANSPORT_BRANCHING1D + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 + XMLName{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label \ + ) + + // default + Branching1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Branching1d( + const wrapper + &label + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Branching1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Branching1d(const Branching1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label) + { + Component::finish(other); + } + + // move + Branching1d(Branching1d &&other) : + 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 "test/v2.0/transport/Branching1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Branching1d + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Branching1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Branching1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Branching1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Branching3d.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Branching3d.hpp new file mode 100644 index 000000000..b9ebb3a94 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Branching3d.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_BRANCHING3D +#define TEST_V2_0_TRANSPORT_BRANCHING3D + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame \ + ) + + // default + Branching3d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Branching3d( + const wrapper + &label, + const wrapper + &productFrame = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame) + { + Component::finish(); + } + + // from node + explicit Branching3d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Branching3d(const Branching3d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame) + { + Component::finish(other); + } + + // move + Branching3d(Branching3d &&other) : + 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 "test/v2.0/transport/Branching3d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Branching3d + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Branching3d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Branching3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Branching3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/CoherentPhoton.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/CoherentPhoton.hpp new file mode 100644 index 000000000..1f00a33ec --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/CoherentPhoton.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_COHERENTPHOTON +#define TEST_V2_0_TRANSPORT_COHERENTPHOTON + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class CoherentPhoton +// ----------------------------------------------------------------------------- + +class CoherentPhoton : + 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 "CoherentPhoton"; } + static auto NODENAME() { return "coherentPhoton"; } + + // 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + CoherentPhoton() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit CoherentPhoton(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CoherentPhoton(const CoherentPhoton &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + CoherentPhoton(CoherentPhoton &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CoherentPhoton &operator=(const CoherentPhoton &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + CoherentPhoton &operator=(CoherentPhoton &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/CoherentPhoton/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CoherentPhoton + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/CoherentPhoton/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/CoherentPhoton/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/CoherentPhoton/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSection.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSection.hpp new file mode 100644 index 000000000..09783fd84 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSection.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_CROSSSECTION +#define TEST_V2_0_TRANSPORT_CROSSSECTION + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" +#include "test/v2.0/transport/ResonancesWithBackground.hpp" +#include "test/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp" +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw1d.hpp" +#include "test/v2.0/transport/Reference.hpp" +#include "test/v2.0/containers/Gridded1d.hpp" +#include "test/v2.0/containers/Ys1d.hpp" +#include "test/v2.0/transport/URR_probabilityTables1d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class CrossSection +// ----------------------------------------------------------------------------- + +class CrossSection : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::XYs1d, + containers::Regions1d, + transport::ResonancesWithBackground, + cpTransport::CoulombPlusNuclearElastic, + tsl::ThermalNeutronScatteringLaw1d, + transport::Reference, + containers::Gridded1d, + containers::Ys1d, + transport::URR_probabilityTables1d + >; + + // ------------------------ + // 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{} | + + // metadata + std::optional{} + / Meta<>("label") | + + // children + _t{} + / --(Child<>("XYs1d") || Child<>("regions1d") || Child<>("resonancesWithBackground") || Child<>("CoulombPlusNuclearElastic") || Child<>("thermalNeutronScatteringLaw1d") || Child<>("reference") || Child<>("gridded1d") || Child<>("Ys1d") || Child<>("URR_probabilityTables1d")) + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d" + }; + 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", + "_xys1dregions1dresonances_with_background_coulomb_plus_nuclear_elasticthermal_neutron_scattering_law1dreferencegridded1d_ys1d_urr_probability_tables1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + + // children - variant + Field<_t> + _XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d{this}; + FieldPart XYs1d{_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d}; + FieldPart regions1d{_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d}; + FieldPart resonancesWithBackground{_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d}; + FieldPart CoulombPlusNuclearElastic{_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d}; + FieldPart thermalNeutronScatteringLaw1d{_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d}; + FieldPart reference{_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d}; + FieldPart gridded1d{_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d}; + FieldPart Ys1d{_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d}; + FieldPart URR_probabilityTables1d{_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d \ + ) + + // default + CrossSection() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSection( + const wrapper> + &label, + const wrapper<_t> + &_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + _XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d(this,_XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d) + { + Component::finish(); + } + + // from node + explicit CrossSection(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSection(const CrossSection &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + _XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d(this,other._XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d) + { + Component::finish(other); + } + + // move + CrossSection(CrossSection &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + _XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d(this,std::move(other._XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CrossSection &operator=(const CrossSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + _XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d = other._XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d; + } + return *this; + } + + // move + CrossSection &operator=(CrossSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + _XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d = std::move(other._XYs1dregions1dresonancesWithBackgroundCoulombPlusNuclearElasticthermalNeutronScatteringLaw1dreferencegridded1dYs1dURR_probabilityTables1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/CrossSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CrossSection + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSection/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSum.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSum.hpp new file mode 100644 index 000000000..ca6d7878d --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSum.hpp @@ -0,0 +1,248 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_CROSSSECTIONSUM +#define TEST_V2_0_TRANSPORT_CROSSSECTIONSUM + +#include "test/v2.0/common/Q.hpp" +#include "test/v2.0/transport/CrossSection.hpp" +#include "test/v2.0/transport/Summands.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / Meta<>("ENDF_MT") | + XMLName{} + / Meta<>("label") | + + // children + --Child + ("Q") | + --Child + ("crossSection") | + --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", + "ENDF_MT", + "label", + "Q", + "crossSection", + "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", + "endf_mt", + "label", + "q", + "cross_section", + "summands" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + ENDF_MT{this}; + Field + label{this}; + + // children + Field + Q{this}; + Field + crossSection{this}; + Field + summands{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(summands(),add); + GNDSTK_SHORTCUT(Q(),documentation); + GNDSTK_SHORTCUT(Q(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MT, \ + this->label, \ + this->Q, \ + this->crossSection, \ + this->summands \ + ) + + // default + CrossSectionSum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSectionSum( + const wrapper> + &ENDF_MT, + const wrapper + &label = {}, + const wrapper + &Q = {}, + const wrapper + &crossSection = {}, + const wrapper + &summands = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MT(this,ENDF_MT), + label(this,label), + Q(this,Q), + crossSection(this,crossSection), + summands(this,summands) + { + Component::finish(); + } + + // from node + explicit CrossSectionSum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSectionSum(const CrossSectionSum &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MT(this,other.ENDF_MT), + label(this,other.label), + Q(this,other.Q), + crossSection(this,other.crossSection), + summands(this,other.summands) + { + Component::finish(other); + } + + // move + CrossSectionSum(CrossSectionSum &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MT(this,std::move(other.ENDF_MT)), + label(this,std::move(other.label)), + Q(this,std::move(other.Q)), + crossSection(this,std::move(other.crossSection)), + summands(this,std::move(other.summands)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CrossSectionSum &operator=(const CrossSectionSum &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + ENDF_MT = other.ENDF_MT; + label = other.label; + Q = other.Q; + crossSection = other.crossSection; + summands = other.summands; + } + return *this; + } + + // move + CrossSectionSum &operator=(CrossSectionSum &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + ENDF_MT = std::move(other.ENDF_MT); + label = std::move(other.label); + Q = std::move(other.Q); + crossSection = std::move(other.crossSection); + summands = std::move(other.summands); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/CrossSectionSum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CrossSectionSum + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSum/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSums.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSums.hpp new file mode 100644 index 000000000..c68810efa --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSums.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_CROSSSECTIONSUMS +#define TEST_V2_0_TRANSPORT_CROSSSECTIONSUMS + +#include "test/v2.0/transport/CrossSectionSum.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->crossSectionSum \ + ) + + // default + CrossSectionSums() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSectionSums( + const wrapper>> + &crossSectionSum + ) : + GNDSTK_COMPONENT(BlockData{}), + crossSectionSum(this,crossSectionSum) + { + Component::finish(); + } + + // from node + explicit CrossSectionSums(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSectionSums(const CrossSectionSums &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + crossSectionSum(this,other.crossSectionSum) + { + Component::finish(other); + } + + // move + CrossSectionSums(CrossSectionSums &&other) : + 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 "test/v2.0/transport/CrossSectionSums/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CrossSectionSums + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSums/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSums/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/CrossSectionSums/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/DiscreteGamma.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/DiscreteGamma.hpp new file mode 100644 index 000000000..c388a4ff6 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/DiscreteGamma.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_DISCRETEGAMMA +#define TEST_V2_0_TRANSPORT_DISCRETEGAMMA + +#include "test/v2.0/containers/Axes.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 + std::optional{} + / Meta<>("domainMax") | + std::optional{} + / Meta<>("domainMin") | + std::optional{} + / Meta<>("value") | + + // 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", + "domainMax", + "domainMin", + "value", + "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", + "domain_max", + "domain_min", + "value", + "axes" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + domainMax{this}; + Field> + domainMin{this}; + Field> + value{this}; + + // children + Field> + axes{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMax, \ + this->domainMin, \ + this->value, \ + this->axes \ + ) + + // default + DiscreteGamma() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DiscreteGamma( + const wrapper> + &domainMax, + const wrapper> + &domainMin = {}, + const wrapper> + &value = {}, + const wrapper> + &axes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + domainMax(this,domainMax), + domainMin(this,domainMin), + value(this,value), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit DiscreteGamma(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DiscreteGamma(const DiscreteGamma &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + domainMax(this,other.domainMax), + domainMin(this,other.domainMin), + value(this,other.value), + axes(this,other.axes) + { + Component::finish(other); + } + + // move + DiscreteGamma(DiscreteGamma &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + domainMax(this,std::move(other.domainMax)), + domainMin(this,std::move(other.domainMin)), + value(this,std::move(other.value)), + 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; + domainMax = other.domainMax; + domainMin = other.domainMin; + value = other.value; + axes = other.axes; + } + return *this; + } + + // move + DiscreteGamma &operator=(DiscreteGamma &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + domainMax = std::move(other.domainMax); + domainMin = std::move(other.domainMin); + value = std::move(other.value); + axes = std::move(other.axes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/DiscreteGamma/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DiscreteGamma + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/DiscreteGamma/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/DiscreteGamma/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/DiscreteGamma/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Distribution.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Distribution.hpp new file mode 100644 index 000000000..283b778dc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Distribution.hpp @@ -0,0 +1,229 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_DISTRIBUTION +#define TEST_V2_0_TRANSPORT_DISTRIBUTION + +#include "test/v2.0/transport/AngularTwoBody.hpp" +#include "test/v2.0/transport/Uncorrelated.hpp" +#include "test/v2.0/transport/AngularEnergy.hpp" +#include "test/v2.0/transport/EnergyAngular.hpp" +#include "test/v2.0/transport/KalbachMann.hpp" +#include "test/v2.0/transport/Reference.hpp" +#include "test/v2.0/transport/Branching3d.hpp" +#include "test/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp" +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw.hpp" +#include "test/v2.0/atomic/CoherentPhotonScattering.hpp" +#include "test/v2.0/atomic/IncoherentPhotonScattering.hpp" +#include "test/v2.0/transport/Unspecified.hpp" +#include "test/v2.0/transport/MultiGroup3d.hpp" +#include "test/v2.0/processed/AngularEnergyMC.hpp" +#include "test/v2.0/processed/EnergyAngularMC.hpp" +#include "test/v2.0/containers/XYs2d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class Distribution +// ----------------------------------------------------------------------------- + +class Distribution : + public Component +{ + friend class Component; + + using _t = std::variant< + transport::AngularTwoBody, + transport::Uncorrelated, + transport::AngularEnergy, + transport::EnergyAngular, + transport::KalbachMann, + transport::Reference, + transport::Branching3d, + cpTransport::CoulombPlusNuclearElastic, + tsl::ThermalNeutronScatteringLaw, + atomic::CoherentPhotonScattering, + atomic::IncoherentPhotonScattering, + transport::Unspecified, + transport::MultiGroup3d, + processed::AngularEnergyMC, + processed::EnergyAngularMC, + containers::XYs2d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + 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 + _t{} + / --(Child<>("angularTwoBody") || Child<>("uncorrelated") || Child<>("angularEnergy") || Child<>("energyAngular") || Child<>("KalbachMann") || Child<>("reference") || Child<>("branching3d") || Child<>("CoulombPlusNuclearElastic") || Child<>("thermalNeutronScatteringLaw") || Child<>("coherentPhotonScattering") || Child<>("incoherentPhotonScattering") || Child<>("unspecified") || Child<>("multiGroup3d") || Child<>("angularEnergyMC") || Child<>("energyAngularMC") || 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", + "_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_angular_two_bodyuncorrelatedangular_energyenergy_angular_kalbach_mannreferencebranching3d_coulomb_plus_nuclear_elasticthermal_neutron_scattering_lawcoherent_photon_scatteringincoherent_photon_scatteringunspecifiedmulti_group3dangular_energy_mcenergy_angular_mcxys2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d{this}; + FieldPart angularTwoBody{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart uncorrelated{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart angularEnergy{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart energyAngular{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart KalbachMann{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart reference{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart branching3d{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart CoulombPlusNuclearElastic{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart thermalNeutronScatteringLaw{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart coherentPhotonScattering{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart incoherentPhotonScattering{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart unspecified{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart multiGroup3d{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart angularEnergyMC{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart energyAngularMC{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + FieldPart XYs2d{_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d \ + ) + + // default + Distribution() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Distribution( + const wrapper<_t> + &_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d + ) : + GNDSTK_COMPONENT(BlockData{}), + _angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d(this,_angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d) + { + Component::finish(); + } + + // from node + explicit Distribution(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Distribution(const Distribution &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d(this,other._angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d) + { + Component::finish(other); + } + + // move + Distribution(Distribution &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d(this,std::move(other._angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Distribution &operator=(const Distribution &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d = other._angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d; + } + return *this; + } + + // move + Distribution &operator=(Distribution &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d = std::move(other._angularTwoBodyuncorrelatedangularEnergyenergyAngularKalbachMannreferencebranching3dCoulombPlusNuclearElasticthermalNeutronScatteringLawcoherentPhotonScatteringincoherentPhotonScatteringunspecifiedmultiGroup3dangularEnergyMCenergyAngularMCXYs2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Distribution/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Distribution + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Distribution/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Distribution/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Distribution/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/DoubleDifferentialCrossSection.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/DoubleDifferentialCrossSection.hpp new file mode 100644 index 000000000..9123a6984 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/DoubleDifferentialCrossSection.hpp @@ -0,0 +1,299 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_DOUBLEDIFFERENTIALCROSSSECTION +#define TEST_V2_0_TRANSPORT_DOUBLEDIFFERENTIALCROSSSECTION + +#include "test/v2.0/containers/Regions3d.hpp" +#include "test/v2.0/containers/XYs3d.hpp" +#include "test/v2.0/cpTransport/CoulombPlusNuclearElastic.hpp" +#include "test/v2.0/transport/Reference.hpp" +#include "test/v2.0/atomic/CoherentPhotonScattering.hpp" +#include "test/v2.0/atomic/IncoherentPhotonScattering.hpp" +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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> + ("regions3d") | + --Child> + ("XYs3d") | + --Child> + ("CoulombPlusNuclearElastic") | + --Child> + ("reference") | + --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", + "regions3d", + "XYs3d", + "CoulombPlusNuclearElastic", + "reference", + "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", + "regions3d", + "xys3d", + "coulomb_plus_nuclear_elastic", + "reference", + "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> + regions3d{this}; + Field> + XYs3d{this}; + Field> + CoulombPlusNuclearElastic{this}; + Field> + reference{this}; + Field> + coherentPhotonScattering{this}; + Field> + incoherentPhotonScattering{this}; + Field> + thermalNeutronScatteringLaw_coherentElastic{this}; + Field> + thermalNeutronScatteringLaw_incoherentElastic{this}; + Field> + thermalNeutronScatteringLaw_incoherentInelastic{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->regions3d, \ + this->XYs3d, \ + this->CoulombPlusNuclearElastic, \ + this->reference, \ + this->coherentPhotonScattering, \ + this->incoherentPhotonScattering, \ + this->thermalNeutronScatteringLaw_coherentElastic, \ + this->thermalNeutronScatteringLaw_incoherentElastic, \ + this->thermalNeutronScatteringLaw_incoherentInelastic \ + ) + + // default + DoubleDifferentialCrossSection() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DoubleDifferentialCrossSection( + const wrapper> + ®ions3d, + const wrapper> + &XYs3d = {}, + const wrapper> + &CoulombPlusNuclearElastic = {}, + const wrapper> + &reference = {}, + const wrapper> + &coherentPhotonScattering = {}, + const wrapper> + &incoherentPhotonScattering = {}, + const wrapper> + &thermalNeutronScatteringLaw_coherentElastic = {}, + const wrapper> + &thermalNeutronScatteringLaw_incoherentElastic = {}, + const wrapper> + &thermalNeutronScatteringLaw_incoherentInelastic = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + regions3d(this,regions3d), + XYs3d(this,XYs3d), + CoulombPlusNuclearElastic(this,CoulombPlusNuclearElastic), + reference(this,reference), + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DoubleDifferentialCrossSection(const DoubleDifferentialCrossSection &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + regions3d(this,other.regions3d), + XYs3d(this,other.XYs3d), + CoulombPlusNuclearElastic(this,other.CoulombPlusNuclearElastic), + reference(this,other.reference), + 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) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + regions3d(this,std::move(other.regions3d)), + XYs3d(this,std::move(other.XYs3d)), + CoulombPlusNuclearElastic(this,std::move(other.CoulombPlusNuclearElastic)), + reference(this,std::move(other.reference)), + 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; + regions3d = other.regions3d; + XYs3d = other.XYs3d; + CoulombPlusNuclearElastic = other.CoulombPlusNuclearElastic; + reference = other.reference; + 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); + regions3d = std::move(other.regions3d); + XYs3d = std::move(other.XYs3d); + CoulombPlusNuclearElastic = std::move(other.CoulombPlusNuclearElastic); + reference = std::move(other.reference); + 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 "test/v2.0/transport/DoubleDifferentialCrossSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DoubleDifferentialCrossSection + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/DoubleDifferentialCrossSection/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/DoubleDifferentialCrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/DoubleDifferentialCrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/EnergyAngular.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/EnergyAngular.hpp new file mode 100644 index 000000000..387cb0ec1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/EnergyAngular.hpp @@ -0,0 +1,218 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_ENERGYANGULAR +#define TEST_V2_0_TRANSPORT_ENERGYANGULAR + +#include "test/v2.0/containers/XYs3d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / Meta<>("label") | + XMLName{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs3d(),axes); + GNDSTK_SHORTCUT(XYs3d(),function2ds); + GNDSTK_SHORTCUT(XYs3d(),uncertainty); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->XYs3d \ + ) + + // default + EnergyAngular() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EnergyAngular( + const wrapper> + &label, + const wrapper + &productFrame = {}, + const wrapper + &XYs3d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + XYs3d(this,XYs3d) + { + Component::finish(); + } + + // from node + explicit EnergyAngular(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EnergyAngular(const EnergyAngular &other) : + 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) : + 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 "test/v2.0/transport/EnergyAngular/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EnergyAngular + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/EnergyAngular/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/EnergyAngular/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/EnergyAngular/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Energy_uncorrelated.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Energy_uncorrelated.hpp new file mode 100644 index 000000000..3e7d30222 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Energy_uncorrelated.hpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_ENERGY_UNCORRELATED +#define TEST_V2_0_TRANSPORT_ENERGY_UNCORRELATED + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" +#include "test/v2.0/transport/GeneralEvaporation.hpp" +#include "test/v2.0/transport/DiscreteGamma.hpp" +#include "test/v2.0/transport/PrimaryGamma.hpp" +#include "test/v2.0/transport/NBodyPhaseSpace.hpp" +#include "test/v2.0/transport/Evaporation.hpp" +#include "test/v2.0/transport/WeightedFunctionals.hpp" +#include "test/v2.0/fissionTransport/SimpleMaxwellianFission.hpp" +#include "test/v2.0/fissionTransport/Watt.hpp" +#include "test/v2.0/fissionTransport/MadlandNix.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class Energy_uncorrelated +// ----------------------------------------------------------------------------- + +class Energy_uncorrelated : + 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 "Energy_uncorrelated"; } + 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{} | + + // children + --Child> + ("XYs2d") | + --Child> + ("regions2d") | + --Child> + ("generalEvaporation") | + --Child> + ("discreteGamma") | + --Child> + ("primaryGamma") | + --Child> + ("NBodyPhaseSpace") | + --Child> + ("evaporation") | + --Child> + ("weightedFunctionals") | + --Child> + ("simpleMaxwellianFission") | + --Child> + ("Watt") | + --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", + "XYs2d", + "regions2d", + "generalEvaporation", + "discreteGamma", + "primaryGamma", + "NBodyPhaseSpace", + "evaporation", + "weightedFunctionals", + "simpleMaxwellianFission", + "Watt", + "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", + "xys2d", + "regions2d", + "general_evaporation", + "discrete_gamma", + "primary_gamma", + "nbody_phase_space", + "evaporation", + "weighted_functionals", + "simple_maxwellian_fission", + "watt", + "madland_nix" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs2d{this}; + Field> + regions2d{this}; + Field> + generalEvaporation{this}; + Field> + discreteGamma{this}; + Field> + primaryGamma{this}; + Field> + NBodyPhaseSpace{this}; + Field> + evaporation{this}; + Field> + weightedFunctionals{this}; + Field> + simpleMaxwellianFission{this}; + Field> + Watt{this}; + Field> + MadlandNix{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d, \ + this->regions2d, \ + this->generalEvaporation, \ + this->discreteGamma, \ + this->primaryGamma, \ + this->NBodyPhaseSpace, \ + this->evaporation, \ + this->weightedFunctionals, \ + this->simpleMaxwellianFission, \ + this->Watt, \ + this->MadlandNix \ + ) + + // default + Energy_uncorrelated() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Energy_uncorrelated( + const wrapper> + &XYs2d, + const wrapper> + ®ions2d = {}, + const wrapper> + &generalEvaporation = {}, + const wrapper> + &discreteGamma = {}, + const wrapper> + &primaryGamma = {}, + const wrapper> + &NBodyPhaseSpace = {}, + const wrapper> + &evaporation = {}, + const wrapper> + &weightedFunctionals = {}, + const wrapper> + &simpleMaxwellianFission = {}, + const wrapper> + &Watt = {}, + const wrapper> + &MadlandNix = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d), + regions2d(this,regions2d), + generalEvaporation(this,generalEvaporation), + discreteGamma(this,discreteGamma), + primaryGamma(this,primaryGamma), + NBodyPhaseSpace(this,NBodyPhaseSpace), + evaporation(this,evaporation), + weightedFunctionals(this,weightedFunctionals), + simpleMaxwellianFission(this,simpleMaxwellianFission), + Watt(this,Watt), + MadlandNix(this,MadlandNix) + { + Component::finish(); + } + + // from node + explicit Energy_uncorrelated(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Energy_uncorrelated(const Energy_uncorrelated &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d), + regions2d(this,other.regions2d), + generalEvaporation(this,other.generalEvaporation), + discreteGamma(this,other.discreteGamma), + primaryGamma(this,other.primaryGamma), + NBodyPhaseSpace(this,other.NBodyPhaseSpace), + evaporation(this,other.evaporation), + weightedFunctionals(this,other.weightedFunctionals), + simpleMaxwellianFission(this,other.simpleMaxwellianFission), + Watt(this,other.Watt), + MadlandNix(this,other.MadlandNix) + { + Component::finish(other); + } + + // move + Energy_uncorrelated(Energy_uncorrelated &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs2d(this,std::move(other.XYs2d)), + regions2d(this,std::move(other.regions2d)), + generalEvaporation(this,std::move(other.generalEvaporation)), + discreteGamma(this,std::move(other.discreteGamma)), + primaryGamma(this,std::move(other.primaryGamma)), + NBodyPhaseSpace(this,std::move(other.NBodyPhaseSpace)), + evaporation(this,std::move(other.evaporation)), + weightedFunctionals(this,std::move(other.weightedFunctionals)), + simpleMaxwellianFission(this,std::move(other.simpleMaxwellianFission)), + Watt(this,std::move(other.Watt)), + MadlandNix(this,std::move(other.MadlandNix)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Energy_uncorrelated &operator=(const Energy_uncorrelated &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs2d = other.XYs2d; + regions2d = other.regions2d; + generalEvaporation = other.generalEvaporation; + discreteGamma = other.discreteGamma; + primaryGamma = other.primaryGamma; + NBodyPhaseSpace = other.NBodyPhaseSpace; + evaporation = other.evaporation; + weightedFunctionals = other.weightedFunctionals; + simpleMaxwellianFission = other.simpleMaxwellianFission; + Watt = other.Watt; + MadlandNix = other.MadlandNix; + } + return *this; + } + + // move + Energy_uncorrelated &operator=(Energy_uncorrelated &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs2d = std::move(other.XYs2d); + regions2d = std::move(other.regions2d); + generalEvaporation = std::move(other.generalEvaporation); + discreteGamma = std::move(other.discreteGamma); + primaryGamma = std::move(other.primaryGamma); + NBodyPhaseSpace = std::move(other.NBodyPhaseSpace); + evaporation = std::move(other.evaporation); + weightedFunctionals = std::move(other.weightedFunctionals); + simpleMaxwellianFission = std::move(other.simpleMaxwellianFission); + Watt = std::move(other.Watt); + MadlandNix = std::move(other.MadlandNix); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Energy_uncorrelated/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Energy_uncorrelated + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Energy_uncorrelated/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Energy_uncorrelated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Energy_uncorrelated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Evaporation.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Evaporation.hpp new file mode 100644 index 000000000..4315e9093 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Evaporation.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_EVAPORATION +#define TEST_V2_0_TRANSPORT_EVAPORATION + +#include "test/v2.0/transport/U.hpp" +#include "test/v2.0/transport/Theta.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->theta \ + ) + + // default + Evaporation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Evaporation( + const wrapper> + &U, + const wrapper> + &theta = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + U(this,U), + theta(this,theta) + { + Component::finish(); + } + + // from node + explicit Evaporation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Evaporation(const Evaporation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + U(this,other.U), + theta(this,other.theta) + { + Component::finish(other); + } + + // move + Evaporation(Evaporation &&other) : + 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 "test/v2.0/transport/Evaporation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Evaporation + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Evaporation/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Evaporation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Evaporation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/F.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/F.hpp new file mode 100644 index 000000000..eddbf2330 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/F.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_F +#define TEST_V2_0_TRANSPORT_F + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class F +// ----------------------------------------------------------------------------- + +class F : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + 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 + _t{} + / --(Child<>("XYs2d") || Child<>("regions2d")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "_XYs2dregions2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys2dregions2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _XYs2dregions2d{this}; + FieldPart XYs2d{_XYs2dregions2d}; + FieldPart regions2d{_XYs2dregions2d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs2dregions2d \ + ) + + // default + F() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit F( + const wrapper<_t> + &_XYs2dregions2d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs2dregions2d(this,_XYs2dregions2d) + { + Component::finish(); + } + + // from node + explicit F(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + F(const F &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs2dregions2d(this,other._XYs2dregions2d) + { + Component::finish(other); + } + + // move + F(F &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs2dregions2d(this,std::move(other._XYs2dregions2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + F &operator=(const F &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs2dregions2d = other._XYs2dregions2d; + } + return *this; + } + + // move + F &operator=(F &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs2dregions2d = std::move(other._XYs2dregions2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/F/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class F + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/F/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/F/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/F/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/FastRegion.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/FastRegion.hpp new file mode 100644 index 000000000..cbb702f11 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/FastRegion.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_FASTREGION +#define TEST_V2_0_TRANSPORT_FASTREGION + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class FastRegion +// ----------------------------------------------------------------------------- + +class FastRegion : + public Component +{ + friend class Component; + + using _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 "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 + _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", + "_XYs1dregions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys1dregions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _XYs1dregions1d{this}; + FieldPart XYs1d{_XYs1dregions1d}; + FieldPart regions1d{_XYs1dregions1d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs1dregions1d \ + ) + + // default + FastRegion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FastRegion( + const wrapper<_t> + &_XYs1dregions1d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs1dregions1d(this,_XYs1dregions1d) + { + Component::finish(); + } + + // from node + explicit FastRegion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FastRegion(const FastRegion &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs1dregions1d(this,other._XYs1dregions1d) + { + Component::finish(other); + } + + // move + FastRegion(FastRegion &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs1dregions1d(this,std::move(other._XYs1dregions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FastRegion &operator=(const FastRegion &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs1dregions1d = other._XYs1dregions1d; + } + return *this; + } + + // move + FastRegion &operator=(FastRegion &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs1dregions1d = std::move(other._XYs1dregions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/FastRegion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FastRegion + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/FastRegion/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/FastRegion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/FastRegion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Forward.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Forward.hpp new file mode 100644 index 000000000..f5274fd95 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Forward.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_FORWARD +#define TEST_V2_0_TRANSPORT_FORWARD + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class Forward +// ----------------------------------------------------------------------------- + +class Forward : + 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 "Forward"; } + static auto NODENAME() { return "forward"; } + + // 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + Forward() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Forward(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Forward(const Forward &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Forward(Forward &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Forward &operator=(const Forward &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + Forward &operator=(Forward &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Forward/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Forward + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Forward/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Forward/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Forward/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/G.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/G.hpp new file mode 100644 index 000000000..2719f2c5e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/G.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_G +#define TEST_V2_0_TRANSPORT_G + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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") | + --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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + G() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit G( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit G(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + G(const G &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + G(G &&other) : + 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 + G &operator=(const G &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + 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); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/G/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class G + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/G/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/G/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/G/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/GeneralEvaporation.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/GeneralEvaporation.hpp new file mode 100644 index 000000000..764adacce --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/GeneralEvaporation.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_GENERALEVAPORATION +#define TEST_V2_0_TRANSPORT_GENERALEVAPORATION + +#include "test/v2.0/transport/U.hpp" +#include "test/v2.0/transport/G.hpp" +#include "test/v2.0/transport/Theta.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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> + ("g") | + --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", + "g", + "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", + "g", + "theta" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + U{this}; + Field> + g{this}; + Field> + theta{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->g, \ + this->theta \ + ) + + // default + GeneralEvaporation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GeneralEvaporation( + const wrapper> + &U, + const wrapper> + &g = {}, + const wrapper> + &theta = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + U(this,U), + g(this,g), + theta(this,theta) + { + Component::finish(); + } + + // from node + explicit GeneralEvaporation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GeneralEvaporation(const GeneralEvaporation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + U(this,other.U), + g(this,other.g), + theta(this,other.theta) + { + Component::finish(other); + } + + // move + GeneralEvaporation(GeneralEvaporation &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + U(this,std::move(other.U)), + g(this,std::move(other.g)), + theta(this,std::move(other.theta)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + GeneralEvaporation &operator=(const GeneralEvaporation &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + U = other.U; + g = other.g; + theta = other.theta; + } + 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); + g = std::move(other.g); + theta = std::move(other.theta); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/GeneralEvaporation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class GeneralEvaporation + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/GeneralEvaporation/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/GeneralEvaporation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/GeneralEvaporation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/IncoherentPhoton.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/IncoherentPhoton.hpp new file mode 100644 index 000000000..586c3d1df --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/IncoherentPhoton.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_INCOHERENTPHOTON +#define TEST_V2_0_TRANSPORT_INCOHERENTPHOTON + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class IncoherentPhoton +// ----------------------------------------------------------------------------- + +class IncoherentPhoton : + 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 "IncoherentPhoton"; } + static auto NODENAME() { return "incoherentPhoton"; } + + // 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + IncoherentPhoton() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit IncoherentPhoton(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncoherentPhoton(const IncoherentPhoton &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + IncoherentPhoton(IncoherentPhoton &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + IncoherentPhoton &operator=(const IncoherentPhoton &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + IncoherentPhoton &operator=(IncoherentPhoton &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/IncoherentPhoton/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class IncoherentPhoton + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/IncoherentPhoton/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/IncoherentPhoton/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/IncoherentPhoton/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/IncompleteReactions.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/IncompleteReactions.hpp new file mode 100644 index 000000000..3214c9c56 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/IncompleteReactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_INCOMPLETEREACTIONS +#define TEST_V2_0_TRANSPORT_INCOMPLETEREACTIONS + +#include "test/v2.0/transport/Reaction.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->reaction \ + ) + + // default + IncompleteReactions() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncompleteReactions( + const wrapper> + &reaction + ) : + GNDSTK_COMPONENT(BlockData{}), + reaction(this,reaction) + { + Component::finish(); + } + + // from node + explicit IncompleteReactions(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncompleteReactions(const IncompleteReactions &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + reaction(this,other.reaction) + { + Component::finish(other); + } + + // move + IncompleteReactions(IncompleteReactions &&other) : + 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 "test/v2.0/transport/IncompleteReactions/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class IncompleteReactions + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/IncompleteReactions/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/IncompleteReactions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/IncompleteReactions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Isotropic2d.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Isotropic2d.hpp new file mode 100644 index 000000000..c4fdd96fc --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Isotropic2d.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_ISOTROPIC2D +#define TEST_V2_0_TRANSPORT_ISOTROPIC2D + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + Isotropic2d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Isotropic2d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotropic2d(const Isotropic2d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Isotropic2d(Isotropic2d &&other) : + 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 "test/v2.0/transport/Isotropic2d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Isotropic2d + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Isotropic2d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Isotropic2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Isotropic2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/KalbachMann.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/KalbachMann.hpp new file mode 100644 index 000000000..d91b20743 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/KalbachMann.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_KALBACHMANN +#define TEST_V2_0_TRANSPORT_KALBACHMANN + +#include "test/v2.0/transport/F.hpp" +#include "test/v2.0/transport/R.hpp" +#include "test/v2.0/transport/A.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / Meta<>("label") | + XMLName{} + / Meta<>("productFrame") | + + // children + --Child + ("f") | + --Child + ("r") | + --Child> + ("a") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "a" + }; + 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", + "a" + }; + 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}; + Field> + a{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->f, \ + this->r, \ + this->a \ + ) + + // default + KalbachMann() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit KalbachMann( + const wrapper> + &label, + const wrapper + &productFrame = {}, + const wrapper + &f = {}, + const wrapper + &r = {}, + const wrapper> + &a = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + f(this,f), + r(this,r), + a(this,a) + { + Component::finish(); + } + + // from node + explicit KalbachMann(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + KalbachMann(const KalbachMann &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + f(this,other.f), + r(this,other.r), + a(this,other.a) + { + Component::finish(other); + } + + // move + KalbachMann(KalbachMann &&other) : + 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)), + a(this,std::move(other.a)) + { + 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; + a = other.a; + } + 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); + a = std::move(other.a); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/KalbachMann/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class KalbachMann + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/KalbachMann/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/KalbachMann/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/KalbachMann/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/MultiGroup3d.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiGroup3d.hpp new file mode 100644 index 000000000..0913b707f --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiGroup3d.hpp @@ -0,0 +1,219 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_MULTIGROUP3D +#define TEST_V2_0_TRANSPORT_MULTIGROUP3D + +#include "test/v2.0/containers/Gridded3d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class MultiGroup3d +// ----------------------------------------------------------------------------- + +class MultiGroup3d : + 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 "MultiGroup3d"; } + static auto NODENAME() { return "scatteringMatrix"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("productFrame") | + + // children + --Child + ("gridded3d") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "gridded3d" + }; + 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", + "gridded3d" + }; + 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 + gridded3d{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(gridded3d(),axes); + GNDSTK_SHORTCUT(gridded3d().axes(),axis); + GNDSTK_SHORTCUT(gridded3d().axes(),grid); + GNDSTK_SHORTCUT(gridded3d().array(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->gridded3d \ + ) + + // default + MultiGroup3d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiGroup3d( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper + &gridded3d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + gridded3d(this,gridded3d) + { + Component::finish(); + } + + // from node + explicit MultiGroup3d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiGroup3d(const MultiGroup3d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + gridded3d(this,other.gridded3d) + { + Component::finish(other); + } + + // move + MultiGroup3d(MultiGroup3d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + gridded3d(this,std::move(other.gridded3d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MultiGroup3d &operator=(const MultiGroup3d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + gridded3d = other.gridded3d; + } + return *this; + } + + // move + MultiGroup3d &operator=(MultiGroup3d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + gridded3d = std::move(other.gridded3d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/MultiGroup3d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MultiGroup3d + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/MultiGroup3d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiGroup3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiGroup3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Multiplicity.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Multiplicity.hpp new file mode 100644 index 000000000..b6e18ff42 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Multiplicity.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_MULTIPLICITY +#define TEST_V2_0_TRANSPORT_MULTIPLICITY + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Constant1d.hpp" +#include "test/v2.0/containers/Polynomial1d.hpp" +#include "test/v2.0/transport/Branching1d.hpp" +#include "test/v2.0/transport/Reference.hpp" +#include "test/v2.0/containers/Gridded1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class Multiplicity +// ----------------------------------------------------------------------------- + +class Multiplicity : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::XYs1d, + containers::Constant1d, + containers::Polynomial1d, + transport::Branching1d, + transport::Reference, + containers::Gridded1d, + containers::Regions1d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + 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 + _t{} + / --(Child<>("XYs1d") || Child<>("constant1d") || Child<>("polynomial1d") || Child<>("branching1d") || Child<>("reference") || Child<>("gridded1d") || 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", + "_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d{this}; + FieldPart XYs1d{_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d}; + FieldPart constant1d{_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d}; + FieldPart polynomial1d{_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d}; + FieldPart branching1d{_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d}; + FieldPart reference{_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d}; + FieldPart gridded1d{_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d}; + FieldPart regions1d{_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d \ + ) + + // default + Multiplicity() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Multiplicity( + const wrapper<_t> + &_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d(this,_XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d) + { + Component::finish(); + } + + // from node + explicit Multiplicity(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Multiplicity(const Multiplicity &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d(this,other._XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d) + { + Component::finish(other); + } + + // move + Multiplicity(Multiplicity &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d(this,std::move(other._XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Multiplicity &operator=(const Multiplicity &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d = other._XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d; + } + return *this; + } + + // move + Multiplicity &operator=(Multiplicity &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d = std::move(other._XYs1dconstant1dpolynomial1dbranching1dreferencegridded1dregions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Multiplicity/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Multiplicity + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Multiplicity/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Multiplicity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Multiplicity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySum.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySum.hpp new file mode 100644 index 000000000..ba9c957f5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySum.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_MULTIPLICITYSUM +#define TEST_V2_0_TRANSPORT_MULTIPLICITYSUM + +#include "test/v2.0/transport/Multiplicity.hpp" +#include "test/v2.0/transport/Summands.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / Meta<>("ENDF_MT") | + XMLName{} + / Meta<>("label") | + + // 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", + "ENDF_MT", + "label", + "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", + "endf_mt", + "label", + "multiplicity", + "summands" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + ENDF_MT{this}; + Field + label{this}; + + // children + Field + multiplicity{this}; + Field + summands{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(summands(),add); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MT, \ + this->label, \ + this->multiplicity, \ + this->summands \ + ) + + // default + MultiplicitySum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiplicitySum( + const wrapper> + &ENDF_MT, + const wrapper + &label = {}, + const wrapper + &multiplicity = {}, + const wrapper + &summands = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MT(this,ENDF_MT), + label(this,label), + multiplicity(this,multiplicity), + summands(this,summands) + { + Component::finish(); + } + + // from node + explicit MultiplicitySum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiplicitySum(const MultiplicitySum &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MT(this,other.ENDF_MT), + label(this,other.label), + multiplicity(this,other.multiplicity), + summands(this,other.summands) + { + Component::finish(other); + } + + // move + MultiplicitySum(MultiplicitySum &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MT(this,std::move(other.ENDF_MT)), + label(this,std::move(other.label)), + 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; + ENDF_MT = other.ENDF_MT; + label = other.label; + 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); + ENDF_MT = std::move(other.ENDF_MT); + label = std::move(other.label); + multiplicity = std::move(other.multiplicity); + summands = std::move(other.summands); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/MultiplicitySum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MultiplicitySum + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySum/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySums.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySums.hpp new file mode 100644 index 000000000..447460b02 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySums.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_MULTIPLICITYSUMS +#define TEST_V2_0_TRANSPORT_MULTIPLICITYSUMS + +#include "test/v2.0/transport/MultiplicitySum.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->multiplicitySum \ + ) + + // default + MultiplicitySums() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiplicitySums( + const wrapper>> + &multiplicitySum + ) : + GNDSTK_COMPONENT(BlockData{}), + multiplicitySum(this,multiplicitySum) + { + Component::finish(); + } + + // from node + explicit MultiplicitySums(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiplicitySums(const MultiplicitySums &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + multiplicitySum(this,other.multiplicitySum) + { + Component::finish(other); + } + + // move + MultiplicitySums(MultiplicitySums &&other) : + 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 "test/v2.0/transport/MultiplicitySums/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class MultiplicitySums + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySums/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySums/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/MultiplicitySums/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/NBodyPhaseSpace.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/NBodyPhaseSpace.hpp new file mode 100644 index 000000000..82469a81b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/NBodyPhaseSpace.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_NBODYPHASESPACE +#define TEST_V2_0_TRANSPORT_NBODYPHASESPACE + +#include "test/v2.0/tsl/Mass.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 + std::optional{} + / 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->numberOfProducts, \ + this->mass \ + ) + + // default + NBodyPhaseSpace() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NBodyPhaseSpace( + const wrapper> + &numberOfProducts, + const wrapper> + &mass = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + numberOfProducts(this,numberOfProducts), + mass(this,mass) + { + Component::finish(); + } + + // from node + explicit NBodyPhaseSpace(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NBodyPhaseSpace(const NBodyPhaseSpace &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + numberOfProducts(this,other.numberOfProducts), + mass(this,other.mass) + { + Component::finish(other); + } + + // move + NBodyPhaseSpace(NBodyPhaseSpace &&other) : + 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 "test/v2.0/transport/NBodyPhaseSpace/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class NBodyPhaseSpace + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/NBodyPhaseSpace/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/NBodyPhaseSpace/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/NBodyPhaseSpace/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProduct.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProduct.hpp new file mode 100644 index 000000000..46b3d1420 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProduct.hpp @@ -0,0 +1,233 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_ORPHANPRODUCT +#define TEST_V2_0_TRANSPORT_ORPHANPRODUCT + +#include "test/v2.0/transport/CrossSection.hpp" +#include "test/v2.0/transport/OutputChannel.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 + Integer32{} + / Meta<>("ENDF_MT") | + XMLName{} + / Meta<>("label") | + + // 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", + "ENDF_MT", + "label", + "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", + "endf_mt", + "label", + "cross_section", + "output_channel" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + ENDF_MT{this}; + Field + label{this}; + + // children + Field + crossSection{this}; + Field + outputChannel{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(outputChannel(),Q); + GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + GNDSTK_SHORTCUT(outputChannel(),products); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MT, \ + this->label, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + OrphanProduct() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OrphanProduct( + const wrapper + &ENDF_MT, + const wrapper + &label = {}, + const wrapper + &crossSection = {}, + const wrapper + &outputChannel = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MT(this,ENDF_MT), + label(this,label), + crossSection(this,crossSection), + outputChannel(this,outputChannel) + { + Component::finish(); + } + + // from node + explicit OrphanProduct(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OrphanProduct(const OrphanProduct &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MT(this,other.ENDF_MT), + label(this,other.label), + crossSection(this,other.crossSection), + outputChannel(this,other.outputChannel) + { + Component::finish(other); + } + + // move + OrphanProduct(OrphanProduct &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MT(this,std::move(other.ENDF_MT)), + label(this,std::move(other.label)), + 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; + ENDF_MT = other.ENDF_MT; + label = other.label; + 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); + ENDF_MT = std::move(other.ENDF_MT); + label = std::move(other.label); + crossSection = std::move(other.crossSection); + outputChannel = std::move(other.outputChannel); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/OrphanProduct/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class OrphanProduct + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProduct/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProduct/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProduct/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProducts.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProducts.hpp new file mode 100644 index 000000000..0aa10de6e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProducts.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_ORPHANPRODUCTS +#define TEST_V2_0_TRANSPORT_ORPHANPRODUCTS + +#include "test/v2.0/transport/OrphanProduct.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->orphanProduct \ + ) + + // default + OrphanProducts() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OrphanProducts( + const wrapper> + &orphanProduct + ) : + GNDSTK_COMPONENT(BlockData{}), + orphanProduct(this,orphanProduct) + { + Component::finish(); + } + + // from node + explicit OrphanProducts(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OrphanProducts(const OrphanProducts &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + orphanProduct(this,other.orphanProduct) + { + Component::finish(other); + } + + // move + OrphanProducts(OrphanProducts &&other) : + 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 "test/v2.0/transport/OrphanProducts/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class OrphanProducts + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProducts/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProducts/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/OrphanProducts/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/OutputChannel.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/OutputChannel.hpp new file mode 100644 index 000000000..29fbb21db --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/OutputChannel.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_OUTPUTCHANNEL +#define TEST_V2_0_TRANSPORT_OUTPUTCHANNEL + +#include "test/v2.0/common/Q.hpp" +#include "test/v2.0/common/Products.hpp" +#include "test/v2.0/fissionFragmentData/FissionFragmentData.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->genre, \ + this->process, \ + this->Q, \ + this->products, \ + this->fissionFragmentData \ + ) + + // default + OutputChannel() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OutputChannel(const OutputChannel &other) : + 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) : + 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 "test/v2.0/transport/OutputChannel/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class OutputChannel + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/OutputChannel/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/OutputChannel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/OutputChannel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/PhotonEmissionProbabilities.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/PhotonEmissionProbabilities.hpp new file mode 100644 index 000000000..44a421405 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/PhotonEmissionProbabilities.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_PHOTONEMISSIONPROBABILITIES +#define TEST_V2_0_TRANSPORT_PHOTONEMISSIONPROBABILITIES + +#include "test/v2.0/pops/Shell.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shell \ + ) + + // default + PhotonEmissionProbabilities() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PhotonEmissionProbabilities( + const wrapper> + &shell + ) : + GNDSTK_COMPONENT(BlockData{}), + shell(this,shell) + { + Component::finish(); + } + + // from node + explicit PhotonEmissionProbabilities(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PhotonEmissionProbabilities(const PhotonEmissionProbabilities &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shell(this,other.shell) + { + Component::finish(other); + } + + // move + PhotonEmissionProbabilities(PhotonEmissionProbabilities &&other) : + 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 "test/v2.0/transport/PhotonEmissionProbabilities/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PhotonEmissionProbabilities + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/PhotonEmissionProbabilities/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/PhotonEmissionProbabilities/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/PhotonEmissionProbabilities/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/PrimaryGamma.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/PrimaryGamma.hpp new file mode 100644 index 000000000..166a61a4c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/PrimaryGamma.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_PRIMARYGAMMA +#define TEST_V2_0_TRANSPORT_PRIMARYGAMMA + +#include "test/v2.0/containers/Axes.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 + std::optional{} + / Meta<>("domainMax") | + std::optional{} + / Meta<>("domainMin") | + std::optional{} + / Meta<>("value") | + std::optional{} + / Meta<>("finalState") | + + // 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", + "domainMax", + "domainMin", + "value", + "finalState", + "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", + "domain_max", + "domain_min", + "value", + "final_state", + "axes" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + domainMax{this}; + Field> + domainMin{this}; + Field> + value{this}; + Field> + finalState{this}; + + // children + Field> + axes{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMax, \ + this->domainMin, \ + this->value, \ + this->finalState, \ + this->axes \ + ) + + // default + PrimaryGamma() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PrimaryGamma( + const wrapper> + &domainMax, + const wrapper> + &domainMin = {}, + const wrapper> + &value = {}, + const wrapper> + &finalState = {}, + const wrapper> + &axes = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + domainMax(this,domainMax), + domainMin(this,domainMin), + value(this,value), + finalState(this,finalState), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit PrimaryGamma(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PrimaryGamma(const PrimaryGamma &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + domainMax(this,other.domainMax), + domainMin(this,other.domainMin), + value(this,other.value), + finalState(this,other.finalState), + axes(this,other.axes) + { + Component::finish(other); + } + + // move + PrimaryGamma(PrimaryGamma &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + domainMax(this,std::move(other.domainMax)), + domainMin(this,std::move(other.domainMin)), + value(this,std::move(other.value)), + finalState(this,std::move(other.finalState)), + 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; + domainMax = other.domainMax; + domainMin = other.domainMin; + value = other.value; + finalState = other.finalState; + axes = other.axes; + } + return *this; + } + + // move + PrimaryGamma &operator=(PrimaryGamma &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + domainMax = std::move(other.domainMax); + domainMin = std::move(other.domainMin); + value = std::move(other.value); + finalState = std::move(other.finalState); + axes = std::move(other.axes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/PrimaryGamma/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PrimaryGamma + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/PrimaryGamma/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/PrimaryGamma/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/PrimaryGamma/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Production.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Production.hpp new file mode 100644 index 000000000..933a95ae4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Production.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_PRODUCTION +#define TEST_V2_0_TRANSPORT_PRODUCTION + +#include "test/v2.0/transport/CrossSection.hpp" +#include "test/v2.0/transport/OutputChannel.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / Meta<>("ENDF_MT") | + std::optional{} + / Meta<>("label") | + + // 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", + "ENDF_MT", + "label", + "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", + "endf_mt", + "label", + "cross_section", + "output_channel" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + ENDF_MT{this}; + Field> + label{this}; + + // children + Field> + crossSection{this}; + Field> + outputChannel{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MT, \ + this->label, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + Production() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Production( + const wrapper> + &ENDF_MT, + const wrapper> + &label = {}, + const wrapper> + &crossSection = {}, + const wrapper> + &outputChannel = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MT(this,ENDF_MT), + label(this,label), + crossSection(this,crossSection), + outputChannel(this,outputChannel) + { + Component::finish(); + } + + // from node + explicit Production(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Production(const Production &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MT(this,other.ENDF_MT), + label(this,other.label), + crossSection(this,other.crossSection), + outputChannel(this,other.outputChannel) + { + Component::finish(other); + } + + // move + Production(Production &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MT(this,std::move(other.ENDF_MT)), + label(this,std::move(other.label)), + 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; + ENDF_MT = other.ENDF_MT; + label = other.label; + 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); + ENDF_MT = std::move(other.ENDF_MT); + label = std::move(other.label); + crossSection = std::move(other.crossSection); + outputChannel = std::move(other.outputChannel); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Production/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Production + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Production/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Production/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Production/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Productions.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Productions.hpp new file mode 100644 index 000000000..423e6fa7e --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Productions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_PRODUCTIONS +#define TEST_V2_0_TRANSPORT_PRODUCTIONS + +#include "test/v2.0/transport/Production.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->production \ + ) + + // default + Productions() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Productions( + const wrapper> + &production + ) : + GNDSTK_COMPONENT(BlockData{}), + production(this,production) + { + Component::finish(); + } + + // from node + explicit Productions(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Productions(const Productions &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + production(this,other.production) + { + Component::finish(other); + } + + // move + Productions(Productions &&other) : + 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 "test/v2.0/transport/Productions/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Productions + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Productions/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Productions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Productions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/R.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/R.hpp new file mode 100644 index 000000000..5bdb2fce0 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/R.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_R +#define TEST_V2_0_TRANSPORT_R + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class R +// ----------------------------------------------------------------------------- + +class R : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + 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 + _t{} + / --(Child<>("XYs2d") || Child<>("regions2d")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "_XYs2dregions2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys2dregions2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _XYs2dregions2d{this}; + FieldPart XYs2d{_XYs2dregions2d}; + FieldPart regions2d{_XYs2dregions2d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs2dregions2d \ + ) + + // default + R() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit R( + const wrapper<_t> + &_XYs2dregions2d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs2dregions2d(this,_XYs2dregions2d) + { + Component::finish(); + } + + // from node + explicit R(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + R(const R &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs2dregions2d(this,other._XYs2dregions2d) + { + Component::finish(other); + } + + // move + R(R &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs2dregions2d(this,std::move(other._XYs2dregions2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + R &operator=(const R &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs2dregions2d = other._XYs2dregions2d; + } + return *this; + } + + // move + R &operator=(R &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs2dregions2d = std::move(other._XYs2dregions2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/R/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class R + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/R/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/R/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/R/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Reaction.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Reaction.hpp new file mode 100644 index 000000000..ac0956e69 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Reaction.hpp @@ -0,0 +1,262 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_REACTION +#define TEST_V2_0_TRANSPORT_REACTION + +#include "test/v2.0/transport/DoubleDifferentialCrossSection.hpp" +#include "test/v2.0/transport/CrossSection.hpp" +#include "test/v2.0/transport/OutputChannel.hpp" + +namespace test { +namespace v2_0 { +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 + Integer32{} + / Meta<>("ENDF_MT") | + std::optional{} + / Meta<>("fissionGenre") | + XMLName{} + / Meta<>("label") | + + // children + --Child> + ("doubleDifferentialCrossSection") | + --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", + "ENDF_MT", + "fissionGenre", + "label", + "doubleDifferentialCrossSection", + "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", + "endf_mt", + "fission_genre", + "label", + "double_differential_cross_section", + "cross_section", + "output_channel" + }; + 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> + doubleDifferentialCrossSection{this}; + Field + crossSection{this}; + Field + outputChannel{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(outputChannel(),Q); + GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + GNDSTK_SHORTCUT(outputChannel(),products); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MT, \ + this->fissionGenre, \ + this->label, \ + this->doubleDifferentialCrossSection, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + Reaction() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reaction( + const wrapper + &ENDF_MT, + const wrapper> + &fissionGenre = {}, + const wrapper + &label = {}, + const wrapper> + &doubleDifferentialCrossSection = {}, + const wrapper + &crossSection = {}, + const wrapper + &outputChannel = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + ENDF_MT(this,ENDF_MT), + fissionGenre(this,fissionGenre), + label(this,label), + doubleDifferentialCrossSection(this,doubleDifferentialCrossSection), + crossSection(this,crossSection), + outputChannel(this,outputChannel) + { + Component::finish(); + } + + // from node + explicit Reaction(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reaction(const Reaction &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MT(this,other.ENDF_MT), + fissionGenre(this,other.fissionGenre), + label(this,other.label), + doubleDifferentialCrossSection(this,other.doubleDifferentialCrossSection), + crossSection(this,other.crossSection), + outputChannel(this,other.outputChannel) + { + Component::finish(other); + } + + // move + Reaction(Reaction &&other) : + 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)), + doubleDifferentialCrossSection(this,std::move(other.doubleDifferentialCrossSection)), + crossSection(this,std::move(other.crossSection)), + outputChannel(this,std::move(other.outputChannel)) + { + 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; + doubleDifferentialCrossSection = other.doubleDifferentialCrossSection; + crossSection = other.crossSection; + outputChannel = other.outputChannel; + } + 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); + doubleDifferentialCrossSection = std::move(other.doubleDifferentialCrossSection); + crossSection = std::move(other.crossSection); + outputChannel = std::move(other.outputChannel); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Reaction/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Reaction + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Reaction/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Reaction/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Reaction/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/ReactionSuite.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/ReactionSuite.hpp new file mode 100644 index 000000000..1f60118f7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/ReactionSuite.hpp @@ -0,0 +1,427 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_REACTIONSUITE +#define TEST_V2_0_TRANSPORT_REACTIONSUITE + +#include "test/v2.0/common/ExternalFiles.hpp" +#include "test/v2.0/styles/Styles.hpp" +#include "test/v2.0/pops/PoPs_database.hpp" +#include "test/v2.0/resonances/Resonances.hpp" +#include "test/v2.0/transport/Reactions.hpp" +#include "test/v2.0/transport/OrphanProducts.hpp" +#include "test/v2.0/transport/Sums.hpp" +#include "test/v2.0/fissionTransport/FissionComponents.hpp" +#include "test/v2.0/transport/Productions.hpp" +#include "test/v2.0/transport/IncompleteReactions.hpp" +#include "test/v2.0/appData/ApplicationData.hpp" + +namespace test { +namespace v2_0 { +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 + XMLName{} + / Meta<>("evaluation") | + XMLName{} + / Meta<>("format") | + XMLName{} + / Meta<>("projectile") | + enums::Frame{} + / Meta<>("projectileFrame") | + XMLName{} + / Meta<>("target") | + enums::Interaction{} + / Meta<>("interaction") | + + // children + --Child> + ("externalFiles") | + --Child + ("styles") | + --Child + ("PoPs") | + --Child> + ("resonances") | + --Child> + ("reactions") | + --Child> + ("orphanProducts") | + --Child> + ("sums") | + --Child> + ("fissionComponents") | + --Child> + ("productions") | + --Child> + ("incompleteReactions") | + --Child> + ("applicationData") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "externalFiles", + "styles", + "PoPs_database", + "resonances", + "reactions", + "orphanProducts", + "sums", + "fissionComponents", + "productions", + "incompleteReactions", + "applicationData" + }; + 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", + "external_files", + "styles", + "po_ps_database", + "resonances", + "reactions", + "orphan_products", + "sums", + "fission_components", + "productions", + "incomplete_reactions", + "application_data" + }; + 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> + externalFiles{this}; + Field + styles{this}; + Field + PoPs_database{this}; + Field> + resonances{this}; + Field> + reactions{this}; + Field> + orphanProducts{this}; + Field> + sums{this}; + Field> + fissionComponents{this}; + Field> + productions{this}; + Field> + incompleteReactions{this}; + Field> + applicationData{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(PoPs_database(),aliases); + GNDSTK_SHORTCUT(PoPs_database(),baryons); + GNDSTK_SHORTCUT(PoPs_database(),chemicalElements); + GNDSTK_SHORTCUT(PoPs_database(),gaugeBosons); + GNDSTK_SHORTCUT(PoPs_database(),leptons); + GNDSTK_SHORTCUT(PoPs_database(),unorthodoxes); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->evaluation, \ + this->format, \ + this->projectile, \ + this->projectileFrame, \ + this->target, \ + this->interaction, \ + this->externalFiles, \ + this->styles, \ + this->PoPs_database, \ + this->resonances, \ + this->reactions, \ + this->orphanProducts, \ + this->sums, \ + this->fissionComponents, \ + this->productions, \ + this->incompleteReactions, \ + this->applicationData \ + ) + + // default + ReactionSuite() : + 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> + &externalFiles = {}, + const wrapper + &styles = {}, + const wrapper + &PoPs_database = {}, + const wrapper> + &resonances = {}, + const wrapper> + &reactions = {}, + const wrapper> + &orphanProducts = {}, + const wrapper> + &sums = {}, + const wrapper> + &fissionComponents = {}, + const wrapper> + &productions = {}, + const wrapper> + &incompleteReactions = {}, + const wrapper> + &applicationData = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + evaluation(this,evaluation), + format(this,format), + projectile(this,projectile), + projectileFrame(this,projectileFrame), + target(this,target), + interaction(this,interaction), + externalFiles(this,externalFiles), + styles(this,styles), + PoPs_database(this,PoPs_database), + resonances(this,resonances), + reactions(this,reactions), + orphanProducts(this,orphanProducts), + sums(this,sums), + fissionComponents(this,fissionComponents), + productions(this,productions), + incompleteReactions(this,incompleteReactions), + applicationData(this,applicationData) + { + Component::finish(); + } + + // from node + explicit ReactionSuite(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ReactionSuite(const ReactionSuite &other) : + 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), + externalFiles(this,other.externalFiles), + styles(this,other.styles), + PoPs_database(this,other.PoPs_database), + resonances(this,other.resonances), + reactions(this,other.reactions), + orphanProducts(this,other.orphanProducts), + sums(this,other.sums), + fissionComponents(this,other.fissionComponents), + productions(this,other.productions), + incompleteReactions(this,other.incompleteReactions), + applicationData(this,other.applicationData) + { + Component::finish(other); + } + + // move + ReactionSuite(ReactionSuite &&other) : + 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)), + externalFiles(this,std::move(other.externalFiles)), + styles(this,std::move(other.styles)), + PoPs_database(this,std::move(other.PoPs_database)), + resonances(this,std::move(other.resonances)), + reactions(this,std::move(other.reactions)), + orphanProducts(this,std::move(other.orphanProducts)), + sums(this,std::move(other.sums)), + fissionComponents(this,std::move(other.fissionComponents)), + productions(this,std::move(other.productions)), + incompleteReactions(this,std::move(other.incompleteReactions)), + applicationData(this,std::move(other.applicationData)) + { + 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; + externalFiles = other.externalFiles; + styles = other.styles; + PoPs_database = other.PoPs_database; + resonances = other.resonances; + reactions = other.reactions; + orphanProducts = other.orphanProducts; + sums = other.sums; + fissionComponents = other.fissionComponents; + productions = other.productions; + incompleteReactions = other.incompleteReactions; + applicationData = other.applicationData; + } + 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); + externalFiles = std::move(other.externalFiles); + styles = std::move(other.styles); + PoPs_database = std::move(other.PoPs_database); + resonances = std::move(other.resonances); + reactions = std::move(other.reactions); + orphanProducts = std::move(other.orphanProducts); + sums = std::move(other.sums); + fissionComponents = std::move(other.fissionComponents); + productions = std::move(other.productions); + incompleteReactions = std::move(other.incompleteReactions); + applicationData = std::move(other.applicationData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/ReactionSuite/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ReactionSuite + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/ReactionSuite/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/ReactionSuite/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/ReactionSuite/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Reactions.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Reactions.hpp new file mode 100644 index 000000000..d88cb33b7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Reactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_REACTIONS +#define TEST_V2_0_TRANSPORT_REACTIONS + +#include "test/v2.0/transport/Reaction.hpp" + +namespace test { +namespace v2_0 { +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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->reaction \ + ) + + // default + Reactions() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reactions( + const wrapper> + &reaction + ) : + GNDSTK_COMPONENT(BlockData{}), + reaction(this,reaction) + { + Component::finish(); + } + + // from node + explicit Reactions(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reactions(const Reactions &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + reaction(this,other.reaction) + { + Component::finish(other); + } + + // move + Reactions(Reactions &&other) : + 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 "test/v2.0/transport/Reactions/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Reactions + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Reactions/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Reactions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Reactions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Recoil.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Recoil.hpp new file mode 100644 index 000000000..7eb9dd934 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Recoil.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_RECOIL +#define TEST_V2_0_TRANSPORT_RECOIL + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Recoil() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Recoil( + const wrapper + &href + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Recoil(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Recoil(const Recoil &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Recoil(Recoil &&other) : + 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 "test/v2.0/transport/Recoil/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Recoil + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Recoil/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Recoil/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Recoil/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Reference.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Reference.hpp new file mode 100644 index 000000000..88034e7be --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Reference.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_REFERENCE +#define TEST_V2_0_TRANSPORT_REFERENCE + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / Meta<>("href") | + std::optional{} + / 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", + "href", + "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", + "href", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + href{this}; + Field> + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->label \ + ) + + // default + Reference() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reference( + const wrapper> + &href, + const wrapper> + &label = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + href(this,href), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Reference(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reference(const Reference &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href), + label(this,other.label) + { + Component::finish(other); + } + + // move + Reference(Reference &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Reference &operator=(const Reference &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + href = other.href; + label = other.label; + } + return *this; + } + + // move + Reference &operator=(Reference &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Reference/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Reference + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Reference/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Reference/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Reference/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/ResolvedRegion.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/ResolvedRegion.hpp new file mode 100644 index 000000000..ae158883c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/ResolvedRegion.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_RESOLVEDREGION +#define TEST_V2_0_TRANSPORT_RESOLVEDREGION + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class ResolvedRegion +// ----------------------------------------------------------------------------- + +class ResolvedRegion : + public Component +{ + friend class Component; + + using _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 "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 + _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", + "_XYs1dregions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys1dregions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _XYs1dregions1d{this}; + FieldPart XYs1d{_XYs1dregions1d}; + FieldPart regions1d{_XYs1dregions1d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs1dregions1d \ + ) + + // default + ResolvedRegion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResolvedRegion( + const wrapper<_t> + &_XYs1dregions1d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs1dregions1d(this,_XYs1dregions1d) + { + Component::finish(); + } + + // from node + explicit ResolvedRegion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResolvedRegion(const ResolvedRegion &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs1dregions1d(this,other._XYs1dregions1d) + { + Component::finish(other); + } + + // move + ResolvedRegion(ResolvedRegion &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs1dregions1d(this,std::move(other._XYs1dregions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ResolvedRegion &operator=(const ResolvedRegion &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs1dregions1d = other._XYs1dregions1d; + } + return *this; + } + + // move + ResolvedRegion &operator=(ResolvedRegion &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs1dregions1d = std::move(other._XYs1dregions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/ResolvedRegion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResolvedRegion + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/ResolvedRegion/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/ResolvedRegion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/ResolvedRegion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesLink.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesLink.hpp new file mode 100644 index 000000000..3726d7ab1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesLink.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_RESONANCESLINK +#define TEST_V2_0_TRANSPORT_RESONANCESLINK + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class ResonancesLink +// ----------------------------------------------------------------------------- + +class ResonancesLink : + 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 "ResonancesLink"; } + 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<>("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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + ResonancesLink() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonancesLink( + const wrapper> + &label, + const wrapper + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit ResonancesLink(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonancesLink(const ResonancesLink &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + ResonancesLink(ResonancesLink &&other) : + 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 + ResonancesLink &operator=(const ResonancesLink &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + } + return *this; + } + + // move + ResonancesLink &operator=(ResonancesLink &&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 "test/v2.0/transport/ResonancesLink/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResonancesLink + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesLink/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesLink/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesLink/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesWithBackground.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesWithBackground.hpp new file mode 100644 index 000000000..146c3fae2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesWithBackground.hpp @@ -0,0 +1,234 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_RESONANCESWITHBACKGROUND +#define TEST_V2_0_TRANSPORT_RESONANCESWITHBACKGROUND + +#include "test/v2.0/transport/ResonancesLink.hpp" +#include "test/v2.0/transport/Background.hpp" +#include "test/v2.0/containers/Uncertainty.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 + XMLName{} + / 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", + "resonancesLink", + "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_link", + "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 + resonancesLink{this}; + Field + background{this}; + Field> + uncertainty{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(background(),fastRegion); + GNDSTK_SHORTCUT(background(),resolvedRegion); + GNDSTK_SHORTCUT(background(),unresolvedRegion); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->resonancesLink, \ + this->background, \ + this->uncertainty \ + ) + + // default + ResonancesWithBackground() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonancesWithBackground( + const wrapper + &label, + const wrapper + &resonancesLink = {}, + const wrapper + &background = {}, + const wrapper> + &uncertainty = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + resonancesLink(this,resonancesLink), + background(this,background), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit ResonancesWithBackground(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonancesWithBackground(const ResonancesWithBackground &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + resonancesLink(this,other.resonancesLink), + background(this,other.background), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + ResonancesWithBackground(ResonancesWithBackground &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + resonancesLink(this,std::move(other.resonancesLink)), + 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; + resonancesLink = other.resonancesLink; + 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); + resonancesLink = std::move(other.resonancesLink); + background = std::move(other.background); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/ResonancesWithBackground/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ResonancesWithBackground + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesWithBackground/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesWithBackground/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/ResonancesWithBackground/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Summands.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Summands.hpp new file mode 100644 index 000000000..f532a509b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Summands.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_SUMMANDS +#define TEST_V2_0_TRANSPORT_SUMMANDS + +#include "test/v2.0/transport/Add.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->add \ + ) + + // default + Summands() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Summands( + const wrapper>> + &add + ) : + GNDSTK_COMPONENT(BlockData{}), + add(this,add) + { + Component::finish(); + } + + // from node + explicit Summands(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Summands(const Summands &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + add(this,other.add) + { + Component::finish(other); + } + + // move + Summands(Summands &&other) : + 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 "test/v2.0/transport/Summands/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Summands + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Summands/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Summands/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Summands/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Sums.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Sums.hpp new file mode 100644 index 000000000..ddc1b3cf5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Sums.hpp @@ -0,0 +1,199 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_SUMS +#define TEST_V2_0_TRANSPORT_SUMS + +#include "test/v2.0/transport/CrossSectionSums.hpp" +#include "test/v2.0/transport/MultiplicitySums.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(crossSectionSums(),crossSectionSum); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->crossSectionSums, \ + this->multiplicitySums \ + ) + + // default + Sums() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Sums( + const wrapper + &crossSectionSums, + const wrapper> + &multiplicitySums = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + crossSectionSums(this,crossSectionSums), + multiplicitySums(this,multiplicitySums) + { + Component::finish(); + } + + // from node + explicit Sums(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Sums(const Sums &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + crossSectionSums(this,other.crossSectionSums), + multiplicitySums(this,other.multiplicitySums) + { + Component::finish(other); + } + + // move + Sums(Sums &&other) : + 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 "test/v2.0/transport/Sums/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Sums + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Sums/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Sums/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Sums/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Theta.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Theta.hpp new file mode 100644 index 000000000..9df5ebf0a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Theta.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_THETA +#define TEST_V2_0_TRANSPORT_THETA + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + Theta() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Theta( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit Theta(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Theta(const Theta &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + Theta(Theta &&other) : + 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 "test/v2.0/transport/Theta/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Theta + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Theta/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Theta/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Theta/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/U.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/U.hpp new file mode 100644 index 000000000..fb40219f5 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/U.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_U +#define TEST_V2_0_TRANSPORT_U + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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 + std::optional{} + / Meta<>("unit") | + std::optional{} + / 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", + "unit", + "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", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + unit{this}; + Field> + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unit, \ + this->value \ + ) + + // default + U() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit U( + const wrapper> + &unit, + const wrapper> + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit U(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + U(const U &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + U(U &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + U &operator=(const U &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + unit = other.unit; + value = other.value; + } + return *this; + } + + // move + U &operator=(U &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/U/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class U + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/U/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/U/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/U/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/URR_probabilityTables1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/URR_probabilityTables1d.hpp new file mode 100644 index 000000000..1ac511a3d --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/URR_probabilityTables1d.hpp @@ -0,0 +1,205 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_URR_PROBABILITYTABLES1D +#define TEST_V2_0_TRANSPORT_URR_PROBABILITYTABLES1D + +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/containers/Regions2d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class URR_probabilityTables1d +// ----------------------------------------------------------------------------- + +class URR_probabilityTables1d : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::XYs2d, + containers::Regions2d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + static auto CLASS() { return "URR_probabilityTables1d"; } + static auto NODENAME() { return "URR_probabilityTables1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("label") | + + // children + _t{} + / --(Child<>("XYs2d") || Child<>("regions2d")) + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "_XYs2dregions2d" + }; + 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", + "_xys2dregions2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children - variant + Field<_t> + _XYs2dregions2d{this}; + FieldPart XYs2d{_XYs2dregions2d}; + FieldPart regions2d{_XYs2dregions2d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->_XYs2dregions2d \ + ) + + // default + URR_probabilityTables1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit URR_probabilityTables1d( + const wrapper + &label, + const wrapper<_t> + &_XYs2dregions2d = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + _XYs2dregions2d(this,_XYs2dregions2d) + { + Component::finish(); + } + + // from node + explicit URR_probabilityTables1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + URR_probabilityTables1d(const URR_probabilityTables1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + _XYs2dregions2d(this,other._XYs2dregions2d) + { + Component::finish(other); + } + + // move + URR_probabilityTables1d(URR_probabilityTables1d &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + _XYs2dregions2d(this,std::move(other._XYs2dregions2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + URR_probabilityTables1d &operator=(const URR_probabilityTables1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + _XYs2dregions2d = other._XYs2dregions2d; + } + return *this; + } + + // move + URR_probabilityTables1d &operator=(URR_probabilityTables1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + _XYs2dregions2d = std::move(other._XYs2dregions2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/URR_probabilityTables1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class URR_probabilityTables1d + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/URR_probabilityTables1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/URR_probabilityTables1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/URR_probabilityTables1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Uncorrelated.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Uncorrelated.hpp new file mode 100644 index 000000000..4a6000de3 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Uncorrelated.hpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_UNCORRELATED +#define TEST_V2_0_TRANSPORT_UNCORRELATED + +#include "test/v2.0/transport/Angular_uncorrelated.hpp" +#include "test/v2.0/transport/Energy_uncorrelated.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / Meta<>("label") | + XMLName{} + / 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_uncorrelated", + "energy_uncorrelated" + }; + 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_uncorrelated", + "energy_uncorrelated" + }; + 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_uncorrelated{this}; + Field + energy_uncorrelated{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(energy_uncorrelated(),MadlandNix); + GNDSTK_SHORTCUT(energy_uncorrelated(),NBodyPhaseSpace); + GNDSTK_SHORTCUT(energy_uncorrelated(),Watt); + GNDSTK_SHORTCUT(energy_uncorrelated(),discreteGamma); + GNDSTK_SHORTCUT(energy_uncorrelated(),evaporation); + GNDSTK_SHORTCUT(angular_uncorrelated(),forward); + GNDSTK_SHORTCUT(energy_uncorrelated(),generalEvaporation); + GNDSTK_SHORTCUT(angular_uncorrelated(),isotropic2d); + GNDSTK_SHORTCUT(energy_uncorrelated(),primaryGamma); + GNDSTK_SHORTCUT(energy_uncorrelated(),regions2d); + GNDSTK_SHORTCUT(energy_uncorrelated(),simpleMaxwellianFission); + GNDSTK_SHORTCUT(energy_uncorrelated(),weightedFunctionals); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->angular_uncorrelated, \ + this->energy_uncorrelated \ + ) + + // default + Uncorrelated() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Uncorrelated( + const wrapper> + &label, + const wrapper + &productFrame = {}, + const wrapper + &angular_uncorrelated = {}, + const wrapper + &energy_uncorrelated = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + angular_uncorrelated(this,angular_uncorrelated), + energy_uncorrelated(this,energy_uncorrelated) + { + Component::finish(); + } + + // from node + explicit Uncorrelated(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Uncorrelated(const Uncorrelated &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + angular_uncorrelated(this,other.angular_uncorrelated), + energy_uncorrelated(this,other.energy_uncorrelated) + { + Component::finish(other); + } + + // move + Uncorrelated(Uncorrelated &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + angular_uncorrelated(this,std::move(other.angular_uncorrelated)), + energy_uncorrelated(this,std::move(other.energy_uncorrelated)) + { + 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_uncorrelated = other.angular_uncorrelated; + energy_uncorrelated = other.energy_uncorrelated; + } + 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_uncorrelated = std::move(other.angular_uncorrelated); + energy_uncorrelated = std::move(other.energy_uncorrelated); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Uncorrelated/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Uncorrelated + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Uncorrelated/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Uncorrelated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Uncorrelated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/UnresolvedRegion.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/UnresolvedRegion.hpp new file mode 100644 index 000000000..259663265 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/UnresolvedRegion.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_UNRESOLVEDREGION +#define TEST_V2_0_TRANSPORT_UNRESOLVEDREGION + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/Regions1d.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class UnresolvedRegion +// ----------------------------------------------------------------------------- + +class UnresolvedRegion : + public Component +{ + friend class Component; + + using _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 "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 + _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", + "_XYs1dregions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "_xys1dregions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field<_t> + _XYs1dregions1d{this}; + FieldPart XYs1d{_XYs1dregions1d}; + FieldPart regions1d{_XYs1dregions1d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->_XYs1dregions1d \ + ) + + // default + UnresolvedRegion() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit UnresolvedRegion( + const wrapper<_t> + &_XYs1dregions1d + ) : + GNDSTK_COMPONENT(BlockData{}), + _XYs1dregions1d(this,_XYs1dregions1d) + { + Component::finish(); + } + + // from node + explicit UnresolvedRegion(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + UnresolvedRegion(const UnresolvedRegion &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + _XYs1dregions1d(this,other._XYs1dregions1d) + { + Component::finish(other); + } + + // move + UnresolvedRegion(UnresolvedRegion &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + _XYs1dregions1d(this,std::move(other._XYs1dregions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + UnresolvedRegion &operator=(const UnresolvedRegion &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + _XYs1dregions1d = other._XYs1dregions1d; + } + return *this; + } + + // move + UnresolvedRegion &operator=(UnresolvedRegion &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + _XYs1dregions1d = std::move(other._XYs1dregions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/UnresolvedRegion/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class UnresolvedRegion + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/UnresolvedRegion/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/UnresolvedRegion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/UnresolvedRegion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Unspecified.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Unspecified.hpp new file mode 100644 index 000000000..e5463ffa1 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Unspecified.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_UNSPECIFIED +#define TEST_V2_0_TRANSPORT_UNSPECIFIED + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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::optional{} + / Meta<>("label") | + XMLName{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame \ + ) + + // default + Unspecified() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unspecified( + const wrapper> + &label, + const wrapper + &productFrame = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame) + { + Component::finish(); + } + + // from node + explicit Unspecified(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unspecified(const Unspecified &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame) + { + Component::finish(other); + } + + // move + Unspecified(Unspecified &&other) : + 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 "test/v2.0/transport/Unspecified/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Unspecified + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Unspecified/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Unspecified/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Unspecified/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Weighted.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Weighted.hpp new file mode 100644 index 000000000..2a7f83ca0 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Weighted.hpp @@ -0,0 +1,274 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_WEIGHTED +#define TEST_V2_0_TRANSPORT_WEIGHTED + +#include "test/v2.0/containers/XYs1d.hpp" +#include "test/v2.0/containers/XYs2d.hpp" +#include "test/v2.0/transport/Evaporation.hpp" +#include "test/v2.0/transport/GeneralEvaporation.hpp" +#include "test/v2.0/fissionTransport/SimpleMaxwellianFission.hpp" +#include "test/v2.0/fissionTransport/Watt.hpp" +#include "test/v2.0/fissionTransport/MadlandNix.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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> + ("XYs2d") | + --Child> + ("evaporation") | + --Child> + ("generalEvaporation") | + --Child> + ("simpleMaxwellianFission") | + --Child> + ("Watt") | + --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", + "XYs1d", + "XYs2d", + "evaporation", + "generalEvaporation", + "simpleMaxwellianFission", + "Watt", + "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", + "xys1d", + "xys2d", + "evaporation", + "general_evaporation", + "simple_maxwellian_fission", + "watt", + "madland_nix" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + Field> + XYs2d{this}; + Field> + evaporation{this}; + Field> + generalEvaporation{this}; + Field> + simpleMaxwellianFission{this}; + Field> + Watt{this}; + Field> + MadlandNix{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->XYs2d, \ + this->evaporation, \ + this->generalEvaporation, \ + this->simpleMaxwellianFission, \ + this->Watt, \ + this->MadlandNix \ + ) + + // default + Weighted() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Weighted( + const wrapper + &XYs1d, + const wrapper> + &XYs2d = {}, + const wrapper> + &evaporation = {}, + const wrapper> + &generalEvaporation = {}, + const wrapper> + &simpleMaxwellianFission = {}, + const wrapper> + &Watt = {}, + const wrapper> + &MadlandNix = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + XYs2d(this,XYs2d), + evaporation(this,evaporation), + generalEvaporation(this,generalEvaporation), + simpleMaxwellianFission(this,simpleMaxwellianFission), + Watt(this,Watt), + MadlandNix(this,MadlandNix) + { + Component::finish(); + } + + // from node + explicit Weighted(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Weighted(const Weighted &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + XYs2d(this,other.XYs2d), + evaporation(this,other.evaporation), + generalEvaporation(this,other.generalEvaporation), + simpleMaxwellianFission(this,other.simpleMaxwellianFission), + Watt(this,other.Watt), + MadlandNix(this,other.MadlandNix) + { + Component::finish(other); + } + + // move + Weighted(Weighted &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + XYs2d(this,std::move(other.XYs2d)), + evaporation(this,std::move(other.evaporation)), + generalEvaporation(this,std::move(other.generalEvaporation)), + simpleMaxwellianFission(this,std::move(other.simpleMaxwellianFission)), + Watt(this,std::move(other.Watt)), + MadlandNix(this,std::move(other.MadlandNix)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Weighted &operator=(const Weighted &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + XYs2d = other.XYs2d; + evaporation = other.evaporation; + generalEvaporation = other.generalEvaporation; + simpleMaxwellianFission = other.simpleMaxwellianFission; + Watt = other.Watt; + MadlandNix = other.MadlandNix; + } + 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); + XYs2d = std::move(other.XYs2d); + evaporation = std::move(other.evaporation); + generalEvaporation = std::move(other.generalEvaporation); + simpleMaxwellianFission = std::move(other.simpleMaxwellianFission); + Watt = std::move(other.Watt); + MadlandNix = std::move(other.MadlandNix); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/transport/Weighted/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Weighted + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/Weighted/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/Weighted/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/Weighted/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/WeightedFunctionals.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/WeightedFunctionals.hpp new file mode 100644 index 000000000..d194efd1c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/WeightedFunctionals.hpp @@ -0,0 +1,191 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TRANSPORT_WEIGHTEDFUNCTIONALS +#define TEST_V2_0_TRANSPORT_WEIGHTEDFUNCTIONALS + +#include "test/v2.0/transport/Weighted.hpp" + +namespace test { +namespace v2_0 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// 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 "transport"; } + 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}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(weighted(),MadlandNix); + GNDSTK_SHORTCUT(weighted(),Watt); + GNDSTK_SHORTCUT(weighted(),XYs1d); + GNDSTK_SHORTCUT(weighted(),XYs2d); + GNDSTK_SHORTCUT(weighted(),evaporation); + GNDSTK_SHORTCUT(weighted(),generalEvaporation); + GNDSTK_SHORTCUT(weighted(),simpleMaxwellianFission); + GNDSTK_SHORTCUT(weighted().XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->weighted \ + ) + + // default + WeightedFunctionals() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit WeightedFunctionals( + const wrapper + &weighted + ) : + GNDSTK_COMPONENT(BlockData{}), + weighted(this,weighted) + { + Component::finish(); + } + + // from node + explicit WeightedFunctionals(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + WeightedFunctionals(const WeightedFunctionals &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + weighted(this,other.weighted) + { + Component::finish(other); + } + + // move + WeightedFunctionals(WeightedFunctionals &&other) : + 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 "test/v2.0/transport/WeightedFunctionals/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class WeightedFunctionals + +} // namespace transport +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/transport/WeightedFunctionals/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/transport/WeightedFunctionals/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/transport/WeightedFunctionals/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/BoundAtomCrossSection.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/BoundAtomCrossSection.hpp new file mode 100644 index 000000000..3c268d173 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/BoundAtomCrossSection.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_BOUNDATOMCROSSSECTION +#define TEST_V2_0_TSL_BOUNDATOMCROSSSECTION + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 + XMLName{} + / Meta<>("unit") | + Float64{} + / 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", + "unit", + "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", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + unit{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unit, \ + this->value \ + ) + + // default + BoundAtomCrossSection() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BoundAtomCrossSection( + const wrapper + &unit, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit BoundAtomCrossSection(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BoundAtomCrossSection(const BoundAtomCrossSection &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + BoundAtomCrossSection(BoundAtomCrossSection &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + BoundAtomCrossSection &operator=(const BoundAtomCrossSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + unit = other.unit; + value = other.value; + } + return *this; + } + + // move + BoundAtomCrossSection &operator=(BoundAtomCrossSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/BoundAtomCrossSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BoundAtomCrossSection + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/BoundAtomCrossSection/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/BoundAtomCrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/BoundAtomCrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdge.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdge.hpp new file mode 100644 index 000000000..af1860f0a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdge.hpp @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_BRAGGEDGE +#define TEST_V2_0_TSL_BRAGGEDGE + +#include "test/v2.0/tsl/BraggEnergy.hpp" +#include "test/v2.0/tsl/StructureFactor.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class BraggEdge +// ----------------------------------------------------------------------------- + +class BraggEdge : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + static auto CLASS() { return "BraggEdge"; } + static auto NODENAME() { return "BraggEdge"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("label") | + + // children + --Child + ("BraggEnergy") | + --Child + ("structureFactor") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "BraggEnergy", + "structureFactor" + }; + 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", + "bragg_energy", + "structure_factor" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field + BraggEnergy{this}; + Field + structureFactor{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->BraggEnergy, \ + this->structureFactor \ + ) + + // default + BraggEdge() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BraggEdge( + const wrapper + &label, + const wrapper + &BraggEnergy = {}, + const wrapper + &structureFactor = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + BraggEnergy(this,BraggEnergy), + structureFactor(this,structureFactor) + { + Component::finish(); + } + + // from node + explicit BraggEdge(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BraggEdge(const BraggEdge &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + BraggEnergy(this,other.BraggEnergy), + structureFactor(this,other.structureFactor) + { + Component::finish(other); + } + + // move + BraggEdge(BraggEdge &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + BraggEnergy(this,std::move(other.BraggEnergy)), + structureFactor(this,std::move(other.structureFactor)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + BraggEdge &operator=(const BraggEdge &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + BraggEnergy = other.BraggEnergy; + structureFactor = other.structureFactor; + } + return *this; + } + + // move + BraggEdge &operator=(BraggEdge &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + BraggEnergy = std::move(other.BraggEnergy); + structureFactor = std::move(other.structureFactor); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/BraggEdge/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BraggEdge + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdge/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdge/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdge/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdges.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdges.hpp new file mode 100644 index 000000000..666db36d7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdges.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_BRAGGEDGES +#define TEST_V2_0_TSL_BRAGGEDGES + +#include "test/v2.0/tsl/BraggEdge.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class BraggEdges +// ----------------------------------------------------------------------------- + +class BraggEdges : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + static auto CLASS() { return "BraggEdges"; } + static auto NODENAME() { return "BraggEdges"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("BraggEdge") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "BraggEdge" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "bragg_edge" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + BraggEdge{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->BraggEdge \ + ) + + // default + BraggEdges() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BraggEdges( + const wrapper> + &BraggEdge + ) : + GNDSTK_COMPONENT(BlockData{}), + BraggEdge(this,BraggEdge) + { + Component::finish(); + } + + // from node + explicit BraggEdges(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BraggEdges(const BraggEdges &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + BraggEdge(this,other.BraggEdge) + { + Component::finish(other); + } + + // move + BraggEdges(BraggEdges &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + BraggEdge(this,std::move(other.BraggEdge)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + BraggEdges &operator=(const BraggEdges &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + BraggEdge = other.BraggEdge; + } + return *this; + } + + // move + BraggEdges &operator=(BraggEdges &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + BraggEdge = std::move(other.BraggEdge); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/BraggEdges/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BraggEdges + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdges/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdges/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEdges/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEnergy.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEnergy.hpp new file mode 100644 index 000000000..ec11a7b54 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEnergy.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_BRAGGENERGY +#define TEST_V2_0_TSL_BRAGGENERGY + +#include "test/v2.0/containers/XYs1d.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class BraggEnergy +// ----------------------------------------------------------------------------- + +class BraggEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + static auto CLASS() { return "BraggEnergy"; } + static auto NODENAME() { return "BraggEnergy"; } + + // 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + BraggEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BraggEnergy( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit BraggEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BraggEnergy(const BraggEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + BraggEnergy(BraggEnergy &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + BraggEnergy &operator=(const BraggEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + BraggEnergy &operator=(BraggEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/BraggEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BraggEnergy + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEnergy/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/BraggEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/CoherentAtomCrossSection.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/CoherentAtomCrossSection.hpp new file mode 100644 index 000000000..185a02bb7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/CoherentAtomCrossSection.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_COHERENTATOMCROSSSECTION +#define TEST_V2_0_TSL_COHERENTATOMCROSSSECTION + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class CoherentAtomCrossSection +// ----------------------------------------------------------------------------- + +class CoherentAtomCrossSection : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + static auto CLASS() { return "CoherentAtomCrossSection"; } + static auto NODENAME() { return "coherentAtomCrossSection"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + XMLName{} + / Meta<>("unit") | + Float64{} + / 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", + "unit", + "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", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + unit{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unit, \ + this->value \ + ) + + // default + CoherentAtomCrossSection() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CoherentAtomCrossSection( + const wrapper + &unit, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit CoherentAtomCrossSection(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CoherentAtomCrossSection(const CoherentAtomCrossSection &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + CoherentAtomCrossSection(CoherentAtomCrossSection &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CoherentAtomCrossSection &operator=(const CoherentAtomCrossSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + unit = other.unit; + value = other.value; + } + return *this; + } + + // move + CoherentAtomCrossSection &operator=(CoherentAtomCrossSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/CoherentAtomCrossSection/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class CoherentAtomCrossSection + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/CoherentAtomCrossSection/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/CoherentAtomCrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/CoherentAtomCrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/DebyeWallerIntegral.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/DebyeWallerIntegral.hpp new file mode 100644 index 000000000..1b40ed92a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/DebyeWallerIntegral.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_DEBYEWALLERINTEGRAL +#define TEST_V2_0_TSL_DEBYEWALLERINTEGRAL + +#include "test/v2.0/containers/XYs1d.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + DebyeWallerIntegral() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DebyeWallerIntegral( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit DebyeWallerIntegral(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DebyeWallerIntegral(const DebyeWallerIntegral &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + DebyeWallerIntegral(DebyeWallerIntegral &&other) : + 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 "test/v2.0/tsl/DebyeWallerIntegral/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DebyeWallerIntegral + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/DebyeWallerIntegral/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/DebyeWallerIntegral/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/DebyeWallerIntegral/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/DistinctScatteringKernel.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/DistinctScatteringKernel.hpp new file mode 100644 index 000000000..12dcffdfa --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/DistinctScatteringKernel.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_DISTINCTSCATTERINGKERNEL +#define TEST_V2_0_TSL_DISTINCTSCATTERINGKERNEL + +#include "test/v2.0/containers/Gridded3d.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class DistinctScatteringKernel +// ----------------------------------------------------------------------------- + +class DistinctScatteringKernel : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + static auto CLASS() { return "DistinctScatteringKernel"; } + static auto NODENAME() { return "distinctScatteringKernel"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("gridded3d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "gridded3d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "gridded3d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + gridded3d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->gridded3d \ + ) + + // default + DistinctScatteringKernel() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DistinctScatteringKernel( + const wrapper> + &gridded3d + ) : + GNDSTK_COMPONENT(BlockData{}), + gridded3d(this,gridded3d) + { + Component::finish(); + } + + // from node + explicit DistinctScatteringKernel(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DistinctScatteringKernel(const DistinctScatteringKernel &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + gridded3d(this,other.gridded3d) + { + Component::finish(other); + } + + // move + DistinctScatteringKernel(DistinctScatteringKernel &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + gridded3d(this,std::move(other.gridded3d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DistinctScatteringKernel &operator=(const DistinctScatteringKernel &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + gridded3d = other.gridded3d; + } + return *this; + } + + // move + DistinctScatteringKernel &operator=(DistinctScatteringKernel &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + gridded3d = std::move(other.gridded3d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/DistinctScatteringKernel/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class DistinctScatteringKernel + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/DistinctScatteringKernel/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/DistinctScatteringKernel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/DistinctScatteringKernel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/E_critical.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/E_critical.hpp new file mode 100644 index 000000000..4d11458d9 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/E_critical.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_E_CRITICAL +#define TEST_V2_0_TSL_E_CRITICAL + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 + std::optional{} + / Meta<>("unit") | + std::optional{} + / 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", + "unit", + "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", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + unit{this}; + Field> + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unit, \ + this->value \ + ) + + // default + E_critical() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit E_critical( + const wrapper> + &unit, + const wrapper> + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit E_critical(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + E_critical(const E_critical &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + E_critical(E_critical &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + E_critical &operator=(const E_critical &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + unit = other.unit; + value = other.value; + } + return *this; + } + + // move + E_critical &operator=(E_critical &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/E_critical/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class E_critical + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/E_critical/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/E_critical/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/E_critical/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/E_max.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/E_max.hpp new file mode 100644 index 000000000..b666ee806 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/E_max.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_E_MAX +#define TEST_V2_0_TSL_E_MAX + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 + std::optional{} + / Meta<>("unit") | + std::optional{} + / 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", + "unit", + "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", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + unit{this}; + Field> + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unit, \ + this->value \ + ) + + // default + E_max() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit E_max( + const wrapper> + &unit, + const wrapper> + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit E_max(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + E_max(const E_max &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + E_max(E_max &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + E_max &operator=(const E_max &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + unit = other.unit; + value = other.value; + } + return *this; + } + + // move + E_max &operator=(E_max &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/E_max/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class E_max + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/E_max/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/E_max/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/E_max/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/FreeGasApproximation.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/FreeGasApproximation.hpp new file mode 100644 index 000000000..b92e100d7 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/FreeGasApproximation.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_FREEGASAPPROXIMATION +#define TEST_V2_0_TSL_FREEGASAPPROXIMATION + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + FreeGasApproximation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit FreeGasApproximation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FreeGasApproximation(const FreeGasApproximation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + FreeGasApproximation(FreeGasApproximation &&other) : + 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 "test/v2.0/tsl/FreeGasApproximation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class FreeGasApproximation + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/FreeGasApproximation/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/FreeGasApproximation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/FreeGasApproximation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/GaussianApproximation.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/GaussianApproximation.hpp new file mode 100644 index 000000000..1b84e4fd3 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/GaussianApproximation.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_GAUSSIANAPPROXIMATION +#define TEST_V2_0_TSL_GAUSSIANAPPROXIMATION + +#include "test/v2.0/tsl/PhononSpectrum.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class GaussianApproximation +// ----------------------------------------------------------------------------- + +class GaussianApproximation : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + static auto CLASS() { return "GaussianApproximation"; } + static auto NODENAME() { return "GaussianApproximation"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("phononSpectrum") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "phononSpectrum" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "phonon_spectrum" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + phononSpectrum{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->phononSpectrum \ + ) + + // default + GaussianApproximation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GaussianApproximation( + const wrapper> + &phononSpectrum + ) : + GNDSTK_COMPONENT(BlockData{}), + phononSpectrum(this,phononSpectrum) + { + Component::finish(); + } + + // from node + explicit GaussianApproximation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GaussianApproximation(const GaussianApproximation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + phononSpectrum(this,other.phononSpectrum) + { + Component::finish(other); + } + + // move + GaussianApproximation(GaussianApproximation &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + phononSpectrum(this,std::move(other.phononSpectrum)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + GaussianApproximation &operator=(const GaussianApproximation &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + phononSpectrum = other.phononSpectrum; + } + return *this; + } + + // move + GaussianApproximation &operator=(GaussianApproximation &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + phononSpectrum = std::move(other.phononSpectrum); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/GaussianApproximation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class GaussianApproximation + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/GaussianApproximation/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/GaussianApproximation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/GaussianApproximation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/Mass.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/Mass.hpp new file mode 100644 index 000000000..66380f045 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/Mass.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_MASS +#define TEST_V2_0_TSL_MASS + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 + XMLName{} + / Meta<>("unit") | + Float64{} + / 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", + "unit", + "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", + "unit", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + unit{this}; + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unit, \ + this->value \ + ) + + // default + Mass() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Mass( + const wrapper + &unit, + const wrapper + &value = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + unit(this,unit), + value(this,value) + { + Component::finish(); + } + + // from node + explicit Mass(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Mass(const Mass &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unit(this,other.unit), + value(this,other.value) + { + Component::finish(other); + } + + // move + Mass(Mass &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + unit(this,std::move(other.unit)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Mass &operator=(const Mass &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + unit = other.unit; + value = other.value; + } + return *this; + } + + // move + Mass &operator=(Mass &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + unit = std::move(other.unit); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/Mass/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Mass + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/Mass/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/Mass/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/Mass/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/PhononSpectrum.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/PhononSpectrum.hpp new file mode 100644 index 000000000..c3ce15265 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/PhononSpectrum.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_PHONONSPECTRUM +#define TEST_V2_0_TSL_PHONONSPECTRUM + +#include "test/v2.0/containers/XYs1d.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class PhononSpectrum +// ----------------------------------------------------------------------------- + +class PhononSpectrum : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + static auto CLASS() { return "PhononSpectrum"; } + static auto NODENAME() { return "phononSpectrum"; } + + // 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + PhononSpectrum() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PhononSpectrum( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit PhononSpectrum(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PhononSpectrum(const PhononSpectrum &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + PhononSpectrum(PhononSpectrum &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PhononSpectrum &operator=(const PhononSpectrum &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + PhononSpectrum &operator=(PhononSpectrum &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/PhononSpectrum/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PhononSpectrum + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/PhononSpectrum/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/PhononSpectrum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/PhononSpectrum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/SCTApproximation.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/SCTApproximation.hpp new file mode 100644 index 000000000..bfeecc121 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/SCTApproximation.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_SCTAPPROXIMATION +#define TEST_V2_0_TSL_SCTAPPROXIMATION + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + SCTApproximation() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit SCTApproximation(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SCTApproximation(const SCTApproximation &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + SCTApproximation(SCTApproximation &&other) : + 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 "test/v2.0/tsl/SCTApproximation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SCTApproximation + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/SCTApproximation/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/SCTApproximation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/SCTApproximation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/S_table.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/S_table.hpp new file mode 100644 index 000000000..2a271e1e2 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/S_table.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_S_TABLE +#define TEST_V2_0_TSL_S_TABLE + +#include "test/v2.0/containers/Gridded2d.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(gridded2d(),axes); + GNDSTK_SHORTCUT(gridded2d().axes(),axis); + GNDSTK_SHORTCUT(gridded2d().axes(),grid); + GNDSTK_SHORTCUT(gridded2d().array(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->gridded2d \ + ) + + // default + S_table() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit S_table( + const wrapper + &gridded2d + ) : + GNDSTK_COMPONENT(BlockData{}), + gridded2d(this,gridded2d) + { + Component::finish(); + } + + // from node + explicit S_table(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + S_table(const S_table &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + gridded2d(this,other.gridded2d) + { + Component::finish(other); + } + + // move + S_table(S_table &&other) : + 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 "test/v2.0/tsl/S_table/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class S_table + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/S_table/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/S_table/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/S_table/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtom.hpp new file mode 100644 index 000000000..84c7f6704 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtom.hpp @@ -0,0 +1,330 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_SCATTERINGATOM +#define TEST_V2_0_TSL_SCATTERINGATOM + +#include "test/v2.0/tsl/Mass.hpp" +#include "test/v2.0/tsl/E_critical.hpp" +#include "test/v2.0/tsl/E_max.hpp" +#include "test/v2.0/tsl/BoundAtomCrossSection.hpp" +#include "test/v2.0/tsl/CoherentAtomCrossSection.hpp" +#include "test/v2.0/tsl/DistinctScatteringKernel.hpp" +#include "test/v2.0/tsl/SelfScatteringKernel.hpp" +#include "test/v2.0/tsl/T_effective.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 + XMLName{} + / Meta<>("pid") | + bool{} + / Meta<>("primaryScatterer") | + Integer32{} + / Meta<>("numberPerMolecule") | + + // children + --Child + ("mass") | + --Child> + ("e_critical") | + --Child + ("e_max") | + --Child + ("boundAtomCrossSection") | + --Child> + ("coherentAtomCrossSection") | + --Child> + ("distinctScatteringKernel") | + --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", + "primaryScatterer", + "numberPerMolecule", + "mass", + "e_critical", + "e_max", + "boundAtomCrossSection", + "coherentAtomCrossSection", + "distinctScatteringKernel", + "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", + "primary_scatterer", + "number_per_molecule", + "mass", + "e_critical", + "e_max", + "bound_atom_cross_section", + "coherent_atom_cross_section", + "distinct_scattering_kernel", + "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 + primaryScatterer{this}; + Field + numberPerMolecule{this}; + + // children + Field + mass{this}; + Field> + e_critical{this}; + Field + e_max{this}; + Field + boundAtomCrossSection{this}; + Field> + coherentAtomCrossSection{this}; + Field> + distinctScatteringKernel{this}; + Field + selfScatteringKernel{this}; + Field> + T_effective{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->pid, \ + this->primaryScatterer, \ + this->numberPerMolecule, \ + this->mass, \ + this->e_critical, \ + this->e_max, \ + this->boundAtomCrossSection, \ + this->coherentAtomCrossSection, \ + this->distinctScatteringKernel, \ + this->selfScatteringKernel, \ + this->T_effective \ + ) + + // default + ScatteringAtom() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringAtom( + const wrapper + &pid, + const wrapper + &primaryScatterer = {}, + const wrapper + &numberPerMolecule = {}, + const wrapper + &mass = {}, + const wrapper> + &e_critical = {}, + const wrapper + &e_max = {}, + const wrapper + &boundAtomCrossSection = {}, + const wrapper> + &coherentAtomCrossSection = {}, + const wrapper> + &distinctScatteringKernel = {}, + const wrapper + &selfScatteringKernel = {}, + const wrapper> + &T_effective = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + pid(this,pid), + primaryScatterer(this,primaryScatterer), + numberPerMolecule(this,numberPerMolecule), + mass(this,mass), + e_critical(this,e_critical), + e_max(this,e_max), + boundAtomCrossSection(this,boundAtomCrossSection), + coherentAtomCrossSection(this,coherentAtomCrossSection), + distinctScatteringKernel(this,distinctScatteringKernel), + selfScatteringKernel(this,selfScatteringKernel), + T_effective(this,T_effective) + { + Component::finish(); + } + + // from node + explicit ScatteringAtom(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringAtom(const ScatteringAtom &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + pid(this,other.pid), + primaryScatterer(this,other.primaryScatterer), + numberPerMolecule(this,other.numberPerMolecule), + mass(this,other.mass), + e_critical(this,other.e_critical), + e_max(this,other.e_max), + boundAtomCrossSection(this,other.boundAtomCrossSection), + coherentAtomCrossSection(this,other.coherentAtomCrossSection), + distinctScatteringKernel(this,other.distinctScatteringKernel), + selfScatteringKernel(this,other.selfScatteringKernel), + T_effective(this,other.T_effective) + { + Component::finish(other); + } + + // move + ScatteringAtom(ScatteringAtom &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + pid(this,std::move(other.pid)), + primaryScatterer(this,std::move(other.primaryScatterer)), + numberPerMolecule(this,std::move(other.numberPerMolecule)), + 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)), + coherentAtomCrossSection(this,std::move(other.coherentAtomCrossSection)), + distinctScatteringKernel(this,std::move(other.distinctScatteringKernel)), + 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; + primaryScatterer = other.primaryScatterer; + numberPerMolecule = other.numberPerMolecule; + mass = other.mass; + e_critical = other.e_critical; + e_max = other.e_max; + boundAtomCrossSection = other.boundAtomCrossSection; + coherentAtomCrossSection = other.coherentAtomCrossSection; + distinctScatteringKernel = other.distinctScatteringKernel; + 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); + primaryScatterer = std::move(other.primaryScatterer); + numberPerMolecule = std::move(other.numberPerMolecule); + mass = std::move(other.mass); + e_critical = std::move(other.e_critical); + e_max = std::move(other.e_max); + boundAtomCrossSection = std::move(other.boundAtomCrossSection); + coherentAtomCrossSection = std::move(other.coherentAtomCrossSection); + distinctScatteringKernel = std::move(other.distinctScatteringKernel); + selfScatteringKernel = std::move(other.selfScatteringKernel); + T_effective = std::move(other.T_effective); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/ScatteringAtom/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ScatteringAtom + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtom/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtom/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtom/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtoms.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtoms.hpp new file mode 100644 index 000000000..ed2d3344b --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtoms.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_SCATTERINGATOMS +#define TEST_V2_0_TSL_SCATTERINGATOMS + +#include "test/v2.0/tsl/ScatteringAtom.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->scatteringAtom \ + ) + + // default + ScatteringAtoms() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringAtoms( + const wrapper> + &scatteringAtom + ) : + GNDSTK_COMPONENT(BlockData{}), + scatteringAtom(this,scatteringAtom) + { + Component::finish(); + } + + // from node + explicit ScatteringAtoms(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringAtoms(const ScatteringAtoms &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + scatteringAtom(this,other.scatteringAtom) + { + Component::finish(other); + } + + // move + ScatteringAtoms(ScatteringAtoms &&other) : + 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 "test/v2.0/tsl/ScatteringAtoms/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ScatteringAtoms + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtoms/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtoms/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ScatteringAtoms/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/SelfScatteringKernel.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/SelfScatteringKernel.hpp new file mode 100644 index 000000000..dcf9fbb24 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/SelfScatteringKernel.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_SELFSCATTERINGKERNEL +#define TEST_V2_0_TSL_SELFSCATTERINGKERNEL + +#include "test/v2.0/containers/Gridded3d.hpp" +#include "test/v2.0/tsl/GaussianApproximation.hpp" +#include "test/v2.0/tsl/SCTApproximation.hpp" +#include "test/v2.0/tsl/FreeGasApproximation.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class SelfScatteringKernel +// ----------------------------------------------------------------------------- + +class SelfScatteringKernel : + public Component +{ + friend class Component; + + using _t = std::variant< + containers::Gridded3d, + tsl::GaussianApproximation, + tsl::SCTApproximation, + tsl::FreeGasApproximation + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + 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 + _t{} + / --(Child<>("gridded3d") || Child<>("GaussianApproximation") || 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", + "_gridded3dGaussianApproximationSCTApproximationfreeGasApproximation" + }; + 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_gaussian_approximation_sctapproximationfree_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 - variant + Field<_t> + _gridded3dGaussianApproximationSCTApproximationfreeGasApproximation{this}; + FieldPart gridded3d{_gridded3dGaussianApproximationSCTApproximationfreeGasApproximation}; + FieldPart GaussianApproximation{_gridded3dGaussianApproximationSCTApproximationfreeGasApproximation}; + FieldPart SCTApproximation{_gridded3dGaussianApproximationSCTApproximationfreeGasApproximation}; + FieldPart freeGasApproximation{_gridded3dGaussianApproximationSCTApproximationfreeGasApproximation}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symmetric, \ + this->_gridded3dGaussianApproximationSCTApproximationfreeGasApproximation \ + ) + + // default + SelfScatteringKernel() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SelfScatteringKernel( + const wrapper> + &symmetric, + const wrapper<_t> + &_gridded3dGaussianApproximationSCTApproximationfreeGasApproximation = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + symmetric(this,symmetric), + _gridded3dGaussianApproximationSCTApproximationfreeGasApproximation(this,_gridded3dGaussianApproximationSCTApproximationfreeGasApproximation) + { + Component::finish(); + } + + // from node + explicit SelfScatteringKernel(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SelfScatteringKernel(const SelfScatteringKernel &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + symmetric(this,other.symmetric), + _gridded3dGaussianApproximationSCTApproximationfreeGasApproximation(this,other._gridded3dGaussianApproximationSCTApproximationfreeGasApproximation) + { + Component::finish(other); + } + + // move + SelfScatteringKernel(SelfScatteringKernel &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + symmetric(this,std::move(other.symmetric)), + _gridded3dGaussianApproximationSCTApproximationfreeGasApproximation(this,std::move(other._gridded3dGaussianApproximationSCTApproximationfreeGasApproximation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + SelfScatteringKernel &operator=(const SelfScatteringKernel &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + symmetric = other.symmetric; + _gridded3dGaussianApproximationSCTApproximationfreeGasApproximation = other._gridded3dGaussianApproximationSCTApproximationfreeGasApproximation; + } + 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); + _gridded3dGaussianApproximationSCTApproximationfreeGasApproximation = std::move(other._gridded3dGaussianApproximationSCTApproximationfreeGasApproximation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/SelfScatteringKernel/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class SelfScatteringKernel + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/SelfScatteringKernel/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/SelfScatteringKernel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/SelfScatteringKernel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/StructureFactor.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/StructureFactor.hpp new file mode 100644 index 000000000..0cf58c11c --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/StructureFactor.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_STRUCTUREFACTOR +#define TEST_V2_0_TSL_STRUCTUREFACTOR + +#include "test/v2.0/containers/XYs1d.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class StructureFactor +// ----------------------------------------------------------------------------- + +class StructureFactor : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + static auto CLASS() { return "StructureFactor"; } + static auto NODENAME() { return "structureFactor"; } + + // 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + StructureFactor() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit StructureFactor( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit StructureFactor(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + StructureFactor(const StructureFactor &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + StructureFactor(StructureFactor &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + StructureFactor &operator=(const StructureFactor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + StructureFactor &operator=(StructureFactor &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/StructureFactor/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class StructureFactor + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/StructureFactor/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/StructureFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/StructureFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/T_effective.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/T_effective.hpp new file mode 100644 index 000000000..5aaaac6a3 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/T_effective.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_T_EFFECTIVE +#define TEST_V2_0_TSL_T_EFFECTIVE + +#include "test/v2.0/containers/XYs1d.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(XYs1d(),axes); + GNDSTK_SHORTCUT(XYs1d(),uncertainty); + GNDSTK_SHORTCUT(XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + T_effective() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit T_effective( + const wrapper + &XYs1d + ) : + GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit T_effective(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + T_effective(const T_effective &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + T_effective(T_effective &&other) : + 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 "test/v2.0/tsl/T_effective/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class T_effective + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/T_effective/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/T_effective/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/T_effective/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw.hpp new file mode 100644 index 000000000..600eeaa93 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW +#define TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + ThermalNeutronScatteringLaw() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ThermalNeutronScatteringLaw( + const wrapper + &label, + const wrapper + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw(const ThermalNeutronScatteringLaw &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw(ThermalNeutronScatteringLaw &&other) : + 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 "test/v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw1d.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw1d.hpp new file mode 100644 index 000000000..e641373ce --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw1d.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW1D +#define TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW1D + +#include "test/v2.0/key.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + ThermalNeutronScatteringLaw1d() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ThermalNeutronScatteringLaw1d( + const wrapper + &label, + const wrapper + &href = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw1d(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw1d(const ThermalNeutronScatteringLaw1d &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw1d(ThermalNeutronScatteringLaw1d &&other) : + 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 "test/v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw1d + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.hpp new file mode 100644 index 000000000..24b29beb0 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC +#define TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC + +#include "test/v2.0/tsl/S_table.hpp" +#include "test/v2.0/tsl/BraggEdges.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// class ThermalNeutronScatteringLaw_coherentElastic +// ----------------------------------------------------------------------------- + +class ThermalNeutronScatteringLaw_coherentElastic : + public Component +{ + friend class Component; + + using _t = std::variant< + tsl::S_table, + tsl::BraggEdges + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "tsl"; } + 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 + XMLName{} + / Meta<>("label") | + Defaulted{"enums::DecayType::Neutron"} + / Meta<>("pid") | + Defaulted{enums::Frame::lab} + / Meta<>("productFrame") | + + // children + _t{} + / --(Child<>("S_table") || Child<>("BraggEdges")) + ; + } + + // Data member names. Usually - but not necessarily - the same 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_tableBraggEdges" + }; + 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_bragg_edges" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const XMLName pid = "enums::DecayType::Neutron"; + static inline const enums::Frame productFrame = enums::Frame::lab; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field> + pid{this,defaults.pid}; + Field> + productFrame{this,defaults.productFrame}; + + // children - variant + Field<_t> + _S_tableBraggEdges{this}; + FieldPart S_table{_S_tableBraggEdges}; + FieldPart BraggEdges{_S_tableBraggEdges}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->_S_tableBraggEdges \ + ) + + // default + ThermalNeutronScatteringLaw_coherentElastic() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit ThermalNeutronScatteringLaw_coherentElastic( + const wrapper + &label, + const wrapper> + &pid = {}, + const wrapper> + &productFrame = {}, + const wrapper<_t> + &_S_tableBraggEdges = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,defaults.pid,pid), + productFrame(this,defaults.productFrame,productFrame), + _S_tableBraggEdges(this,_S_tableBraggEdges) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw_coherentElastic(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw_coherentElastic(const ThermalNeutronScatteringLaw_coherentElastic &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid), + productFrame(this,other.productFrame), + _S_tableBraggEdges(this,other._S_tableBraggEdges) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw_coherentElastic(ThermalNeutronScatteringLaw_coherentElastic &&other) : + 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_tableBraggEdges(this,std::move(other._S_tableBraggEdges)) + { + 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_tableBraggEdges = other._S_tableBraggEdges; + } + 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_tableBraggEdges = std::move(other._S_tableBraggEdges); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw_coherentElastic + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.hpp new file mode 100644 index 000000000..9035d4945 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic.hpp @@ -0,0 +1,248 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC +#define TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC + +#include "test/v2.0/tsl/BoundAtomCrossSection.hpp" +#include "test/v2.0/tsl/DebyeWallerIntegral.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 + XMLName{} + / Meta<>("label") | + XMLName{} + / Meta<>("pid") | + enums::Frame{} + / 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(DebyeWallerIntegral(),XYs1d); + GNDSTK_SHORTCUT(DebyeWallerIntegral().XYs1d(),axes); + GNDSTK_SHORTCUT(DebyeWallerIntegral().XYs1d(),uncertainty); + GNDSTK_SHORTCUT(DebyeWallerIntegral().XYs1d(),values); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->boundAtomCrossSection, \ + this->DebyeWallerIntegral \ + ) + + // default + ThermalNeutronScatteringLaw_incoherentElastic() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw_incoherentElastic(const ThermalNeutronScatteringLaw_incoherentElastic &other) : + 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) : + 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 "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw_incoherentElastic + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.hpp new file mode 100644 index 000000000..15f3c66b4 --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic.hpp @@ -0,0 +1,281 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC +#define TEST_V2_0_TSL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC + +#include "test/v2.0/tsl/ScatteringAtoms.hpp" + +namespace test { +namespace v2_0 { +namespace tsl { + +// ----------------------------------------------------------------------------- +// tsl:: +// 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 "tsl"; } + 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 + XMLName{} + / Meta<>("label") | + Defaulted{"enums::DecayType::Neutron"} + / Meta<>("pid") | + Defaulted{enums::Frame::lab} + / Meta<>("productFrame") | + Defaulted{false} + / Meta<>("calculatedAtThermal") | + Defaulted{true} + / Meta<>("incoherentApproximation") | + XMLName{} + / Meta<>("primaryScatterer") | + + // 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", + "calculatedAtThermal", + "incoherentApproximation", + "primaryScatterer", + "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", + "calculated_at_thermal", + "incoherent_approximation", + "primary_scatterer", + "scattering_atoms" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const XMLName pid = "enums::DecayType::Neutron"; + static inline const enums::Frame productFrame = enums::Frame::lab; + static inline const bool calculatedAtThermal = false; + static inline const bool incoherentApproximation = true; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field> + pid{this,defaults.pid}; + Field> + productFrame{this,defaults.productFrame}; + Field> + calculatedAtThermal{this,defaults.calculatedAtThermal}; + Field> + incoherentApproximation{this,defaults.incoherentApproximation}; + Field + primaryScatterer{this}; + + // children + Field + scatteringAtoms{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(scatteringAtoms(),scatteringAtom); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->calculatedAtThermal, \ + this->incoherentApproximation, \ + this->primaryScatterer, \ + this->scatteringAtoms \ + ) + + // default + ThermalNeutronScatteringLaw_incoherentInelastic() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit ThermalNeutronScatteringLaw_incoherentInelastic( + const wrapper + &label, + const wrapper> + &pid = {}, + const wrapper> + &productFrame = {}, + const wrapper> + &calculatedAtThermal = {}, + const wrapper> + &incoherentApproximation = {}, + const wrapper + &primaryScatterer = {}, + const wrapper + &scatteringAtoms = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,defaults.pid,pid), + productFrame(this,defaults.productFrame,productFrame), + calculatedAtThermal(this,defaults.calculatedAtThermal,calculatedAtThermal), + incoherentApproximation(this,defaults.incoherentApproximation,incoherentApproximation), + primaryScatterer(this,primaryScatterer), + scatteringAtoms(this,scatteringAtoms) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw_incoherentInelastic(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw_incoherentInelastic(const ThermalNeutronScatteringLaw_incoherentInelastic &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid), + productFrame(this,other.productFrame), + calculatedAtThermal(this,other.calculatedAtThermal), + incoherentApproximation(this,other.incoherentApproximation), + primaryScatterer(this,other.primaryScatterer), + scatteringAtoms(this,other.scatteringAtoms) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw_incoherentInelastic(ThermalNeutronScatteringLaw_incoherentInelastic &&other) : + 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)), + calculatedAtThermal(this,std::move(other.calculatedAtThermal)), + incoherentApproximation(this,std::move(other.incoherentApproximation)), + primaryScatterer(this,std::move(other.primaryScatterer)), + 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; + calculatedAtThermal = other.calculatedAtThermal; + incoherentApproximation = other.incoherentApproximation; + primaryScatterer = other.primaryScatterer; + 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); + calculatedAtThermal = std::move(other.calculatedAtThermal); + incoherentApproximation = std::move(other.incoherentApproximation); + primaryScatterer = std::move(other.primaryScatterer); + scatteringAtoms = std::move(other.scatteringAtoms); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw_incoherentInelastic + +} // namespace tsl +} // namespace v2_0 +} // namespace test + +#endif diff --git a/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/gnds-2.0/test/src/test/v2.0/tsl/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/gnds-2.0/try/.gitignore b/standards/gnds-2.0/try/.gitignore new file mode 100644 index 000000000..a6577f98c --- /dev/null +++ b/standards/gnds-2.0/try/.gitignore @@ -0,0 +1,6 @@ + +0 +m +pugixml.o +*.xml +out diff --git a/standards/gnds-2.0/try/0.cpp b/standards/gnds-2.0/try/0.cpp new file mode 100644 index 000000000..7c2bd049c --- /dev/null +++ b/standards/gnds-2.0/try/0.cpp @@ -0,0 +1,41 @@ + +#include "test/v2.0.hpp" + +using namespace njoy::GNDStk; +using namespace test::v2_0; + +int main(const int argc, const char *const *const argv) +{ + // color for diagnostics + colors = true; + + // usage + if (argc < 2) { + std::cout << "Usage: " << argv[0] << " file ..." << std::endl; + exit(EXIT_FAILURE); + } + + // double + containers::Double d; + d << ""; + std::cout << d << std::endl; + + // files + for (int n = 1; n < argc; ++n) { + const std::string filename = argv[n]; + std::cout << "File: \"" << filename << '"' << std::endl; + + std::cout << "ReactionSuite begin" << std::endl; + transport::ReactionSuite r; + std::cout << "ReactionSuite end" << std::endl; + + try { + if (r.read(filename)) + std::cout << " yes" << std::endl; + else + std::cout << " no" << std::endl; + } catch (...) { + r.print(); + } + } +} diff --git a/standards/gnds-2.0/try/compile b/standards/gnds-2.0/try/compile new file mode 100755 index 000000000..a2c84a088 --- /dev/null +++ b/standards/gnds-2.0/try/compile @@ -0,0 +1,33 @@ +#!/bin/bash + +COMPILE=" + clang++ -std=c++17 + -I../../../../GNDStk/src + -I../../../../GNDStk/standards/gnds-2.0/test/src + -I../../../../GNDStk/build/_deps/pugixml-adapter-src/src/src + -I../../../../GNDStk/build/_deps/hdf5-src/include + -I../../../../GNDStk/build/_deps/json-src/include + -I../../../../GNDStk/build/_deps/json-src/include/nlohmann + -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 " +# -g -O3 + +if [ ! -f "pugixml.o" ]; then +echo 'Compiling pugixml.cpp...' +$COMPILE \ + ../../../../GNDStk/build/_deps/pugixml-adapter-src/src/src/pugixml.cpp \ + -c -o pugixml.o +fi + +# Compile examples +echo 'Compiling...' +$COMPILE 0.cpp pugixml.o -o 0 + +# wait $(jobs -p) diff --git a/standards/incremental/.gitignore b/standards/incremental/.gitignore new file mode 100644 index 000000000..6ddbe5efc --- /dev/null +++ b/standards/incremental/.gitignore @@ -0,0 +1,3 @@ + +old.json +j diff --git a/standards/incremental/changes.json b/standards/incremental/changes.json new file mode 100644 index 000000000..e35c0ecc0 --- /dev/null +++ b/standards/incremental/changes.json @@ -0,0 +1,175 @@ +{ + "// 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" : { + "// json spec corrections" : "", + "bodyText" : "std::string", + "attributeValue" : "std::string", + "date" : "std::string", + "checksum" : "std::string", + "Boolean" : "bool", + + "// enumerator types" : "", + "dateType" : "enums::DateType", + "contributorType" : "enums::ContributorType", + "relationType" : "enums::RelationType", + "parity" : "enums::Parity", + "frame" : "enums::Frame", + "interpolation" : "enums::Interpolation", + "interpolationQualifier" : "enums::InterpolationQualifier", + "hashAlgorithm" : "enums::HashAlgorithm", + "algorithm" : "enums::HashAlgorithm", + "decayType" : "enums::DecayType", + "gridStyle" : "enums::GridStyle", + "boundaryCondition" : "enums::BoundaryCondition", + "interaction" : "enums::Interaction" + }, + + "// 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'": "", + + "// json spec corrections" : "", + "\\\\attr{lin-lin}" : "enums::Interpolation::linlin", + + "// 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", + + "// 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", + + "// 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", + + "// parity" : "", + "-1" : "enums::Parity::minus", + "+1" : "enums::Parity::plus", + + "// frame" : "", + "lab" : "enums::Frame::lab", + "centerOfMass" : "enums::Frame::centerOfMass", + + "// 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", + + "// interpolationQualifier" : "", + "direct" : "enums::InterpolationQualifier::direct", + "unitBase" : "enums::InterpolationQualifier::unitBase", + "correspondingEnergies" : "enums::InterpolationQualifier::correspondingEnergies", + "correspondingPoints" : "enums::InterpolationQualifier::correspondingPoints", + + "// hashAlgorithm" : "", + "md5" : "enums::HashAlgorithm::md5", + "sha1" : "enums::HashAlgorithm::sha1", + + "// 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", + + "// gridStyle" : "", + "none" : "enums::GridStyle::none", + "points" : "enums::GridStyle::points", + "boundaries" : "enums::GridStyle::boundaries", + "parameters" : "enums::GridStyle::parameters", + + "// boundaryCondition" : "", + "EliminateShiftFunction" : "enums::BoundaryCondition::EliminateShiftFunction", + "NegativeOrbitalMomentum" : "enums::BoundaryCondition::NegativeOrbitalMomentum", + "Brune" : "enums::BoundaryCondition::Brune", + "Given" : "enums::BoundaryCondition::Given", + + "// interaction" : "", + "nuclear" : "enums::Interaction::nuclear", + "atomic" : "enums::Interaction::atomic", + "thermalNeutronScatteringLaw" : "enums::Interaction::thermalNeutronScatteringLaw" + } + } +} diff --git a/standards/incremental/code/c/src/v2.0.h b/standards/incremental/code/c/src/v2.0.h new file mode 100644 index 000000000..a2926f209 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0.h @@ -0,0 +1,38 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// ----------------------------------------------------------------------------- +// This header file is designed to work with both C and C++ +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_CODE_V2_0 +#define C_INTERFACE_CODE_V2_0 + +#include "GNDStk.h" + +#ifdef __cplusplus + // For C++ + #include "code/v2.0.hpp" +#endif + +#include "v2.0/gnds/Atomic.h" +#include "v2.0/gnds/Author.h" +#include "v2.0/gnds/Authors.h" +#include "v2.0/gnds/BindingEnergy.h" +#include "v2.0/gnds/Body.h" +#include "v2.0/gnds/ChemicalElement.h" +#include "v2.0/gnds/ChemicalElements.h" +#include "v2.0/gnds/Configuration.h" +#include "v2.0/gnds/Configurations.h" +#include "v2.0/gnds/Date.h" +#include "v2.0/gnds/Dates.h" +#include "v2.0/gnds/Documentation.h" +#include "v2.0/gnds/Double.h" +#include "v2.0/gnds/EndfCompatible.h" +#include "v2.0/gnds/Evaluated.h" +#include "v2.0/gnds/PoPs.h" +#include "v2.0/gnds/Styles.h" +#include "v2.0/gnds/Title.h" + +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Atomic.cpp b/standards/incremental/code/c/src/v2.0/gnds/Atomic.cpp new file mode 100644 index 000000000..380d9e173 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Atomic.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Atomic.hpp" +#include "Atomic.h" + +using namespace njoy::GNDStk; +using namespace code::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 = gnds::Configurations; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAtomic +AtomicDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/gnds/Atomic/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Atomic.h b/standards/incremental/code/c/src/v2.0/gnds/Atomic.h new file mode 100644 index 000000000..1be2e500a --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/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_CODE_V2_0_GNDS_ATOMIC +#define C_INTERFACE_CODE_V2_0_GNDS_ATOMIC + +#include "GNDStk.h" +#include "v2.0/gnds/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 +extern_c Handle2Atomic +AtomicDefault(); + +// --- Create, general, const +extern_c Handle2ConstAtomic +AtomicCreateConst( + ConstHandle2ConstConfigurations configurations +); + +// +++ Create, general +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/gnds/Atomic/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Atomic/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Atomic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Atomic/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Atomic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Author.cpp b/standards/incremental/code/c/src/v2.0/gnds/Author.cpp new file mode 100644 index 000000000..12918df8f --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Author.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Author.hpp" +#include "Author.h" + +using namespace njoy::GNDStk; +using namespace code::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 +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 +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/gnds/Author/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Author.h b/standards/incremental/code/c/src/v2.0/gnds/Author.h new file mode 100644 index 000000000..30ad1c297 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/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_CODE_V2_0_GNDS_AUTHOR +#define C_INTERFACE_CODE_V2_0_GNDS_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 +extern_c Handle2Author +AuthorDefault(); + +// --- Create, general, const +extern_c Handle2ConstAuthor +AuthorCreateConst( + const char *const name +); + +// +++ Create, general +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/gnds/Author/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Author/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Author/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Author/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Author/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Authors.cpp b/standards/incremental/code/c/src/v2.0/gnds/Authors.cpp new file mode 100644 index 000000000..c847e732f --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Authors.cpp @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Authors.hpp" +#include "Authors.h" + +using namespace njoy::GNDStk; +using namespace code::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 = gnds::Author; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAuthors +AuthorsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// 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/gnds/Authors/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Authors.h b/standards/incremental/code/c/src/v2.0/gnds/Authors.h new file mode 100644 index 000000000..7d1ad470e --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Authors.h @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_CODE_V2_0_GNDS_AUTHORS +#define C_INTERFACE_CODE_V2_0_GNDS_AUTHORS + +#include "GNDStk.h" +#include "v2.0/gnds/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 +extern_c Handle2Authors +AuthorsDefault(); + +// --- Create, general, const +extern_c Handle2ConstAuthors +AuthorsCreateConst( + ConstHandle2Author *const author, const size_t authorSize +); + +// +++ Create, general +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 +); + +// +++ 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/gnds/Authors/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Authors/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Authors/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Authors/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Authors/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/BindingEnergy.cpp b/standards/incremental/code/c/src/v2.0/gnds/BindingEnergy.cpp new file mode 100644 index 000000000..efa6f5e21 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/BindingEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/BindingEnergy.hpp" +#include "BindingEnergy.h" + +using namespace njoy::GNDStk; +using namespace code::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 = gnds::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBindingEnergy +BindingEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/gnds/BindingEnergy/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/BindingEnergy.h b/standards/incremental/code/c/src/v2.0/gnds/BindingEnergy.h new file mode 100644 index 000000000..c129ced35 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/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_CODE_V2_0_GNDS_BINDINGENERGY +#define C_INTERFACE_CODE_V2_0_GNDS_BINDINGENERGY + +#include "GNDStk.h" +#include "v2.0/gnds/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 +extern_c Handle2BindingEnergy +BindingEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBindingEnergy +BindingEnergyCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general +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/gnds/BindingEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/BindingEnergy/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/BindingEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/BindingEnergy/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/BindingEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Body.cpp b/standards/incremental/code/c/src/v2.0/gnds/Body.cpp new file mode 100644 index 000000000..bd2dddec4 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Body.cpp @@ -0,0 +1,387 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Body.hpp" +#include "Body.h" + +using namespace njoy::GNDStk; +using namespace code::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 +Handle2Body +BodyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBody +BodyCreateConst() +{ + ConstHandle2Body handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +BodyIntsClear(ConstHandle2Body self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +BodyIntsSize(ConstHandle2ConstBody self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +BodyIntsGet(ConstHandle2ConstBody self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BodyIntsSet(ConstHandle2Body self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +BodyIntsGetArrayConst(ConstHandle2ConstBody self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +BodyIntsGetArray(ConstHandle2Body self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +BodyIntsSetArray(ConstHandle2Body self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +BodyUnsignedsClear(ConstHandle2Body self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +BodyUnsignedsSize(ConstHandle2ConstBody self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +BodyUnsignedsGet(ConstHandle2ConstBody self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BodyUnsignedsSet(ConstHandle2Body self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +BodyUnsignedsGetArrayConst(ConstHandle2ConstBody self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +BodyUnsignedsGetArray(ConstHandle2Body self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +BodyUnsignedsSetArray(ConstHandle2Body self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +BodyFloatsClear(ConstHandle2Body self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +BodyFloatsSize(ConstHandle2ConstBody self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +BodyFloatsGet(ConstHandle2ConstBody self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BodyFloatsSet(ConstHandle2Body self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +BodyFloatsGetArrayConst(ConstHandle2ConstBody self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +BodyFloatsGetArray(ConstHandle2Body self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +BodyFloatsSetArray(ConstHandle2Body self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +BodyDoublesClear(ConstHandle2Body self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +BodyDoublesSize(ConstHandle2ConstBody self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +BodyDoublesGet(ConstHandle2ConstBody self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +BodyDoublesSet(ConstHandle2Body self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +BodyDoublesGetArrayConst(ConstHandle2ConstBody self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +BodyDoublesGetArray(ConstHandle2Body self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +BodyDoublesSetArray(ConstHandle2Body self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Body/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Body.h b/standards/incremental/code/c/src/v2.0/gnds/Body.h new file mode 100644 index 000000000..49e58c4d4 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Body.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. +// +// 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_CODE_V2_0_GNDS_BODY +#define C_INTERFACE_CODE_V2_0_GNDS_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 +extern_c Handle2Body +BodyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBody +BodyCreateConst(); + +// +++ Create, general +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); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +BodyIntsClear(ConstHandle2Body self); + +// +++ Get size +extern_c size_t +BodyIntsSize(ConstHandle2ConstBody self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +BodyIntsGet(ConstHandle2ConstBody self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BodyIntsSet(ConstHandle2Body self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +BodyIntsGetArrayConst(ConstHandle2ConstBody self); + +// +++ Get pointer to existing values, non-const +extern_c int * +BodyIntsGetArray(ConstHandle2Body self); + +// +++ Set completely new values and size +extern_c void +BodyIntsSetArray(ConstHandle2Body self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +BodyUnsignedsClear(ConstHandle2Body self); + +// +++ Get size +extern_c size_t +BodyUnsignedsSize(ConstHandle2ConstBody self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +BodyUnsignedsGet(ConstHandle2ConstBody self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BodyUnsignedsSet(ConstHandle2Body self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +BodyUnsignedsGetArrayConst(ConstHandle2ConstBody self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +BodyUnsignedsGetArray(ConstHandle2Body self); + +// +++ Set completely new values and size +extern_c void +BodyUnsignedsSetArray(ConstHandle2Body self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +BodyFloatsClear(ConstHandle2Body self); + +// +++ Get size +extern_c size_t +BodyFloatsSize(ConstHandle2ConstBody self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +BodyFloatsGet(ConstHandle2ConstBody self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BodyFloatsSet(ConstHandle2Body self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +BodyFloatsGetArrayConst(ConstHandle2ConstBody self); + +// +++ Get pointer to existing values, non-const +extern_c float * +BodyFloatsGetArray(ConstHandle2Body self); + +// +++ Set completely new values and size +extern_c void +BodyFloatsSetArray(ConstHandle2Body self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +BodyDoublesClear(ConstHandle2Body self); + +// +++ Get size +extern_c size_t +BodyDoublesSize(ConstHandle2ConstBody self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +BodyDoublesGet(ConstHandle2ConstBody self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +BodyDoublesSet(ConstHandle2Body self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +BodyDoublesGetArrayConst(ConstHandle2ConstBody self); + +// +++ Get pointer to existing values, non-const +extern_c double * +BodyDoublesGetArray(ConstHandle2Body self); + +// +++ Set completely new values and size +extern_c void +BodyDoublesSetArray(ConstHandle2Body self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Body/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Body/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Body/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Body/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Body/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement.cpp b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement.cpp new file mode 100644 index 000000000..294f1e810 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/ChemicalElement.hpp" +#include "ChemicalElement.h" + +using namespace njoy::GNDStk; +using namespace code::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; }; +} + +using CPPAtomic = gnds::Atomic; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChemicalElement +ChemicalElementDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +) { + ConstHandle2ChemicalElement handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + symbol, + Z, + name, + detail::tocpp(atomic) + ); + return handle; +} + +// Create, general +Handle2ChemicalElement +ChemicalElementCreate( + const char *const symbol, + const int Z, + const char *const name, + ConstHandle2ConstAtomic atomic +) { + ConstHandle2ChemicalElement handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + symbol, + Z, + name, + detail::tocpp(atomic) + ); + return handle; +} + +// Assign +// Use this to assign 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/ChemicalElement/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement.h b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement.h new file mode 100644 index 000000000..5118edc31 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement.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. +// +// 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_CODE_V2_0_GNDS_CHEMICALELEMENT +#define C_INTERFACE_CODE_V2_0_GNDS_CHEMICALELEMENT + +#include "GNDStk.h" +#include "v2.0/gnds/Atomic.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 +extern_c Handle2ChemicalElement +ChemicalElementDefault(); + +// --- Create, general, const +extern_c Handle2ConstChemicalElement +ChemicalElementCreateConst( + const char *const symbol, + const int Z, + const char *const name, + ConstHandle2ConstAtomic atomic +); + +// +++ Create, general +extern_c Handle2ChemicalElement +ChemicalElementCreate( + const char *const symbol, + const int Z, + const char *const name, + ConstHandle2ConstAtomic atomic +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/ChemicalElement/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElement/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements.cpp b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements.cpp new file mode 100644 index 000000000..a8f3aa126 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/ChemicalElements.hpp" +#include "ChemicalElements.h" + +using namespace njoy::GNDStk; +using namespace code::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 = gnds::ChemicalElement; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChemicalElements +ChemicalElementsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// 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); +} + +// 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); +} + +// 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/gnds/ChemicalElements/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements.h b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements.h new file mode 100644 index 000000000..bdd3eebd8 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements.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. +// +// 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_CODE_V2_0_GNDS_CHEMICALELEMENTS +#define C_INTERFACE_CODE_V2_0_GNDS_CHEMICALELEMENTS + +#include "GNDStk.h" +#include "v2.0/gnds/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 +extern_c Handle2ChemicalElements +ChemicalElementsDefault(); + +// --- Create, general, const +extern_c Handle2ConstChemicalElements +ChemicalElementsCreateConst( + ConstHandle2ChemicalElement *const chemicalElement, const size_t chemicalElementSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ 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 +); + +// +++ 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/gnds/ChemicalElements/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/ChemicalElements/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Configuration.cpp b/standards/incremental/code/c/src/v2.0/gnds/Configuration.cpp new file mode 100644 index 000000000..abd9c15e6 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Configuration.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Configuration.hpp" +#include "Configuration.h" + +using namespace njoy::GNDStk; +using namespace code::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; }; +} + +using CPPBindingEnergy = gnds::BindingEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConfiguration +ConfigurationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Configuration +ConfigurationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConfiguration +ConfigurationCreateConst( + const char *const subshell, + const char *const electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy +) { + ConstHandle2Configuration handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + subshell, + electronNumber, + detail::tocpp(bindingEnergy) + ); + return handle; +} + +// Create, general +Handle2Configuration +ConfigurationCreate( + const char *const subshell, + const char *const electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy +) { + ConstHandle2Configuration handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + subshell, + electronNumber, + detail::tocpp(bindingEnergy) + ); + return handle; +} + +// Assign +// Use this to assign 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 +const char * +ConfigurationElectronNumberGet(ConstHandle2ConstConfiguration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ElectronNumberGet", self, extract::electronNumber); +} + +// Set +void +ConfigurationElectronNumberSet(ConstHandle2Configuration self, const char *const 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Configuration/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Configuration.h b/standards/incremental/code/c/src/v2.0/gnds/Configuration.h new file mode 100644 index 000000000..2431b9854 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Configuration.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. +// +// 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_CODE_V2_0_GNDS_CONFIGURATION +#define C_INTERFACE_CODE_V2_0_GNDS_CONFIGURATION + +#include "GNDStk.h" +#include "v2.0/gnds/BindingEnergy.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 +extern_c Handle2Configuration +ConfigurationDefault(); + +// --- Create, general, const +extern_c Handle2ConstConfiguration +ConfigurationCreateConst( + const char *const subshell, + const char *const electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy +); + +// +++ Create, general +extern_c Handle2Configuration +ConfigurationCreate( + const char *const subshell, + const char *const electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy +); + +// +++ Assign +// +++ Use this to assign one handled 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 const char * +ConfigurationElectronNumberGet(ConstHandle2ConstConfiguration self); + +// +++ Set +extern_c void +ConfigurationElectronNumberSet(ConstHandle2Configuration self, const char *const 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Configuration/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Configuration/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Configuration/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Configuration/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Configuration/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Configurations.cpp b/standards/incremental/code/c/src/v2.0/gnds/Configurations.cpp new file mode 100644 index 000000000..81a773810 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Configurations.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Configurations.hpp" +#include "Configurations.h" + +using namespace njoy::GNDStk; +using namespace code::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 = gnds::Configuration; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConfigurations +ConfigurationsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// 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); +} + +// Has, by electronNumber +int +ConfigurationsConfigurationHasByElectronNumber( + ConstHandle2ConstConfigurations self, + const char *const electronNumber +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationHasByElectronNumber", + self, extract::configuration, meta::electronNumber, electronNumber); +} + +// Get, by electronNumber, const +Handle2ConstConfiguration +ConfigurationsConfigurationGetByElectronNumberConst( + ConstHandle2ConstConfigurations self, + const char *const electronNumber +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationGetByElectronNumberConst", + self, extract::configuration, meta::electronNumber, electronNumber); +} + +// Get, by electronNumber, non-const +Handle2Configuration +ConfigurationsConfigurationGetByElectronNumber( + ConstHandle2Configurations self, + const char *const electronNumber +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationGetByElectronNumber", + self, extract::configuration, meta::electronNumber, electronNumber); +} + +// Set, by electronNumber +void +ConfigurationsConfigurationSetByElectronNumber( + ConstHandle2Configurations self, + const char *const electronNumber, + ConstHandle2ConstConfiguration configuration +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationSetByElectronNumber", + self, extract::configuration, meta::electronNumber, electronNumber, configuration); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Configurations/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Configurations.h b/standards/incremental/code/c/src/v2.0/gnds/Configurations.h new file mode 100644 index 000000000..2e791b2c2 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Configurations.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_CODE_V2_0_GNDS_CONFIGURATIONS +#define C_INTERFACE_CODE_V2_0_GNDS_CONFIGURATIONS + +#include "GNDStk.h" +#include "v2.0/gnds/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 +extern_c Handle2Configurations +ConfigurationsDefault(); + +// --- Create, general, const +extern_c Handle2ConstConfigurations +ConfigurationsCreateConst( + ConstHandle2Configuration *const configuration, const size_t configurationSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ Has, by electronNumber +extern_c int +ConfigurationsConfigurationHasByElectronNumber( + ConstHandle2ConstConfigurations self, + const char *const electronNumber +); + +// --- Get, by electronNumber, const +extern_c Handle2ConstConfiguration +ConfigurationsConfigurationGetByElectronNumberConst( + ConstHandle2ConstConfigurations self, + const char *const electronNumber +); + +// +++ Get, by electronNumber, non-const +extern_c Handle2Configuration +ConfigurationsConfigurationGetByElectronNumber( + ConstHandle2Configurations self, + const char *const electronNumber +); + +// +++ Set, by electronNumber +extern_c void +ConfigurationsConfigurationSetByElectronNumber( + ConstHandle2Configurations self, + const char *const electronNumber, + ConstHandle2ConstConfiguration configuration +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Configurations/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Configurations/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Configurations/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Configurations/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Configurations/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Date.cpp b/standards/incremental/code/c/src/v2.0/gnds/Date.cpp new file mode 100644 index 000000000..383b42776 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Date.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Date.hpp" +#include "Date.h" + +using namespace njoy::GNDStk; +using namespace code::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 +Handle2Date +DateDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDate +DateCreateConst( + const char *const value, + const enums::DateType dateType +) { + ConstHandle2Date handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + dateType + ); + return handle; +} + +// Create, general +Handle2Date +DateCreate( + const char *const value, + const enums::DateType 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 +enums::DateType +DateDateTypeGet(ConstHandle2ConstDate self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateTypeGet", self, extract::dateType); +} + +// Set +void +DateDateTypeSet(ConstHandle2Date self, const enums::DateType dateType) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateTypeSet", self, extract::dateType, dateType); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Date/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Date.h b/standards/incremental/code/c/src/v2.0/gnds/Date.h new file mode 100644 index 000000000..aba832a94 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/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_CODE_V2_0_GNDS_DATE +#define C_INTERFACE_CODE_V2_0_GNDS_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 +extern_c Handle2Date +DateDefault(); + +// --- Create, general, const +extern_c Handle2ConstDate +DateCreateConst( + const char *const value, + const enums::DateType dateType +); + +// +++ Create, general +extern_c Handle2Date +DateCreate( + const char *const value, + const enums::DateType 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 enums::DateType +DateDateTypeGet(ConstHandle2ConstDate self); + +// +++ Set +extern_c void +DateDateTypeSet(ConstHandle2Date self, const enums::DateType dateType); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Date/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Date/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Date/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Date/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Date/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Dates.cpp b/standards/incremental/code/c/src/v2.0/gnds/Dates.cpp new file mode 100644 index 000000000..b5e4fd7b4 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Dates.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Dates.hpp" +#include "Dates.h" + +using namespace njoy::GNDStk; +using namespace code::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 = gnds::Date; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDates +DatesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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); +} + +// 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); +} + +// Has, by dateType +int +DatesDateHasByDateType( + ConstHandle2ConstDates self, + const enums::DateType dateType +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DateHasByDateType", + self, extract::date, meta::dateType, dateType); +} + +// Get, by dateType, const +Handle2ConstDate +DatesDateGetByDateTypeConst( + ConstHandle2ConstDates self, + const enums::DateType dateType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DateGetByDateTypeConst", + self, extract::date, meta::dateType, dateType); +} + +// Get, by dateType, non-const +Handle2Date +DatesDateGetByDateType( + ConstHandle2Dates self, + const enums::DateType dateType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DateGetByDateType", + self, extract::date, meta::dateType, dateType); +} + +// Set, by dateType +void +DatesDateSetByDateType( + ConstHandle2Dates self, + const enums::DateType dateType, + ConstHandle2ConstDate date +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DateSetByDateType", + self, extract::date, meta::dateType, dateType, date); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Dates/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Dates.h b/standards/incremental/code/c/src/v2.0/gnds/Dates.h new file mode 100644 index 000000000..16a556223 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Dates.h @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ 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_CODE_V2_0_GNDS_DATES +#define C_INTERFACE_CODE_V2_0_GNDS_DATES + +#include "GNDStk.h" +#include "v2.0/gnds/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 +extern_c Handle2Dates +DatesDefault(); + +// --- Create, general, const +extern_c Handle2ConstDates +DatesCreateConst( + ConstHandle2Date *const date, const size_t dateSize +); + +// +++ Create, general +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 +); + +// +++ 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 +); + +// +++ Has, by dateType +extern_c int +DatesDateHasByDateType( + ConstHandle2ConstDates self, + const enums::DateType dateType +); + +// --- Get, by dateType, const +extern_c Handle2ConstDate +DatesDateGetByDateTypeConst( + ConstHandle2ConstDates self, + const enums::DateType dateType +); + +// +++ Get, by dateType, non-const +extern_c Handle2Date +DatesDateGetByDateType( + ConstHandle2Dates self, + const enums::DateType dateType +); + +// +++ Set, by dateType +extern_c void +DatesDateSetByDateType( + ConstHandle2Dates self, + const enums::DateType dateType, + ConstHandle2ConstDate date +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Dates/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Dates/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Dates/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Dates/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Dates/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Documentation.cpp b/standards/incremental/code/c/src/v2.0/gnds/Documentation.cpp new file mode 100644 index 000000000..35dcf1d25 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Documentation.cpp @@ -0,0 +1,353 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Documentation.hpp" +#include "Documentation.h" + +using namespace njoy::GNDStk; +using namespace code::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 = gnds::Authors; +using CPPDates = gnds::Dates; +using CPPTitle = gnds::Title; +using CPPBody = gnds::Body; +using CPPEndfCompatible = gnds::EndfCompatible; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDocumentation +DocumentationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +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/gnds/Documentation/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Documentation.h b/standards/incremental/code/c/src/v2.0/gnds/Documentation.h new file mode 100644 index 000000000..46b0d5640 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/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_CODE_V2_0_GNDS_DOCUMENTATION +#define C_INTERFACE_CODE_V2_0_GNDS_DOCUMENTATION + +#include "GNDStk.h" +#include "v2.0/gnds/Authors.h" +#include "v2.0/gnds/Dates.h" +#include "v2.0/gnds/Title.h" +#include "v2.0/gnds/Body.h" +#include "v2.0/gnds/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 +extern_c Handle2Documentation +DocumentationDefault(); + +// --- Create, general, const +extern_c Handle2ConstDocumentation +DocumentationCreateConst( + ConstHandle2ConstAuthors authors, + ConstHandle2ConstDates dates, + ConstHandle2ConstTitle title, + ConstHandle2ConstBody body, + ConstHandle2ConstEndfCompatible endfCompatible +); + +// +++ Create, general +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/gnds/Documentation/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Documentation/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Documentation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Documentation/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Documentation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Double.cpp b/standards/incremental/code/c/src/v2.0/gnds/Double.cpp new file mode 100644 index 000000000..beb7ca530 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Double.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Double.hpp" +#include "Double.h" + +using namespace njoy::GNDStk; +using namespace code::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; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDouble +DoubleDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Double +DoubleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDouble +DoubleCreateConst( + const char *const label, + const double value, + const char *const unit +) { + ConstHandle2Double handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit + ); + return handle; +} + +// Create, general +Handle2Double +DoubleCreate( + const char *const label, + const double value, + const char *const unit +) { + ConstHandle2Double 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 +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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Double/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Double.h b/standards/incremental/code/c/src/v2.0/gnds/Double.h new file mode 100644 index 000000000..27e2c7197 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Double.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. +// +// 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_CODE_V2_0_GNDS_DOUBLE +#define C_INTERFACE_CODE_V2_0_GNDS_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 +extern_c Handle2Double +DoubleDefault(); + +// --- Create, general, const +extern_c Handle2ConstDouble +DoubleCreateConst( + const char *const label, + const double value, + const char *const unit +); + +// +++ Create, general +extern_c Handle2Double +DoubleCreate( + const char *const label, + 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 +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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Double/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Double/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Double/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Double/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Double/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible.cpp b/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible.cpp new file mode 100644 index 000000000..3405d22be --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible.cpp @@ -0,0 +1,387 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/EndfCompatible.hpp" +#include "EndfCompatible.h" + +using namespace njoy::GNDStk; +using namespace code::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 +Handle2EndfCompatible +EndfCompatibleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEndfCompatible +EndfCompatibleCreateConst() +{ + ConstHandle2EndfCompatible handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +EndfCompatibleIntsClear(ConstHandle2EndfCompatible self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +EndfCompatibleIntsSize(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +EndfCompatibleIntsGet(ConstHandle2ConstEndfCompatible self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +EndfCompatibleIntsSet(ConstHandle2EndfCompatible self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +EndfCompatibleIntsGetArrayConst(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +EndfCompatibleIntsGetArray(ConstHandle2EndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +EndfCompatibleIntsSetArray(ConstHandle2EndfCompatible self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +EndfCompatibleUnsignedsClear(ConstHandle2EndfCompatible self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +EndfCompatibleUnsignedsSize(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +EndfCompatibleUnsignedsGet(ConstHandle2ConstEndfCompatible self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +EndfCompatibleUnsignedsSet(ConstHandle2EndfCompatible self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +EndfCompatibleUnsignedsGetArrayConst(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +EndfCompatibleUnsignedsGetArray(ConstHandle2EndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +EndfCompatibleUnsignedsSetArray(ConstHandle2EndfCompatible self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +EndfCompatibleFloatsClear(ConstHandle2EndfCompatible self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +EndfCompatibleFloatsSize(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +EndfCompatibleFloatsGet(ConstHandle2ConstEndfCompatible self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +EndfCompatibleFloatsSet(ConstHandle2EndfCompatible self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +EndfCompatibleFloatsGetArrayConst(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +EndfCompatibleFloatsGetArray(ConstHandle2EndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +EndfCompatibleFloatsSetArray(ConstHandle2EndfCompatible self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +EndfCompatibleDoublesClear(ConstHandle2EndfCompatible self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +EndfCompatibleDoublesSize(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +EndfCompatibleDoublesGet(ConstHandle2ConstEndfCompatible self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +EndfCompatibleDoublesSet(ConstHandle2EndfCompatible self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +EndfCompatibleDoublesGetArrayConst(ConstHandle2ConstEndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +EndfCompatibleDoublesGetArray(ConstHandle2EndfCompatible self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +EndfCompatibleDoublesSetArray(ConstHandle2EndfCompatible self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/EndfCompatible/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible.h b/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible.h new file mode 100644 index 000000000..6a7a8dc32 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible.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. +// +// 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_CODE_V2_0_GNDS_ENDFCOMPATIBLE +#define C_INTERFACE_CODE_V2_0_GNDS_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 +extern_c Handle2EndfCompatible +EndfCompatibleDefault(); + +// --- Create, general, const +extern_c Handle2ConstEndfCompatible +EndfCompatibleCreateConst(); + +// +++ Create, general +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); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +EndfCompatibleIntsClear(ConstHandle2EndfCompatible self); + +// +++ Get size +extern_c size_t +EndfCompatibleIntsSize(ConstHandle2ConstEndfCompatible self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +EndfCompatibleIntsGet(ConstHandle2ConstEndfCompatible self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +EndfCompatibleIntsSet(ConstHandle2EndfCompatible self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +EndfCompatibleIntsGetArrayConst(ConstHandle2ConstEndfCompatible self); + +// +++ Get pointer to existing values, non-const +extern_c int * +EndfCompatibleIntsGetArray(ConstHandle2EndfCompatible self); + +// +++ Set completely new values and size +extern_c void +EndfCompatibleIntsSetArray(ConstHandle2EndfCompatible self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +EndfCompatibleUnsignedsClear(ConstHandle2EndfCompatible self); + +// +++ Get size +extern_c size_t +EndfCompatibleUnsignedsSize(ConstHandle2ConstEndfCompatible self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +EndfCompatibleUnsignedsGet(ConstHandle2ConstEndfCompatible self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +EndfCompatibleUnsignedsSet(ConstHandle2EndfCompatible self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +EndfCompatibleUnsignedsGetArrayConst(ConstHandle2ConstEndfCompatible self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +EndfCompatibleUnsignedsGetArray(ConstHandle2EndfCompatible self); + +// +++ Set completely new values and size +extern_c void +EndfCompatibleUnsignedsSetArray(ConstHandle2EndfCompatible self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +EndfCompatibleFloatsClear(ConstHandle2EndfCompatible self); + +// +++ Get size +extern_c size_t +EndfCompatibleFloatsSize(ConstHandle2ConstEndfCompatible self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +EndfCompatibleFloatsGet(ConstHandle2ConstEndfCompatible self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +EndfCompatibleFloatsSet(ConstHandle2EndfCompatible self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +EndfCompatibleFloatsGetArrayConst(ConstHandle2ConstEndfCompatible self); + +// +++ Get pointer to existing values, non-const +extern_c float * +EndfCompatibleFloatsGetArray(ConstHandle2EndfCompatible self); + +// +++ Set completely new values and size +extern_c void +EndfCompatibleFloatsSetArray(ConstHandle2EndfCompatible self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +EndfCompatibleDoublesClear(ConstHandle2EndfCompatible self); + +// +++ Get size +extern_c size_t +EndfCompatibleDoublesSize(ConstHandle2ConstEndfCompatible self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +EndfCompatibleDoublesGet(ConstHandle2ConstEndfCompatible self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +EndfCompatibleDoublesSet(ConstHandle2EndfCompatible self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +EndfCompatibleDoublesGetArrayConst(ConstHandle2ConstEndfCompatible self); + +// +++ Get pointer to existing values, non-const +extern_c double * +EndfCompatibleDoublesGetArray(ConstHandle2EndfCompatible self); + +// +++ Set completely new values and size +extern_c void +EndfCompatibleDoublesSetArray(ConstHandle2EndfCompatible self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/EndfCompatible/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/EndfCompatible/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Evaluated.cpp b/standards/incremental/code/c/src/v2.0/gnds/Evaluated.cpp new file mode 100644 index 000000000..58ce97575 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Evaluated.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Evaluated.hpp" +#include "Evaluated.h" + +using namespace njoy::GNDStk; +using namespace code::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; }; +} + +using CPPDocumentation = gnds::Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEvaluated +EvaluatedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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 +) { + ConstHandle2Evaluated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + date, + library, + version, + detail::tocpp(documentation) + ); + return handle; +} + +// Create, general +Handle2Evaluated +EvaluatedCreate( + const char *const label, + const char *const date, + const char *const library, + const char *const version, + ConstHandle2ConstDocumentation documentation +) { + ConstHandle2Evaluated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + date, + library, + version, + detail::tocpp(documentation) + ); + return handle; +} + +// Assign +// Use this to assign 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Evaluated/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Evaluated.h b/standards/incremental/code/c/src/v2.0/gnds/Evaluated.h new file mode 100644 index 000000000..29f812e5d --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Evaluated.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. +// +// 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_CODE_V2_0_GNDS_EVALUATED +#define C_INTERFACE_CODE_V2_0_GNDS_EVALUATED + +#include "GNDStk.h" +#include "v2.0/gnds/Documentation.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 +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 +); + +// +++ Create, general +extern_c Handle2Evaluated +EvaluatedCreate( + const char *const label, + const char *const date, + const char *const library, + const char *const version, + ConstHandle2ConstDocumentation documentation +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Evaluated/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Evaluated/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Evaluated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Evaluated/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Evaluated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/PoPs.cpp b/standards/incremental/code/c/src/v2.0/gnds/PoPs.cpp new file mode 100644 index 000000000..d17b6b357 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/PoPs.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/PoPs.hpp" +#include "PoPs.h" + +using namespace njoy::GNDStk; +using namespace code::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 styles = [](auto &obj) { return &obj.styles; }; + static auto chemicalElements = [](auto &obj) { return &obj.chemicalElements; }; +} + +using CPPStyles = gnds::Styles; +using CPPChemicalElements = gnds::ChemicalElements; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPoPs +PoPsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +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, + ConstHandle2ConstStyles styles, + ConstHandle2ConstChemicalElements chemicalElements +) { + ConstHandle2PoPs handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name, + version, + format, + detail::tocpp(styles), + detail::tocpp(chemicalElements) + ); + return handle; +} + +// Create, general +Handle2PoPs +PoPsCreate( + const char *const name, + const char *const version, + const char *const format, + ConstHandle2ConstStyles styles, + ConstHandle2ConstChemicalElements chemicalElements +) { + ConstHandle2PoPs handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name, + version, + format, + detail::tocpp(styles), + detail::tocpp(chemicalElements) + ); + return handle; +} + +// Assign +// Use this to assign 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: 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: 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/PoPs/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/PoPs.h b/standards/incremental/code/c/src/v2.0/gnds/PoPs.h new file mode 100644 index 000000000..9e65a578a --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/PoPs.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. +// +// 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_CODE_V2_0_GNDS_POPS +#define C_INTERFACE_CODE_V2_0_GNDS_POPS + +#include "GNDStk.h" +#include "v2.0/gnds/Styles.h" +#include "v2.0/gnds/ChemicalElements.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 +extern_c Handle2PoPs +PoPsDefault(); + +// --- Create, general, const +extern_c Handle2ConstPoPs +PoPsCreateConst( + const char *const name, + const char *const version, + const char *const format, + ConstHandle2ConstStyles styles, + ConstHandle2ConstChemicalElements chemicalElements +); + +// +++ Create, general +extern_c Handle2PoPs +PoPsCreate( + const char *const name, + const char *const version, + const char *const format, + ConstHandle2ConstStyles styles, + ConstHandle2ConstChemicalElements chemicalElements +); + +// +++ Assign +// +++ Use this to assign one handled 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: 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: 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/PoPs/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/PoPs/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/PoPs/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/PoPs/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/PoPs/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Styles.cpp b/standards/incremental/code/c/src/v2.0/gnds/Styles.cpp new file mode 100644 index 000000000..f319f623c --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Styles.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Styles.hpp" +#include "Styles.h" + +using namespace njoy::GNDStk; +using namespace code::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; }; +} + +using CPPEvaluated = gnds::Evaluated; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstStyles +StylesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Styles +StylesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstStyles +StylesCreateConst( + ConstHandle2ConstEvaluated evaluated +) { + ConstHandle2Styles handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(evaluated) + ); + return handle; +} + +// Create, general +Handle2Styles +StylesCreate( + ConstHandle2ConstEvaluated evaluated +) { + ConstHandle2Styles handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(evaluated) + ); + return handle; +} + +// Assign +// Use this to assign 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); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Styles/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Styles.h b/standards/incremental/code/c/src/v2.0/gnds/Styles.h new file mode 100644 index 000000000..be046f271 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Styles.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. +// +// 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_CODE_V2_0_GNDS_STYLES +#define C_INTERFACE_CODE_V2_0_GNDS_STYLES + +#include "GNDStk.h" +#include "v2.0/gnds/Evaluated.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 +extern_c Handle2Styles +StylesDefault(); + +// --- Create, general, const +extern_c Handle2ConstStyles +StylesCreateConst( + ConstHandle2ConstEvaluated evaluated +); + +// +++ Create, general +extern_c Handle2Styles +StylesCreate( + ConstHandle2ConstEvaluated evaluated +); + +// +++ Assign +// +++ Use this to assign one handled 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); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Styles/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Styles/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Styles/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Styles/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Styles/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Title.cpp b/standards/incremental/code/c/src/v2.0/gnds/Title.cpp new file mode 100644 index 000000000..9786352bb --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Title.cpp @@ -0,0 +1,387 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "code/v2.0/gnds/Title.hpp" +#include "Title.h" + +using namespace njoy::GNDStk; +using namespace code::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 +Handle2Title +TitleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTitle +TitleCreateConst() +{ + ConstHandle2Title handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +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"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +TitleIntsClear(ConstHandle2Title self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +TitleIntsSize(ConstHandle2ConstTitle self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +TitleIntsGet(ConstHandle2ConstTitle self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +TitleIntsSet(ConstHandle2Title self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +TitleIntsGetArrayConst(ConstHandle2ConstTitle self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +TitleIntsGetArray(ConstHandle2Title self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +TitleIntsSetArray(ConstHandle2Title self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +TitleUnsignedsClear(ConstHandle2Title self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +TitleUnsignedsSize(ConstHandle2ConstTitle self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +TitleUnsignedsGet(ConstHandle2ConstTitle self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +TitleUnsignedsSet(ConstHandle2Title self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +TitleUnsignedsGetArrayConst(ConstHandle2ConstTitle self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +TitleUnsignedsGetArray(ConstHandle2Title self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +TitleUnsignedsSetArray(ConstHandle2Title self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +TitleFloatsClear(ConstHandle2Title self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +TitleFloatsSize(ConstHandle2ConstTitle self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +TitleFloatsGet(ConstHandle2ConstTitle self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +TitleFloatsSet(ConstHandle2Title self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +TitleFloatsGetArrayConst(ConstHandle2ConstTitle self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +TitleFloatsGetArray(ConstHandle2Title self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +TitleFloatsSetArray(ConstHandle2Title self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +TitleDoublesClear(ConstHandle2Title self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +TitleDoublesSize(ConstHandle2ConstTitle self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +TitleDoublesGet(ConstHandle2ConstTitle self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +TitleDoublesSet(ConstHandle2Title self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +TitleDoublesGetArrayConst(ConstHandle2ConstTitle self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +TitleDoublesGetArray(ConstHandle2Title self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +TitleDoublesSetArray(ConstHandle2Title self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Title/src/custom.cpp" diff --git a/standards/incremental/code/c/src/v2.0/gnds/Title.h b/standards/incremental/code/c/src/v2.0/gnds/Title.h new file mode 100644 index 000000000..24bfacd80 --- /dev/null +++ b/standards/incremental/code/c/src/v2.0/gnds/Title.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. +// +// 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_CODE_V2_0_GNDS_TITLE +#define C_INTERFACE_CODE_V2_0_GNDS_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 +extern_c Handle2Title +TitleDefault(); + +// --- Create, general, const +extern_c Handle2ConstTitle +TitleCreateConst(); + +// +++ Create, general +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); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +TitleIntsClear(ConstHandle2Title self); + +// +++ Get size +extern_c size_t +TitleIntsSize(ConstHandle2ConstTitle self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +TitleIntsGet(ConstHandle2ConstTitle self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +TitleIntsSet(ConstHandle2Title self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +TitleIntsGetArrayConst(ConstHandle2ConstTitle self); + +// +++ Get pointer to existing values, non-const +extern_c int * +TitleIntsGetArray(ConstHandle2Title self); + +// +++ Set completely new values and size +extern_c void +TitleIntsSetArray(ConstHandle2Title self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +TitleUnsignedsClear(ConstHandle2Title self); + +// +++ Get size +extern_c size_t +TitleUnsignedsSize(ConstHandle2ConstTitle self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +TitleUnsignedsGet(ConstHandle2ConstTitle self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +TitleUnsignedsSet(ConstHandle2Title self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +TitleUnsignedsGetArrayConst(ConstHandle2ConstTitle self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +TitleUnsignedsGetArray(ConstHandle2Title self); + +// +++ Set completely new values and size +extern_c void +TitleUnsignedsSetArray(ConstHandle2Title self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +TitleFloatsClear(ConstHandle2Title self); + +// +++ Get size +extern_c size_t +TitleFloatsSize(ConstHandle2ConstTitle self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +TitleFloatsGet(ConstHandle2ConstTitle self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +TitleFloatsSet(ConstHandle2Title self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +TitleFloatsGetArrayConst(ConstHandle2ConstTitle self); + +// +++ Get pointer to existing values, non-const +extern_c float * +TitleFloatsGetArray(ConstHandle2Title self); + +// +++ Set completely new values and size +extern_c void +TitleFloatsSetArray(ConstHandle2Title self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +TitleDoublesClear(ConstHandle2Title self); + +// +++ Get size +extern_c size_t +TitleDoublesSize(ConstHandle2ConstTitle self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +TitleDoublesGet(ConstHandle2ConstTitle self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +TitleDoublesSet(ConstHandle2Title self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +TitleDoublesGetArrayConst(ConstHandle2ConstTitle self); + +// +++ Get pointer to existing values, non-const +extern_c double * +TitleDoublesGetArray(ConstHandle2Title self); + +// +++ Set completely new values and size +extern_c void +TitleDoublesSetArray(ConstHandle2Title self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/gnds/Title/src/custom.h" + +#undef extern_c +#endif diff --git a/standards/incremental/code/c/src/v2.0/gnds/Title/src/custom.cpp b/standards/incremental/code/c/src/v2.0/gnds/Title/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/c/src/v2.0/gnds/Title/src/custom.h b/standards/incremental/code/c/src/v2.0/gnds/Title/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/standards/incremental/code/python/src/v2.0/gnds.python.cpp b/standards/incremental/code/python/src/v2.0/gnds.python.cpp new file mode 100644 index 000000000..684d5a746 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds.python.cpp @@ -0,0 +1,65 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +namespace py = pybind11; + +// v2.0 interface +namespace python_v2_0 { + +// gnds declarations +namespace python_gnds { + void wrapAuthor(py::module &); + void wrapAuthors(py::module &); + void wrapDate(py::module &); + void wrapDates(py::module &); + void wrapTitle(py::module &); + void wrapBody(py::module &); + void wrapEndfCompatible(py::module &); + void wrapDocumentation(py::module &); + void wrapEvaluated(py::module &); + void wrapStyles(py::module &); + void wrapDouble(py::module &); + void wrapBindingEnergy(py::module &); + void wrapConfiguration(py::module &); + void wrapConfigurations(py::module &); + void wrapAtomic(py::module &); + void wrapChemicalElement(py::module &); + void wrapChemicalElements(py::module &); + void wrapPoPs(py::module &); +} // namespace python_gnds + +// wrapper for gnds +void wrapGnds(py::module &module) +{ + // create the gnds submodule + py::module submodule = module.def_submodule( + "gnds", + "code v2.0 gnds" + ); + + // wrap gnds components + python_gnds::wrapAuthor(submodule); + python_gnds::wrapAuthors(submodule); + python_gnds::wrapDate(submodule); + python_gnds::wrapDates(submodule); + python_gnds::wrapTitle(submodule); + python_gnds::wrapBody(submodule); + python_gnds::wrapEndfCompatible(submodule); + python_gnds::wrapDocumentation(submodule); + python_gnds::wrapEvaluated(submodule); + python_gnds::wrapStyles(submodule); + python_gnds::wrapDouble(submodule); + python_gnds::wrapBindingEnergy(submodule); + python_gnds::wrapConfiguration(submodule); + python_gnds::wrapConfigurations(submodule); + python_gnds::wrapAtomic(submodule); + python_gnds::wrapChemicalElement(submodule); + python_gnds::wrapChemicalElements(submodule); + python_gnds::wrapPoPs(submodule); +}; + +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Atomic.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Atomic.python.cpp new file mode 100644 index 000000000..34141bc46 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Atomic.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Atomic.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Atomic +void wrapAtomic(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Atomic; + + // create the Python object + py::class_ object( + module, "Atomic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const gnds::Configurations & + >(), + py::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 gnds::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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Author.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Author.python.cpp new file mode 100644 index 000000000..2daa04d5b --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Author.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Author.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Author +void wrapAuthor(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Author; + + // create the Python object + py::class_ object( + module, "Author", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string & + >(), + py::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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Authors.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Authors.python.cpp new file mode 100644 index 000000000..f68bbaac3 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Authors.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Authors.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Authors +void wrapAuthors(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Authors; + + // create the Python object + py::class_ object( + module, "Authors", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/BindingEnergy.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/BindingEnergy.python.cpp new file mode 100644 index 000000000..903f90638 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/BindingEnergy.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/BindingEnergy.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::BindingEnergy +void wrapBindingEnergy(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::BindingEnergy; + + // create the Python object + py::class_ object( + module, "BindingEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const gnds::Double & + >(), + py::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 gnds::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Body.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Body.python.cpp new file mode 100644 index 000000000..a1c9d7750 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Body.python.cpp @@ -0,0 +1,115 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Body.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Body +void wrapBody(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Body; + + // create the Python object + py::class_ object( + module, "Body", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/ChemicalElement.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/ChemicalElement.python.cpp new file mode 100644 index 000000000..5b3429210 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/ChemicalElement.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/ChemicalElement.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::ChemicalElement +void wrapChemicalElement(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::ChemicalElement; + + // create the Python object + py::class_ object( + module, "ChemicalElement", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const int &, + const std::string &, + const gnds::Atomic & + >(), + py::arg("symbol"), + py::arg("z"), + py::arg("name"), + py::arg("atomic"), + 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 gnds::Atomic &value) + { + self.atomic() = value; + }, + cppCLASS::component_t::documentation("atomic").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() + ); + + // shortcut: get/set configurations + object.def_property( + "configurations", + [](const cppCLASS &self) -> decltype(auto) + { + return self.configurations(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.configurations() = value; + }, + cppCLASS::component_t::documentation("configurations").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/ChemicalElements.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/ChemicalElements.python.cpp new file mode 100644 index 000000000..7c2ef037e --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/ChemicalElements.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/ChemicalElements.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::ChemicalElements +void wrapChemicalElements(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::ChemicalElements; + + // create the Python object + py::class_ object( + module, "ChemicalElements", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Configuration.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Configuration.python.cpp new file mode 100644 index 000000000..9b80d4190 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Configuration.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Configuration.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Configuration +void wrapConfiguration(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Configuration; + + // create the Python object + py::class_ object( + module, "Configuration", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const gnds::BindingEnergy & + >(), + py::arg("subshell"), + py::arg("electron_number"), + py::arg("binding_energy"), + 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 std::string &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 gnds::BindingEnergy &value) + { + self.bindingEnergy() = value; + }, + cppCLASS::component_t::documentation("binding_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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Configurations.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Configurations.python.cpp new file mode 100644 index 000000000..30bc46d08 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Configurations.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Configurations.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Configurations +void wrapConfigurations(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Configurations; + + // create the Python object + py::class_ object( + module, "Configurations", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Date.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Date.python.cpp new file mode 100644 index 000000000..ea04b5e17 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Date.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Date.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Date +void wrapDate(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Date; + + // create the Python object + py::class_ object( + module, "Date", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const enums::DateType & + >(), + py::arg("value"), + py::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 enums::DateType &value) + { + self.dateType() = value; + }, + cppCLASS::component_t::documentation("date_type").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Dates.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Dates.python.cpp new file mode 100644 index 000000000..ffd834fd2 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Dates.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Dates.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Dates +void wrapDates(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Dates; + + // create the Python object + py::class_ object( + module, "Dates", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::vector & + >(), + py::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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Documentation.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Documentation.python.cpp new file mode 100644 index 000000000..3d392b746 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Documentation.python.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Documentation.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Documentation +void wrapDocumentation(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Documentation; + + // create the Python object + py::class_ object( + module, "Documentation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const gnds::Authors &, + const gnds::Dates &, + const gnds::Title &, + const gnds::Body &, + const gnds::EndfCompatible & + >(), + py::arg("authors"), + py::arg("dates"), + py::arg("title"), + py::arg("body"), + py::arg("endf_compatible"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set authors + object.def_property( + "authors", + [](const cppCLASS &self) -> decltype(auto) + { + return self.authors(); + }, + [](cppCLASS &self, const gnds::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 gnds::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 gnds::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 gnds::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 gnds::EndfCompatible &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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Double.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Double.python.cpp new file mode 100644 index 000000000..9a6956972 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Double.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Double.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Double +void wrapDouble(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Double; + + // create the Python object + py::class_ object( + module, "Double", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const double &, + const std::string & + >(), + py::arg("label"), + py::arg("value"), + py::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 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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/EndfCompatible.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/EndfCompatible.python.cpp new file mode 100644 index 000000000..955a247d9 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/EndfCompatible.python.cpp @@ -0,0 +1,115 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/EndfCompatible.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::EndfCompatible +void wrapEndfCompatible(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::EndfCompatible; + + // create the Python object + py::class_ object( + module, "EndfCompatible", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Evaluated.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Evaluated.python.cpp new file mode 100644 index 000000000..57d41b157 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Evaluated.python.cpp @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Evaluated.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Evaluated +void wrapEvaluated(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Evaluated; + + // create the Python object + py::class_ object( + module, "Evaluated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const gnds::Documentation & + >(), + py::arg("label"), + py::arg("date"), + py::arg("library"), + py::arg("version"), + py::arg("documentation"), + 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 gnds::Documentation &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/PoPs.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/PoPs.python.cpp new file mode 100644 index 000000000..521c4d82c --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/PoPs.python.cpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/PoPs.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::PoPs +void wrapPoPs(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::PoPs; + + // create the Python object + py::class_ object( + module, "PoPs", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const std::string &, + const std::string &, + const std::string &, + const gnds::Styles &, + const gnds::ChemicalElements & + >(), + py::arg("name"), + py::arg("version"), + py::arg("format"), + py::arg("styles"), + py::arg("chemical_elements"), + 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 styles + object.def_property( + "styles", + [](const cppCLASS &self) -> decltype(auto) + { + return self.styles(); + }, + [](cppCLASS &self, const gnds::Styles &value) + { + self.styles() = value; + }, + cppCLASS::component_t::documentation("styles").data() + ); + + // get/set chemicalElements + object.def_property( + "chemical_elements", + [](const cppCLASS &self) -> decltype(auto) + { + return self.chemicalElements(); + }, + [](cppCLASS &self, const gnds::ChemicalElements &value) + { + self.chemicalElements() = value; + }, + cppCLASS::component_t::documentation("chemical_elements").data() + ); + + // shortcut: get/set chemicalElement + object.def_property( + "chemical_element", + [](const cppCLASS &self) -> decltype(auto) + { + return self.chemicalElement(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.chemicalElement() = value; + }, + cppCLASS::component_t::documentation("chemical_element").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() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Styles.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Styles.python.cpp new file mode 100644 index 000000000..454640258 --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Styles.python.cpp @@ -0,0 +1,146 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Styles.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Styles +void wrapStyles(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Styles; + + // create the Python object + py::class_ object( + module, "Styles", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + const gnds::Evaluated & + >(), + py::arg("evaluated"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set evaluated + object.def_property( + "evaluated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaluated(); + }, + [](cppCLASS &self, const gnds::Evaluated &value) + { + self.evaluated() = value; + }, + cppCLASS::component_t::documentation("evaluated").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 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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/python/src/v2.0/gnds/Title.python.cpp b/standards/incremental/code/python/src/v2.0/gnds/Title.python.cpp new file mode 100644 index 000000000..87558e80c --- /dev/null +++ b/standards/incremental/code/python/src/v2.0/gnds/Title.python.cpp @@ -0,0 +1,115 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "code/v2.0/gnds/Title.hpp" +#include "definitions.hpp" + +// namespace aliases +namespace py = pybind11; + +namespace python_v2_0 { +namespace python_gnds { + +// wrapper for gnds::Title +void wrapTitle(py::module &module) +{ + using namespace code; + using namespace code::v2_0; + + // type aliases + using cppCLASS = gnds::Title; + + // create the Python object + py::class_ object( + module, "Title", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + py::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + py::init< + const std::vector & + >(), + py::arg("strings"), + cppCLASS::component_t::documentation("constructor").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_gnds +} // namespace python_v2_0 diff --git a/standards/incremental/code/src/code/v2.0.hpp b/standards/incremental/code/src/code/v2.0.hpp new file mode 100644 index 000000000..42c618611 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0.hpp @@ -0,0 +1,27 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0 +#define CODE_V2_0 + +#include "code/v2.0/gnds/Atomic.hpp" +#include "code/v2.0/gnds/Author.hpp" +#include "code/v2.0/gnds/Authors.hpp" +#include "code/v2.0/gnds/BindingEnergy.hpp" +#include "code/v2.0/gnds/Body.hpp" +#include "code/v2.0/gnds/ChemicalElement.hpp" +#include "code/v2.0/gnds/ChemicalElements.hpp" +#include "code/v2.0/gnds/Configuration.hpp" +#include "code/v2.0/gnds/Configurations.hpp" +#include "code/v2.0/gnds/Date.hpp" +#include "code/v2.0/gnds/Dates.hpp" +#include "code/v2.0/gnds/Documentation.hpp" +#include "code/v2.0/gnds/Double.hpp" +#include "code/v2.0/gnds/EndfCompatible.hpp" +#include "code/v2.0/gnds/Evaluated.hpp" +#include "code/v2.0/gnds/PoPs.hpp" +#include "code/v2.0/gnds/Styles.hpp" +#include "code/v2.0/gnds/Title.hpp" + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Atomic.hpp b/standards/incremental/code/src/code/v2.0/gnds/Atomic.hpp new file mode 100644 index 000000000..784af5a74 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Atomic.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_ATOMIC +#define CODE_V2_0_GNDS_ATOMIC + +#include "code/v2.0/gnds/Configurations.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(configurations(),configuration); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->configurations \ + ) + + // default + Atomic() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Atomic( + const wrapper + &configurations + ) : + GNDSTK_COMPONENT(BlockData{}), + configurations(this,configurations) + { + Component::finish(); + } + + // from node + explicit Atomic(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Atomic(const Atomic &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + configurations(this,other.configurations) + { + Component::finish(other); + } + + // move + Atomic(Atomic &&other) : + 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 "code/v2.0/gnds/Atomic/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Atomic + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Atomic/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Atomic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Atomic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Author.hpp b/standards/incremental/code/src/code/v2.0/gnds/Author.hpp new file mode 100644 index 000000000..296206ea8 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Author.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_AUTHOR +#define CODE_V2_0_GNDS_AUTHOR + +#include "code/v2.0/key.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name \ + ) + + // default + Author() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Author( + const wrapper + &name + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name) + { + Component::finish(); + } + + // from node + explicit Author(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Author(const Author &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name) + { + Component::finish(other); + } + + // move + Author(Author &&other) : + 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 "code/v2.0/gnds/Author/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Author + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Author/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Author/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Author/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Authors.hpp b/standards/incremental/code/src/code/v2.0/gnds/Authors.hpp new file mode 100644 index 000000000..65d1c4917 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Authors.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_AUTHORS +#define CODE_V2_0_GNDS_AUTHORS + +#include "code/v2.0/gnds/Author.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->author \ + ) + + // default + Authors() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Authors( + const wrapper> + &author + ) : + GNDSTK_COMPONENT(BlockData{}), + author(this,author) + { + Component::finish(); + } + + // from node + explicit Authors(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Authors(const Authors &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + author(this,other.author) + { + Component::finish(other); + } + + // move + Authors(Authors &&other) : + 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 "code/v2.0/gnds/Authors/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Authors + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Authors/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Authors/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Authors/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/BindingEnergy.hpp b/standards/incremental/code/src/code/v2.0/gnds/BindingEnergy.hpp new file mode 100644 index 000000000..e38c1a4f2 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/BindingEnergy.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_BINDINGENERGY +#define CODE_V2_0_GNDS_BINDINGENERGY + +#include "code/v2.0/gnds/Double.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + BindingEnergy() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BindingEnergy( + const wrapper + &Double + ) : + GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit BindingEnergy(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BindingEnergy(const BindingEnergy &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + BindingEnergy(BindingEnergy &&other) : + 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 "code/v2.0/gnds/BindingEnergy/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class BindingEnergy + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/BindingEnergy/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/BindingEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/BindingEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Body.hpp b/standards/incremental/code/src/code/v2.0/gnds/Body.hpp new file mode 100644 index 000000000..c9d600435 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Body.hpp @@ -0,0 +1,162 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_BODY +#define CODE_V2_0_GNDS_BODY + +#include "code/v2.0/key.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// class Body +// ----------------------------------------------------------------------------- + +class Body : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "gnds"; } + 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 member names. Usually - but not necessarily - the same 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; + using BlockData::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + Body() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Body(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Body(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Body(const Body &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Body(Body &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Body &operator=(const Body &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + Body &operator=(Body &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "code/v2.0/gnds/Body/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Body + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Body/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Body/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Body/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/ChemicalElement.hpp b/standards/incremental/code/src/code/v2.0/gnds/ChemicalElement.hpp new file mode 100644 index 000000000..4e48e8e04 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/ChemicalElement.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_CHEMICALELEMENT +#define CODE_V2_0_GNDS_CHEMICALELEMENT + +#include "code/v2.0/gnds/Atomic.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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") + ; + } + + // Data member names. Usually - but not necessarily - the same 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" + }; + 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" + }; + 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}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(atomic().configurations(),configuration); + GNDSTK_SHORTCUT(atomic(),configurations); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symbol, \ + this->Z, \ + this->name, \ + this->atomic \ + ) + + // default + ChemicalElement() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ChemicalElement( + const wrapper + &symbol, + const wrapper + &Z = {}, + const wrapper + &name = {}, + const wrapper + &atomic = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + symbol(this,symbol), + Z(this,Z), + name(this,name), + atomic(this,atomic) + { + Component::finish(); + } + + // from node + explicit ChemicalElement(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ChemicalElement(const ChemicalElement &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + symbol(this,other.symbol), + Z(this,other.Z), + name(this,other.name), + atomic(this,other.atomic) + { + Component::finish(other); + } + + // move + ChemicalElement(ChemicalElement &&other) : + 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)) + { + 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; + } + 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); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "code/v2.0/gnds/ChemicalElement/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ChemicalElement + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/ChemicalElement/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/ChemicalElement/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/ChemicalElement/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/ChemicalElements.hpp b/standards/incremental/code/src/code/v2.0/gnds/ChemicalElements.hpp new file mode 100644 index 000000000..9335c890d --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/ChemicalElements.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_CHEMICALELEMENTS +#define CODE_V2_0_GNDS_CHEMICALELEMENTS + +#include "code/v2.0/gnds/ChemicalElement.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->chemicalElement \ + ) + + // default + ChemicalElements() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ChemicalElements( + const wrapper> + &chemicalElement + ) : + GNDSTK_COMPONENT(BlockData{}), + chemicalElement(this,chemicalElement) + { + Component::finish(); + } + + // from node + explicit ChemicalElements(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ChemicalElements(const ChemicalElements &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + chemicalElement(this,other.chemicalElement) + { + Component::finish(other); + } + + // move + ChemicalElements(ChemicalElements &&other) : + 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 "code/v2.0/gnds/ChemicalElements/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class ChemicalElements + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/ChemicalElements/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/ChemicalElements/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/ChemicalElements/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Configuration.hpp b/standards/incremental/code/src/code/v2.0/gnds/Configuration.hpp new file mode 100644 index 000000000..2c118e3d6 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Configuration.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_CONFIGURATION +#define CODE_V2_0_GNDS_CONFIGURATION + +#include "code/v2.0/gnds/BindingEnergy.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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") | + std::string{} + / Meta<>("electronNumber") | + + // children + --Child + ("bindingEnergy") + ; + } + + // Data member names. Usually - but not necessarily - the same 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" + }; + 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" + }; + 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}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(bindingEnergy(),Double); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->subshell, \ + this->electronNumber, \ + this->bindingEnergy \ + ) + + // default + Configuration() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Configuration( + const wrapper + &subshell, + const wrapper + &electronNumber = {}, + const wrapper + &bindingEnergy = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + subshell(this,subshell), + electronNumber(this,electronNumber), + bindingEnergy(this,bindingEnergy) + { + Component::finish(); + } + + // from node + explicit Configuration(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Configuration(const Configuration &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + subshell(this,other.subshell), + electronNumber(this,other.electronNumber), + bindingEnergy(this,other.bindingEnergy) + { + Component::finish(other); + } + + // move + Configuration(Configuration &&other) : + 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)) + { + 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; + } + 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); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "code/v2.0/gnds/Configuration/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Configuration + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Configuration/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Configuration/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Configuration/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Configurations.hpp b/standards/incremental/code/src/code/v2.0/gnds/Configurations.hpp new file mode 100644 index 000000000..629028474 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Configurations.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_CONFIGURATIONS +#define CODE_V2_0_GNDS_CONFIGURATIONS + +#include "code/v2.0/gnds/Configuration.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->configuration \ + ) + + // default + Configurations() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Configurations( + const wrapper> + &configuration + ) : + GNDSTK_COMPONENT(BlockData{}), + configuration(this,configuration) + { + Component::finish(); + } + + // from node + explicit Configurations(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Configurations(const Configurations &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + configuration(this,other.configuration) + { + Component::finish(other); + } + + // move + Configurations(Configurations &&other) : + 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 "code/v2.0/gnds/Configurations/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Configurations + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Configurations/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Configurations/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Configurations/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Date.hpp b/standards/incremental/code/src/code/v2.0/gnds/Date.hpp new file mode 100644 index 000000000..794023362 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Date.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_DATE +#define CODE_V2_0_GNDS_DATE + +#include "code/v2.0/key.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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") | + enums::DateType{} + / 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->dateType \ + ) + + // default + Date() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Date( + const wrapper + &value, + const wrapper + &dateType = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + value(this,value), + dateType(this,dateType) + { + Component::finish(); + } + + // from node + explicit Date(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Date(const Date &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + dateType(this,other.dateType) + { + Component::finish(other); + } + + // move + Date(Date &&other) : + 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 "code/v2.0/gnds/Date/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Date + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Date/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Date/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Date/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Dates.hpp b/standards/incremental/code/src/code/v2.0/gnds/Dates.hpp new file mode 100644 index 000000000..eec4232d5 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Dates.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_DATES +#define CODE_V2_0_GNDS_DATES + +#include "code/v2.0/gnds/Date.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date \ + ) + + // default + Dates() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Dates( + const wrapper> + &date + ) : + GNDSTK_COMPONENT(BlockData{}), + date(this,date) + { + Component::finish(); + } + + // from node + explicit Dates(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Dates(const Dates &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date) + { + Component::finish(other); + } + + // move + Dates(Dates &&other) : + 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 "code/v2.0/gnds/Dates/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Dates + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Dates/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Dates/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Dates/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Documentation.hpp b/standards/incremental/code/src/code/v2.0/gnds/Documentation.hpp new file mode 100644 index 000000000..711e22705 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Documentation.hpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_DOCUMENTATION +#define CODE_V2_0_GNDS_DOCUMENTATION + +#include "code/v2.0/gnds/Authors.hpp" +#include "code/v2.0/gnds/Dates.hpp" +#include "code/v2.0/gnds/Title.hpp" +#include "code/v2.0/gnds/Body.hpp" +#include "code/v2.0/gnds/EndfCompatible.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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 GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(authors(),author); + GNDSTK_SHORTCUT(dates(),date); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->authors, \ + this->dates, \ + this->title, \ + this->body, \ + this->endfCompatible \ + ) + + // default + Documentation() : + 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 = {} + ) : + 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) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Documentation(const Documentation &other) : + 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) : + 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 "code/v2.0/gnds/Documentation/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Documentation + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Documentation/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Documentation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Documentation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Double.hpp b/standards/incremental/code/src/code/v2.0/gnds/Double.hpp new file mode 100644 index 000000000..098f3a4c3 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Double.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_DOUBLE +#define CODE_V2_0_GNDS_DOUBLE + +#include "code/v2.0/key.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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::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 GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit \ + ) + + // default + Double() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Double( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &unit = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Double(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Double(const Double &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + Double(Double &&other) : + 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 + Double &operator=(const Double &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + } + 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); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "code/v2.0/gnds/Double/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Double + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Double/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Double/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Double/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/EndfCompatible.hpp b/standards/incremental/code/src/code/v2.0/gnds/EndfCompatible.hpp new file mode 100644 index 000000000..f826bf149 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/EndfCompatible.hpp @@ -0,0 +1,162 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_ENDFCOMPATIBLE +#define CODE_V2_0_GNDS_ENDFCOMPATIBLE + +#include "code/v2.0/key.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// class EndfCompatible +// ----------------------------------------------------------------------------- + +class EndfCompatible : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "gnds"; } + 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 member names. Usually - but not necessarily - the same 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; + using BlockData::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + EndfCompatible() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit EndfCompatible(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit EndfCompatible(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + EndfCompatible(const EndfCompatible &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + EndfCompatible(EndfCompatible &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EndfCompatible &operator=(const EndfCompatible &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + EndfCompatible &operator=(EndfCompatible &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "code/v2.0/gnds/EndfCompatible/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class EndfCompatible + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/EndfCompatible/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/EndfCompatible/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/EndfCompatible/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Evaluated.hpp b/standards/incremental/code/src/code/v2.0/gnds/Evaluated.hpp new file mode 100644 index 000000000..74cec0c96 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Evaluated.hpp @@ -0,0 +1,249 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_EVALUATED +#define CODE_V2_0_GNDS_EVALUATED + +#include "code/v2.0/gnds/Documentation.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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") + ; + } + + // Data member names. Usually - but not necessarily - the same 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" + }; + 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" + }; + 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}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(documentation().authors(),author); + GNDSTK_SHORTCUT(documentation(),authors); + GNDSTK_SHORTCUT(documentation(),body); + GNDSTK_SHORTCUT(documentation(),dates); + GNDSTK_SHORTCUT(documentation(),endfCompatible); + GNDSTK_SHORTCUT(documentation(),title); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->date, \ + this->library, \ + this->version, \ + this->documentation \ + ) + + // default + Evaluated() : + 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 = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + label(this,label), + date(this,date), + library(this,library), + version(this,version), + documentation(this,documentation) + { + Component::finish(); + } + + // from node + explicit Evaluated(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Evaluated(const Evaluated &other) : + 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) + { + Component::finish(other); + } + + // move + Evaluated(Evaluated &&other) : + 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)) + { + 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; + } + 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); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "code/v2.0/gnds/Evaluated/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Evaluated + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Evaluated/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Evaluated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Evaluated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/PoPs.hpp b/standards/incremental/code/src/code/v2.0/gnds/PoPs.hpp new file mode 100644 index 000000000..0e26eda5d --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/PoPs.hpp @@ -0,0 +1,247 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_POPS +#define CODE_V2_0_GNDS_POPS + +#include "code/v2.0/gnds/Styles.hpp" +#include "code/v2.0/gnds/ChemicalElements.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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 + ("styles") | + --Child + ("chemicalElements") + ; + } + + // Data member names. Usually - but not necessarily - the same 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", + "styles", + "chemicalElements" + }; + 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", + "styles", + "chemical_elements" + }; + 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 + styles{this}; + Field + chemicalElements{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(chemicalElements(),chemicalElement); + GNDSTK_SHORTCUT(styles().evaluated(),documentation); + GNDSTK_SHORTCUT(styles(),evaluated); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->version, \ + this->format, \ + this->styles, \ + this->chemicalElements \ + ) + + // default + PoPs() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PoPs( + const wrapper + &name, + const wrapper + &version = {}, + const wrapper + &format = {}, + const wrapper + &styles = {}, + const wrapper + &chemicalElements = {} + ) : + GNDSTK_COMPONENT(BlockData{}), + name(this,name), + version(this,version), + format(this,format), + styles(this,styles), + chemicalElements(this,chemicalElements) + { + Component::finish(); + } + + // from node + explicit PoPs(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PoPs(const PoPs &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + version(this,other.version), + format(this,other.format), + styles(this,other.styles), + chemicalElements(this,other.chemicalElements) + { + Component::finish(other); + } + + // move + PoPs(PoPs &&other) : + 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)), + styles(this,std::move(other.styles)), + chemicalElements(this,std::move(other.chemicalElements)) + { + 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; + styles = other.styles; + chemicalElements = other.chemicalElements; + } + 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); + styles = std::move(other.styles); + chemicalElements = std::move(other.chemicalElements); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "code/v2.0/gnds/PoPs/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class PoPs + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/PoPs/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/PoPs/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/PoPs/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Styles.hpp b/standards/incremental/code/src/code/v2.0/gnds/Styles.hpp new file mode 100644 index 000000000..5a30dadbe --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Styles.hpp @@ -0,0 +1,189 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_STYLES +#define CODE_V2_0_GNDS_STYLES + +#include "code/v2.0/gnds/Evaluated.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// 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 "gnds"; } + 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") + ; + } + + // Data member names. Usually - but not necessarily - the same 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" + }; + 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" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + evaluated{this}; + + // shortcuts + #define GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + GNDSTK_SHORTCUT(evaluated().documentation(),authors); + GNDSTK_SHORTCUT(evaluated().documentation(),body); + GNDSTK_SHORTCUT(evaluated().documentation(),dates); + GNDSTK_SHORTCUT(evaluated(),documentation); + GNDSTK_SHORTCUT(evaluated().documentation(),endfCompatible); + GNDSTK_SHORTCUT(evaluated().documentation(),title); + #undef GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->evaluated \ + ) + + // default + Styles() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Styles( + const wrapper + &evaluated + ) : + GNDSTK_COMPONENT(BlockData{}), + evaluated(this,evaluated) + { + Component::finish(); + } + + // from node + explicit Styles(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Styles(const Styles &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + evaluated(this,other.evaluated) + { + Component::finish(other); + } + + // move + Styles(Styles &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + evaluated(this,std::move(other.evaluated)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Styles &operator=(const Styles &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + evaluated = other.evaluated; + } + 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); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "code/v2.0/gnds/Styles/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Styles + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Styles/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Styles/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Styles/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/gnds/Title.hpp b/standards/incremental/code/src/code/v2.0/gnds/Title.hpp new file mode 100644 index 000000000..5afae207f --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Title.hpp @@ -0,0 +1,162 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_GNDS_TITLE +#define CODE_V2_0_GNDS_TITLE + +#include "code/v2.0/key.hpp" + +namespace code { +namespace v2_0 { +namespace gnds { + +// ----------------------------------------------------------------------------- +// gnds:: +// class Title +// ----------------------------------------------------------------------------- + +class Title : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "gnds"; } + 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 member names. Usually - but not necessarily - the same 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; + using BlockData::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + Title() : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Title(const Node &node) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Title(const std::vector &vector) : + GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Title(const Title &other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Title(Title &&other) : + GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Title &operator=(const Title &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + Title &operator=(Title &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "code/v2.0/gnds/Title/src/custom.hpp" + #undef GNDSTK_COMPONENT +}; // class Title + +} // namespace gnds +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/code/src/code/v2.0/gnds/Title/src/custom.hpp b/standards/incremental/code/src/code/v2.0/gnds/Title/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/gnds/Title/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/standards/incremental/code/src/code/v2.0/key.hpp b/standards/incremental/code/src/code/v2.0/key.hpp new file mode 100644 index 000000000..a271d55e9 --- /dev/null +++ b/standards/incremental/code/src/code/v2.0/key.hpp @@ -0,0 +1,101 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef CODE_V2_0_KEY +#define CODE_V2_0_KEY + +// GNDStk Core Interface +#include "GNDStk.hpp" + +namespace code { +namespace v2_0 { + +using namespace njoy; +using namespace GNDStk; + + +// ----------------------------------------------------------------------------- +// meta:: +// ----------------------------------------------------------------------------- + +namespace meta { + +#define GNDSTK_MAKE_LOOKUP(nameField,nameGNDS) \ + inline const auto nameField = makeLookup( \ + #nameGNDS, \ + [](const auto &obj) -> decltype(obj.nameField()) \ + { return obj.nameField(); } \ + ) +// nameField vs. nameGNDS: for, e.g., Double vs. double in GNDS + +GNDSTK_MAKE_LOOKUP(Z,Z); +GNDSTK_MAKE_LOOKUP(date,date); +GNDSTK_MAKE_LOOKUP(dateType,dateType); +GNDSTK_MAKE_LOOKUP(electronNumber,electronNumber); +GNDSTK_MAKE_LOOKUP(format,format); +GNDSTK_MAKE_LOOKUP(label,label); +GNDSTK_MAKE_LOOKUP(library,library); +GNDSTK_MAKE_LOOKUP(name,name); +GNDSTK_MAKE_LOOKUP(subshell,subshell); +GNDSTK_MAKE_LOOKUP(symbol,symbol); +GNDSTK_MAKE_LOOKUP(unit,unit); +GNDSTK_MAKE_LOOKUP(value,value); +GNDSTK_MAKE_LOOKUP(version,version); + +#undef GNDSTK_MAKE_LOOKUP + +} // namespace meta + + +// ----------------------------------------------------------------------------- +// gnds::child:: +// ----------------------------------------------------------------------------- + +namespace gnds { +namespace child { + +inline const Child<> Double("double"); +inline const Child<> PoPs("PoPs"); +inline const Child<> atomic("atomic"); +inline const Child<> author("author"); +inline const Child<> authors("authors"); +inline const Child<> bindingEnergy("bindingEnergy"); +inline const Child<> body("body"); +inline const Child<> chemicalElement("chemicalElement"); +inline const Child<> chemicalElements("chemicalElements"); +inline const Child<> configuration("configuration"); +inline const Child<> configurations("configurations"); +inline const Child<> date("date"); +inline const Child<> dates("dates"); +inline const Child<> documentation("documentation"); +inline const Child<> endfCompatible("endfCompatible"); +inline const Child<> evaluated("evaluated"); +inline const Child<> styles("styles"); +inline const Child<> title("title"); + +} // namespace child +using namespace child; +} // namespace gnds + + +// ----------------------------------------------------------------------------- +// For convenience: using directives +// ----------------------------------------------------------------------------- + +namespace key { + using namespace meta; + using namespace gnds::child; +} // namespace key + +using namespace key; +using namespace gnds; + + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + +} // namespace v2_0 +} // namespace code + +#endif diff --git a/standards/incremental/example/.gitignore b/standards/incremental/example/.gitignore new file mode 100644 index 000000000..b9ad0b022 --- /dev/null +++ b/standards/incremental/example/.gitignore @@ -0,0 +1,10 @@ + +0 +m +pugixml.o +*.xml +*.out +out +h +notes +j diff --git a/standards/incremental/example/0.cpp b/standards/incremental/example/0.cpp new file mode 100644 index 000000000..c9bd20fd2 --- /dev/null +++ b/standards/incremental/example/0.cpp @@ -0,0 +1,94 @@ + +#include "code/v2.0.hpp" + +using namespace njoy::GNDStk; +using namespace code::v2_0; + +void print() +{ + std::cout << std::endl; +} + +template +void print(const T &value) +{ + std::cout << value << std::endl; +} + +// ----------------------------------------------------------------------------- +// main +// ----------------------------------------------------------------------------- + +int main(const int argc, const char *const *const argv) +{ + print(); + + // for printing + colors = true; + comments = false; + + // documentation: default construction + print("1"); + gnds::Documentation d; + print("2"); + + // usage + if (argc < 2) { + std::cout << "Usage: " << argv[0] << " file ..." << std::endl; + exit(EXIT_FAILURE); + } + + // speed test: read + for (int n = 1; n < argc; ++n) { + const std::string filename = argv[n]; + std::cout << "\nFile: \"" << filename << '"' << std::endl; + print(); + + gnds::PoPs pops; + pops.read(filename); + pops.print(); // Component's prettyprinting + //pops.write(); // Internal debug format :-/ + pops.xml(); + print(); + } + + /* + // speed test: construct from node + for (int n = 1; n < argc; ++n) { + const std::string filename = argv[n]; + std::cout << "\nFile: \"" << filename << '"' << std::endl; + + Node node; + node.read(filename); + for (int n = 0; n < 100000; ++n) + gnds::PoPs pops(node); + } + */ + + /* + // files + for (int n = 1; n < argc; ++n) { + const std::string filename = argv[n]; + std::cout << "\nFile: \"" << filename << '"' << std::endl; + + // The following doesn't do what we might intend. Rather, it calls + // PoPs' default constructor. Think about this...it could prove to + // be something that confuses users. + // gnds::PoPs p(filename); + // CORRECT WAY: + print("1"); + gnds::PoPs p; + print("2"); + + print(); + + print("read begin"); + p.read(filename); + print("read end"); + + print(); + p.print(); + print(); + } + */ +} diff --git a/standards/incremental/example/compile b/standards/incremental/example/compile new file mode 100755 index 000000000..0b490b893 --- /dev/null +++ b/standards/incremental/example/compile @@ -0,0 +1,32 @@ +#!/bin/bash + +COMPILE=" + clang++ -std=c++17 + -I../../../../GNDStk/src + -I../../../../GNDStk/standards/incremental/code/src + -I../../../../GNDStk/build/_deps/pugixml-adapter-src/src/src + -I../../../../GNDStk/build/_deps/hdf5-src/include + -I../../../../GNDStk/build/_deps/json-src/include + -I../../../../GNDStk/build/_deps/json-src/include/nlohmann + -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 " + +if [ ! -f "pugixml.o" ]; then +echo 'Compiling pugixml.cpp...' +$COMPILE \ + ../../../../GNDStk/build/_deps/pugixml-adapter-src/src/src/pugixml.cpp \ + -c -o pugixml.o +fi + +# Compile examples +echo 'Compiling...' +$COMPILE 0.cpp pugixml.o -o 0 + +# wait $(jobs -p) diff --git a/standards/incremental/incremental-classes.json b/standards/incremental/incremental-classes.json new file mode 100644 index 000000000..b6953333e --- /dev/null +++ b/standards/incremental/incremental-classes.json @@ -0,0 +1,239 @@ +{ + "namespace": "gnds", + + "PoPs": { + "metadata": { + "name": { + "required": true, + "type": "string" + }, + "version": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + }, + "children": { + "styles": { + "times": "1", + "required": true + }, + "chemicalElements": { + "times": "1", + "required": true + } + } + }, + + "styles": { + "children": { + "evaluated": { + "times": "1", + "required": true + } + } + }, + + "evaluated": { + "metadata": { + "label": { + "required": true, + "type": "string" + }, + "date": { + "required": true, + "type": "string" + }, + "library": { + "required": true, + "type": "string" + }, + "version": { + "required": true, + "type": "string" + } + }, + "children": { + "documentation": { + "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": true + } + } + }, + + "authors": { + "children": { + "author": { + "times": "1+", + "required": true + } + } + }, + + "author": { + "metadata": { + "name": { + "required": true, + "type": "string" + } + } + }, + + "dates": { + "children": { + "date": { + "times": "1+", + "required": true + } + } + }, + + "date": { + "metadata": { + "value": { + "required": true, + "remark": "type changes to (std::)string via changes.json...", + "type": "date" + }, + "dateType": { + "required": true, + "type": "dateType" + } + } + }, + + "title": { + "vector": "" + }, + + "body": { + "vector": "" + }, + + "endfCompatible": { + "vector": "" + }, + + "chemicalElements": { + "children": { + "chemicalElement": { + "times": "1+", + "required": true + } + } + }, + + "chemicalElement": { + "metadata": { + "symbol": { + "required": true, + "type": "string" + }, + "Z": { + "required": true, + "type": "int" + }, + "name": { + "required": true, + "type": "string" + } + }, + "children": { + "atomic": { + "times": "1", + "required": true + } + } + }, + + "atomic": { + "children": { + "configurations": { + "times": "1", + "required": true + } + } + }, + + "configurations": { + "children": { + "configuration": { + "times": "1+", + "required": true + } + } + }, + + "configuration": { + "metadata": { + "subshell": { + "required": true, + "type": "string" + }, + "electronNumber": { + "required": true, + "type": "string" + } + }, + "children": { + "bindingEnergy": { + "times": "1", + "required": true + } + } + }, + + "bindingEnergy": { + "children": { + "double": { + "times": "1", + "required": true + } + } + }, + + "double": { + "metadata": { + "label": { + "required": true, + "type": "string" + }, + "value": { + "required": true, + "type": "double" + }, + "unit": { + "required": true, + "type": "string" + } + } + } +} diff --git a/standards/incremental/incremental.json b/standards/incremental/incremental.json new file mode 100644 index 000000000..e13853128 --- /dev/null +++ b/standards/incremental/incremental.json @@ -0,0 +1,12 @@ +{ + "Path": ".", + "Project": "code", + "Version": "v2.0", + + "JSONDir": ".", + "JSONFiles": [ + "incremental-classes.json" + ], + + "Changes": "changes.json" +}