LCOV - code coverage report
Current view: top level - co - objectSlaveDataOStream.cpp (source / functions) Hit Total Coverage
Test: Collage Lines: 6 17 35.3 %
Date: 2016-12-14 01:26:48 Functions: 4 7 57.1 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2007-2014, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                    2010, Cedric Stalder  <cedric.stalder@gmail.com>
       4             :  *                    2012, Daniel Nachbaur <danielnachbaur@gmail.com>
       5             :  *
       6             :  * This file is part of Collage <https://github.com/Eyescale/Collage>
       7             :  *
       8             :  * This library is free software; you can redistribute it and/or modify it under
       9             :  * the terms of the GNU Lesser General Public License version 2.1 as published
      10             :  * by the Free Software Foundation.
      11             :  *
      12             :  * This library is distributed in the hope that it will be useful, but WITHOUT
      13             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      14             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      15             :  * details.
      16             :  *
      17             :  * You should have received a copy of the GNU Lesser General Public License
      18             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      19             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      20             :  */
      21             : 
      22             : #include "objectSlaveDataOStream.h"
      23             : 
      24             : #include "log.h"
      25             : #include "versionedMasterCM.h"
      26             : #include "object.h"
      27             : #include "objectCommand.h"
      28             : #include "objectDataIStream.h"
      29             : #include "objectDataOCommand.h"
      30             : 
      31             : namespace co
      32             : {
      33          34 : ObjectSlaveDataOStream::ObjectSlaveDataOStream( const ObjectCM* cm )
      34             :     : ObjectDataOStream( cm )
      35          34 :     ,  _commit( lunchbox::make_UUID( ))
      36             : {
      37          34 : }
      38             : 
      39          34 : ObjectSlaveDataOStream::~ObjectSlaveDataOStream()
      40          34 : {}
      41             : 
      42           0 : void ObjectSlaveDataOStream::enableSlaveCommit( NodePtr node )
      43             : {
      44           0 :     _version = lunchbox::make_UUID();
      45           0 :     _setupConnection( node, false /* useMulticast */ );
      46           0 :     _enable();
      47           0 : }
      48             : 
      49           0 : void ObjectSlaveDataOStream::sendData( const void* data, const uint64_t size,
      50             :                                        const bool last )
      51             : {
      52           0 :     send( CMD_OBJECT_SLAVE_DELTA, COMMANDTYPE_OBJECT,
      53           0 :           _cm->getObject()->getMasterInstanceID(), data, size, last ) <<_commit;
      54             : 
      55           0 :     if( last )
      56           0 :         _commit = lunchbox::make_UUID();
      57           0 : }
      58             : 
      59          66 : }

Generated by: LCOV version 1.11