Equalizer
1.2.1
|
00001 00002 /* Copyright (c) 2005-2011, 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 EQ_PIPEPACKETS_H 00020 #define EQ_PIPEPACKETS_H 00021 00022 #include <eq/client/packets.h> // base structs 00023 00025 namespace eq 00026 { 00027 struct PipeCreateWindowPacket : public co::ObjectPacket 00028 { 00029 PipeCreateWindowPacket() 00030 { 00031 command = fabric::CMD_PIPE_CREATE_WINDOW; 00032 size = sizeof( PipeCreateWindowPacket ); 00033 } 00034 00035 co::base::UUID windowID; 00036 }; 00037 00038 struct PipeDestroyWindowPacket : public co::ObjectPacket 00039 { 00040 PipeDestroyWindowPacket( const co::base::UUID& id ) 00041 : windowID( id ) 00042 { 00043 command = fabric::CMD_PIPE_DESTROY_WINDOW; 00044 size = sizeof( PipeDestroyWindowPacket ); 00045 } 00046 00047 const co::base::UUID windowID; 00048 }; 00049 00050 struct PipeConfigInitPacket : public co::ObjectPacket 00051 { 00052 PipeConfigInitPacket() 00053 { 00054 command = fabric::CMD_PIPE_CONFIG_INIT; 00055 size = sizeof( PipeConfigInitPacket ); 00056 } 00057 00058 uint128_t initID; 00059 uint32_t frameNumber; 00060 }; 00061 00062 struct PipeConfigInitReplyPacket : public co::ObjectPacket 00063 { 00064 PipeConfigInitReplyPacket() 00065 { 00066 command = fabric::CMD_PIPE_CONFIG_INIT_REPLY; 00067 size = sizeof( PipeConfigInitReplyPacket ); 00068 } 00069 00070 bool result; 00071 }; 00072 00073 struct PipeConfigExitPacket : public co::ObjectPacket 00074 { 00075 PipeConfigExitPacket() 00076 { 00077 command = fabric::CMD_PIPE_CONFIG_EXIT; 00078 size = sizeof( PipeConfigExitPacket ); 00079 } 00080 }; 00081 00082 struct PipeConfigExitReplyPacket : public co::ObjectPacket 00083 { 00084 PipeConfigExitReplyPacket( const UUID& pipeID, const bool res ) 00085 : result( res ) 00086 { 00087 command = fabric::CMD_PIPE_CONFIG_EXIT_REPLY; 00088 size = sizeof( PipeConfigExitReplyPacket ); 00089 objectID = pipeID; 00090 } 00091 00092 const bool result; 00093 }; 00094 00095 struct PipeFrameStartClockPacket : public co::ObjectPacket 00096 { 00097 PipeFrameStartClockPacket() 00098 { 00099 command = fabric::CMD_PIPE_FRAME_START_CLOCK; 00100 size = sizeof( PipeFrameStartClockPacket ); 00101 } 00102 }; 00103 00104 struct PipeFrameStartPacket : public co::ObjectPacket 00105 { 00106 PipeFrameStartPacket() 00107 { 00108 command = fabric::CMD_PIPE_FRAME_START; 00109 size = sizeof( PipeFrameStartPacket ); 00110 } 00111 00112 uint128_t version; 00113 uint128_t frameID; 00114 uint32_t frameNumber; 00115 }; 00116 00117 struct PipeFrameFinishPacket : public co::ObjectPacket 00118 { 00119 PipeFrameFinishPacket() 00120 { 00121 command = fabric::CMD_PIPE_FRAME_FINISH; 00122 size = sizeof( PipeFrameFinishPacket ); 00123 } 00124 00125 uint128_t frameID; 00126 uint32_t frameNumber; 00127 }; 00128 00129 struct PipeFrameDrawFinishPacket : public PipePacket 00130 { 00131 PipeFrameDrawFinishPacket() 00132 { 00133 command = fabric::CMD_PIPE_FRAME_DRAW_FINISH; 00134 size = sizeof( PipeFrameDrawFinishPacket ); 00135 } 00136 uint128_t frameID; 00137 uint32_t frameNumber; 00138 }; 00139 00140 struct PipeExitThreadPacket : public PipePacket 00141 { 00142 PipeExitThreadPacket() 00143 { 00144 command = fabric::CMD_PIPE_EXIT_THREAD; 00145 size = sizeof( PipeExitThreadPacket ); 00146 } 00147 }; 00148 00149 struct PipeDetachViewPacket : public co::ObjectPacket 00150 { 00151 PipeDetachViewPacket( const uint128_t& view ) : viewID( view ) 00152 { 00153 command = fabric::CMD_PIPE_DETACH_VIEW; 00154 size = sizeof( PipeDetachViewPacket ); 00155 } 00156 00157 uint128_t viewID; 00158 }; 00159 00160 inline std::ostream& operator << ( std::ostream& os, 00161 const PipeCreateWindowPacket* packet ) 00162 { 00163 os << (co::ObjectPacket*)packet << " id " << packet->windowID; 00164 return os; 00165 } 00166 inline std::ostream& operator << ( std::ostream& os, 00167 const PipeConfigInitPacket* packet ) 00168 { 00169 os << (co::ObjectPacket*)packet << " init id " << packet->initID 00170 << " frame " << packet->frameNumber; 00171 return os; 00172 } 00173 inline std::ostream& operator << ( std::ostream& os, 00174 const PipeConfigInitReplyPacket* packet ) 00175 { 00176 os << (co::ObjectPacket*)packet << " result " << packet->result; 00177 return os; 00178 } 00179 inline std::ostream& operator << ( std::ostream& os, 00180 const PipeFrameStartPacket* packet ) 00181 { 00182 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber 00183 << " id " << packet->frameID; 00184 return os; 00185 } 00186 inline std::ostream& operator << ( std::ostream& os, 00187 const PipeFrameDrawFinishPacket* packet ) 00188 { 00189 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber 00190 << " id " << packet->frameID; 00191 return os; 00192 } 00193 inline std::ostream& operator << ( std::ostream& os, 00194 const PipeFrameFinishPacket* packet ) 00195 { 00196 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber 00197 << " id " << packet->frameID; 00198 return os; 00199 } 00200 } 00202 #endif //EQ_PIPEPACKETS_H