LCOV - code coverage report
Current view: top level - co - staticMasterCM.h (source / functions) Hit Total Coverage
Test: Collage Lines: 7 13 53.8 %
Date: 2016-12-14 01:26:48 Functions: 7 12 58.3 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2007-2016, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                          Cedric Stalder <cedric.stalder@gmail.com>
       4             :  *                          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             : #ifndef CO_STATICMASTERCM_H
      23             : #define CO_STATICMASTERCM_H
      24             : 
      25             : #include "objectCM.h"    // base class
      26             : #include <co/version.h>  // enum
      27             : #include "objectInstanceDataOStream.h"
      28             : 
      29             : #include <deque>
      30             : 
      31             : namespace co
      32             : {
      33             : class Node;
      34             : 
      35             : /** @internal
      36             :  * An object change manager handling a static master instance.
      37             :  */
      38             : class StaticMasterCM : public ObjectCM
      39             : {
      40             : public:
      41           8 :     explicit StaticMasterCM( Object* object ) : ObjectCM( object ) {}
      42          16 :     virtual ~StaticMasterCM() {}
      43             : 
      44           8 :     void init() override {}
      45             : 
      46             :     /** @name Versioning */
      47             :     //@{
      48           0 :     void setAutoObsolete( const uint32_t ) override {}
      49           0 :     uint32_t getAutoObsolete() const override { return 0; }
      50             : 
      51           0 :     uint128_t getHeadVersion() const override { return VERSION_FIRST; }
      52           1 :     uint128_t getVersion() const override { return VERSION_FIRST; }
      53             :     //@}
      54             : 
      55          40 :     bool isMaster() const override { return true; }
      56           0 :     uint32_t getMasterInstanceID() const override
      57           0 :         { LBDONTCALL; return CO_INSTANCE_INVALID; }
      58             : 
      59           8 :     bool addSlave( const MasterCMCommand& command ) override
      60           8 :         { return ObjectCM::_addSlave( command, VERSION_FIRST ); }
      61           0 :     void removeSlaves( NodePtr ) override { /* NOP */}
      62             : };
      63             : }
      64             : 
      65             : #endif // CO_STATICMASTERCM_H

Generated by: LCOV version 1.11