AGX Dynamics  2.37.2.0
StatisticsTrack.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGX_STATISTICSTRACK_H
18 #define AGX_STATISTICSTRACK_H
19 
20 #include <agx/Statistics.h>
21 #include <agx/Clock.h>
22 #include <agxData/FrameIO.h>
23 
24 namespace agxSDK
25 {
27 }
28 
29 namespace agx
30 {
32  {
33  public:
34  StatisticsFrameReader(agxSDK::Simulation *simulation, Clock *clock, Statistics *statistics = Statistics::instance());
35 
36 
37  virtual agxData::Frame *readFrame() override;
38 
39  protected:
40  virtual ~StatisticsFrameReader();
41 
42  private:
43  class DataBinding : public agxData::Frame::DataBinding
44  {
45  public:
46  DataBinding(const agx::Path& internalPath, const agx::Path& externalPath, Statistics::AbstractData *data = nullptr);
47 
48  Statistics::AbstractData *getData();
49  void setData(Statistics::AbstractData *data);
50 
51  protected:
52  virtual ~DataBinding();
53 
54  private:
56  };
57 
58  virtual agxData::Frame::DataBinding *createDataBinding(const agx::Path& internalPath, const agx::Path& externalPath) override;
59  void updateCallback(Clock *clock);
60 
61  private:
62  agxSDK::SimulationRef m_simulation;
63  ClockRef m_clock;
64  Statistics *m_statistics;
65  TaskRef m_updateTask;
66  mutable agx::Block m_clockBlock;
67  mutable agx::Block m_readerBlock;
68  Clock::TickEvent::CallbackType m_updateCallback;
69  };
70 
71 }
72 
73 
74 #endif /* AGX_STATISTICSTRACK_H */
Representation of a path, a list of name components.
Definition: Path.h:32
Base statistics gathering class.
Definition: Statistics.h:98
The FrameReader reads frames from an external source.
Definition: FrameIO.h:126
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Block synchronization primitive.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Templated callback with one argument.
Definition: Callback.h:100
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
Clock class keeps representation of virtual/simulated time.
Definition: Clock.h:37
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30