Free Electron
datatoolAS.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_datatoolAS_h__
8 #define __datatool_datatoolAS_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /// possible attributes of a top level signal
16 class AsSignal
17  : public AccessorSet, public Initialize<AsSignal>
18 {
19  public:
20  void initialize(void)
21  {
22  add(winData, FE_USE("win:data"));
23  //add(appData, FE_USE("app:data"));
24  //add(simData, FE_USE("sim:data"));
25  add(event, FE_USE("evt:record"));
26  }
27  /// window data record
29  /// application data record
30  //Accessor<Record> appData;
31  /// simulation data record
32  //Accessor<Record> simData;
33  /// event record
35 };
36 
37 /// window data
38 class AsWindata
39  : public AccessorSet, public Initialize<AsWindata>
40 {
41  public:
42  void initialize(void)
43  {
44  add(windowI, FE_USE("win:component"));
45  add(drawI, FE_USE("win:draw"));
46  add(group, FE_USE("win:group"));
47  }
48  /// reference to window component
50  /// window DrawI component
52  /// groups for records associated with window
54 };
55 
56 /// Group Operator
58  : public AccessorSet, public Initialize<AsOperator>
59 {
60  public:
61  void initialize(void)
62  {
63  add(input, FE_USE("op:input"));
64  add(output, FE_USE("op:output"));
65  }
66  /// input group
68  /// output group
70 };
71 
72 /// Time-based Operator
74  : public AccessorSet, public Initialize<AsTemporal>
75 {
76  public:
77  void initialize(void)
78  {
79  add(time, FE_USE("sim:time"));
80  add(timestep, FE_USE("sim:timestep"));
81  }
82  /// input group
84  /// output group
86 };
87 
88 /// Signal to Initialize
89 class AsInit
90  : public AccessorSet, public Initialize<AsInit>
91 {
92  public:
93  void initialize(void)
94  {
95  add(is, FE_USE("app:init"));
96  }
97  ///
98  Accessor<void> is;
99 };
100 
101 /// Pair of records
102 class AsPair
103  : public AccessorSet, public Initialize<AsPair>
104 {
105  public:
106  AsPair(void){}
107  void initialize(void)
108  {
109  add(left, FE_USE("pair:left"));
110  add(right, FE_USE("pair:right"));
111  }
112  /// One record in a pair of records
114  /// One record in a pair of records
116 };
117 
118 class AsProximity
119  : public AccessorSet, public Initialize<AsProximity>
120 {
121  public:
122  AsProximity(void){}
123  void initialize(void)
124  {
125  // these are different than for pair since they are not weak
126  add(left, FE_USE("prox:left"));
127  add(right, FE_USE("prox:right"));
128  }
130  Accessor<WeakRecord> right;
131 };
132 
133 /// Named Records
134 class AsNamed
135  : public AccessorSet, public Initialize<AsNamed>
136 {
137  public:
138  AsNamed(void){}
139  void initialize(void)
140  {
141  add(name, FE_USE("name"));
142  }
143  /// string name
145 
146  void filterMap(std::map<String, Record> &a_records, sp<RecordGroup> rg_input)
147  {
148  for (RecordGroup::iterator i_in = rg_input->begin();
149  i_in != rg_input->end(); i_in++)
150  {
151  bind((*i_in)->layout()->scope());
152  if (check(*i_in))
153  {
154  for (int i = (*i_in)->length() - 1; i >= 0; i--)
155  {
156  Record r = (*i_in)->getRecord(i);
157  a_records[name(r)] = r;
158  }
159  }
160  }
161  }
162 };
163 
164 class AsGroup
165  : public AccessorSet, public Initialize<AsGroup>
166 {
167  public:
168  AsGroup(void){}
169  void initialize(void)
170  {
171  add(group, FE_USE("group"));
172  }
173  /// record group
175 };
176 
177 
178 
179 } /* namespace ext */
180 } /* namespace fe */
181 
182 #endif /* __datatool_datatoolAS_h__ */
183 
window data
Definition: datatoolAS.h:38
Set of accessors.
Definition: AccessorSet.h:18
Accessor< WeakRecord > right
One record in a pair of records.
Definition: datatoolAS.h:115
Accessor< sp< Component > > windowI
reference to window component
Definition: datatoolAS.h:49
Accessor< Real > time
input group
Definition: datatoolAS.h:83
possible attributes of a top level signal
Definition: datatoolAS.h:16
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
The main data access class for the data system.
Definition: Accessor.h:128
Group Operator.
Definition: datatoolAS.h:57
Accessor< sp< RecordGroup > > output
output group
Definition: datatoolAS.h:69
Accessor< WeakRecord > left
One record in a pair of records.
Definition: datatoolAS.h:113
Accessor< sp< Component > > drawI
window DrawI component
Definition: datatoolAS.h:51
Accessor< Real > timestep
output group
Definition: datatoolAS.h:85
Pair of records.
Definition: datatoolAS.h:102
Named Records.
Definition: datatoolAS.h:134
Accessor< Record > winData
window data record
Definition: datatoolAS.h:28
Time-based Operator.
Definition: datatoolAS.h:73
STL style iterator.
Definition: RecordGroup.h:124
Accessor< Record > event
application data record
Definition: datatoolAS.h:34
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Accessor< String > name
string name
Definition: datatoolAS.h:144
const String & name(void) const
Return the components chosen name.
Definition: Component.h:77
Accessor< sp< RecordGroup > > group
groups for records associated with window
Definition: datatoolAS.h:53
Accessor< sp< RecordGroup > > input
input group
Definition: datatoolAS.h:67
Signal to Initialize.
Definition: datatoolAS.h:89