Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/subprojects/network/simple_sync.cc @ 10644

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

merged network back to trunk

File size: 1.7 KB
RevLine 
[5650]1/*
2  orxonox - the future of 3D-vertical-scrollers
[5800]3
[5650]4  Copyright (C) 2004 orx
[5800]5
[5650]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.
[5800]10
[5650]11### File Specific:
12    main-programmer: Patrick Boenzli
[5800]13    co-programmer:
[5650]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#include "simple_sync.h"
23
[10114]24
[9869]25#include "loading/fast_factory.h"
[7954]26#include "lib/util/loading/factory.h"
27
[5650]28#include "debug.h"
29
[7954]30CREATE_FACTORY(SimpleSync, CL_SIMPLE_SYNC);
[5800]31
[7954]32
[5650]33/**
34 *  default constructor
35 */
[7954]36SimpleSync::SimpleSync( std::string name )
[5650]37{
[7954]38  setName( name );
39  this->setClassID( CL_SIMPLE_SYNC, "SimpleSync" );
40  in = 0;
41  out = 1;
42  syncStr = "hallo test test";
43  id = this->registerVarId( new SynchronizeableInt( &in, &out, "var", PERMISSION_ALL ) );
44  registerVar( new SynchronizeableString( &syncStr, &syncStr, "syncStr" ) );
[5650]45}
46
[5800]47
[5650]48/**
49 *  default destructor deletes all unneded stuff
50 */
51SimpleSync::~SimpleSync()
52{
53}
54
[7954]55void SimpleSync::debug( )
[5650]56{
[7954]57  printf("IN: %d OUT: %d\n", in, out);
58  printf("str: %s\n", syncStr.c_str());
[5650]59}
60
[7954]61SimpleSync::SimpleSync( const TiXmlElement * root )
[5650]62{
[7954]63  setName( "" );
64  this->setClassID( CL_SIMPLE_SYNC, "SimpleSync" );
65  in = 0;
66  out = 1;
67  syncStr = "hallo test test";
68  id = this->registerVarId( new SynchronizeableInt( &in, &out, "var", PERMISSION_ALL ) );
69  registerVar( new SynchronizeableString( &syncStr, &syncStr, "syncStr" ) );
[5650]70}
71
[5800]72
[5650]73
[5800]74
Note: See TracBrowser for help on using the repository browser.