objectDeltaDataOStream.cpp

00001 
00002 /* Copyright (c) 2007-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #include "objectDeltaDataOStream.h"
00019 
00020 #include "log.h"
00021 #include "object.h"
00022 #include "packets.h"
00023 #include "session.h"
00024 
00025 #include <eq/base/idPool.h>
00026 
00027 using namespace std;
00028 
00029 namespace eq
00030 {
00031 namespace net
00032 {
00033 ObjectDeltaDataOStream::ObjectDeltaDataOStream( const Object* object)
00034         : ObjectDataOStream( object )
00035 {}
00036 
00037 ObjectDeltaDataOStream::~ObjectDeltaDataOStream()
00038 {}
00039 
00040 void ObjectDeltaDataOStream::sendBuffer( const void* buffer,
00041                                          const uint64_t size )
00042 {
00043     ObjectDeltaDataPacket deltaPacket;
00044     deltaPacket.deltaSize  = size;
00045     deltaPacket.sessionID  = _object->getSession()->getID();
00046     deltaPacket.objectID   = _object->getID();
00047     deltaPacket.instanceID = _instanceID;
00048 
00049     EQLOG( LOG_OBJECTS ) << "send " << &deltaPacket << " to " 
00050                          << _connections.size() << " receivers " << endl;
00051     Connection::send( _connections, deltaPacket, buffer, size, true );
00052 }
00053 
00054 void ObjectDeltaDataOStream::sendFooter( const void* buffer, 
00055                                          const uint64_t size )
00056 {
00057     ObjectDeltaPacket deltaPacket;
00058     deltaPacket.version    = _version;
00059     deltaPacket.deltaSize  = size;
00060     deltaPacket.sessionID  = _object->getSession()->getID();
00061     deltaPacket.objectID   = _object->getID();
00062     deltaPacket.instanceID = _instanceID;
00063 
00064     EQLOG( LOG_OBJECTS ) << "send " << &deltaPacket << " to " 
00065                          << _connections.size() << " receivers " << endl;
00066     Connection::send( _connections, deltaPacket, buffer, size, true );
00067 }
00068 }
00069 }
Generated on Mon Aug 10 18:58:40 2009 for Equalizer 0.9 by  doxygen 1.5.8