LCOV - code coverage report
Current view: top level - eq - eventICommand.cpp (source / functions) Hit Total Coverage
Test: Equalizer Lines: 21 23 91.3 %
Date: 2017-12-16 05:07:20 Functions: 8 10 80.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2012-2016, Daniel Nachbaur <danielnachbaur@gmail.com>
       3             :  *
       4             :  * This library is free software; you can redistribute it and/or modify it under
       5             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       6             :  * by the Free Software Foundation.
       7             :  *
       8             :  * This library is distributed in the hope that it will be useful, but WITHOUT
       9             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      10             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      11             :  * details.
      12             :  *
      13             :  * You should have received a copy of the GNU Lesser General Public License
      14             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      15             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      16             :  */
      17             : 
      18             : #include "eventICommand.h"
      19             : 
      20             : #include <eq/fabric/event.h>
      21             : 
      22             : namespace eq
      23             : {
      24             : namespace detail
      25             : {
      26             : class EventICommand
      27             : {
      28             : public:
      29          54 :     EventICommand()
      30          54 :         : eventType(0)
      31             :     {
      32          54 :     }
      33             : 
      34             :     uint32_t eventType;
      35             : };
      36             : }
      37             : 
      38          23 : EventICommand::EventICommand(const co::ICommand& command)
      39             :     : co::ObjectICommand(command)
      40          23 :     , _impl(new detail::EventICommand)
      41             : {
      42          23 :     _init();
      43          23 : }
      44             : 
      45          31 : EventICommand::EventICommand(const EventICommand& rhs)
      46             :     : co::ObjectICommand(rhs)
      47          31 :     , _impl(new detail::EventICommand)
      48             : {
      49          31 :     _init();
      50          31 : }
      51             : 
      52         108 : EventICommand::~EventICommand()
      53             : {
      54          54 :     delete _impl;
      55          54 : }
      56             : 
      57          54 : void EventICommand::_init()
      58             : {
      59          54 :     if (isValid())
      60          47 :         *this >> _impl->eventType;
      61          54 : }
      62             : 
      63          31 : uint32_t EventICommand::getEventType() const
      64             : {
      65          31 :     return _impl->eventType;
      66             : }
      67             : 
      68           0 : std::ostream& operator<<(std::ostream& os, const EventICommand& event)
      69             : {
      70           0 :     return os << "Event command, type " << EventType(event.getEventType());
      71             : }
      72          30 : }

Generated by: LCOV version 1.11