Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5647 in orxonox.OLD for branches/network/src/lib/network


Ignore:
Timestamp:
Nov 20, 2005, 12:25:50 AM (19 years ago)
Author:
patrick
Message:

network: modiefied the unit test to enable diffrent modes, extended the NetworkStream constructors interface and NetworkManager interface

Location:
branches/network/src/lib/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_manager.cc

    r5609 r5647  
    3131#include "network_manager.h"
    3232
    33 /* include this file, it contains some default definitions */
    34 #include "netdefs.h"
    3533
    3634/* using namespace std is default, this needs to be here */
     
    116114/**
    117115 *  creates a connection from one object to a host
     116 * @param hostName: the name of the destination host
     117 * @param synchronizeable: reference to the sync object
     118 */
     119NetworkStream& establishConnection(const char& hostName, const Synchronizeable& sync)
     120{}
     121
     122
     123/**
     124 *  creates a connection from one object to a host
    118125 * @param address: the address of the destination host
    119126 * @param synchronizeable: reference to the sync object
    120127 */
    121 NetworkStream& NetworkManager::establishConnection(/* address, port, object reference*/)
     128NetworkStream& NetworkManager::establishConnection(const IPaddress& address, const Synchronizeable& sync)
    122129{
    123130  PRINTF(0)("Establish connection...\n");
    124131  /* creating a new network stream, it will register itself automaticaly to the class list */
    125   NetworkStream* netStream = new NetworkStream();
     132//  NetworkStream* netStream = new NetworkStream();
    126133}
    127134
  • branches/network/src/lib/network/network_manager.h

    r5575 r5647  
    99#define _NETWORK_MANAGER
    1010
     11/* include this file, it contains some default definitions */
     12#include "netdefs.h"
    1113
    1214/* include base_object.h since all classes are derived from this one */
    1315#include "base_object.h"
     16
    1417
    1518/* forward declarations for the header file (include the header via #include "bla.h" in the source file) */
     
    3033  void shutdown();
    3134 
    32   NetworkStream& establishConnection(/* address, port, object reference*/);
     35  NetworkStream& establishConnection(const IPaddress& address, const Synchronizeable& sync);
     36  NetworkStream& establishConnection(const char& hostName, const Synchronizeable& sync);
    3337  void shutdownConnection();
    3438 
  • branches/network/src/lib/network/network_stream.cc

    r5615 r5647  
    2121
    2222
     23#include "base_object.h"
     24//#include "network_protocol.h"
     25#include "network_socket.h"
     26#include "connection_monitor.h"
     27#include "synchronizeable.h"
     28#include "list.h"
     29
     30
    2331/* include your own header */
    2432#include "network_stream.h"
     
    2836
    2937
     38NetworkStream::NetworkStream(DataStream& inStream, DataStream& outStream)
     39  : DataStream(inStream, outStream)
     40{
     41  this->init();
     42}
     43
     44NetworkStream::NetworkStream(Synchronizeable& sync, NetworkSocket& socket)
     45  : DataStream(sync, socket)
     46{
     47  this->init();
     48}
     49
     50NetworkStream::NetworkStream(DataStream& inStream, NetworkSocket& socket)
     51  : DataStream(inStream, socket)
     52{
     53  this->init();
     54}
     55
     56NetworkStream::NetworkStream(Synchronizeable& sync, DataStream& outStream)
     57  : DataStream(sync, outStream)
     58{
     59  this->init();
     60}
     61
    3062NetworkStream::NetworkStream()
     63{
     64  this->init();
     65  /* initialize the references */
     66  this->networkSocket = new NetworkSocket();
     67  this->synchronizeables = new Synchronizeable();
     68  this->connectionMonitor = new ConnectionMonitor();
     69}
     70
     71
     72void NetworkStream::init()
    3173{
    3274  /* set the class id for the base object */
    3375  this->setClassID(CL_NETWORK_STREAM, "NetworkStream");
     76}
    3477
    35   /* initialize the references */
    36   this->networkSockets = new NetworkSocket();
    37   this->synchronizeables = new Synchronizeable();
    38   this->connectionMonitor = new ConnectionMonitor();
    39 
    40  
    41 
    42 }
    4378
    4479NetworkStream::~NetworkStream()
  • branches/network/src/lib/network/network_stream.h

    r5610 r5647  
    77#define _NETWORK_STREAM
    88
    9 #include "base_object.h"
    109#include "data_stream.h"
    11 //#include "network_protocol.h"
    12 #include "network_socket.h"
    13 #include "connection_monitor.h"
    14 #include "synchronizeable.h"
    15 #include "list.h"
    1610
     11class Synchronizeable;
     12class NetworkSocket;
     13class ConnectionMonitor;
    1714
    1815class NetworkStream : public virtual DataStream
     
    2118public:
    2219  NetworkStream();
     20  NetworkStream(DataStream& inStream, DataStream& outStream);
     21  NetworkStream(Synchronizeable& sync, NetworkSocket& socket);
     22  NetworkStream(DataStream& inStream, NetworkSocket& socket);
     23  NetworkStream(Synchronizeable& sync, DataStream& outStream);
     24 
    2325  ~NetworkStream();
    24    virtual void processData();
     26   
     27  void init();
     28 
     29  virtual void processData();
    2530
    2631private:
Note: See TracChangeset for help on using the changeset viewer.