compoundExitVisitor.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "compoundExitVisitor.h"
00019
00020 #include "config.h"
00021 #include "frame.h"
00022 #include "swapBarrier.h"
00023 #include "window.h"
00024
00025 #include <eq/client/log.h>
00026
00027 using namespace std;
00028 using namespace eq::base;
00029
00030 namespace eq
00031 {
00032 namespace server
00033 {
00034 CompoundExitVisitor::CompoundExitVisitor()
00035 {}
00036
00037 VisitorResult CompoundExitVisitor::visit( Compound* compound )
00038 {
00039 Config* config = compound->getConfig();
00040 EQASSERT( config );
00041
00042 const std::vector< Frame* >& outputFrames = compound->getOutputFrames();
00043 for( vector<Frame*>::const_iterator i = outputFrames.begin();
00044 i != outputFrames.end(); ++i )
00045 {
00046 Frame* frame = *i;
00047 frame->flush();
00048 config->deregisterObject( frame );
00049 }
00050
00051 const std::vector< Frame* >& inputFrames = compound->getInputFrames();
00052 for( vector<Frame*>::const_iterator i = inputFrames.begin();
00053 i != inputFrames.end(); ++i )
00054 {
00055 Frame* frame = *i;
00056 config->deregisterObject( frame );
00057 }
00058
00059 Channel* channel = compound->getChannel();
00060 if( compound->isDestination() && !channel->getSegment( ))
00061 {
00062 EQASSERT( !channel->getView( ));
00063
00064
00065
00066 compound->deactivate();
00067 }
00068
00069 return TRAVERSE_CONTINUE;
00070 }
00071
00072 }
00073 }