FEDEM Model Database  R8.0
Source code of the FEDEM model database
FFaSwitchBoard.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
13 #ifndef FFA_SWITCH_BOARD_H
14 #define FFA_SWITCH_BOARD_H
15 
16 #if defined(win32) || defined(win64)
17 #pragma warning(disable:4503)
18 #endif
19 
20 #include <map>
21 #include <set>
22 #include <list>
23 #include <cstddef>
24 
25 class FFaSlotBase;
27 
28 
31 {
32  FFaSlotBase* slotPt = NULL;
33  short int refCount = 0;
34 };
35 
37 using FFaSlotList = std::list<FFaSlotBasePt>;
38 
42 typedef void(*anyFunctionType)(...);
43 
44 
47 namespace FFaSwitchBoard
48 {
50  void connect(FFaSwitchBoardConnector* sender, int subject,
51  FFaSlotBase* slot);
53  void disConnect(FFaSwitchBoardConnector* sender, int subject,
54  FFaSlotBase* slot);
55 
58 
60  FFaSlotList& getSlots(FFaSwitchBoardConnector* sender, int subject,
61  unsigned int typeID);
62 
64  FFaSlotList::iterator nextValidSlot(FFaSlotList::iterator it,
65  FFaSlotList& slots,
67  int subject);
69  void removeSlotReference(FFaSwitchBoardConnector* sender, int subject,
70  FFaSlotBase* slot);
71 
74 
76  void removeInstance();
77 };
78 
79 
83 {
84 public:
86  FFaSwitchBoardConnector(const char* s = NULL);
88  virtual ~FFaSwitchBoardConnector();
89 
91  void removeSlot(FFaSlotBase* slot)
92  {
93  if (!IAmDeletingMe)
94  mySlots.erase(slot);
95  }
96 
98  void addSlot(FFaSlotBase* slot)
99  {
100  mySlots.insert(slot);
101  }
102 
103  // Mainly for debug output
104  const char* getLabel() const { return label ? label : ""; }
105  void setLabel(const char* s) { label = s; }
106 
107 private:
108  std::set<FFaSlotBase*> mySlots;
110  const char* label;
111 };
112 
113 
117 {
118 public:
120  FFaSlotBase() { myTypeID = 0; IAmDeletingMe = false; }
122  virtual ~FFaSlotBase();
123 
125  virtual bool operator==(FFaSlotBase& otherSlot) = 0;
127  unsigned int getTypeID() const { return myTypeID; }
128 
129  // These methods must ONLY be used from FFaSwitchBoard
130  bool addConnection(FFaSwitchBoardConnector* sender, int subject);
131  bool removeConnection(FFaSwitchBoardConnector* sender, int subject);
132 
133  // Should be protected, used only by operator==
135  virtual anyMethodType getMethod() = 0;
137  virtual bool isStaticSlot() const = 0;
138 
139 protected:
140  unsigned int myTypeID;
141  static int uniqueTypeId;
142 
143 private:
144  using IntMap = std::map<int,int>;
146  using SwbMap = std::map<FFaSwitchBoardConnector*,IntMap>;
147 
150 };
151 
152 
155 // Defines for macro arguments
156 
157 // One type :
158 
159 #define FFASWB_TEMPLATE1 template < class P1Type >
160 #define FFASWB_ADDED_TEMPLATE_ARGS1 , class P1Type
161 #define FFASWB_TYPE_LIST1 < P1Type >
162 #define FFASWB_ADDED_TYPE_LIST1 , P1Type
163 
164 #define FFASWB_ARGUMENT_LIST1 P1Type p1
165 #define FFASWB_ADDED_FUNCTION_ARGS1 , P1Type p1
166 
167 #define FFASWB_PARAM_LIST1 p1
168 
169 // Two types :
170 
171 #define FFASWB_TEMPLATE2 template < class P1Type, class P2Type >
172 #define FFASWB_ADDED_TEMPLATE_ARGS2 , class P1Type, class P2Type
173 #define FFASWB_TYPE_LIST2 < P1Type, P2Type >
174 #define FFASWB_ADDED_TYPE_LIST2 , P1Type, P2Type
175 
176 #define FFASWB_ARGUMENT_LIST2 P1Type p1, P2Type p2
177 #define FFASWB_ADDED_FUNCTION_ARGS2 , P1Type p1, P2Type p2
178 
179 #define FFASWB_PARAM_LIST2 p1, p2
180 
181 // Tree types :
182 
183 #define FFASWB_TEMPLATE3 template < class P1Type, class P2Type, class P3Type >
184 #define FFASWB_ADDED_TEMPLATE_ARGS3 , class P1Type, class P2Type, class P3Type
185 #define FFASWB_TYPE_LIST3 < P1Type, P2Type, P3Type >
186 #define FFASWB_ADDED_TYPE_LIST3 , P1Type, P2Type, P3Type
187 
188 #define FFASWB_ARGUMENT_LIST3 P1Type p1, P2Type p2, P3Type p3
189 #define FFASWB_ADDED_FUNCTION_ARGS3 , P1Type p1, P2Type p2, P3Type p3
190 
191 #define FFASWB_PARAM_LIST3 p1, p2, p3
192 
193 // Four types :
194 
195 #define FFASWB_TEMPLATE4 template < class P1Type, class P2Type, class P3Type, class P4Type >
196 #define FFASWB_ADDED_TEMPLATE_ARGS4 , class P1Type, class P2Type, class P3Type, class P4Type
197 #define FFASWB_TYPE_LIST4 < P1Type, P2Type, P3Type, P4Type >
198 #define FFASWB_ADDED_TYPE_LIST4 , P1Type, P2Type, P3Type, P4Type
199 
200 #define FFASWB_ARGUMENT_LIST4 P1Type p1, P2Type p2, P3Type p3, P4Type p4
201 #define FFASWB_ADDED_FUNCTION_ARGS4 , P1Type p1, P2Type p2, P3Type p3, P4Type p4
202 
203 #define FFASWB_PARAM_LIST4 p1, p2, p3, p4
204 
205 
210 #define FFASWB_MAKE_SLOTBASE_TEMPLATE(nr, templateDef, argumentList, typeList) \
211  \
212 templateDef \
213 class FFaSlotBase##nr : public FFaSlotBase \
214 { \
215 public: \
216  FFaSlotBase##nr () { myTypeID = getClassTypeID(); } \
217  virtual ~FFaSlotBase##nr () {} \
218  virtual void invoke(argumentList) = 0; \
219  static unsigned int getClassTypeID() \
220  { \
221  static unsigned int ourClassTypeID = ++uniqueTypeId; \
222  return ourClassTypeID; \
223  } \
224 };
225 
227 FFASWB_MAKE_SLOTBASE_TEMPLATE(1, FFASWB_TEMPLATE1, FFASWB_ARGUMENT_LIST1, FFASWB_TYPE_LIST1)
228 FFASWB_MAKE_SLOTBASE_TEMPLATE(2, FFASWB_TEMPLATE2, FFASWB_ARGUMENT_LIST2, FFASWB_TYPE_LIST2)
229 FFASWB_MAKE_SLOTBASE_TEMPLATE(3, FFASWB_TEMPLATE3, FFASWB_ARGUMENT_LIST3, FFASWB_TYPE_LIST3)
230 FFASWB_MAKE_SLOTBASE_TEMPLATE(4, FFASWB_TEMPLATE4, FFASWB_ARGUMENT_LIST4, FFASWB_TYPE_LIST4)
231 
232 
236 #define FFASWB_MAKE_SLOT_TEMPLATE(nr, addedTemplateArgs, argumentList, parameterList, typeList) \
237  \
238 template<class T addedTemplateArgs> \
239 class FFaSlot##nr : public FFaSlotBase##nr typeList \
240 { \
241  typedef void (T::*methodType)(argumentList); \
242  \
243 public: \
244  FFaSlot##nr (T* obj, methodType method) \
245  { \
246  myObject = obj; \
247  myMethodPt = method; \
248  myObject->addSlot(this); \
249  } \
250  \
251  virtual ~FFaSlot##nr () \
252  { \
253  myObject->removeSlot(this); \
254  } \
255  \
256  virtual void invoke(argumentList) \
257  { \
258  (this->myObject->*this->myMethodPt)(parameterList); \
259  } \
260  \
261  virtual bool operator==(FFaSlotBase& otherSlot) \
262  { \
263  return ((FFaSwitchBoardConnector*)this->myObject == otherSlot.getObject() && \
264  (anyMethodType)this->myMethodPt == otherSlot.getMethod()); \
265  } \
266  \
267  virtual FFaSwitchBoardConnector* getObject() { return myObject; } \
268  virtual anyMethodType getMethod() { return (anyMethodType)myMethodPt; } \
269  virtual anyFunctionType getFunction() { return (anyFunctionType)NULL; } \
270  virtual bool isStaticSlot() const { return false; } \
271  \
272 private: \
273  T* myObject; \
274  methodType myMethodPt; \
275 };
276 
277 FFASWB_MAKE_SLOT_TEMPLATE(0, , , , )
278 FFASWB_MAKE_SLOT_TEMPLATE(1, FFASWB_ADDED_TEMPLATE_ARGS1, FFASWB_ARGUMENT_LIST1, FFASWB_PARAM_LIST1, FFASWB_TYPE_LIST1)
279 FFASWB_MAKE_SLOT_TEMPLATE(2, FFASWB_ADDED_TEMPLATE_ARGS2, FFASWB_ARGUMENT_LIST2, FFASWB_PARAM_LIST2, FFASWB_TYPE_LIST2)
280 FFASWB_MAKE_SLOT_TEMPLATE(3, FFASWB_ADDED_TEMPLATE_ARGS3, FFASWB_ARGUMENT_LIST3, FFASWB_PARAM_LIST3, FFASWB_TYPE_LIST3)
281 FFASWB_MAKE_SLOT_TEMPLATE(4, FFASWB_ADDED_TEMPLATE_ARGS4, FFASWB_ARGUMENT_LIST4, FFASWB_PARAM_LIST4, FFASWB_TYPE_LIST4)
282 
283 
287 #define FFASWB_MAKE_STATIC_SLOT_TEMPLATE(nr, templateDef, argumentList, parameterList, typeList) \
288  \
289 templateDef \
290 class FFaStaticSlot##nr : public FFaSlotBase##nr typeList \
291 { \
292  typedef void (*functionType)(argumentList); \
293  \
294 public: \
295  FFaStaticSlot##nr (functionType func) { myFunctionPt = func; } \
296  virtual ~FFaStaticSlot##nr () {} \
297  \
298  virtual void invoke(argumentList) { (this->myFunctionPt)(parameterList); } \
299  \
300  virtual bool operator==(FFaSlotBase& otherSlot) \
301  { \
302  if (otherSlot.isStaticSlot()) \
303  return (anyFunctionType)myFunctionPt == otherSlot.getFunction(); \
304  else \
305  return false; \
306  } \
307  \
308  virtual FFaSwitchBoardConnector* getObject() { return NULL; } \
309  virtual anyMethodType getMethod() { return (anyMethodType)NULL; } \
310  virtual anyFunctionType getFunction() { return (anyFunctionType)myFunctionPt; } \
311  virtual bool isStaticSlot() const { return true; } \
312  \
313 private: \
314  functionType myFunctionPt; \
315 };
316 
318 FFASWB_MAKE_STATIC_SLOT_TEMPLATE(1, FFASWB_TEMPLATE1, FFASWB_ARGUMENT_LIST1, FFASWB_PARAM_LIST1, FFASWB_TYPE_LIST1)
319 FFASWB_MAKE_STATIC_SLOT_TEMPLATE(2, FFASWB_TEMPLATE2, FFASWB_ARGUMENT_LIST2, FFASWB_PARAM_LIST2, FFASWB_TYPE_LIST2)
320 FFASWB_MAKE_STATIC_SLOT_TEMPLATE(3, FFASWB_TEMPLATE3, FFASWB_ARGUMENT_LIST3, FFASWB_PARAM_LIST3, FFASWB_TYPE_LIST3)
321 FFASWB_MAKE_STATIC_SLOT_TEMPLATE(4, FFASWB_TEMPLATE4, FFASWB_ARGUMENT_LIST4, FFASWB_PARAM_LIST4, FFASWB_TYPE_LIST4)
322 
323 
325 
332 #define FFASWB_MAKE_EMIT_FUNCTION_TEMPLATE(nr, templateDef, addedArgumentList, parameterList, typeList) \
333  \
334 templateDef void FFaSwitchBoardCall(FFaSwitchBoardConnector* sender, int subject addedArgumentList) \
335 { \
336  unsigned int typeID = FFaSlotBase##nr typeList::getClassTypeID(); \
337  FFaSlotList& ffSlot = FFaSwitchBoard::getSlots(sender,subject,typeID); \
338  FFaSlotList::iterator it = ffSlot.end(); \
339  while ((it = FFaSwitchBoard::nextValidSlot(it,ffSlot,sender,subject)) != ffSlot.end()) \
340  static_cast<FFaSlotBase##nr typeList*>(it->slotPt)->invoke(parameterList); \
341 }
342 
343 FFASWB_MAKE_EMIT_FUNCTION_TEMPLATE(0, inline, , , )
344 FFASWB_MAKE_EMIT_FUNCTION_TEMPLATE(1, FFASWB_TEMPLATE1, FFASWB_ADDED_FUNCTION_ARGS1, FFASWB_PARAM_LIST1, FFASWB_TYPE_LIST1)
345 FFASWB_MAKE_EMIT_FUNCTION_TEMPLATE(2, FFASWB_TEMPLATE2, FFASWB_ADDED_FUNCTION_ARGS2, FFASWB_PARAM_LIST2, FFASWB_TYPE_LIST2)
346 FFASWB_MAKE_EMIT_FUNCTION_TEMPLATE(3, FFASWB_TEMPLATE3, FFASWB_ADDED_FUNCTION_ARGS3, FFASWB_PARAM_LIST3, FFASWB_TYPE_LIST3)
347 FFASWB_MAKE_EMIT_FUNCTION_TEMPLATE(4, FFASWB_TEMPLATE4, FFASWB_ADDED_FUNCTION_ARGS4, FFASWB_PARAM_LIST4, FFASWB_TYPE_LIST4)
348 
349 
352 #define FFASWB_MAKE_SIMPLE_CONNECT_FUNCTION_TEMPLATE(nr, addedTemplateArgs, argumentList, addedTypeList) \
353  \
354 template<class RecieverType addedTemplateArgs> \
355 void FFaSwitchBoardConnect(FFaSwitchBoardConnector* sender, int subject, RecieverType* receiver, \
356  void (RecieverType::*method)(argumentList)) \
357 { \
358  FFaSwitchBoard::connect(sender, subject, new FFaSlot##nr <RecieverType addedTypeList>(receiver,method)); \
359 }
360 
362 FFASWB_MAKE_SIMPLE_CONNECT_FUNCTION_TEMPLATE(1, FFASWB_ADDED_TEMPLATE_ARGS1, FFASWB_ARGUMENT_LIST1, FFASWB_ADDED_TYPE_LIST1)
363 FFASWB_MAKE_SIMPLE_CONNECT_FUNCTION_TEMPLATE(2, FFASWB_ADDED_TEMPLATE_ARGS2, FFASWB_ARGUMENT_LIST2, FFASWB_ADDED_TYPE_LIST2)
364 FFASWB_MAKE_SIMPLE_CONNECT_FUNCTION_TEMPLATE(3, FFASWB_ADDED_TEMPLATE_ARGS3, FFASWB_ARGUMENT_LIST3, FFASWB_ADDED_TYPE_LIST3)
365 FFASWB_MAKE_SIMPLE_CONNECT_FUNCTION_TEMPLATE(4, FFASWB_ADDED_TEMPLATE_ARGS4, FFASWB_ARGUMENT_LIST4, FFASWB_ADDED_TYPE_LIST4)
366 
367 
370 #define FFASWB_MAKE_SIMPLE_DISCONNECT_FUNCTION_TEMPLATE(nr, addedTemplateArgs, argumentList, addedTypeList) \
371  \
372 template<class RecieverType addedTemplateArgs> \
373 void FFaSwitchBoardDisConnect(FFaSwitchBoardConnector* sender, int subject, RecieverType* receiver, \
374  void (RecieverType::*method)(argumentList)) \
375 { \
376  FFaSwitchBoard::disConnect(sender, subject, new FFaSlot##nr <RecieverType addedTypeList>(receiver,method)); \
377 }
378 
380 FFASWB_MAKE_SIMPLE_DISCONNECT_FUNCTION_TEMPLATE(1, FFASWB_ADDED_TEMPLATE_ARGS1, FFASWB_ARGUMENT_LIST1, FFASWB_ADDED_TYPE_LIST1)
381 FFASWB_MAKE_SIMPLE_DISCONNECT_FUNCTION_TEMPLATE(2, FFASWB_ADDED_TEMPLATE_ARGS2, FFASWB_ARGUMENT_LIST2, FFASWB_ADDED_TYPE_LIST2)
382 FFASWB_MAKE_SIMPLE_DISCONNECT_FUNCTION_TEMPLATE(3, FFASWB_ADDED_TEMPLATE_ARGS3, FFASWB_ARGUMENT_LIST3, FFASWB_ADDED_TYPE_LIST3)
383 FFASWB_MAKE_SIMPLE_DISCONNECT_FUNCTION_TEMPLATE(4, FFASWB_ADDED_TEMPLATE_ARGS4, FFASWB_ARGUMENT_LIST4, FFASWB_ADDED_TYPE_LIST4)
384 
385 
387 // Slot macro interface //
389 
391 #define FFaSlot0S(ownerType, method) new FFaStaticSlot0 (&ownerType::method)
393 #define FFaSlot1S(ownerType, method, P1Type) new FFaStaticSlot1<P1Type> (&ownerType::method)
395 #define FFaSlot2S(ownerType, method, P1Type, P2Type) new FFaStaticSlot2<P1Type, P2Type> (&ownerType::method)
397 #define FFaSlot3S(ownerType, method, P1Type, P2Type, P3Type) new FFaStaticSlot3<P1Type, P2Type, P3Type> (&ownerType::method)
399 #define FFaSlot4S(ownerType, method, P1Type, P2Type, P3Type, P4Type) new FFaStaticSlot4<P1Type, P2Type, P3Type, P4Type> (&ownerType::method)
400 
402 #define FFaSlot0M(ownerType, owner, method) new FFaSlot0<ownerType> (owner,&ownerType::method)
404 #define FFaSlot1M(ownerType, owner, method, P1Type) new FFaSlot1<ownerType, P1Type> (owner,&ownerType::method)
406 #define FFaSlot2M(ownerType, owner, method, P1Type, P2Type) new FFaSlot2<ownerType, P1Type, P2Type> (owner,&ownerType::method)
408 #define FFaSlot3M(ownerType, owner, method, P1Type, P2Type, P3Type) new FFaSlot3<ownerType, P1Type, P2Type, P3Type> (owner,&ownerType::method)
410 #define FFaSlot4M(ownerType, owner, method, P1Type, P2Type, P3Type, P4Type) new FFaSlot4<ownerType, P1Type, P2Type, P3Type, P4Type> (owner,&ownerType::method)
411 
412 #endif
void(* anyFunctionType)(...)
Callback function pointer.
Definition: FFaSwitchBoard.H:42
std::list< FFaSlotBasePt > FFaSlotList
Slot container.
Definition: FFaSwitchBoard.H:37
#define FFASWB_MAKE_SLOT_TEMPLATE(nr, addedTemplateArgs, argumentList, parameterList, typeList)
Macro that defines the different slotN templates.
Definition: FFaSwitchBoard.H:236
#define FFASWB_MAKE_SIMPLE_DISCONNECT_FUNCTION_TEMPLATE(nr, addedTemplateArgs, argumentList, addedTypeList)
Macro that defines the disconnect function templates.
Definition: FFaSwitchBoard.H:370
#define FFASWB_MAKE_SIMPLE_CONNECT_FUNCTION_TEMPLATE(nr, addedTemplateArgs, argumentList, addedTypeList)
Macro that defines the connect function templates.
Definition: FFaSwitchBoard.H:352
#define FFASWB_MAKE_EMIT_FUNCTION_TEMPLATE(nr, templateDef, addedArgumentList, parameterList, typeList)
Function to call all the slots connected to a signal.
Definition: FFaSwitchBoard.H:332
#define FFASWB_MAKE_STATIC_SLOT_TEMPLATE(nr, templateDef, argumentList, parameterList, typeList)
Macro that defines the different static slotN templates.
Definition: FFaSwitchBoard.H:287
void(FFaSwitchBoardConnector::* anyMethodType)(...)
Callback function pointer.
Definition: FFaSwitchBoard.H:40
#define FFASWB_MAKE_SLOTBASE_TEMPLATE(nr, templateDef, argumentList, typeList)
Macro that defines the different slotBaseN templates.
Definition: FFaSwitchBoard.H:210
The most basic slot class.
Definition: FFaSwitchBoard.H:117
bool addConnection(FFaSwitchBoardConnector *sender, int subject)
Definition: FFaSwitchBoard.C:336
SwbMap mySwitchBoardLookups
sender --> (subject,count)
Definition: FFaSwitchBoard.H:148
static int uniqueTypeId
Running counter to ensure unique Ids.
Definition: FFaSwitchBoard.H:141
bool removeConnection(FFaSwitchBoardConnector *sender, int subject)
Definition: FFaSwitchBoard.C:353
virtual ~FFaSlotBase()
The destructor removes this from the switchboard.
Definition: FFaSwitchBoard.C:323
virtual FFaSwitchBoardConnector * getObject()=0
virtual bool isStaticSlot() const =0
virtual anyMethodType getMethod()=0
unsigned int myTypeID
Class type Id of this slot.
Definition: FFaSwitchBoard.H:140
unsigned int getTypeID() const
Returns the myTypeID of this slot.
Definition: FFaSwitchBoard.H:127
bool IAmDeletingMe
Set to true during destruction.
Definition: FFaSwitchBoard.H:149
std::map< int, int > IntMap
Definition: FFaSwitchBoard.H:144
FFaSlotBase()
Default constructor.
Definition: FFaSwitchBoard.H:120
std::map< FFaSwitchBoardConnector *, IntMap > SwbMap
Convenience type alias, switchboard connection mapping.
Definition: FFaSwitchBoard.H:146
virtual bool operator==(FFaSlotBase &otherSlot)=0
Equality operator.
virtual anyFunctionType getFunction()=0
Base class for every class that want to send or recieve.
Definition: FFaSwitchBoard.H:83
std::set< FFaSlotBase * > mySlots
The slot container for this object.
Definition: FFaSwitchBoard.H:108
void setLabel(const char *s)
Definition: FFaSwitchBoard.H:105
const char * label
Label used for debug output.
Definition: FFaSwitchBoard.H:110
const char * getLabel() const
Definition: FFaSwitchBoard.H:104
void removeSlot(FFaSlotBase *slot)
Removes slot from mySlots.
Definition: FFaSwitchBoard.H:91
virtual ~FFaSwitchBoardConnector()
The destructor cleans up mySlots.
Definition: FFaSwitchBoard.C:310
FFaSwitchBoardConnector(const char *s=NULL)
Default constructor.
Definition: FFaSwitchBoard.C:300
bool IAmDeletingMe
Set to true during destruction.
Definition: FFaSwitchBoard.H:109
void addSlot(FFaSlotBase *slot)
Adds slot to mySlots.
Definition: FFaSwitchBoard.H:98
Static switchboard that holds the connection information.
Definition: FFaSwitchBoard.H:48
void disConnect(FFaSwitchBoardConnector *sender, int subject, FFaSlotBase *slot)
Removes slot from the switchboard.
Definition: FFaSwitchBoard.C:89
void removeSlotReference(FFaSwitchBoardConnector *sender, int subject, FFaSlotBase *slot)
Used by FFaSlotBase only.
Definition: FFaSwitchBoard.C:198
void removeInstance()
Cleans up the heap-allocated switchboard container.
Definition: FFaSwitchBoard.C:70
FFaSlotList::iterator nextValidSlot(FFaSlotList::iterator it, FFaSlotList &slots, FFaSwitchBoardConnector *sender, int subject)
Used internally by the switchboard mechanism classes.
Definition: FFaSwitchBoard.C:238
void removeAllOwnerConnections(FFaSwitchBoardConnector *owner)
Removes all slots connected to owener.
Definition: FFaSwitchBoard.C:149
FFaSlotList & getSlots(FFaSwitchBoardConnector *sender, int subject, unsigned int typeID)
Used internally in switchboard mechanism classes.
Definition: FFaSwitchBoard.C:214
void removeAllSenderConnections(FFaSwitchBoardConnector *sender)
Used by FFaSwitchBoardConnector only.
Definition: FFaSwitchBoard.C:112
void connect(FFaSwitchBoardConnector *sender, int subject, FFaSlotBase *slot)
Adds a new slot to the switchboard.
Definition: FFaSwitchBoard.C:77
A slot pointer with reference counting.
Definition: FFaSwitchBoard.H:31
short int refCount
Number of references to this slot.
Definition: FFaSwitchBoard.H:33
FFaSlotBase * slotPt
Pointer to the actial slot.
Definition: FFaSwitchBoard.H:32