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