Free Electron
NetworkOp.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 __oplab_NetworkOp_h__
8 #define __oplab_NetworkOp_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief Communicate a mesh as a RecordGroup
16 
17  @ingroup oplab
18 *//***************************************************************************/
19 class FE_DL_EXPORT NetworkOp:
20  public OperatorSurfaceCommon,
21  public Initialize<NetworkOp>
22 {
23  public:
24 
25  class Handler:
26  public ObjectSafeShared<Handler>,
27  virtual public HandlerI
28  {
29  public:
30  Handler(void) {}
31  virtual ~Handler(void) {}
32 
33  virtual void handle(Record &a_signal);
34 
35  void bind(sp<Catalog> a_spCatalog)
36  { m_spActionCatalog=a_spCatalog; }
37 
38  void bind(sp<NetworkOp> a_spNetworkOp)
39  { m_hpNetworkOp=a_spNetworkOp; }
40 
41  String state(void) const;
42  void setState(String a_state);
43 
44  String action(String a_key) const;
45  void setAction(String a_key,String a_state);
46 
47  Record record(void) const;
48 
49  void setSelf(String a_source) { m_self=a_source; }
50 
51  private:
52  sp<Catalog> m_spActionCatalog;
53  hp<NetworkOp> m_hpNetworkOp;
54  String m_self;
55  String m_state;
56  Record m_record;
57  };
58 
59  NetworkOp(void):
60  m_brushed(FALSE),
61  m_lastFrame(0.0),
62  m_commandPid(0) {}
63 virtual ~NetworkOp(void) {}
64 
65  void initialize(void);
66 
67  //* As HandlerI
68 virtual void handleBind(sp<SignalerI> a_spSignalerI,
69  sp<Layout> a_spLayout);
70 virtual void handle(Record& a_rSignal);
71 
72  Accessor<int> m_ttl;
73  Accessor<String> m_source;
74  Accessor<String> m_text;
75  Accessor<Record> m_model;
76 
77  private:
78  void sendText(Record a_signal,String a_message);
79 
80  sp<SurfaceAccessibleI> importSurface(Record& a_rSignal,String a_args);
81  void relayMessages(void);
82 
83  BWORD m_brushed;
84  Real m_lastFrame;
85  I32 m_commandPid;
86 
87  sp<Scope> m_spScope;
88  sp<Layout> m_spLayoutHB;
89  sp<Layout> m_spLayoutMessage;
90  sp<Layout> m_spLayoutSurface;
91 
92  sp<SignalerI> m_spSignaler;
93  sp<Handler> m_spHandler;
94  sp<ServerI> m_spServer;
95  sp<ClientI> m_spClient;
96  sp<OperatorSurfaceI> m_spImportOp;
97 };
98 
99 } /* namespace ext */
100 } /* namespace fe */
101 
102 #endif /* __oplab_NetworkOp_h__ */
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
Safe handle for shared pointer.
Definition: Handled.h:61
Automatically reference-counted string container.
Definition: String.h:128
Partial Generic SurfaceI Implemention.
Definition: OperatorSurfaceCommon.h:20
Communicate a mesh as a RecordGroup.
Definition: NetworkOp.h:19
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Object level locking for thread safety.
Definition: SafeShared.h:220