/* * ObservedMaximumAtomTrajectorySize.hpp * * Created on: Nov 10, 2025 * Author: heber */ #ifndef OBSERVEDMAXIMUMTRAJECTORYSIZE_HPP_ #define OBSERVEDMAXIMUMTRAJECTORYSIZE_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/Singleton.hpp" #include "CodePatterns/Observer/Observable.hpp" #include "CodePatterns/Observer/Observer.hpp" /** * Relays the updates from all (individual!) Atom::TrajectoryChanged * received through the AtomObserver, computes the maximum trajectory * size over all atoms from that and provides this as an observable * derived value. * * This can then be used inside an \a ObservedValue to pass on to * the Qt side of molecuilder. */ class ObservedMaximumAtomTrajectorySize : public Singleton, public Observable { public: //!> grant Singleton access to cstor and dstor. friend class Singleton< ObservedMaximumAtomTrajectorySize >; enum NotificationType { MaximumChanged, NotificationType_MAX // denotes the maximum of available notification types }; /** Dstor of ObservedMaximumAtomTrajectorySize. * */ virtual ~ObservedMaximumAtomTrajectorySize(); const int GetMaximumAtomTrajectorySize() const; // Observer functions void update(Observable *publisher); void subjectKilled(Observable *publisher); void recieveNotification(Observable *publisher, Notification_ptr notification); private: /** private cstor of ObservedMaximumAtomTrajectorySize due to singleton. */ ObservedMaximumAtomTrajectorySize(); private: //!> maximum size over all current atom trajectories int maximumAtomTrajectorySize; //!> whether we are signed on to AtomObserver bool atomObserver_signedOn; }; #endif /* OBSERVEDMAXIMUMTRAJECTORYSIZE_HPP_ */