Free Electron
AccessorSets.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_AccessorSets_h__
8 #define __data_AccessorSets_h__
9 
10 namespace fe
11 {
12 
13 
14 /** System reserved attributes. Note that this collection is not intended
15  to be necessarily populated as a full set. */
16 class AsSystem
17  : public AccessorSet, public Initialize<AsSystem>
18 {
19  public:
20  AsSystem(void){}
21  void initialize(void)
22  {
23  add(count, FE_SPEC(":CT", "fe system reference count"));
24  add(id, FE_SPEC(":ID", "fe system id"));
25  add(sn, FE_SPEC(":SN", "fe serial number"));
26  add(ttl, FE_SPEC(":TTL", "fe system time to live"));
27  }
28  /// record reference count
30  /// record identifier
32  /// record serial number
34  /// signal time to live in networking
36 };
37 
38 /** Generic reusable attributes. Useful for internal unshared unpublic
39  attributes. */
40 class AsGeneric :
41  public AccessorSet,
42  public Initialize<AsGeneric>
43 {
44  public:
45  void initialize(void)
46  {
47  add(r0, FE_USE("generic:r_0"));
48  add(r1, FE_USE("generic:r_1"));
49 
50  add(s0, FE_USE("generic:s_0"));
51 
52  add(i0, FE_USE("generic:i_0"));
53  add(i1, FE_USE("generic:i_1"));
54 
55  add(g0, FE_USE("generic:g_0"));
56  }
59 
61 
62  Accessor<int> i0;
63  Accessor<int> i1;
64 
66 };
67 
68 /// Sequencer signal
70  : public AccessorSet, public Initialize<AsSequenceSignal>
71 {
72  public:
73  AsSequenceSignal(void){}
74  void initialize(void)
75  {
76  add(time, FE_USE("seq:time"));
77  add(interval, FE_USE("seq:interval"));
78  add(count, FE_USE("seq:count"));
79  add(periodic, FE_USE("seq:periodic"));
80  }
81  /// time setting for sequencer signals
83  /// interval setting for sequencer signals
85  /// count setting for sequencer signals
87  /// mode setting for sequencer signals
89 };
90 
91 /// just a Component
93  : public AccessorSet, public Initialize<AsComponent>
94 {
95  public:
96  AsComponent(void){}
97  void initialize(void)
98  {
99  add(component, FE_USE("component"));
100  }
101  /// component
103 };
104 
105 
106 } /* namespace */
107 
108 #endif /* __data_AccessorSets_h__ */
109 
Set of accessors.
Definition: AccessorSet.h:18
just a Component
Definition: AccessorSets.h:92
Generic reusable attributes.
Definition: AccessorSets.h:40
kernel
Definition: namespace.dox:3
Accessor< int > ttl
signal time to live in networking
Definition: AccessorSets.h:35
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
The main data access class for the data system.
Definition: Accessor.h:128
Accessor< int > time
time setting for sequencer signals
Definition: AccessorSets.h:82
Accessor< sp< Component > > component
component
Definition: AccessorSets.h:102
Accessor< std::atomic< int > > count
record reference count
Definition: AccessorSets.h:29
Accessor< int > periodic
mode setting for sequencer signals
Definition: AccessorSets.h:88
Accessor< int > count
count setting for sequencer signals
Definition: AccessorSets.h:86
Accessor< std::atomic< int > > sn
record serial number
Definition: AccessorSets.h:33
int count(void) const
Return the count of references.
Definition: Counted.h:156
System reserved attributes.
Definition: AccessorSets.h:16
Accessor< int > interval
interval setting for sequencer signals
Definition: AccessorSets.h:84
Accessor< int > id
record identifier
Definition: AccessorSets.h:31
Sequencer signal.
Definition: AccessorSets.h:69