Equalizer 1.0

serverPackets.h

00001 
00002 /* Copyright (c) 2005-2010, 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     typedef fabric::ServerPacket ServerPacket;
00028     
00029     struct ServerChooseConfigPacket : public ServerPacket
00030     {
00031         ServerChooseConfigPacket()
00032                 : fill ( 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 fill;
00041         EQ_ALIGN8( char rendererInfo[8] );
00042     };
00043 
00044     struct ServerChooseConfigReplyPacket : public ServerPacket
00045     {
00046         ServerChooseConfigReplyPacket( const ServerChooseConfigPacket*
00047                                        requestPacket )
00048             {
00049                 command   = fabric::CMD_SERVER_CHOOSE_CONFIG_REPLY;
00050                 size      = sizeof( ServerChooseConfigReplyPacket );
00051                 requestID = requestPacket->requestID;
00052                 connectionData[0] = 0;
00053             }
00054 
00055         co::base::UUID configID;
00056         uint32_t requestID;
00057         EQ_ALIGN8( char connectionData[8] );
00058     };
00059 
00060     struct ServerReleaseConfigPacket : public ServerPacket
00061     {
00062         ServerReleaseConfigPacket()
00063             {
00064                 command = fabric::CMD_SERVER_RELEASE_CONFIG;
00065                 size    = sizeof( ServerReleaseConfigPacket );
00066             }
00067 
00068         co::base::UUID configID;
00069         uint32_t requestID;
00070     };
00071 
00072     struct ServerReleaseConfigReplyPacket : public ServerPacket
00073     {
00074         ServerReleaseConfigReplyPacket( const ServerReleaseConfigPacket*
00075                                         requestPacket )
00076             {
00077                 command   = fabric::CMD_SERVER_RELEASE_CONFIG_REPLY;
00078                 size      = sizeof( ServerReleaseConfigReplyPacket );
00079                 requestID = requestPacket->requestID;
00080             }
00081 
00082         uint32_t requestID;
00083     };
00084 
00085     struct ServerShutdownPacket : public ServerPacket
00086     {
00087         ServerShutdownPacket()
00088             {
00089                 command = fabric::CMD_SERVER_SHUTDOWN;
00090                 size    = sizeof( ServerShutdownPacket );
00091             }
00092 
00093         uint32_t requestID;
00094     };
00095 
00096     struct ServerShutdownReplyPacket : public ServerPacket
00097     {
00098         ServerShutdownReplyPacket( const ServerShutdownPacket* requestPacket )
00099             {
00100                 command   = fabric::CMD_SERVER_SHUTDOWN_REPLY;
00101                 size      = sizeof( ServerShutdownReplyPacket );
00102                 requestID = requestPacket->requestID;
00103             }
00104 
00105         uint32_t requestID;
00106         bool     result;
00107     };
00108 
00109     //------------------------------------------------------------
00110     inline std::ostream& operator << ( std::ostream& os, 
00111                                        const ServerChooseConfigPacket* packet )
00112     {
00113         os << (fabric::ServerPacket*)packet << " req " << packet->requestID
00114            << " renderer " << packet->rendererInfo;
00115         return os;
00116     }
00117     inline std::ostream& operator << ( std::ostream& os, 
00118                                   const ServerChooseConfigReplyPacket* packet )
00119     {
00120         os << (fabric::ServerPacket*)packet << " req " << packet->requestID
00121            << " id " << packet->configID;
00122         return os;
00123     }
00124     inline std::ostream& operator << ( std::ostream& os, 
00125         const ServerReleaseConfigPacket* packet )
00126     {
00127         os << (fabric::ServerPacket*)packet << " config " << packet->configID;
00128         return os;
00129     }
00130 }
00132 #endif //EQ_SERVERPACKETS_H
Generated on Sun May 8 2011 19:11:07 for Equalizer 1.0 by  doxygen 1.7.3