| 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_DynamicTopology.h" |
| 10 |
#include "Ioss_DynamicTopologyNotifier.h" |
| 11 |
#include "Ioss_DynamicTopologyObserver.h" |
| 12 |
|
| 13 |
#include "Ioss_CodeTypes.h" |
| 14 |
#include "Ioss_DBUsage.h" |
| 15 |
#include "Ioss_DatabaseIO.h" // for DatabaseIO |
| 16 |
#include "Ioss_ParallelUtils.h" // for ParallelUtils |
| 17 |
#include "Ioss_PropertyManager.h" // for PropertyManager |
| 18 |
#include "Ioss_Utils.h" |
| 19 |
#include "ioss_export.h" |
| 20 |
|
| 21 |
#include <cstddef> // for size_t, nullptr |
| 22 |
#include <cstdint> // for int64_t |
| 23 |
#include <iomanip> |
| 24 |
#include <sstream> |
| 25 |
#include <string> // for string, operator< |
| 26 |
|
| 27 |
namespace Ioss { |
| 28 |
class Region; |
| 29 |
|
| 30 |
class IOSS_EXPORT DynamicTopologyBroker |
| 31 |
{ |
| 32 |
public: |
| 33 |
static DynamicTopologyBroker *broker(); |
| 34 |
|
| 35 |
void register_model(const std::string &model_name); |
| 36 |
void remove_model(const std::string &model_name); |
| 37 |
void clear_models(); |
| 38 |
|
| 39 |
std::shared_ptr<DynamicTopologyNotifier> get_notifier(const std::string &model_name) const; |
| 40 |
std::vector<std::shared_ptr<DynamicTopologyObserver>> |
| 41 |
get_observers(const std::string &model_name) const; |
| 42 |
|
| 43 |
void register_observer(const std::string &model_name, |
| 44 |
std::shared_ptr<DynamicTopologyObserver> observer); |
| 45 |
void register_observer(const std::string &model_name, |
| 46 |
std::shared_ptr<DynamicTopologyObserver> observer, Region ®ion); |
| 47 |
|
| 48 |
void reset_topology_modification(const std::string &model_name); |
| 49 |
void set_topology_modification(const std::string &model_name, unsigned int type); |
| 50 |
|
| 51 |
private: |
| 52 |
DynamicTopologyBroker() = default; |
| 53 |
DynamicTopologyBroker(DynamicTopologyBroker &) = delete; |
| 54 |
|
| 55 |
std::map<std::string, std::shared_ptr<DynamicTopologyNotifier>> m_notifiers; |
| 56 |
}; |
| 57 |
|
| 58 |
} // namespace Ioss |