IAP GITLAB

Skip to content
Snippets Groups Projects
Interface.dummy.cc 1.83 KiB
Newer Older
Ralf M Ulrich's avatar
Ralf M Ulrich committed
/*
 * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
 *
 * See file AUTHORS for a list of contributors.
 *
 * This software is distributed under the terms of the GNU General Public
 * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
 * the license.
 */

ralfulrich's avatar
ralfulrich committed
#include <stdexcept>
Ralf M Ulrich's avatar
Ralf M Ulrich committed
#include <string>
ralfulrich's avatar
ralfulrich committed

namespace corsika_data {

Ralf M Ulrich's avatar
Ralf M Ulrich committed
  void CorDataOpenFile(const std::string&) {
ralfulrich's avatar
ralfulrich committed
    throw std::runtime_error("CorDataOpenFile: Cannot read compressed data files with dummy library.");
Ralf M Ulrich's avatar
Ralf M Ulrich committed
  }
  void CorDataFillArray(double*, const int&) {
ralfulrich's avatar
ralfulrich committed
    throw std::runtime_error("CorDataFillArray: Cannot read compressed data files with dummy library.");
Ralf M Ulrich's avatar
Ralf M Ulrich committed
  }
  void CorDataCloseFile() {
ralfulrich's avatar
ralfulrich committed
    throw std::runtime_error("CorDataCloseFile: Cannot read compressed data files with dummy library.");
Ralf M Ulrich's avatar
Ralf M Ulrich committed
  }
  double CorDataNextNumber() {
ralfulrich's avatar
ralfulrich committed
    throw std::runtime_error("CorDataNextNumber: Cannot read compressed data files with dummy library.");
Ralf M Ulrich's avatar
Ralf M Ulrich committed
    return 0;
  }
Ralf M Ulrich's avatar
Ralf M Ulrich committed
  void CorDataNextText(std::string&) {
ralfulrich's avatar
ralfulrich committed
    throw std::runtime_error("CorDataNextText(string&): Cannot read compressed data files with dummy library.");
Ralf M Ulrich's avatar
Ralf M Ulrich committed
  }
  void CorDataNextText(char*, int) {
ralfulrich's avatar
ralfulrich committed
    throw std::runtime_error("CorDataNextText(char*): Cannot read compressed data files with dummy library.");
Ralf M Ulrich's avatar
Ralf M Ulrich committed
  }
ralfulrich's avatar
ralfulrich committed
  bool CorDataCanDeCompress() { return false; }

  // the fortran interface functions
  extern "C" {
ralfulrich's avatar
ralfulrich committed
  void cordataopenfile_(const char* name) { CorDataOpenFile(name); }
  void cordatafillarray_(double* data, const int& length) {
    CorDataFillArray(data, length);
  }
  void cordataclosefile_() { CorDataCloseFile(); }
  double cordatanextnumber_() { return CorDataNextNumber(); }
  void cordatanexttext_(char*, int) {
ralfulrich's avatar
ralfulrich committed
    throw std::runtime_error("cordatanexttext_: Cannot read compressed data files with dummy library.");
ralfulrich's avatar
ralfulrich committed
  }
  int cordatacandecompress_() { return 0; }
Ralf M Ulrich's avatar
Ralf M Ulrich committed
  }
} // namespace corsika_data