LCOV - code coverage report
Current view: top level - co - staticSlaveCM.h (source / functions) Hit Total Coverage
Test: lcov2.info Lines: 6 10 60.0 %
Date: 2014-10-06 Functions: 6 9 66.7 %

          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_STATICSLAVECM_H
      22             : #define CO_STATICSLAVECM_H
      23             : 
      24             : #include "objectCM.h"     // base class
      25             : #include <co/objectVersion.h> // VERSION_FOO values
      26             : #include <lunchbox/thread.h>  // thread-safety check
      27             : 
      28             : namespace co
      29             : {
      30             :     /** @internal
      31             :      * An object change manager handling static object slave instances.
      32             :      */
      33             :     class StaticSlaveCM : public ObjectCM
      34             :     {
      35             :     public:
      36             :         StaticSlaveCM( Object* object );
      37             :         virtual ~StaticSlaveCM();
      38             : 
      39           8 :         void init() override {}
      40             : 
      41             :         /**
      42             :          * @name Versioning
      43             :          */
      44             :         //@{
      45           0 :         uint128_t getHeadVersion() const override { return VERSION_FIRST; }
      46           1 :         uint128_t getVersion() const override { return VERSION_FIRST; }
      47             :         //@}
      48             : 
      49          32 :         bool isMaster() const override { return false; }
      50           8 :         uint32_t getMasterInstanceID() const override
      51           8 :             { return CO_INSTANCE_INVALID; }
      52             : 
      53           0 :         bool addSlave( const MasterCMCommand& ) override
      54           0 :             { LBDONTCALL; return false; }
      55           0 :         void removeSlaves( NodePtr ) override {}
      56             : 
      57             :         void applyMapData( const uint128_t& version ) override;
      58             :         void addInstanceDatas( const ObjectDataIStreamDeque&,
      59             :                                        const uint128_t& startVersion ) override;
      60             :     protected:
      61             :         /** input stream for receiving the current version */
      62             :         ObjectDataIStream* _currentIStream;
      63             : 
      64             :     private:
      65             :         /* The command handlers. */
      66             :         bool _cmdInstance( ICommand& command );
      67          16 :         LB_TS_VAR( _rcvThread );
      68             :     };
      69             : }
      70             : 
      71             : #endif // CO_STATICSLAVECM_H

Generated by: LCOV version 1.10