paths.h

00001 
00002 /* Copyright (c) 2009, 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 EQSERVER_PATHS_H
00019 #define EQSERVER_PATHS_H
00020 
00021 #include "types.h"
00022 
00023 namespace eq
00024 {
00025 namespace server
00026 {
00027 
00028 //----- defines path types with are used to reference entities
00029 // node...channel hierarchy
00030 struct NodePath
00031 {
00032     NodePath( const uint32_t index = 0 ) : nodeIndex( index ) {}
00033     uint32_t nodeIndex;
00034 };
00035 
00036 struct PipePath : public NodePath
00037 {
00038     PipePath( const uint32_t index = 0 ) : pipeIndex( index ) {}
00039     PipePath( const NodePath& p ) : NodePath( p ), pipeIndex( 0 ) {}
00040     uint32_t pipeIndex;
00041 };
00042 
00043 struct WindowPath : public PipePath
00044 {
00045     WindowPath( const uint32_t index = 0 ) : windowIndex( index ) {}
00046     WindowPath( const PipePath& p ) : PipePath( p ), windowIndex( 0 ) {}
00047     uint32_t windowIndex;
00048 };
00049 
00050 struct ChannelPath : public WindowPath
00051 {
00052     ChannelPath( const uint32_t index = 0 ) : channelIndex( index ) {}
00053     ChannelPath( const WindowPath& p ) : WindowPath( p ), channelIndex( 0 ) {}
00054     uint32_t channelIndex;
00055 };
00056 
00057 // View hierarchy
00058 struct CanvasPath
00059 {
00060     CanvasPath( const uint32_t index = 0 ) : canvasIndex( index ) {}
00061     uint32_t canvasIndex;
00062 };
00063 
00064 struct SegmentPath : public CanvasPath
00065 {
00066     SegmentPath( const uint32_t index = 0 ) : segmentIndex( index ) {}
00067     SegmentPath( const CanvasPath& p ) : CanvasPath( p ), segmentIndex( 0 ) {}
00068     uint32_t segmentIndex;
00069 };
00070 
00071 struct ObserverPath
00072 {
00073     ObserverPath( const uint32_t index = 0 ) : observerIndex( index ) {}
00074     uint32_t observerIndex;
00075 };
00076 
00077 struct LayoutPath
00078 {
00079     LayoutPath( const uint32_t index = 0 ) : layoutIndex( index ) {}
00080     uint32_t layoutIndex;
00081 };
00082 
00083 struct ViewPath : public LayoutPath
00084 {
00085     ViewPath( const uint32_t index = 0 ) : viewIndex( index ) {}
00086     ViewPath( const LayoutPath& p ) : LayoutPath( p ), viewIndex( 0 ) {}
00087     uint32_t viewIndex;
00088 };
00089 
00090 // ostream operators
00091 inline std::ostream& operator << ( std::ostream& os, const NodePath& path )
00092 {
00093     os << "node " << path.nodeIndex;
00094     return os;
00095 }
00096 inline std::ostream& operator << ( std::ostream& os, const PipePath& path )
00097 {
00098     os << static_cast< const NodePath& >( path ) << " pipe " << path.pipeIndex;
00099     return os;
00100 }
00101 inline std::ostream& operator << ( std::ostream& os, const WindowPath& path )
00102 {
00103     os << static_cast< const PipePath& >( path ) << " window "
00104        << path.windowIndex;
00105     return os;
00106 }
00107 inline std::ostream& operator << ( std::ostream& os, const ChannelPath& path )
00108 {
00109     os << static_cast< const WindowPath& >( path ) << " channel "
00110        << path.channelIndex;
00111     return os;
00112 }
00113 
00114 inline std::ostream& operator << ( std::ostream& os, const ObserverPath& path )
00115 {
00116     os << "observer " << path.observerIndex;
00117     return os;
00118 }
00119 
00120 inline std::ostream& operator << ( std::ostream& os, const LayoutPath& path )
00121 {
00122     os << "layout   " << path.layoutIndex;
00123     return os;
00124 }
00125 inline std::ostream& operator << ( std::ostream& os, const ViewPath& path )
00126 {
00127     os << static_cast< const LayoutPath& >( path ) << " view "
00128        << path.viewIndex;
00129     return os;
00130 }
00131 
00132 inline std::ostream& operator << ( std::ostream& os, const CanvasPath& path )
00133 {
00134     os << "canvas " << path.canvasIndex;
00135     return os;
00136 }
00137 inline std::ostream& operator << ( std::ostream& os, const SegmentPath& path )
00138 {
00139     os << static_cast< const CanvasPath& >( path ) << " segment "
00140        << path.segmentIndex;
00141     return os;
00142 }
00143 
00144 }
00145 }
00146 #endif // EQSERVER_PATHS_H
Generated on Mon Aug 10 18:58:40 2009 for Equalizer 0.9 by  doxygen 1.5.8