LCOV - code coverage report
Current view: top level - co - customOCommand.cpp (source / functions) Hit Total Coverage
Test: Collage Lines: 15 28 53.6 %
Date: 2016-12-14 01:26:48 Functions: 6 10 60.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2012, Daniel Nachbaur <danielnachbaur@gmail.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 "customOCommand.h"
      21             : #include "nodeCommand.h"
      22             : 
      23             : namespace co
      24             : {
      25             : 
      26             : namespace detail
      27             : {
      28             : 
      29             : class CustomOCommand
      30             : {
      31             : public:
      32           2 :     explicit CustomOCommand( const uint128_t& commandID_ )
      33           2 :         : commandID( commandID_ )
      34           2 :     {}
      35             : 
      36           0 :     CustomOCommand( const CustomOCommand& rhs )
      37           0 :         : commandID( rhs.commandID )
      38           0 :     {}
      39             : 
      40             :     const uint128_t commandID;
      41             : };
      42             : 
      43             : }
      44             : 
      45           2 : CustomOCommand::CustomOCommand( const Connections& receivers,
      46           2 :                                 const uint128_t& commandID )
      47             :     : OCommand( receivers, CMD_NODE_COMMAND, COMMANDTYPE_NODE )
      48           2 :     , _impl( new detail::CustomOCommand( commandID ))
      49             : {
      50           2 :     _init();
      51           2 : }
      52             : 
      53           0 : CustomOCommand::CustomOCommand( LocalNodePtr localNode,
      54           0 :                                 const uint128_t& commandID )
      55           0 :     : OCommand( localNode.get(), localNode, CMD_NODE_COMMAND, COMMANDTYPE_NODE )
      56           0 :     , _impl( new detail::CustomOCommand( commandID ))
      57             : {
      58           0 :     _init();
      59           0 : }
      60             : 
      61           0 : CustomOCommand::CustomOCommand( const CustomOCommand& rhs )
      62             :     : OCommand( rhs )
      63           0 :     , _impl( new detail::CustomOCommand( *rhs._impl ))
      64             : {
      65           0 :     _init();
      66           0 : }
      67             : 
      68           2 : void CustomOCommand::_init()
      69             : {
      70           2 :     *this << _impl->commandID;
      71           2 : }
      72             : 
      73           4 : CustomOCommand::~CustomOCommand()
      74             : {
      75           2 :     delete _impl;
      76           2 : }
      77             : 
      78          66 : }

Generated by: LCOV version 1.11