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 55 : class CompoundExitVisitor : public CompoundVisitor
31 : {
32 : public:
33 55 : virtual ~CompoundExitVisitor() {}
34 :
35 : /** Visit all compounds. */
36 381 : virtual VisitorResult visit( Compound* compound )
37 : {
38 381 : Channel* channel = compound->getChannel();
39 762 : if( !channel || // non-channel root compounds
40 : // old-school (non-Layout) destination channel
41 381 : ( compound->isDestination() && !channel->getSegment( )))
42 : {
43 55 : LBASSERT( !channel || !channel->getView( ));
44 55 : uint32_t eyes = compound->getEyes();
45 55 : if( eyes == fabric::EYE_UNDEFINED )
46 55 : eyes = fabric::EYES_ALL;
47 :
48 55 : compound->deactivate( eyes );
49 : }
50 :
51 381 : const Frames& outputFrames = compound->getOutputFrames();
52 1350 : for( FramesCIter i = outputFrames.begin();
53 900 : i != outputFrames.end(); ++i )
54 : {
55 69 : Frame* frame = *i;
56 69 : frame->flush();
57 : }
58 :
59 381 : const TileQueues& outputQueues =compound->getOutputTileQueues();
60 1143 : for( TileQueuesCIter i = outputQueues.begin();
61 762 : i != outputQueues.end(); ++i )
62 : {
63 0 : TileQueue* queue = *i;
64 0 : queue->flush();
65 : }
66 :
67 381 : return TRAVERSE_CONTINUE;
68 : }
69 : };
70 : }
71 : }
72 : #endif // EQSERVER_COMPOUNDEXITVISITOR_H
|