18#include "ioss_export.h"
35 std::string
name()
const {
return m_modelName; }
37 const std::vector<std::shared_ptr<DynamicTopologyObserver>> &
get_observers()
const
42 std::vector<std::shared_ptr<DynamicTopologyObserver>> &
get_observers() {
return m_observers; }
44 void register_observer(std::shared_ptr<DynamicTopologyObserver> observer);
46 void unregister_observer(std::shared_ptr<DynamicTopologyObserver> observer);
48 void reset_topology_modification();
50 void set_topology_modification(
unsigned int type);
56 for (
const std::shared_ptr<DynamicTopologyObserver> &observer : m_observers) {
57 if (
dynamic_cast<const ObserverType *
>(observer.get()) !=
nullptr) {
65 template <
typename ObserverType>
68 std::vector<std::shared_ptr<ObserverType>> typed_observers;
70 for (
const std::shared_ptr<DynamicTopologyObserver> &observer : m_observers) {
71 ObserverType *typed_observer =
dynamic_cast<ObserverType *
>(observer.get());
72 if (typed_observer !=
nullptr) {
73 typed_observers.push_back(std::dynamic_pointer_cast<ObserverType>(observer));
77 return typed_observers;
82 std::vector<std::shared_ptr<DynamicTopologyObserver>>
m_observers;
Definition Ioss_DynamicTopologyNotifier.h:29
std::vector< std::shared_ptr< DynamicTopologyObserver > > m_observers
Definition Ioss_DynamicTopologyNotifier.h:82
const std::string m_modelName
Definition Ioss_DynamicTopologyNotifier.h:81
std::vector< std::shared_ptr< ObserverType > > get_observer_type() const
Definition Ioss_DynamicTopologyNotifier.h:66
std::string name() const
Definition Ioss_DynamicTopologyNotifier.h:35
DynamicTopologyNotifier(const std::string &model_name)
Definition Ioss_DynamicTopologyNotifier.h:31
std::vector< std::shared_ptr< DynamicTopologyObserver > > & get_observers()
Definition Ioss_DynamicTopologyNotifier.h:42
bool has_observer_type() const
Definition Ioss_DynamicTopologyNotifier.h:52
const std::vector< std::shared_ptr< DynamicTopologyObserver > > & get_observers() const
Definition Ioss_DynamicTopologyNotifier.h:37
virtual ~DynamicTopologyNotifier()=default
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40