Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/terrain.old/src/lib/network/network_manager.h @ 10712

Last change on this file since 10712 was 9406, checked in by bensch, 18 years ago

orxonox/trunk: merged the proxy back

merged with commandsvn merge -r9346:HEAD https://svn.orxonox.net/orxonox/branches/proxy .

no conflicts

File size: 1.7 KB
Line 
1/*!
2 * @file network_manager.h
3  *  Main interface for the network module. Manages all the modules
4*/
5
6/* you will want to add such a a line at your header file also, since it will
7   prevent c++ from including your code twice*/
8#ifndef _NETWORK_MANAGER
9#define _NETWORK_MANAGER
10
11/* include this file, it contains some default definitions */
12#include "netdefs.h"
13#include "shared_network_data.h"
14
15/* include base_object.h since all classes are derived from this one */
16#include "base_object.h"
17
18
19/* forward declarations for the header file (include the header via #include "bla.h" in the source file) */
20class NetworkStream;
21class Synchronizeable;
22template<typename>
23class tList;
24
25/* and here is the class itsself*/
26class NetworkManager : public BaseObject
27{
28
29  public:
30
31    inline static NetworkManager* getInstance() { if (!NetworkManager::singletonRef) NetworkManager::singletonRef = new NetworkManager();
32      return NetworkManager::singletonRef; }
33    virtual ~NetworkManager();
34
35    void initialize();
36    void shutdown();
37
38    int createClient( const std::string & name, unsigned int port);
39    int createMasterServer( unsigned int port);
40    int createProxyServer( unsigned int port);
41
42    void connectSynchronizeable(Synchronizeable& sync);
43    void synchronize(float dtS);
44
45    void debug();
46
47
48  private:
49    NetworkManager();
50
51
52  private:
53    static NetworkManager*           singletonRef;            //!< Pointer to the only instance of this Class
54    NetworkStream*                   networkStream;           //!< pointer to network stream
55
56    float                            elapsedTime;             //!< elapsed time since the last network update
57};
58
59
60
61#endif /* _NETWORK_MANAGER */
Note: See TracBrowser for help on using the repository browser.