Equalizer  1.4.1
client/serverPackets.h
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_SERVERPACKETS_H
00020 #define EQ_SERVERPACKETS_H
00021 
00022 #include <eq/fabric/packets.h> // base structs
00023 
00025 namespace eq
00026 {
00027     using fabric::ServerPacket;
00028     
00029     struct ServerChooseConfigPacket : public ServerPacket
00030     {
00031         ServerChooseConfigPacket()
00032                 : flags( 0 )
00033             {
00034                 command = fabric::CMD_SERVER_CHOOSE_CONFIG;
00035                 size    = sizeof( ServerChooseConfigPacket );
00036                 rendererInfo[0] = '\0';
00037             }
00038 
00039         uint32_t requestID;
00040         uint32_t flags;
00041         LB_ALIGN8( char rendererInfo[8] );
00042     };
00043 
00044     struct ServerChooseConfigReplyPacket : public ServerPacket
00045     {
00046         ServerChooseConfigReplyPacket( const ServerChooseConfigPacket* req )
00047                 : fill( 0 )
00048             {
00049                 command   = fabric::CMD_SERVER_CHOOSE_CONFIG_REPLY;
00050                 size      = sizeof( ServerChooseConfigReplyPacket );
00051                 requestID = req->requestID;
00052                 connectionData[0] = 0;
00053             }
00054 
00055         UUID configID;
00056         uint32_t requestID;
00057         const uint32_t fill;
00058         LB_ALIGN8( char connectionData[8] );
00059     };
00060 
00061     struct ServerReleaseConfigPacket : public ServerPacket
00062     {
00063         ServerReleaseConfigPacket()
00064             {
00065                 command = fabric::CMD_SERVER_RELEASE_CONFIG;
00066                 size    = sizeof( ServerReleaseConfigPacket );
00067             }
00068 
00069         UUID configID;
00070         uint32_t requestID;
00071     };
00072 
00073     struct ServerReleaseConfigReplyPacket : public ServerPacket
00074     {
00075         ServerReleaseConfigReplyPacket( const ServerReleaseConfigPacket*
00076                                         requestPacket )
00077             {
00078                 command   = fabric::CMD_SERVER_RELEASE_CONFIG_REPLY;
00079                 size      = sizeof( ServerReleaseConfigReplyPacket );
00080                 requestID = requestPacket->requestID;
00081             }
00082 
00083         uint32_t requestID;
00084     };
00085 
00086     struct ServerShutdownPacket : public ServerPacket
00087     {
00088         ServerShutdownPacket()
00089             {
00090                 command = fabric::CMD_SERVER_SHUTDOWN;
00091                 size    = sizeof( ServerShutdownPacket );
00092             }
00093 
00094         uint32_t requestID;
00095     };
00096 
00097     struct ServerShutdownReplyPacket : public ServerPacket
00098     {
00099         ServerShutdownReplyPacket( const ServerShutdownPacket* requestPacket )
00100             {
00101                 command   = fabric::CMD_SERVER_SHUTDOWN_REPLY;
00102                 size      = sizeof( ServerShutdownReplyPacket );
00103                 requestID = requestPacket->requestID;
00104             }
00105 
00106         uint32_t requestID;
00107         bool     result;
00108     };
00109 
00110     //------------------------------------------------------------
00111     inline std::ostream& operator << ( std::ostream& os, 
00112                                        const ServerChooseConfigPacket* packet )
00113     {
00114         os << (fabric::ServerPacket*)packet << " req " << packet->requestID
00115            << " renderer " << packet->rendererInfo;
00116         return os;
00117     }
00118     inline std::ostream& operator << ( std::ostream& os, 
00119                                   const ServerChooseConfigReplyPacket* packet )
00120     {
00121         os << (fabric::ServerPacket*)packet << " req " << packet->requestID
00122            << " id " << packet->configID;
00123         return os;
00124     }
00125     inline std::ostream& operator << ( std::ostream& os, 
00126         const ServerReleaseConfigPacket* packet )
00127     {
00128         os << (fabric::ServerPacket*)packet << " config " << packet->configID;
00129         return os;
00130     }
00131 }
00133 #endif //EQ_SERVERPACKETS_H
Generated on Mon Nov 26 2012 14:41:49 for Equalizer 1.4.1 by  doxygen 1.7.6.1