Free Electron
xRelay.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_test_xRelay_h__
8 #define __datatool_test_xRelay_h__
9 
10 namespace
11 {
12 static const char* gs_myAttributes[]=
13 {
14  "F32", "MyF32",
15  "I32", "MyI32"
16 };
17 }
18 
19 class MyRelay: public fe::Relay<2,MyRelay>
20 {
21  public:
22  enum
23  {
24  e_myF32,
25  e_myI32,
26  e_size
27  };
28 static
29 const char* layoutName(void) { return "base"; }
30 static
31 const char** attributes(void) { return gs_myAttributes; }
32 };
33 
34 namespace
35 {
36 static const char* gs_moreAttributes[]=
37 {
38  "F32", "MoreF32"
39 };
40 }
41 
42 class DerivedRelay: public fe::Relay<1,DerivedRelay,MyRelay>
43 {
44  public:
45  enum
46  {
47  e_moreF32=MyRelay::e_size,
48  e_size
49  };
50 
51 static
52 const char* layoutName(void) { return "derived"; }
53 static
54 const char** attributes(void) { return gs_moreAttributes; }
55 
56 virtual void initialize(void) { set(MyRelay::e_myF32,4.5f); }
57 };
58 
59 #endif // __datatool_test_xRelay_h__