Exemplo n.º 1
0
    // throws RMF::IOException if couldn't create file or unsupported file
    // format
    SharedData* create_shared_data(std::string path, bool create) {
      SharedData *ret;
      if (cache.find(path) != cache.end()) {
        return cache.find(path)->second;
      }
      if (boost::algorithm::ends_with(path, ".rmf")) {
        HDF5Group g;
        if (create) {
          g= create_hdf5_file(path);
        } else {
          g= open_hdf5_file(path);
        }
        ret= new HDF5SharedData(g, create);
#ifdef RMF_USE_PROTOBUF
      } else if (boost::algorithm::ends_with(path, ".prmf")) {
        ret= new ProtoBufSharedData(path, create);
#endif
      } else {
        IMP_RMF_THROW("Don't know how to open file", IOException);
      }
      cache[path]=ret;
      reverse_cache[ret]=path;
      return ret;
    }
Exemplo n.º 2
0
void open_hdf5_file_(int *iun, char *filename)
{
  /* This is just an Fortran interface to the "open_hdf5_file" function. */
     open_hdf5_file(iun, filename);
}