Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

netobject.cpp

Go to the documentation of this file.
00001 /*
00002         $Id: netobject.cpp,v 1.4 2001/03/17 07:29:34 vaidhy Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #ifdef WIN32
00016 #pragma warning (disable:4786)
00017 #endif
00018 
00019 #include "API/Network/netobject.h"
00020 #include "API/Network/netobject_channel.h"
00021 #include "netobject_generic.h"
00022 #include "netobject_channel_generic.h"
00023 
00024 CL_NetObject::CL_NetObject(const CL_NetObject &copy)
00025 {
00026         impl = copy.impl;
00027         impl->add_ref();
00028 }
00029 
00030 CL_NetObject::CL_NetObject(CL_NetObjectChannel *obj_channel)
00031 : impl(new CL_NetObject_Generic(obj_channel->impl))
00032 {
00033         impl->add_ref();
00034 }
00035 
00036 CL_NetObject::CL_NetObject(int obj_id, CL_NetObjectChannel *obj_channel)
00037 : impl(new CL_NetObject_Generic(obj_id, obj_channel->impl))
00038 {
00039         impl->add_ref();
00040 }
00041 
00042 CL_NetObject::~CL_NetObject()
00043 {
00044         if (impl != NULL && impl->release_ref() == 0) delete impl;
00045 }
00046 
00047 CL_Slot CL_NetObject::connect(
00048         int msg_type,
00049         CL_Slot_v1<CL_InputSource &> *slot)
00050 {
00051         return impl->connect(msg_type, slot);
00052 }
00053 
00054 CL_Slot CL_NetObject::connect(
00055         int talkback_type,
00056         CL_Slot_v2<const CL_NetComputer &, class CL_InputSource &> *slot)
00057 {
00058         return impl->connect(talkback_type, slot);
00059 }
00060 
00061 void CL_NetObject::send(int msg_type, const std::string &message)
00062 {
00063         impl->send(msg_type, message);
00064 }
00065 
00066 void CL_NetObject::talkback(int talkback_type, const std::string &message)
00067 {
00068         impl->talkback(talkback_type, message);
00069 }
00070 
00071 int CL_NetObject::get_obj_id() const
00072 {
00073         return impl->get_obj_id();
00074 }

Generated at Wed Apr 4 19:54:02 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001