LCOV - code coverage report
Current view: top level - co - masterCMCommand.cpp (source / functions) Hit Total Coverage
Test: Collage Lines: 37 45 82.2 %
Date: 2018-01-09 16:37:03 Functions: 15 18 83.3 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2012-2015, Daniel Nachbaur <danielnachbaur@gmail.com>
       3             :  *                          Stefan.Eilemann@epfl.ch
       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             : #include "masterCMCommand.h"
      22             : 
      23             : namespace co
      24             : {
      25             : namespace detail
      26             : {
      27             : class MasterCMCommand
      28             : {
      29             : public:
      30          40 :     MasterCMCommand()
      31          40 :         : maxVersion(0)
      32             :         , requestID(0)
      33             :         , instanceID(CO_INSTANCE_INVALID)
      34             :         , masterInstanceID(CO_INSTANCE_INVALID)
      35          40 :         , useCache(false)
      36             :     {
      37          40 :     }
      38             : 
      39           0 :     MasterCMCommand(const MasterCMCommand&)
      40           0 :         : maxVersion(0)
      41             :         , requestID(0)
      42             :         , instanceID(CO_INSTANCE_INVALID)
      43             :         , masterInstanceID(CO_INSTANCE_INVALID)
      44           0 :         , useCache(false)
      45             :     {
      46           0 :     }
      47             : 
      48             :     uint128_t requestedVersion;
      49             :     uint128_t minCachedVersion;
      50             :     uint128_t maxCachedVersion;
      51             :     uint128_t objectID;
      52             :     uint64_t maxVersion;
      53             :     uint32_t requestID;
      54             :     uint32_t instanceID;
      55             :     uint32_t masterInstanceID;
      56             :     bool useCache;
      57             : };
      58             : }
      59             : 
      60          40 : MasterCMCommand::MasterCMCommand(const ICommand& command)
      61             :     : ICommand(command)
      62          40 :     , _impl(new detail::MasterCMCommand)
      63             : {
      64          40 :     _init();
      65          40 : }
      66             : 
      67           0 : MasterCMCommand::MasterCMCommand(const MasterCMCommand& rhs)
      68             :     : ICommand(rhs)
      69           0 :     , _impl(new detail::MasterCMCommand(*rhs._impl))
      70             : {
      71           0 :     _init();
      72           0 : }
      73             : 
      74          40 : void MasterCMCommand::_init()
      75             : {
      76          40 :     if (isValid())
      77          40 :         *this >> _impl->requestedVersion >> _impl->minCachedVersion >>
      78          80 :             _impl->maxCachedVersion >> _impl->objectID >> _impl->maxVersion >>
      79          80 :             _impl->requestID >> _impl->instanceID >> _impl->masterInstanceID >>
      80          80 :             _impl->useCache;
      81          40 : }
      82             : 
      83          80 : MasterCMCommand::~MasterCMCommand()
      84             : {
      85          40 :     delete _impl;
      86          40 : }
      87             : 
      88          68 : const uint128_t& MasterCMCommand::getRequestedVersion() const
      89             : {
      90          68 :     return _impl->requestedVersion;
      91             : }
      92             : 
      93          30 : const uint128_t& MasterCMCommand::getMinCachedVersion() const
      94             : {
      95          30 :     return _impl->minCachedVersion;
      96             : }
      97             : 
      98          34 : const uint128_t& MasterCMCommand::getMaxCachedVersion() const
      99             : {
     100          34 :     return _impl->maxCachedVersion;
     101             : }
     102             : 
     103         116 : const uint128_t& MasterCMCommand::getObjectID() const
     104             : {
     105         116 :     return _impl->objectID;
     106             : }
     107             : 
     108          34 : uint64_t MasterCMCommand::getMaxVersion() const
     109             : {
     110          34 :     return _impl->maxVersion;
     111             : }
     112             : 
     113          80 : uint32_t MasterCMCommand::getRequestID() const
     114             : {
     115          80 :     return _impl->requestID;
     116             : }
     117             : 
     118         114 : uint32_t MasterCMCommand::getInstanceID() const
     119             : {
     120         114 :     return _impl->instanceID;
     121             : }
     122             : 
     123           4 : uint32_t MasterCMCommand::getMasterInstanceID() const
     124             : {
     125           4 :     return _impl->masterInstanceID;
     126             : }
     127             : 
     128          76 : bool MasterCMCommand::useCache() const
     129             : {
     130          76 :     return _impl->useCache;
     131             : }
     132          63 : }

Generated by: LCOV version 1.11