Equalizer
1.4.1
|
00001 00002 /* Copyright (c) 2009-2010, Stefan Eilemann <eile@equalizergraphics.com> 00003 * 00004 * This library is free software; you can redistribute it and/or modify it under 00005 * the terms of the GNU Lesser General Public License version 2.1 as published 00006 * by the Free Software Foundation. 00007 * 00008 * This library is distributed in the hope that it will be useful, but WITHOUT 00009 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00010 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00011 * details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public License 00014 * along with this library; if not, write to the Free Software Foundation, Inc., 00015 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00016 */ 00017 00018 #ifndef EQFABRIC_PATHS_H 00019 #define EQFABRIC_PATHS_H 00020 00021 #include "types.h" 00022 00024 namespace eq 00025 { 00026 namespace fabric 00027 { 00028 00029 //----- defines path types with are used to reference entities 00030 // node...channel hierarchy 00031 struct NodePath 00032 { 00033 NodePath( const uint32_t index = 0 ) : nodeIndex( index ) {} 00034 uint32_t nodeIndex; 00035 }; 00036 00037 struct PipePath : public NodePath 00038 { 00039 PipePath( const uint32_t index = 0 ) : pipeIndex( index ) {} 00040 PipePath( const NodePath& p ) : NodePath( p ), pipeIndex( 0 ) {} 00041 uint32_t pipeIndex; 00042 }; 00043 00044 struct WindowPath : public PipePath 00045 { 00046 WindowPath( const uint32_t index = 0 ) : windowIndex( index ) {} 00047 WindowPath( const PipePath& p ) : PipePath( p ), windowIndex( 0 ) {} 00048 uint32_t windowIndex; 00049 }; 00050 00051 struct ChannelPath : public WindowPath 00052 { 00053 ChannelPath( const uint32_t index = 0 ) : channelIndex( index ) {} 00054 ChannelPath( const WindowPath& p ) : WindowPath( p ), channelIndex( 0 ) {} 00055 uint32_t channelIndex; 00056 }; 00057 00058 // View hierarchy 00059 struct CanvasPath 00060 { 00061 CanvasPath( const uint32_t index = 0 ) : canvasIndex( index ) {} 00062 uint32_t canvasIndex; 00063 }; 00064 00065 struct SegmentPath : public CanvasPath 00066 { 00067 SegmentPath( const uint32_t index = 0 ) : segmentIndex( index ) {} 00068 SegmentPath( const CanvasPath& p ) : CanvasPath( p ), segmentIndex( 0 ) {} 00069 uint32_t segmentIndex; 00070 }; 00071 00072 struct ObserverPath 00073 { 00074 ObserverPath( const uint32_t index = 0 ) : observerIndex( index ) {} 00075 uint32_t observerIndex; 00076 }; 00077 00078 struct LayoutPath 00079 { 00080 LayoutPath( const uint32_t index = 0 ) : layoutIndex( index ) {} 00081 uint32_t layoutIndex; 00082 }; 00083 00084 struct ViewPath : public LayoutPath 00085 { 00086 ViewPath( const uint32_t index = 0 ) : viewIndex( index ) {} 00087 ViewPath( const LayoutPath& p ) : LayoutPath( p ), viewIndex( 0 ) {} 00088 uint32_t viewIndex; 00089 }; 00090 00091 // ostream operators 00092 inline std::ostream& operator << ( std::ostream& os, const NodePath& path ) 00093 { 00094 os << "node " << path.nodeIndex; 00095 return os; 00096 } 00097 inline std::ostream& operator << ( std::ostream& os, const PipePath& path ) 00098 { 00099 os << static_cast< const NodePath& >( path ) << " pipe " << path.pipeIndex; 00100 return os; 00101 } 00102 inline std::ostream& operator << ( std::ostream& os, const WindowPath& path ) 00103 { 00104 os << static_cast< const PipePath& >( path ) << " window " 00105 << path.windowIndex; 00106 return os; 00107 } 00108 inline std::ostream& operator << ( std::ostream& os, const ChannelPath& path ) 00109 { 00110 os << static_cast< const WindowPath& >( path ) << " channel " 00111 << path.channelIndex; 00112 return os; 00113 } 00114 00115 inline std::ostream& operator << ( std::ostream& os, const ObserverPath& path ) 00116 { 00117 os << "observer " << path.observerIndex; 00118 return os; 00119 } 00120 00121 inline std::ostream& operator << ( std::ostream& os, const LayoutPath& path ) 00122 { 00123 os << "layout " << path.layoutIndex; 00124 return os; 00125 } 00126 inline std::ostream& operator << ( std::ostream& os, const ViewPath& path ) 00127 { 00128 os << static_cast< const LayoutPath& >( path ) << " view " 00129 << path.viewIndex; 00130 return os; 00131 } 00132 00133 inline std::ostream& operator << ( std::ostream& os, const CanvasPath& path ) 00134 { 00135 os << "canvas " << path.canvasIndex; 00136 return os; 00137 } 00138 inline std::ostream& operator << ( std::ostream& os, const SegmentPath& path ) 00139 { 00140 os << static_cast< const CanvasPath& >( path ) << " segment " 00141 << path.segmentIndex; 00142 return os; 00143 } 00146 } 00147 } 00148 #endif // EQFABRIC_PATHS_H