Equalizer
1.4.1
|
00001 00002 /* Copyright (c) 2005-2012, 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_CONFIGPACKETS_H 00020 #define EQ_CONFIGPACKETS_H 00021 00022 #include <eq/client/packets.h> // base structs 00023 00025 namespace eq 00026 { 00027 struct ConfigCreateNodePacket : public ConfigPacket 00028 { 00029 ConfigCreateNodePacket() 00030 { 00031 command = fabric::CMD_CONFIG_CREATE_NODE; 00032 size = sizeof( ConfigCreateNodePacket ); 00033 } 00034 00035 UUID nodeID; 00036 }; 00037 00038 struct ConfigDestroyNodePacket : public ConfigPacket 00039 { 00040 ConfigDestroyNodePacket( const UUID& id ) 00041 : nodeID( id ) 00042 { 00043 command = fabric::CMD_CONFIG_DESTROY_NODE; 00044 size = sizeof( ConfigDestroyNodePacket ); 00045 } 00046 00047 const UUID nodeID; 00048 }; 00049 00050 struct ConfigInitPacket : public ConfigPacket 00051 { 00052 ConfigInitPacket() 00053 : pad( 0 ) 00054 { 00055 command = fabric::CMD_CONFIG_INIT; 00056 size = sizeof( ConfigInitPacket ); 00057 } 00058 00059 uint128_t initID; 00060 uint32_t requestID; 00061 const uint32_t pad; 00062 }; 00063 00064 struct ConfigInitReplyPacket : public ConfigPacket 00065 { 00066 ConfigInitReplyPacket( const ConfigInitPacket* requestPacket ) 00067 { 00068 command = fabric::CMD_CONFIG_INIT_REPLY; 00069 size = sizeof( ConfigInitReplyPacket ); 00070 requestID = requestPacket->requestID; 00071 objectID = requestPacket->objectID; 00072 } 00073 00074 uint128_t version; 00075 uint32_t requestID; 00076 bool result; 00077 }; 00078 00079 struct ConfigUpdatePacket : public ConfigPacket 00080 { 00081 ConfigUpdatePacket() 00082 { 00083 command = fabric::CMD_CONFIG_UPDATE; 00084 size = sizeof( ConfigUpdatePacket ); 00085 } 00086 00087 uint32_t versionID; 00088 uint32_t finishID; 00089 uint32_t requestID; 00090 }; 00091 00092 struct ConfigUpdateVersionPacket : public ConfigPacket 00093 { 00094 ConfigUpdateVersionPacket( const ConfigUpdatePacket* request, 00095 const uint128_t& v, const uint32_t req ) 00096 : version( v ) 00097 , versionID( request->versionID ) 00098 , finishID( request->finishID ) 00099 , requestID( req ) 00100 { 00101 command = fabric::CMD_CONFIG_UPDATE_VERSION; 00102 size = sizeof( ConfigUpdateVersionPacket ); 00103 objectID = request->objectID; 00104 } 00105 00106 const uint128_t version; 00107 const uint32_t versionID; 00108 const uint32_t finishID; 00109 const uint32_t requestID; 00110 }; 00111 00112 struct ConfigUpdateReplyPacket : public ConfigPacket 00113 { 00114 ConfigUpdateReplyPacket( const ConfigUpdatePacket* request ) 00115 : requestID( request->requestID ) 00116 { 00117 command = fabric::CMD_CONFIG_UPDATE_REPLY; 00118 size = sizeof( ConfigUpdateReplyPacket ); 00119 objectID = request->objectID; 00120 } 00121 uint128_t version; 00122 const uint32_t requestID; 00123 bool result; 00124 }; 00125 00126 struct ConfigExitPacket : public ConfigPacket 00127 { 00128 ConfigExitPacket() 00129 { 00130 command = fabric::CMD_CONFIG_EXIT; 00131 size = sizeof( ConfigExitPacket ); 00132 } 00133 uint32_t requestID; 00134 }; 00135 00136 struct ConfigExitReplyPacket : public ConfigPacket 00137 { 00138 ConfigExitReplyPacket( const ConfigExitPacket* requestPacket ) 00139 { 00140 command = fabric::CMD_CONFIG_EXIT_REPLY; 00141 size = sizeof( ConfigExitReplyPacket ); 00142 requestID = requestPacket->requestID; 00143 } 00144 uint32_t requestID; 00145 bool result; 00146 }; 00147 00148 struct ConfigStartFramePacket : public ConfigPacket 00149 { 00150 ConfigStartFramePacket( const uint128_t& frameID_ ) 00151 : frameID( frameID_ ) 00152 { 00153 command = fabric::CMD_CONFIG_START_FRAME; 00154 size = sizeof( ConfigStartFramePacket ); 00155 } 00156 const uint128_t frameID; 00157 }; 00158 00159 struct ConfigStopFramesPacket : public ConfigPacket 00160 { 00161 ConfigStopFramesPacket() 00162 { 00163 command = fabric::CMD_CONFIG_STOP_FRAMES; 00164 size = sizeof( ConfigStopFramesPacket ); 00165 } 00166 }; 00167 00168 struct ConfigReleaseFrameLocalPacket : public ConfigPacket 00169 { 00170 ConfigReleaseFrameLocalPacket() 00171 { 00172 command = fabric::CMD_CONFIG_RELEASE_FRAME_LOCAL; 00173 size = sizeof( ConfigReleaseFrameLocalPacket ); 00174 } 00175 uint32_t frameNumber; 00176 }; 00177 00178 struct ConfigFrameFinishPacket : public ConfigPacket 00179 { 00180 ConfigFrameFinishPacket() 00181 { 00182 command = fabric::CMD_CONFIG_FRAME_FINISH; 00183 size = sizeof( ConfigFrameFinishPacket ); 00184 } 00185 uint32_t frameNumber; 00186 }; 00187 00188 struct ConfigFinishAllFramesPacket : public ConfigPacket 00189 { 00190 ConfigFinishAllFramesPacket() 00191 { 00192 command = fabric::CMD_CONFIG_FINISH_ALL_FRAMES; 00193 size = sizeof( ConfigFinishAllFramesPacket ); 00194 } 00195 }; 00196 00197 struct ConfigSyncClockPacket : public ConfigPacket 00198 { 00199 ConfigSyncClockPacket() 00200 { 00201 command = fabric::CMD_CONFIG_SYNC_CLOCK; 00202 size = sizeof( ConfigSyncClockPacket ); 00203 } 00204 00205 int64_t time; 00206 }; 00207 00208 struct ConfigSwapObjectPacket : public ConfigPacket 00209 { 00210 ConfigSwapObjectPacket() 00211 : requestID( LB_UNDEFINED_UINT32 ) 00212 { 00213 command = fabric::CMD_CONFIG_SWAP_OBJECT; 00214 size = sizeof( ConfigSwapObjectPacket ); 00215 } 00216 uint32_t requestID; 00217 co::Object* object; 00218 }; 00219 00220 inline std::ostream& operator << ( std::ostream& os, 00221 const ConfigFrameFinishPacket* packet ) 00222 { 00223 os << (ConfigPacket*)packet << " frame " << packet->frameNumber; 00224 return os; 00225 } 00226 } 00228 #endif //EQ_CONFIGPACKETS_H