Equalizer 1.0
|
00001 00002 /* Copyright (c) 2008-2010, Stefan Eilemann <eile@equalizergraphics.com> 00003 * 2010, Cedric Stalder <cedric.stalder@gmail.com> 00004 * 00005 * This library is free software; you can redistribute it and/or modify it under 00006 * the terms of the GNU Lesser General Public License version 2.1 as published 00007 * by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, but WITHOUT 00010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00012 * details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public License 00015 * along with this library; if not, write to the Free Software Foundation, Inc., 00016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00017 */ 00018 00019 #ifndef EQFABRIC_ELEMENTVISITOR_H 00020 #define EQFABRIC_ELEMENTVISITOR_H 00021 00022 #include <eq/fabric/leafVisitor.h> // base class 00023 00024 namespace eq 00025 { 00026 namespace fabric 00027 { 00029 template< class T, class C > class ElementVisitor : public C 00030 { 00031 public: 00033 ElementVisitor(){} 00034 00036 virtual ~ElementVisitor(){} 00037 00039 virtual VisitorResult visitPre( T* element ) 00040 { return visitPre( static_cast< const T* >( element )); } 00041 00043 virtual VisitorResult visitPost( T* element ) 00044 { return visitPost( static_cast< const T* >( element )); } 00045 00047 virtual VisitorResult visitPre( const T* ) 00048 { return TRAVERSE_CONTINUE; } 00049 00051 virtual VisitorResult visitPost( const T* ) 00052 { return TRAVERSE_CONTINUE; } 00053 }; 00054 } 00055 } 00056 #endif // EQFABRIC_ELEMENTVISITOR_H