SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NetworkIDObject.h
Go to the documentation of this file.
1 /*
2 * Original work: Copyright (c) 2014, Oculus VR, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7 * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8 *
9 *
10 * Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
11 *
12 * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
13 * license found in the license.txt file in the root directory of this source tree.
14 */
15
19
20
21 #if !defined(__NETWORK_ID_GENERATOR)
22 #define __NETWORK_ID_GENERATOR
23
24 #include "types.h"
25 #include "memoryoverride.h"
26 #include "Export.h"
27
28 namespace SLNet
29 {
31 class NetworkIDManager;
32
33 typedef uint32_t NetworkIDType;
34
41 class RAK_DLL_EXPORT NetworkIDObject
42 {
43 public:
44 // Constructor. NetworkIDs, if IsNetworkIDAuthority() is true, are created here.
45 NetworkIDObject();
46
47 // Destructor. Used NetworkIDs, if any, are freed here.
48 virtual ~NetworkIDObject();
49
53 virtual void SetNetworkIDManager( NetworkIDManager *manager);
54
56 virtual NetworkIDManager * GetNetworkIDManager( void ) const;
57
62 virtual NetworkID GetNetworkID( void );
63
66 virtual void SetNetworkID( NetworkID id );
67
71 virtual void SetParent( void *_parent );
72
75 virtual void* GetParent( void ) const;
76
77 protected:
78
80 // networkID is assigned when networkIDManager is set.
81 NetworkID networkID;
82 NetworkIDManager *networkIDManager;
83
85 void *parent;
86
88 friend class NetworkIDManager;
89 NetworkIDObject *nextInstanceForNetworkIDManager;
90 };
91
92 } // namespace SLNet
93
94 #endif