Free Electron
NetHost.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 __networkhost_NetHost_h__
8 #define __networkhost_NetHost_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Point of Entry for Net Development
17 
18  @ingroup networkhost
19 *//***************************************************************************/
20 class FE_DL_PUBLIC FE_NETWORKHOST_PORT NetHost:
21  public Handled<NetHost>,
22  public CastableAs<NetHost>
23 {
24  public:
25  NetHost(void);
26 virtual ~NetHost(void);
27 
28  /** @brief Return a NetHost singleton
29 
30  If the HostHost does not yet exist,
31  it is created.
32  */
33 static sp<NetHost> FE_CDECL create(void);
34 
35  /** @brief Internal bookkeeping function
36 
37  @internal
38 
39  Do not call this method.
40  */
41 virtual void release(void);
42 
43  /** @brief Return the Master singleton
44 
45  A Master will have been created before
46  you get the reference to a NetHost.
47  */
49  { return ms_spSingleMaster->master(); }
50 
51  /// @brief Return TRUE if the space exists
52  BWORD hasSpace(String a_space);
53 
54  /** @brief Return a named space
55 
56  As a StateCatalog, a space is a
57  mutex-protected double-key dictionary
58  with freely extensible value types.
59 
60  If the space does not exist,
61  it will be created.
62 
63  An implementation string can be
64  specified to narrow what is used
65  to provide the space,
66  such as a particular network framework.
67  */
68  sp<StateCatalog> accessSpace(String a_space,
69  String a_implementation=
70  "ConnectedCatalog");
71 // "*.ZeroCatalog");
72 
73 protected:
74 
75 static sp<SingleMaster> singleMaster(void);
76 
77 static void lock(void)
78  { ms_recursiveMutex.lock(); }
79 static void unlock(void)
80  { ms_recursiveMutex.lock(); }
81 
82  private:
83 static FE_DL_PUBLIC sp<SingleMaster> ms_spSingleMaster;
84 static FE_DL_PUBLIC RecursiveMutex ms_recursiveMutex;
85 };
86 
87 } /* namespace ext */
88 } /* namespace fe */
89 
90 #endif /* __networkhost_NetHost_h__ */
kernel
Definition: namespace.dox:3
Automatically reference-counted string container.
Definition: String.h:128
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Base class providing an fe::Handle to the derived class.
Definition: Handled.h:209
Point of Entry for Net Development.
Definition: NetHost.h:20
sp< Master > master(void)
Return the Master singleton.
Definition: NetHost.h:48
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192