<
    Kitware and KbPort announce the launch of SimPulse
×
SEDataRequested.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 
6 #include "cdm/PhysiologyEngine.h"
7 #include "cdm/engine/SEEventManager.h"
8 
9 class CDM_DECL SEDataRequested : public LoggerForward, public SEEventHandler
10 {
11  friend class PBEngine;//friend the serialization class
12 public:
13  explicit SEDataRequested();
14  virtual ~SEDataRequested();
15 
16  SEDataRequested(const SEDataRequested&) = delete;
17  SEDataRequested operator=(const SEDataRequested&) = delete;
18 
19  virtual void SetEngine(const PhysiologyEngine& engine);
20 
21  virtual void Clear(); //clear memory
22 
23  bool SerializeToString(std::string& output, eSerializationFormat m) const;
24  static bool SerializeToString(const std::vector<SEDataRequested*>& src, std::string& dst, eSerializationFormat m);
25 
26  virtual int GetID() const;
27  virtual void SetID(int id);
28 
29  virtual bool IsActive() const;// Set when an Error or Fatal has been loggged
30  virtual void SetIsActive(bool b);
31 
32  virtual void PullDataRequested();
33  virtual void ClearDataRequested();
34 
35  virtual const std::vector<double>& GetValues() const;
36 
37  virtual bool KeepLogMessages() const { return m_KeepLogMessages; }
38  virtual void KeepLogMessages(bool b) { m_KeepLogMessages = b; }
39  virtual const std::vector<SEEventChange>& GetEventChanges() const;
40  virtual const LogMessages& GetLogMessages() const;
41  virtual void ForwardDebug(const std::string& msg, const std::string& origin);
42  virtual void ForwardInfo(const std::string& msg, const std::string& origin);
43  virtual void ForwardWarning(const std::string& msg, const std::string& origin);
44  virtual void ForwardError(const std::string& msg, const std::string& origin);
45  virtual void ForwardFatal(const std::string& msg, const std::string& origin);
46 
47  virtual bool KeepEventChanges() const { return m_KeepEventChanges; }
48  virtual void KeepEventChanges(bool b) { m_KeepEventChanges = b; }
49  void HandleEvent(eEvent type, bool active, const SEScalarTime* time = nullptr);
50 
51 protected:
52  int m_ID;
53  bool m_IsActive;
54  std::vector<double> m_Values;
56  std::vector<SEEventChange> m_EventChanges;
60 };
bool m_KeepEventChanges
Definition: SEDataRequested.h:55
Definition: Logger.h:132
static bool SerializeToString(const LogMessages &src, std::string &output, eSerializationFormat m, Logger *logger)
Definition: PBEngine.cpp:154
virtual void ForwardFatal(std::string const &, std::string const &)
Definition: Logger.h:63
int m_ID
Definition: SEDataRequested.h:52
virtual void KeepEventChanges(bool b)
Definition: SEDataRequested.h:48
virtual void ForwardWarning(std::string const &, std::string const &)
Definition: Logger.h:61
Definition: SEEventManager.h:64
std::vector< double > m_Values
Definition: SEDataRequested.h:54
Definition: SEDataRequested.h:9
LogMessages m_LogMessages
Definition: SEDataRequested.h:58
virtual bool KeepEventChanges() const
Definition: SEDataRequested.h:47
Definition: PBEngine.h:28
Definition: PhysiologyEngine.h:56
bool m_IsActive
Definition: SEDataRequested.h:53
virtual void ForwardDebug(std::string const &, std::string const &)
Definition: Logger.h:59
bool m_KeepLogMessages
Definition: SEDataRequested.h:57
Definition: Logger.h:56
virtual void ForwardError(std::string const &, std::string const &)
Definition: Logger.h:62
virtual void ForwardInfo(std::string const &, std::string const &)
Definition: Logger.h:60
Definition: SEScalarTime.h:27
std::vector< SEEventChange > m_EventChanges
Definition: SEDataRequested.h:56
virtual void HandleEvent(eEvent e, bool active, const SEScalarTime *simTime=nullptr)=0
const PhysiologyEngine * m_Engine
Definition: SEDataRequested.h:59
virtual void KeepLogMessages(bool b)
Definition: SEDataRequested.h:38
virtual bool KeepLogMessages() const
Definition: SEDataRequested.h:37

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.