Index: trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.cc
===================================================================
--- trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.cc	(revision 10114)
+++ trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.cc	(revision 10114)
@@ -0,0 +1,75 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christoph Renner
+   co-programmer: ...
+*/
+
+
+#include "synchronizeable_classid.h"
+#include "converter.h"
+
+#include <cassert>
+
+/**
+ * standard constructor
+ * @todo this constructor is not jet implemented - do it
+*/
+SynchronizeableClassID::SynchronizeableClassID( BaseObject * ptrIn, std::string name, int permission, int priority) : SynchronizeableVar( ptrIn, ptrIn, name, INTSIZE, permission, priority )
+{
+  this->vPtrIn = ptrIn;
+  this->vPtrOut = ptrIn;
+}
+
+
+/**
+ * standard deconstructor
+*/
+SynchronizeableClassID::~SynchronizeableClassID ()
+{
+}
+
+/**
+ * write var data to byte buffer
+ * @param buf pointer to write to
+ * @param maxLength writeToBuf will not write more than maxLength bytes
+ * @return number bytes written
+ */
+int SynchronizeableClassID::writeToBuf( byte * buf, int maxLength )
+{
+  int res = Converter::intToByteArray( vPtrIn->getClassID().id(), buf, maxLength );
+
+  assert( res == INTSIZE );
+
+  return res;
+}
+
+/**
+ * read var data from byte buffer. actually this function does nothing but 
+ * return INTSIZE
+ * @param buf pointer to read from
+ * @param maxLength readFromBuf will not read more than maxLength bytes
+ * @return number bytes read
+ */
+int SynchronizeableClassID::readFromBuf( byte * buf, int maxLength )
+{
+  return INTSIZE;
+}
+
+
+/**
+ * print out variable value
+ */
+void SynchronizeableClassID::debug( )
+{
+  printf( "SYNCHRONIZEABLE_VAR: %s IN: %d\n", name.c_str(), vPtrIn->getClassID().id() );
+}
+
Index: trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.h
===================================================================
--- trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.h	(revision 10114)
+++ trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.h	(revision 10114)
@@ -0,0 +1,38 @@
+/*!
+ * @file synchronizeable_int.h
+ * @brief Definition of SynchronizeableInt
+*/
+
+
+#ifndef _SYNCHRONIZEABLE_CLASSID_H
+#define _SYNCHRONIZEABLE_CLASSID_H
+
+#include "synchronizeable_var.h"
+
+class BaseObject;
+
+class SynchronizeableClassID : public SynchronizeableVar {
+
+  public:
+    SynchronizeableClassID( BaseObject * ptrIn, std::string name, int permission, int priority = 0 );
+    virtual ~SynchronizeableClassID();
+
+    virtual int writeToBuf( byte * buf, int maxLength );
+    virtual int readFromBuf( byte * buf, int maxLength );
+
+    /**
+     * check if writeToBuf will return the same size every time
+     * @return true if same size every time
+     */
+    virtual bool hasStaticSize(){ return true; };
+
+    virtual void debug();
+
+  protected:
+    BaseObject * vPtrIn;       //!< pointer to data (read)
+    BaseObject * vPtrOut;      //!< pointer to data (write)
+
+
+};
+
+#endif /* _PROTO_CLASS_H */
Index: trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.cc
===================================================================
--- trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.cc	(revision 10114)
+++ trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.cc	(revision 10114)
@@ -0,0 +1,176 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christoph Renner
+   co-programmer: ...
+*/
+
+
+#include "synchronizeable_classid_list.h"
+#include "converter.h"
+#include <cassert>
+
+
+/**
+ * standard constructor
+ * @todo this constructor is not jet implemented - do it
+*/
+SynchronizeableClassIDList::SynchronizeableClassIDList( std::map< std::string, int > * ptrIn, std::map< std::string, int > * ptrOut, std::string name, int permission, int priority) : SynchronizeableVar( ptrIn, ptrOut, name, 0, permission, priority )
+{
+  this->vPtrIn = ptrIn;
+  this->vPtrOut = ptrOut;
+}
+
+
+/**
+ * standard deconstructor
+*/
+SynchronizeableClassIDList::~SynchronizeableClassIDList ()
+{
+}
+
+/**
+ * write var data to byte buffer
+ * @param buf pointer to write to
+ * @param maxLength writeToBuf will not write more than maxLength bytes
+ * @return number bytes written
+ */
+int SynchronizeableClassIDList::writeToBuf( byte * buf, int maxLength )
+{
+  int res = 0;
+  int n;
+
+  std::map< std::string, int >::const_iterator it;
+  
+  n = Converter::intToByteArray( vPtrIn->size(), buf, maxLength );
+  assert( n == INTSIZE );
+  res += n;
+  
+  for ( it = vPtrIn->begin(); it != vPtrIn->end(); it++ )
+  {
+    n = Converter::stringToByteArray( it->first, buf+res, maxLength-res );
+    assert( n == (int)it->first.length()+INTSIZE );
+    res += n;
+    
+    n = Converter::intToByteArray( it->second, buf+res, maxLength-res );
+    assert( n == INTSIZE );
+    res += n;
+  }
+
+  return res;
+}
+
+int SynchronizeableClassIDList::getSize()
+{
+   int res = 0;
+   
+   std::map< std::string, int >::const_iterator it;
+  
+   res += INTSIZE;
+  
+   for ( it = vPtrIn->begin(); it != vPtrIn->end(); it++ )
+   {
+     res += it->first.length()+2*INTSIZE;
+   }
+   
+   return res;
+}
+
+/**
+ * read var data from byte buffer
+ * @param buf pointer to read from
+ * @param maxLength readFromBuf will not read more than maxLength bytes
+ * @return number bytes read
+ */
+int SynchronizeableClassIDList::readFromBuf( byte * buf, int maxLength )
+{
+  setHasChanged( false );
+
+  int res = 0;
+  int num;
+  
+  assert( maxLength >= INTSIZE );
+  int n = Converter::byteArrayToInt( buf, &num );
+  assert( n == INTSIZE );
+  res += n;
+  
+  int id;
+  std::string name;
+  
+  for ( int i = 0; i < num; i++ )
+  {
+    n = Converter::byteArrayToString( buf+res, name, maxLength-res );
+    assert( n > 0 );
+    res += n;
+    
+    n = Converter::byteArrayToInt( buf+res, &id );
+    assert( n == INTSIZE );
+    res += n;
+    
+    if ( vPtrOut->find(name) == vPtrOut->end() )
+      setHasChanged( true );
+    else
+    {
+      if ( (*vPtrOut)[name] != id )
+      {
+        setHasChanged( true );
+      }
+    }
+    
+    (*vPtrOut)[name] = id;
+  }
+
+  return res;
+}
+
+/**
+ * print out variable value
+ */
+void SynchronizeableClassIDList::debug( )
+{
+
+}
+
+
+/**
+ * reads actual size from buffer. this is used when size is not constant
+ * @param buf pointer to data
+ * @param maxLength maximal size of data
+ * @return same as readFromBuf would return
+ */
+int SynchronizeableClassIDList::getSizeFromBuf( byte * buf, int maxLength )
+{
+  int res = 0;
+  int num;
+  
+  assert( maxLength >= INTSIZE );
+  int n = Converter::byteArrayToInt( buf, &num );
+  assert( n == INTSIZE );
+  res += n;
+  
+  int id;
+  std::string name;
+  
+  for ( int i = 0; i < num; i++ )
+  {
+    n = Converter::byteArrayToString( buf+res, name, maxLength-res );
+    assert( n > 0 );
+    res += n;
+    
+    n = Converter::byteArrayToInt( buf+res, &id );
+    assert( n == INTSIZE );
+    res += n;
+  }
+
+  return res;
+}
+
+
Index: trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.h
===================================================================
--- trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.h	(revision 10114)
+++ trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.h	(revision 10114)
@@ -0,0 +1,42 @@
+/*!
+ * @file synchronizeable_classid_list.h
+ * @brief Definition of SynchronizeableClassIDList
+*/
+
+#ifndef _SYNCHRONIZEABLE_CLASSID_LIST_H
+#define _SYNCHRONIZEABLE_CLASSID_LIST_H
+
+#include "synchronizeable_var.h"
+
+#include <map>
+#include <string>
+
+class SynchronizeableClassIDList : public SynchronizeableVar {
+
+  public:
+    SynchronizeableClassIDList( std::map< std::string, int > * ptrIn, std::map< std::string, int > * ptrOut, std::string name, int permission, int priority = 0 );
+    virtual ~SynchronizeableClassIDList();
+
+    virtual int writeToBuf( byte * buf, int maxLength );
+    virtual int readFromBuf( byte * buf, int maxLength );
+
+
+    /**
+     * check if writeToBuf will return the same size every time
+     * @return true if same size every time
+     */
+    virtual bool hasStaticSize(){ return false; };
+
+    virtual int getSize();
+
+    virtual int getSizeFromBuf( byte * buf, int maxLength );
+
+    virtual void debug();
+
+  private:
+    std::map< std::string, int > * vPtrIn;       //!< pointer to data (read)
+    std::map< std::string, int > * vPtrOut;      //!< pointer to data (write)
+
+};
+
+#endif /* _SYNCHRONIZEABLE_STRING_H */
