IOSS 2.0
Loading...
Searching...
No Matches
Ioss_IOFactory.h
Go to the documentation of this file.
1// Copyright(C) 1999-, 20242024 National Technology & Engineering Solutions
2// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3// NTESS, the U.S. Government retains certain rights in this software.
4//
5// See packages/seacas/LICENSE for details
6
7#pragma once
8
9#include "ioss_export.h"
10
11#include "Ioss_CodeTypes.h"
12#include <string>
13
14#include "Ioss_DBUsage.h"
15#include "Ioss_ParallelUtils.h"
17
18#include <map>
19#include <vector>
20
21/** \brief The main namespace for the Ioss library.
22 */
23namespace Ioss {
24
25 class IOFactory;
26
28 using IOFactoryMap = std::map<std::string, IOFactory *, std::less<>>;
29
30 class DatabaseIO;
31
32 /** \brief The main public user interface for creating Ioss::DatabaseIO objects.
33 */
34 class IOSS_EXPORT IOFactory
35 {
36 public:
37 virtual ~IOFactory() = default;
39 create(const std::string &type, const std::string &filename, DatabaseUsage db_usage,
41 const Ioss::PropertyManager &properties = Ioss::PropertyManager());
42
43 static int describe(NameList *names);
44 IOSS_NODISCARD static NameList describe();
45 static void clean();
46 IOSS_NODISCARD static std::string show_configuration();
47
48 protected:
49 explicit IOFactory(const std::string &type);
50
51 IOSS_NODISCARD virtual DatabaseIO *make_IO(const std::string &filename, DatabaseUsage db_usage,
52 Ioss_MPI_Comm communicator,
53 const Ioss::PropertyManager &properties) const = 0;
54
55 IOSS_NODISCARD virtual std::string show_config() const { return {""}; }
56
57 static void alias(const std::string &base, const std::string &syn);
58
59 private:
60 IOSS_NODISCARD static IOFactoryMap *registry();
61 };
62} // namespace Ioss
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:55
int Ioss_MPI_Comm
Definition Ioss_CodeTypes.h:64
An input or output Database.
Definition Ioss_DatabaseIO.h:63
The main public user interface for creating Ioss::DatabaseIO objects.
Definition Ioss_IOFactory.h:35
virtual ~IOFactory()=default
virtual IOSS_NODISCARD std::string show_config() const
Definition Ioss_IOFactory.h:55
virtual IOSS_NODISCARD DatabaseIO * make_IO(const std::string &filename, DatabaseUsage db_usage, Ioss_MPI_Comm communicator, const Ioss::PropertyManager &properties) const =0
static IOSS_NODISCARD constexpr Ioss_MPI_Comm comm_world()
Definition Ioss_ParallelUtils.h:48
A collection of Ioss::Property objects.
Definition Ioss_PropertyManager.h:36
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40
Ioss::NameList NameList
Definition Ioss_ChangeSetFactory.h:25
DatabaseUsage
Specifies how an Ioss::DatabaseIO object will be used.
Definition Ioss_DBUsage.h:13
std::map< std::string, IOFactory *, std::less<> > IOFactoryMap
Definition Ioss_IOFactory.h:28