Line data Source code
1 :
2 : /* Copyright (c) 2007-2014, Stefan Eilemann <eile@equalizergraphics.com>
3 : * 2011-2012, Daniel Nachbaur <danielnachbaur@gmail.com>
4 : *
5 : * This file is part of Collage <https://github.com/Eyescale/Collage>
6 : *
7 : * This library is free software; you can redistribute it and/or modify it under
8 : * the terms of the GNU Lesser General Public License version 2.1 as published
9 : * by the Free Software Foundation.
10 : *
11 : * This library is distributed in the hope that it will be useful, but WITHOUT
12 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 : * details.
15 : *
16 : * You should have received a copy of the GNU Lesser General Public License
17 : * along with this library; if not, write to the Free Software Foundation, Inc.,
18 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 : */
20 :
21 : #ifndef CO_NULLCM_H
22 : #define CO_NULLCM_H
23 :
24 : #include "objectCM.h" // base class
25 :
26 : namespace co
27 : {
28 : class Node;
29 :
30 : /**
31 : * The NOP object change manager for unmapped objects.
32 : * @internal
33 : */
34 : class NullCM : public ObjectCM
35 : {
36 : public:
37 20 : NullCM() : ObjectCM( 0 ) {}
38 40 : virtual ~NullCM() {}
39 :
40 28 : void init() override {}
41 :
42 0 : void push( const uint128_t&, const uint128_t&,
43 0 : const Nodes& ) override { LBDONTCALL; }
44 0 : bool sendSync( const MasterCMCommand& ) override
45 0 : { LBDONTCALL; return false; }
46 :
47 0 : uint128_t getHeadVersion() const override
48 0 : { return VERSION_NONE; }
49 0 : uint128_t getVersion() const override { return VERSION_NONE; }
50 82 : bool isMaster() const override { return false; }
51 0 : uint32_t getMasterInstanceID() const override
52 0 : { LBDONTCALL; return CO_INSTANCE_INVALID; }
53 :
54 0 : bool addSlave( const MasterCMCommand& ) override
55 0 : { LBDONTCALL; return false; }
56 0 : void removeSlaves( NodePtr ) override { LBDONTCALL; }
57 :
58 : private:
59 : };
60 : }
61 :
62 : #endif // CO_NULLCM_H
|