Equalizer 1.0

channelPackets.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_CHANNELPACKETS_H
00020 #define EQ_CHANNELPACKETS_H
00021 
00022 #include <eq/packets.h> // base structs
00023 
00024 #include <eq/statistic.h>     // member
00025 
00027 namespace eq
00028 {
00029     struct ChannelConfigInitPacket : public ChannelPacket
00030     {
00031         ChannelConfigInitPacket()
00032             {
00033                 command = fabric::CMD_CHANNEL_CONFIG_INIT;
00034                 size    = sizeof( ChannelConfigInitPacket );
00035             }
00036 
00037         uint128_t        initID;
00038     };
00039 
00040     struct ChannelConfigInitReplyPacket : public ChannelPacket
00041     {
00042         ChannelConfigInitReplyPacket()
00043             {
00044                 command   = fabric::CMD_CHANNEL_CONFIG_INIT_REPLY;
00045                 size      = sizeof( ChannelConfigInitReplyPacket );
00046             }
00047 
00048         bool result;
00049     };
00050 
00051     struct ChannelConfigExitPacket : public ChannelPacket
00052     {
00053         ChannelConfigExitPacket()
00054             {
00055                 command = fabric::CMD_CHANNEL_CONFIG_EXIT;
00056                 size    = sizeof( ChannelConfigExitPacket );
00057             }
00058     };
00059 
00060     struct ChannelConfigExitReplyPacket : public ChannelPacket
00061     {
00062         ChannelConfigExitReplyPacket( const co::base::UUID& channelID, const bool res )
00063                 : result( res )
00064             {
00065                 command   = fabric::CMD_CHANNEL_CONFIG_EXIT_REPLY;
00066                 size      = sizeof( ChannelConfigExitReplyPacket );
00067                 objectID  = channelID;
00068             }
00069 
00070         const bool result;
00071     };
00072 
00073 
00074 
00075     struct ChannelFrameStartPacket : public ChannelTaskPacket
00076     {
00077         ChannelFrameStartPacket()
00078             {
00079                 command        = fabric::CMD_CHANNEL_FRAME_START;
00080                 size           = sizeof( ChannelFrameStartPacket );
00081             }
00082 
00083         uint128_t version;
00084         uint32_t  frameNumber;
00085     };  
00086 
00087     struct ChannelStopFramePacket : public co::ObjectPacket
00088     {
00089         ChannelStopFramePacket()
00090             {
00091                 command       = fabric::CMD_CHANNEL_STOP_FRAME;
00092                 size          = sizeof( ChannelStopFramePacket );
00093             }
00094         uint32_t lastFrameNumber;
00095     };
00096 
00097     struct ChannelFrameFinishPacket : public ChannelTaskPacket
00098     {
00099         ChannelFrameFinishPacket()
00100             {
00101                 command        = fabric::CMD_CHANNEL_FRAME_FINISH;
00102                 size           = sizeof( ChannelFrameFinishPacket );
00103             }
00104 
00105         uint32_t frameNumber;
00106     };
00107 
00108     struct ChannelFrameFinishReplyPacket : public ChannelPacket
00109     {
00110         ChannelFrameFinishReplyPacket( )
00111             {
00112                 command     = fabric::CMD_CHANNEL_FRAME_FINISH_REPLY;
00113                 size        = sizeof( ChannelFrameFinishReplyPacket );
00114             }
00115 
00116         uint32_t frameNumber;
00117         uint32_t nStatistics;
00118         EQ_ALIGN8( Statistic statistics[1] );
00119     };
00120         
00121 
00122     struct ChannelFrameDrawFinishPacket : public ChannelPacket
00123     {
00124         ChannelFrameDrawFinishPacket()
00125             {
00126                 command       = fabric::CMD_CHANNEL_FRAME_DRAW_FINISH;
00127                 size          = sizeof( ChannelFrameDrawFinishPacket );
00128             }
00129 
00130         uint128_t frameID;
00131         uint32_t  frameNumber;
00132     };
00133         
00134     struct ChannelFrameClearPacket : public ChannelTaskPacket
00135     {
00136         ChannelFrameClearPacket()
00137             {
00138                 command       = fabric::CMD_CHANNEL_FRAME_CLEAR;
00139                 size          = sizeof( ChannelFrameClearPacket );
00140             }
00141     };
00142         
00143     struct ChannelFrameDrawPacket : public ChannelTaskPacket
00144     {
00145         ChannelFrameDrawPacket()
00146                 : finish( false )
00147             {
00148                 command       = fabric::CMD_CHANNEL_FRAME_DRAW;
00149                 size          = sizeof( ChannelFrameDrawPacket );
00150             }
00151         bool finish;
00152     };
00153         
00154     struct ChannelFrameAssemblePacket : public ChannelTaskPacket
00155     {
00156         ChannelFrameAssemblePacket()
00157             {
00158                 command       = fabric::CMD_CHANNEL_FRAME_ASSEMBLE;
00159                 size          = sizeof( ChannelFrameAssemblePacket );
00160             }
00161 
00162         uint32_t             nFrames;
00163         EQ_ALIGN8( co::ObjectVersion frames[1] );
00164     };
00165         
00166     struct ChannelFrameReadbackPacket : public ChannelTaskPacket
00167     {
00168         ChannelFrameReadbackPacket()
00169             {
00170                 command       = fabric::CMD_CHANNEL_FRAME_READBACK;
00171                 size          = sizeof( ChannelFrameReadbackPacket );
00172             }
00173 
00174         uint32_t             nFrames;
00175         EQ_ALIGN8( co::ObjectVersion frames[1] );
00176     };
00177         
00178     struct ChannelFrameTransmitPacket : public ChannelTaskPacket
00179     {
00180         ChannelFrameTransmitPacket()
00181             {
00182                 command       = fabric::CMD_CHANNEL_FRAME_TRANSMIT;
00183                 size          = sizeof( ChannelFrameTransmitPacket );
00184             }
00185 
00186         
00187         co::ObjectVersion frameData;
00188         uint128_t          netNodeID;
00189         uint128_t          clientNodeID;
00190         uint32_t           statisticsIndex;
00191         uint32_t           frameNumber;
00192     };
00193 
00194     struct ChannelFrameViewStartPacket : public ChannelTaskPacket
00195     {
00196         ChannelFrameViewStartPacket()
00197             {
00198                 command       = fabric::CMD_CHANNEL_FRAME_VIEW_START;
00199                 size          = sizeof( ChannelFrameViewStartPacket );
00200             }
00201     };
00202 
00203     struct ChannelFrameViewFinishPacket : public ChannelTaskPacket
00204     {
00205         ChannelFrameViewFinishPacket()
00206             {
00207                 command       = fabric::CMD_CHANNEL_FRAME_VIEW_FINISH;
00208                 size          = sizeof( ChannelFrameViewFinishPacket );
00209             }
00210     };
00211     
00212     inline std::ostream& operator << ( std::ostream& os, 
00213                                     const ChannelConfigInitReplyPacket* packet )
00214     {
00215         os << (co::ObjectPacket*)packet << " result " << packet->result;
00216         return os;
00217     }
00218 
00219     inline std::ostream& operator << ( std::ostream& os, 
00220                                        const ChannelFrameStartPacket* packet )
00221     {
00222         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber;
00223         return os;
00224     }
00225     inline std::ostream& operator << ( std::ostream& os, 
00226                                    const ChannelFrameFinishReplyPacket* packet )
00227     {
00228         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber;
00229         return os;
00230     }
00231     inline std::ostream& operator << ( std::ostream& os, 
00232                                     const ChannelFrameDrawFinishPacket* packet )
00233     {
00234         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00235            << " id " << packet->frameID;
00236         return os;
00237     }
00238     inline std::ostream& operator << ( std::ostream& os, 
00239                                       const ChannelFrameReadbackPacket* packet )
00240     {
00241         os << (ChannelTaskPacket*)packet << " nFrames " << packet->nFrames;
00242         return os;
00243     }
00244     inline std::ostream& operator << ( std::ostream& os, 
00245                                      const ChannelFrameTransmitPacket* packet )
00246     {
00247         os << (co::ObjectPacket*)packet << " frame data " << packet->frameData
00248            << " receiver " << packet->clientNodeID << " on "
00249            << packet->netNodeID;
00250         return os;
00251     }
00252     inline std::ostream& operator << ( std::ostream& os, 
00253                                       const ChannelFrameAssemblePacket* packet )
00254     {
00255         os << (ChannelTaskPacket*)packet << " nFrames " << packet->nFrames;
00256         return os;
00257     }
00258 }
00260 #endif //EQ_CHANNELPACKETS_H
Generated on Sun May 8 2011 19:11:05 for Equalizer 1.0 by  doxygen 1.7.3