Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/lib/network/network_manager.cc @ 5575

Last change on this file since 5575 was 5575, checked in by patrick, 18 years ago

network: now working with classlist

File size: 3.0 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Patrick Boenzli
13   co-programmer: ...
14*/
15
16
17/* this is for debug output. It just says, that all calls to PRINT() belong to the DEBUG_MODULE_NETWORK module
18   For more information refere to https://www.orxonox.net/cgi-bin/trac.cgi/wiki/DebugOutput
19*/
20#define DEBUG_MODULE_NETWORK
21
22
23#include "network_stream.h"
24#include "list.h"
25#include "class_list.h"
26
27
28/* include your own header */
29#include "network_manager.h"
30
31/* include this file, it contains some default definitions */
32#include "netdefs.h"
33
34/* using namespace std is default, this needs to be here */
35using namespace std;
36
37
38/************************************
39  What you will see here are the function definitions from the header file (network_manager.h) with doxygen documentation. Here is an example:
40
41
42 In file network_manager.h
43
44 class NetworkManager
45 {
46   int doSomeStuff(float argument, float* pointer);
47 }
48
49 will be implemented in the source file as follows:
50
51 In file network_manager.cc
52
53 / **
54  *  this is the short description for this function: it just does some stuff
55  * @param argument: this is the first argument, stuff...
56  * @param pointer:  this is the pointer to nowhereland
57  * return: whatever the function returns: for example an index, number, etc.
58  * /
59 int NetworkManager::doSomeStuff(float argument, float* pointer)
60 {
61   // whaterver you want to do
62 }
63
64
65 if you want to make automake compile your files: you will want to add the file names to the local Makefile.am
66
67 ************************************/
68
69
70/**
71 *  standard constructor
72 */
73NetworkManager::NetworkManager()
74{
75  /* set the class id for the base object */
76  this->setClassID(CL_NETWORK_MANAGER, "NetworkManager");
77  /* initialize the references */
78  this->netStreamList = NULL;
79  this->syncList = NULL;
80}
81
82
83/**
84 *  standard deconstructor
85 */
86NetworkManager::~NetworkManager()
87{}
88
89
90/**
91 *  initializes the network manager
92 */
93void NetworkManager::initialize()
94{
95  /* get the synchronizeable list from the class list */
96  this->netStreamList = ClassList::getList(CL_SYNCHRONIZEABLE);
97}
98
99
100/**
101 *  shutsdown the network manager
102 */
103void NetworkManager::shutdown()
104{}
105
106
107/**
108 *  creates a connection from one object to a host
109 * @param address: the address of the destination host
110 * @param synchronizeable: reference to the sync object
111 */
112NetworkStream& NetworkManager::establishConnection(/* address, port, object reference*/)
113{
114  /* creating a new network stream */
115  NetworkStream* netStream = new NetworkStream();
116}
117
118
119/**
120 *  teardown a connection
121 */
122void NetworkManager::shutdownConnection()
123{}
124
125
126
127/**
128 *  sync the network
129 */
130void NetworkManager::synchronize()
131{}
132
133
Note: See TracBrowser for help on using the repository browser.