| 1 |
// Copyright(C) 2022, 2023, 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_CodeTypes.h" |
| 10 |
#include <functional> |
| 11 |
#include <map> |
| 12 |
#include <string> |
| 13 |
|
| 14 |
#include "ioss_export.h" |
| 15 |
|
| 16 |
namespace Ioss { |
| 17 |
class Transform; |
| 18 |
|
| 19 |
class TransformFactory; |
| 20 |
|
| 21 |
using TransformFactoryMap = std::map<std::string, TransformFactory *, std::less<>>; |
| 22 |
|
| 23 |
class IOSS_EXPORT TransformFactory |
| 24 |
{ |
| 25 |
public: |
| 26 |
virtual ~TransformFactory() = default; |
| 27 |
IOSS_NODISCARD static Ioss::Transform *create(const std::string &type); |
| 28 |
|
| 29 |
static int describe(Ioss::NameList *names); |
| 30 |
IOSS_NODISCARD static Ioss::NameList describe(); |
| 31 |
|
| 32 |
protected: |
| 33 |
explicit TransformFactory(const std::string &type); |
| 34 |
virtual Ioss::Transform *make(const std::string &) const = 0; |
| 35 |
static void alias(const std::string &base, const std::string &syn); |
| 36 |
|
| 37 |
private: |
| 38 |
static TransformFactoryMap ®istry(); |
| 39 |
}; |
| 40 |
} // namespace Ioss |