bng_converter.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2020-2021 by
  4. * The Salk Institute for Biological Studies
  5. *
  6. * Use of this source code is governed by an MIT-style
  7. * license that can be found in the LICENSE file or at
  8. * https://opensource.org/licenses/MIT.
  9. *
  10. ******************************************************************************/
  11. #ifndef LIBMCELL_API_BNG_CONVERTER_H_
  12. #define LIBMCELL_API_BNG_CONVERTER_H_
  13. #include <string>
  14. #include "bng/bng_defines.h"
  15. namespace BNG {
  16. class BNGData;
  17. class BNGConfig;
  18. class Component;
  19. class ElemMol;
  20. class Cplx;
  21. }
  22. namespace MCell {
  23. namespace API {
  24. class ComponentType;
  25. class Component;
  26. class ElementaryMoleculeType;
  27. class ElementaryMolecule;
  28. class Complex;
  29. class BNGConverter {
  30. public:
  31. BNGConverter(BNG::BNGData& bng_data_, const BNG::BNGConfig& bng_config_) :
  32. bng_data(bng_data_), bng_config(bng_config_) {
  33. }
  34. BNG::component_type_id_t convert_component_type(
  35. const std::string& elem_mol_type_name, API::ComponentType& api_ct);
  36. BNG::Component convert_component_instance(
  37. const std::string& elem_mol_type_name, API::Component& api_ci);
  38. BNG::elem_mol_type_id_t convert_elementary_molecule_type(
  39. API::ElementaryMoleculeType& mt, const bool in_rxn_or_observables = false);
  40. BNG::ElemMol convert_molecule_instance(
  41. API::ElementaryMolecule& mi, const bool in_rxn_or_observables = false);
  42. // in_observables should be set to true if we are converting a pattern for
  43. // matching purposes
  44. BNG::Cplx convert_complex(
  45. API::Complex& inst, const bool in_observables = false, const bool in_rxn = false);
  46. private:
  47. BNG::BNGData& bng_data;
  48. const BNG::BNGConfig& bng_config;
  49. };
  50. } // namespace API
  51. } // namespace MCell
  52. #endif /* LIBMCELL_API_BNG_CONVERTER_H_ */