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 33 : ObjectSlaveDataOStream::ObjectSlaveDataOStream( const ObjectCM* cm )
34 : : ObjectDataOStream( cm )
35 33 : , _commit( lunchbox::make_UUID( ))
36 : {
37 33 : }
38 :
39 33 : ObjectSlaveDataOStream::~ObjectSlaveDataOStream()
40 33 : {}
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 : 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 60 : }
|