Free Electron
View.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_View_h__
8 #define __datatool_View_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /** Base class for generated views
16  */
17 class View
18 {
19  public:
20  View(void)
21  {
22  }
23 virtual ~View(void)
24  {
25  }
26  void bind(Record &a_record)
27  {
28  m_record = a_record;
29  }
30  bool check(sp<Layout> spLayout)
31  {
32  for(unsigned int i = 0; i < m_accessors.size(); i++)
33  {
34  if(!m_accessors[i].check(spLayout))
35  {
36  return false;
37  }
38  }
39  return true;
40  }
41  bool check(Record &a_record)
42  {
43  for(unsigned int i = 0; i < m_accessors.size(); i++)
44  {
45  if(!m_accessors[i].check(a_record))
46  {
47  return false;
48  }
49  }
50  return true;
51  }
52  bool check(sp<RecordArray> spRA)
53  {
54  for(unsigned int i = 0; i < m_accessors.size(); i++)
55  {
56  if(!m_accessors[i].check(spRA))
57  {
58  return false;
59  }
60  }
61  return true;
62  }
63  bool check(void)
64  {
65  return check(m_record);
66  }
67  protected:
68  Array<BaseAccessor> m_accessors;
69  Record m_record;
70 };
71 
72 } /* namespace ext */
73 } /* namespace fe */
74 
75 #endif /* __datatool_View_h__ */
76 
Base class for generated views.
Definition: View.h:17
kernel
Definition: namespace.dox:3
Wrapper for std::vector.
Definition: Array.h:21
Reference to an instance of a Layout.
Definition: RecordSB.h:35