| 1 |
// Copyright(C) 2024 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 <map> |
| 13 |
#include <memory> |
| 14 |
#include <string> |
| 15 |
#include <vector> |
| 16 |
|
| 17 |
/** \brief The main namespace for the Ioss library. |
| 18 |
*/ |
| 19 |
namespace Ioss { |
| 20 |
|
| 21 |
class Region; |
| 22 |
class DatabaseIO; |
| 23 |
class ChangeSet; |
| 24 |
class ChangeSetFactory; |
| 25 |
using NameList = Ioss::NameList; |
| 26 |
using ChangeSetFactoryMap = std::map<std::string, ChangeSetFactory *, std::less<>>; |
| 27 |
|
| 28 |
/** \brief The main public user interface for creating Ioss::ChangeSet objects. |
| 29 |
*/ |
| 30 |
class IOSS_EXPORT ChangeSetFactory |
| 31 |
{ |
| 32 |
public: |
| 33 |
virtual ~ChangeSetFactory() = default; |
| 34 |
IOSS_NODISCARD static std::shared_ptr<ChangeSet> create(Ioss::Region *region); |
| 35 |
IOSS_NODISCARD static std::shared_ptr<ChangeSet> create(Ioss::DatabaseIO *db, |
| 36 |
const std::string &dbName, |
| 37 |
const std::string &dbType, |
| 38 |
unsigned fileCyclicCount = 0); |
| 39 |
|
| 40 |
static int describe(NameList *names); |
| 41 |
IOSS_NODISCARD static NameList describe(); |
| 42 |
|
| 43 |
static const ChangeSetFactory *factory(); |
| 44 |
|
| 45 |
protected: |
| 46 |
explicit ChangeSetFactory(const std::string &type); |
| 47 |
|
| 48 |
IOSS_NODISCARD virtual ChangeSet *make_ChangeSet(Ioss::Region *region) const; |
| 49 |
IOSS_NODISCARD virtual ChangeSet *make_ChangeSet(Ioss::DatabaseIO *db, |
| 50 |
const std::string &dbName, |
| 51 |
const std::string &dbType, |
| 52 |
unsigned fileCyclicCount) const; |
| 53 |
|
| 54 |
static void alias(const std::string &base, const std::string &syn); |
| 55 |
|
| 56 |
private: |
| 57 |
IOSS_NODISCARD static ChangeSetFactoryMap *registry(); |
| 58 |
}; |
| 59 |
|
| 60 |
} // namespace Ioss |