LCOV - code coverage report
Current view: top level - eq/server - compoundExitVisitor.h (source / functions) Hit Total Coverage
Test: Equalizer Lines: 18 20 90.0 %
Date: 2017-12-16 05:07:20 Functions: 3 4 75.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2010, Stefan Eilemann <eile@eyescale.ch>
       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             : #ifndef EQSERVER_COMPOUNDEXITVISITOR_H
      19             : #define EQSERVER_COMPOUNDEXITVISITOR_H
      20             : 
      21             : #include "compoundVisitor.h" // base class
      22             : 
      23             : #include <eq/fabric/eye.h>
      24             : 
      25             : namespace eq
      26             : {
      27             : namespace server
      28             : {
      29             : /** The compound visitor exiting a compound tree. */
      30          14 : class CompoundExitVisitor : public CompoundVisitor
      31             : {
      32             : public:
      33          14 :     virtual ~CompoundExitVisitor() {}
      34             :     /** Visit all compounds. */
      35         132 :     virtual VisitorResult visit(Compound* compound)
      36             :     {
      37         132 :         Channel* channel = compound->getChannel();
      38         264 :         if (!channel || // non-channel root compounds
      39             :             // old-school (non-Layout) destination channel
      40         132 :             (compound->isDestination() && !channel->getSegment()))
      41             :         {
      42          14 :             LBASSERT(!channel || !channel->getView());
      43          14 :             uint32_t eyes = compound->getEyes();
      44          14 :             if (eyes == fabric::EYE_UNDEFINED)
      45          14 :                 eyes = fabric::EYES_ALL;
      46             : 
      47          14 :             compound->deactivate(eyes);
      48             :         }
      49             : 
      50         132 :         const Frames& outputFrames = compound->getOutputFrames();
      51         164 :         for (FramesCIter i = outputFrames.begin(); i != outputFrames.end(); ++i)
      52             :         {
      53          32 :             Frame* frame = *i;
      54          32 :             frame->flush();
      55             :         }
      56             : 
      57         132 :         const TileQueues& outputQueues = compound->getOutputTileQueues();
      58         132 :         for (TileQueuesCIter i = outputQueues.begin(); i != outputQueues.end();
      59             :              ++i)
      60             :         {
      61           0 :             TileQueue* queue = *i;
      62           0 :             queue->flush();
      63             :         }
      64             : 
      65         132 :         return TRAVERSE_CONTINUE;
      66             :     }
      67             : };
      68             : }
      69             : }
      70             : #endif // EQSERVER_COMPOUNDEXITVISITOR_H

Generated by: LCOV version 1.11