Free Electron
MyView.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 /* generated by mkview.py */
8 
9 #ifndef __MyView_h__
10 #define __MyView_h__
11 
12 #include "datatool/datatool.h"
13 
14 namespace fe
15 {
16 namespace ext
17 {
18 
19 /// test view specification
20 class AccessView : public View
21 {
22  public:
23  AccessView(sp<Scope> spScope)
24  {
25  m_a_MyF32.setup(spScope, "MyF32");
26  m_accessors.push_back(m_a_MyF32);
27  m_a_blat.setup(spScope, "blat");
28  m_accessors.push_back(m_a_blat);
29  }
30  /// test accesor
31  /// test accesor
32  F32 &MyF32(void)
33  {
34  if(!m_record.isValid())
35  {
36  feX("invalid record");
37  }
38  return m_a_MyF32(m_record);
39  }
40  /// test accesor
41  /// test accesor
42  F32 &MyF32(Record &a_record)
43  {
44  if(!a_record.isValid())
45  {
46  feX("invalid record");
47  }
48  return m_a_MyF32(a_record);
49  }
50  /// another
51  int &blat(void)
52  {
53  if(!m_record.isValid())
54  {
55  feX("invalid record");
56  }
57  return m_a_blat(m_record);
58  }
59  /// another
60  int &blat(Record &a_record)
61  {
62  if(!a_record.isValid())
63  {
64  feX("invalid record");
65  }
66  return m_a_blat(a_record);
67  }
68  private:
69  Accessor<F32> m_a_MyF32;
70  Accessor<int> m_a_blat;
71 };
72 
73 class thingView : public View
74 {
75  public:
76  thingView(sp<Scope> spScope)
77  {
78  m_a_blob.setup(spScope, "blob");
79  m_accessors.push_back(m_a_blob);
80  }
81  int &blob(void)
82  {
83  if(!m_record.isValid())
84  {
85  feX("invalid record");
86  }
87  return m_a_blob(m_record);
88  }
89  int &blob(Record &a_record)
90  {
91  if(!a_record.isValid())
92  {
93  feX("invalid record");
94  }
95  return m_a_blob(a_record);
96  }
97  private:
98  Accessor<int> m_a_blob;
99 };
100 
101 class appdataView : public View
102 {
103  public:
104  static const int ms_run = 1;
105  static const int ms_pause = 2;
106  appdataView(sp<Scope> spScope)
107  {
108  m_a_runlevel.setup(spScope, "runlevel");
109  m_accessors.push_back(m_a_runlevel);
110  }
111  int &runlevel(void)
112  {
113  if(!m_record.isValid())
114  {
115  feX("invalid record");
116  }
117  return m_a_runlevel(m_record);
118  }
119  int &runlevel(Record &a_record)
120  {
121  if(!a_record.isValid())
122  {
123  feX("invalid record");
124  }
125  return m_a_runlevel(a_record);
126  }
127  private:
128  Accessor<int> m_a_runlevel;
129 };
130 
131 #if FALSE
132 class particleView : public View
133 {
134  public:
135  particleView(sp<Scope> spScope)
136  {
137  m_a_mass.setup(spScope, "mass");
138  m_accessors.push_back(m_a_mass);
139  m_a_location.setup(spScope, "location");
140  m_accessors.push_back(m_a_location);
141  }
142  float &mass(void)
143  {
144  if(!m_record.isValid())
145  {
146  feX("invalid record");
147  }
148  return m_a_mass(m_record);
149  }
150  float &mass(Record &a_record)
151  {
152  if(!a_record.isValid())
153  {
154  feX("invalid record");
155  }
156  return m_a_mass(a_record);
157  }
158  SpatialVector &location(void)
159  {
160  if(!m_record.isValid())
161  {
162  feX("invalid record");
163  }
164  return m_a_location(m_record);
165  }
166  SpatialVector &location(Record &a_record)
167  {
168  if(!a_record.isValid())
169  {
170  feX("invalid record");
171  }
172  return m_a_location(a_record);
173  }
174  private:
175  Accessor<float> m_a_mass;
176  Accessor<SpatialVector> m_a_location;
177 };
178 #endif
179 
180 } /* namespace ext */
181 } /* namespace fe */
182 
183 #endif
Base class for generated views.
Definition: View.h:17
int & blat(void)
another
Definition: MyView.h:51
F32 & MyF32(void)
test accesor test accesor
Definition: MyView.h:32
bool isValid(void) const
Return true if the Record points to a valid state block.
Definition: RecordSB.h:184
kernel
Definition: namespace.dox:3
int & blat(Record &a_record)
another
Definition: MyView.h:60
test view specification
Definition: MyView.h:20
Reference to an instance of a Layout.
Definition: RecordSB.h:35
F32 & MyF32(Record &a_record)
test accesor test accesor
Definition: MyView.h:42
void setup(sp< Scope > spScope, const String &attribute)
setup functions setup the accessor and also setup the Scope.
Definition: Accessor.cc:113