Free Electron
Modifier.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 __element_Modifier_h__
8 #define __element_Modifier_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief Stream particles through an operation
16 
17  NOTE This is a historical experiment and is not currently recommended
18  for future work.
19 *//***************************************************************************/
20 template<typename GROUP,int SUBGROUP,typename RECORDOP>
21 class FE_DL_EXPORT Modifier: virtual public HandlerI
22 {
23  public:
24  //* As HandlerI
25 virtual void handle(Record& record)
26  {
27  m_groupRV.bind(record);
28  sp<RecordGroup>& rspRecordGroup=m_groupRV.SUBGROUP();
29 
30  FEASSERT(rspRecordGroup.isValid());
31  RECORDOP op(record.layout()->scope());
32  op.bind(record);
33  rspRecordGroup->all(op);
34  }
35  private:
36 
37  GROUP m_groupRV;
38 };
39 
40 } /* namespace ext */
41 } /* namespace fe */
42 
43 #endif /* __element_Modifier_h__ */
virtual void all(RecordOperation &op)
Perform the RecordOperation op on all records.
Definition: RecordGroup.cc:213
kernel
Definition: namespace.dox:3
sp< Layout > layout(void) const
Return the Layout.
Definition: RecordSB.h:189
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
Stream particles through an operation.
Definition: Modifier.h:21
Reference to an instance of a Layout.
Definition: RecordSB.h:35