Free Electron
RecordRecorder.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __datatool_RecordRecorder_h__
8 #define __datatool_RecordRecorder_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Saves Record's op:input for every handle call that time advances
17 
18  @ingroup datatool
19 
20  As RecorderI, the pathname is the directory name and the integer limit
21  sets the number of cycled files.
22  The scalar for findNameFor() indicates the desired time to find a file for.
23 *//***************************************************************************/
24 class FE_DL_EXPORT RecordRecorder: virtual public HandlerI,
25  virtual public RecorderI
26 {
27  public:
28  RecordRecorder(void):
29  m_basename("test/trace"),
30  m_index(0),
31  m_ringSize(20)
32  { m_timeStamp.resize(m_ringSize); }
33 
34  //* as HandlerI
35 virtual void handle(Record &record);
36 
37  //* as RecorderI
38 virtual void configure(String pathname,U32 limit);
39 virtual String findNameFor(Real scalar);
40 
41  private:
42  String m_basename;
43  U32 m_index;
44  U32 m_ringSize;
45  Array<Real> m_timeStamp;
46 
47  AsOperator m_asOperator;
48  AsTemporal m_asTemporal;
49  Accessor< sp<Component> > m_aRecordRecorder;
50 };
51 
52 inline void RecordRecorder::configure(String pathname,U32 limit)
53 {
54  m_basename=pathname;
55  m_ringSize=limit;
56  m_timeStamp.resize(m_ringSize);
57 }
58 
59 } /* namespace ext */
60 } /* namespace fe */
61 
62 #endif /* __datatool_RecordRecorder_h__ */
kernel
Definition: namespace.dox:3
The main data access class for the data system.
Definition: Accessor.h:128
void resize(U32 size, char c=' ')
Add or remove characters to set the string length.
Definition: String.cc:590
Storage of incremental state to a resource, like a file.
Definition: RecorderI.h:20
Group Operator.
Definition: datatoolAS.h:57
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
Automatically reference-counted string container.
Definition: String.h:128
Time-based Operator.
Definition: datatoolAS.h:73
Saves Record&#39;s op:input for every handle call that time advances.
Definition: RecordRecorder.h:24
Reference to an instance of a Layout.
Definition: RecordSB.h:35