Free Electron
Strata.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 __terrain_Strata_h__
8 #define __terrain_Strata_h__
9 
10 FE_ATTRIBUTE("surf:strataName", "Name of StrataI Component");
11 FE_ATTRIBUTE("surf:strataI", "Instance of StrataI Component");
12 namespace fe
13 {
14 namespace ext
15 {
16 
17 /**************************************************************************//**
18  @brief Strata RecordView
19 
20  @ingroup terrain
21 *//***************************************************************************/
22 class FE_DL_EXPORT Strata: public RecordView
23 {
24  public:
25  Functor<String> strataName;
26  Functor< cp<Component> > strataComponent;
27  Functor< sp<RecordGroup> > stratumGroup;
28 
29  Strata(void) { setName("Strata"); }
30 virtual void addFunctors(void)
31  {
32  add(strataName, FE_USE("surf:strataName"));
33  add(strataComponent, FE_USE("surf:strataI"));
34  add(stratumGroup, FE_SPEC("surf:stratumGrp",
35  "RecordGroup of Stratum"));
36  }
37 virtual void initializeRecord(void)
38  {
40 
41  strataComponent.attribute()->setSerialize(FALSE);
42 
43  feLog("Strata::initializeRecord %s\n",name().c_str());
44  }
45 virtual void finalizeRecord(void)
46  {
48 
49  feLog("Strata::finalizeRecord %s %s\n",name().c_str(),
50  strataName().c_str());
51 
52  if(!strataName().empty())
53  {
54  strataComponent.createAndSetComponent(strataName());
55  }
56  }
57 };
58 
59 } /* namespace ext */
60 } /* namespace fe */
61 
62 #endif /* __terrain_Strata_h__ */
63 
kernel
Definition: namespace.dox:3
Bound accessor in a RecordView.
Definition: RecordView.h:147
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Strata.h:30
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Strata.h:37
virtual void finalizeRecord(void)
Called right after instantiation to finalize complex attributes.
Definition: Strata.h:45
Strata RecordView.
Definition: Strata.h:22
sp< Attribute > attribute(void) const
Return the attribute this accessor is for.
Definition: Accessor.cc:151
void createAndSetComponent(String componentName)
Create a named component for the attribute.
Definition: RecordView.h:236
Bindable collection of accessor Functors.
Definition: RecordView.h:106
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: RecordView.h:571
virtual void finalizeRecord(void)
Called right after instantiation to finalize complex attributes.
Definition: RecordView.h:583