Free Electron
Radio.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 __intelligence_Radio_h__
8 #define __intelligence_Radio_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief Radio RecordView
16 
17  @ingroup intelligence
18 *//***************************************************************************/
19 class FE_DL_EXPORT Radio: virtual public RecordView
20 {
21  public:
22  Functor<F32> range;
23  Functor<Record> neighborhood;
24  Functor<Record> newNeighborhood;
25  Functor< sp<RecordGroup> > neighbors;
26 
27  Radio(void) { setName("Radio"); }
28 virtual void addFunctors(void)
29  {
30  add(range, FE_SPEC("comm:range",
31  "Radius of effect"));
32  add(neighborhood, FE_SPEC("comm:crowd",
33  "Cooperative network"));
34  add(newNeighborhood, FE_SPEC("comm:newcrowd",
35  "Crowd update during partitioning"));
36  add(neighbors, FE_USE("comm:neighbors"));
37  }
38 virtual void initializeRecord(void)
39  {
40  neighborhood.attribute()->setCloneable(FALSE);
41  neighbors.attribute()->setCloneable(FALSE);
42 
43  Crowd crowdRV;
44  crowdRV.bind(scope());
45  neighborhood()=crowdRV.createRecord();
46  crowdRV.neighbors()->add(record());
47 
48  neighbors.createAndSetRecordGroup();
49  neighbors()->setWeak(TRUE);
50 
51  range()=1.0f;
52  }
53 };
54 
55 } /* namespace ext */
56 } /* namespace fe */
57 
58 #endif /* __intelligence_Radio_h__ */
void createAndSetRecordGroup(void)
Create a RecordGroup for the attribute.
Definition: RecordView.h:258
void bind(sp< Scope > &rspScope)
Associate with a Scope.
Definition: RecordView.h:319
kernel
Definition: namespace.dox:3
Bound accessor in a RecordView.
Definition: RecordView.h:147
Radio RecordView.
Definition: Radio.h:19
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Radio.h:38
sp< Attribute > attribute(void) const
Return the attribute this accessor is for.
Definition: Accessor.cc:151
Record createRecord(void)
Create a Record using all the attributes.
Definition: RecordView.h:469
Bindable collection of accessor Functors.
Definition: RecordView.h:106
Crowd RecordView.
Definition: Crowd.h:19
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Radio.h:28