Free Electron
SignalMessenger.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 __network_SignalMessenger_h__
8 #define __network_SignalMessenger_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Convert signals to network messages
17 
18  The SignalMessenger should be bound to a particular key on
19  a specific StateCatalog.
20 
21  As a HandlerI, each incoming signal will be placed in the StateCatalog
22  using its sendMessage method.
23 
24  @ingroup network
25 *//***************************************************************************/
26 class FE_DL_EXPORT SignalMessenger:
27  virtual public StateBindI,
28  virtual public HandlerI,
29  public CastableAs<SignalMessenger>
30 {
31  public:
32  SignalMessenger(void) {}
33 
34  //* as StateBindI
35 virtual void bind(sp<StateCatalog> a_spStateCatalog)
36  { m_spStateCatalog=a_spStateCatalog; }
37 virtual void setKey(String a_name)
38  { m_key=a_name; }
39 
40  //* as HandlerI
41 virtual void handle(Record& a_signal);
42 
43  private:
44  sp<StateCatalog> m_spStateCatalog;
45  String m_key;
46 };
47 
48 } /* namespace ext */
49 } /* namespace fe */
50 
51 #endif /* __network_SignalMessenger_h__ */
52 
Convert signals to network messages.
Definition: SignalMessenger.h:26
kernel
Definition: namespace.dox:3
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
virtual void setKey(String a_name)
target a particular key in the StateCatalog
Definition: SignalMessenger.h:37
Automatically reference-counted string container.
Definition: String.h:128
Specify a StateCatalog and key.
Definition: StateBindI.h:20
Reference to an instance of a Layout.
Definition: RecordSB.h:35
virtual void bind(sp< StateCatalog > a_spStateCatalog)
specify a StateCatalog of interest
Definition: SignalMessenger.h:35
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192