Free Electron
Crowd.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_Crowd_h__
8 #define __intelligence_Crowd_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief Crowd RecordView
16 
17  @ingroup intelligence
18 *//***************************************************************************/
19 class FE_DL_EXPORT Crowd: virtual public RecordView
20 {
21  public:
22  Functor<Record> viewpoint;
23  Functor< sp<RecordGroup> > neighbors;
24  Functor<I32> serial;
25 
26  Crowd(void) { setName("Crowd"); }
27 virtual void addFunctors(void)
28  {
29  add(viewpoint, FE_SPEC("ai:viewpoint",
30  "Surveillance of what can be seen"));
31 
32  add(neighbors, FE_SPEC("comm:neighbors",
33  "Group of nearby Records with similar interests"));
34 
35  add(serial, FE_USE(":SN"));
36  }
37 virtual void initializeRecord(void)
38  {
39  Surveillance surveillanceRV;
40  surveillanceRV.bind(scope());
41  viewpoint()=surveillanceRV.createRecord();
42 
43  neighbors.createAndSetRecordGroup();
44  neighbors()->setWeak(TRUE);
45  }
46 };
47 
48 } /* namespace ext */
49 } /* namespace fe */
50 
51 #endif /* __intelligence_Crowd_h__ */
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Crowd.h:37
Surveillance RecordView.
Definition: Surveillance.h:19
void bind(sp< Scope > &rspScope)
Associate with a Scope.
Definition: RecordView.h:319
kernel
Definition: namespace.dox:3
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Crowd.h:27
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