Equalizer  2.1.0
Parallel Rendering Framework
paths.h
1 
2 /* Copyright (c) 2009-2010, Stefan Eilemann <eile@equalizergraphics.com>
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 EQFABRIC_PATHS_H
19 #define EQFABRIC_PATHS_H
20 
21 #include "types.h"
22 
24 namespace eq
25 {
26 namespace fabric
27 {
28 //----- defines path types with are used to reference entities
29 // node...channel hierarchy
30 struct NodePath
31 {
32  explicit NodePath(const uint32_t index = 0)
33  : nodeIndex(index)
34  {
35  }
36  uint32_t nodeIndex;
37 };
38 
39 struct PipePath : public NodePath
40 {
41  explicit PipePath(const uint32_t index = 0)
42  : pipeIndex(index)
43  {
44  }
45  explicit PipePath(const NodePath& p)
46  : NodePath(p)
47  , pipeIndex(0)
48  {
49  }
50  uint32_t pipeIndex;
51 };
52 
53 struct WindowPath : public PipePath
54 {
55  explicit WindowPath(const uint32_t index = 0)
56  : windowIndex(index)
57  {
58  }
59  explicit WindowPath(const PipePath& p)
60  : PipePath(p)
61  , windowIndex(0)
62  {
63  }
64  uint32_t windowIndex;
65 };
66 
67 struct ChannelPath : public WindowPath
68 {
69  explicit ChannelPath(const uint32_t index = 0)
70  : channelIndex(index)
71  {
72  }
73  explicit ChannelPath(const WindowPath& p)
74  : WindowPath(p)
75  , channelIndex(0)
76  {
77  }
78  uint32_t channelIndex;
79 };
80 
81 // View hierarchy
82 struct CanvasPath
83 {
84  explicit CanvasPath(const uint32_t index = 0)
85  : canvasIndex(index)
86  {
87  }
88  uint32_t canvasIndex;
89 };
90 
91 struct SegmentPath : public CanvasPath
92 {
93  explicit SegmentPath(const uint32_t index = 0)
94  : segmentIndex(index)
95  {
96  }
97  explicit SegmentPath(const CanvasPath& p)
98  : CanvasPath(p)
99  , segmentIndex(0)
100  {
101  }
102  uint32_t segmentIndex;
103 };
104 
105 struct ObserverPath
106 {
107  explicit ObserverPath(const uint32_t index = 0)
108  : observerIndex(index)
109  {
110  }
111  uint32_t observerIndex;
112 };
113 
114 struct LayoutPath
115 {
116  explicit LayoutPath(const uint32_t index = 0)
117  : layoutIndex(index)
118  {
119  }
120  uint32_t layoutIndex;
121 };
122 
123 struct ViewPath : public LayoutPath
124 {
125  explicit ViewPath(const uint32_t index = 0)
126  : viewIndex(index)
127  {
128  }
129  explicit ViewPath(const LayoutPath& p)
130  : LayoutPath(p)
131  , viewIndex(0)
132  {
133  }
134  uint32_t viewIndex;
135 };
136 
137 // ostream operators
138 inline std::ostream& operator<<(std::ostream& os, const NodePath& path)
139 {
140  os << "node " << path.nodeIndex;
141  return os;
142 }
143 inline std::ostream& operator<<(std::ostream& os, const PipePath& path)
144 {
145  os << static_cast<const NodePath&>(path) << " pipe " << path.pipeIndex;
146  return os;
147 }
148 inline std::ostream& operator<<(std::ostream& os, const WindowPath& path)
149 {
150  os << static_cast<const PipePath&>(path) << " window " << path.windowIndex;
151  return os;
152 }
153 inline std::ostream& operator<<(std::ostream& os, const ChannelPath& path)
154 {
155  os << static_cast<const WindowPath&>(path) << " channel "
156  << path.channelIndex;
157  return os;
158 }
159 
160 inline std::ostream& operator<<(std::ostream& os, const ObserverPath& path)
161 {
162  os << "observer " << path.observerIndex;
163  return os;
164 }
165 
166 inline std::ostream& operator<<(std::ostream& os, const LayoutPath& path)
167 {
168  os << "layout " << path.layoutIndex;
169  return os;
170 }
171 inline std::ostream& operator<<(std::ostream& os, const ViewPath& path)
172 {
173  os << static_cast<const LayoutPath&>(path) << " view " << path.viewIndex;
174  return os;
175 }
176 
177 inline std::ostream& operator<<(std::ostream& os, const CanvasPath& path)
178 {
179  os << "canvas " << path.canvasIndex;
180  return os;
181 }
182 inline std::ostream& operator<<(std::ostream& os, const SegmentPath& path)
183 {
184  os << static_cast<const CanvasPath&>(path) << " segment "
185  << path.segmentIndex;
186  return os;
187 }
189 }
190 }
191 #endif // EQFABRIC_PATHS_H
The Equalizer client library.
Definition: eq/agl/types.h:23
std::ostream & operator<<(std::ostream &os, const AxisEvent &event)
Print the axis event to the given output stream.
Definition: axisEvent.h:49