LCOV - code coverage report
Current view: top level - co - objectVersion.cpp (source / functions) Hit Total Coverage
Test: Collage Lines: 17 24 70.8 %
Date: 2016-12-14 01:26:48 Functions: 6 7 85.7 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2009-2013, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *
       4             :  * This file is part of Collage <https://github.com/Eyescale/Collage>
       5             :  *
       6             :  * This library is free software; you can redistribute it and/or modify it under
       7             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       8             :  * by the Free Software Foundation.
       9             :  *
      10             :  * This library is distributed in the hope that it will be useful, but WITHOUT
      11             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      12             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      13             :  * details.
      14             :  *
      15             :  * You should have received a copy of the GNU Lesser General Public License
      16             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      17             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      18             :  */
      19             : 
      20             : #include "objectVersion.h"
      21             : 
      22             : #include "object.h"
      23             : 
      24             : namespace co
      25             : {
      26          12 : ObjectVersion::ObjectVersion()
      27          12 :         : version( VERSION_NONE )
      28          12 : {}
      29             : 
      30      197297 : ObjectVersion::ObjectVersion( const uint128_t& id_, const uint128_t& version_ )
      31      197297 :         : identifier( id_ ), version( version_ )
      32      197297 : {}
      33             : 
      34          25 : ObjectVersion::ObjectVersion( const Object* object )
      35          25 :         : version( VERSION_NONE )
      36             : {
      37          25 :     if( object && object->isAttached( ))
      38             :     {
      39          25 :         identifier = object->getID();
      40          25 :         version = object->getVersion();
      41             :     }
      42          25 : }
      43             : 
      44           2 : ObjectVersion::ObjectVersion( const Object& object )
      45           2 :     : identifier( object.getID( ))
      46           2 :     , version( object.getVersion( ))
      47           2 : {}
      48             : 
      49           0 : ObjectVersion& ObjectVersion::operator = ( const Object* object )
      50             : {
      51           0 :     if( object )
      52             :     {
      53           0 :         identifier = object->getID();
      54           0 :         version = object->getVersion();
      55             :     }
      56             :     else
      57             :     {
      58           0 :         identifier = 0;
      59           0 :         version = VERSION_NONE;
      60             :     }
      61             : 
      62           0 :     return *this;
      63             : }
      64             : 
      65          66 : }

Generated by: LCOV version 1.11