Loading [MathJax]/extensions/tex2jax.js
Free Electron
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
fe_data.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 __data_fe_data_h__
8 #define __data_fe_data_h__
9 
10 class ScopePtr;
11 
12 class LayoutPtr
13 {
14  public:
15  LayoutPtr(void);
16  LayoutPtr(PyObject *pObj);
17  LayoutPtr &operator=(fe::sp<fe::Layout> spLayout);
18  LayoutPtr populate(const std::string &attr,
19  const std::string &typ);
20  ScopePtr scope(void);
21  fe::sp<fe::Layout> ptr(void) const;
22  void assign(fe::sp<fe::Layout> &spL);
23  std::string name(void);
24  private:
25  fe::sp<fe::Layout> m_spLayout;
26 };
27 
28 class PyWatcher : public fe::WatcherI
29 {
30  public:
31  PyWatcher(PyObject *pPyObject);
32 virtual ~PyWatcher(void);
33 virtual void add(const fe::Record &record);
34 virtual void remove(const fe::Record &record);
35 virtual void clear(void);
36  private:
37  PyObject *m_pObject;
38 };
39 
40 class WatcherBase
41 {
42  public:
43  WatcherBase(void);
44  WatcherBase(PyObject *pP);
45 virtual ~WatcherBase(void);
46 };
47 
48 class WatcherFS : public WatcherBase, public FunctionSet<fe::WatcherI>
49 {
50  public:
51  WatcherFS(PyObject *self_, PyObject *pP):
52  FunctionSet<fe::WatcherI>(pP) {}
53  WatcherFS(PyObject *self_);
54  PyObject *object(void);
55 virtual ~WatcherFS(void);
56 };
57 
58 
59 class ScopePtr
60 {
61  public:
62  ScopePtr(void);
63  ScopePtr(fe::sp<fe::Scope> spScope);
64  ~ScopePtr(void);
65  LayoutPtr declare(const std::string &name);
66  LayoutPtr lookupLayout(const std::string &name);
67  PyObject *createRecord(const LayoutPtr &layoutPtr);
68  PyObject *createRecordArray(const LayoutPtr &layoutPtr);
69  bool clear(const std::string &name);
70  void dump(void);
71  void support( const std::string &mayHave,
72  const std::string &ofType);
73  void enforce( const std::string &ifHas,
74  const std::string &mustHave);
75  void populate( const std::string &ifIs,
76  const std::string &mustHave);
77  void addWatcher( WatcherFS &watcher);
78 
79  fe::sp<fe::Scope> ptr(void) const;
80  private:
81  fe::sp<fe::Scope> m_spScope;
82 };
83 
84 
85 #endif /* __data_fe_data_h__ */
86 
kernel
Definition: namespace.dox:3
Reference to an instance of a Layout.
Definition: RecordSB.h:35