FV3 Bundle
IodaIOfactory.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017 UCAR
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #ifndef FILEIO_IODAIOFACTORY_H_
9 #define FILEIO_IODAIOFACTORY_H_
10 
11 #include <string>
12 
13 #include "fileio/IodaIO.h"
14 
15 namespace ioda {
16 
17 /*!
18  * \brief Factory class to instantiate objects of IodaIO subclasses.
19  *
20  * \details This class provides two Create methods. The Create method with two arguements
21  * Is intended for use when opening a file in read mode. The Create method with
22  * six arguments is intended for use when opening a file in write mode.
23  *
24  * Currently, the subclass from which to instantiate an object from is chosen
25  * based on the suffix in the file name. ".nc4" and ".nc" are recognized as
26  * netcdf files, and .odb is recognized as an ODB file. This isn't necessarily
27  * the best way to identify the file format, so this should be revisited in
28  * the future.
29  *
30  * \author Stephen Herbener (JCSDA)
31  */
32 
34  public:
37 
38  // Factory methods
39  static ioda::IodaIO* Create(const std::string & FileName, const std::string & FileMode);
40  static ioda::IodaIO* Create(const std::string & FileName, const std::string & FileMode,
41  const std::size_t & Nlocs, const std::size_t & Nobs,
42  const std::size_t & Nrecs, const std::size_t & Nvars);
43 };
44 
45 } // namespace ioda
46 
47 #endif // FILEIO_IODAIOFACTORY_H_
File access class for IODA.
Factory class to instantiate objects of IodaIO subclasses.
Definition: IodaIOfactory.h:33
static ioda::IodaIO * Create(const std::string &FileName, const std::string &FileMode)
Instantiate a IodaIO object in read mode.