Equalizer  1.2.1
channelPackets.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_CHANNELPACKETS_H
00020 #define EQ_CHANNELPACKETS_H
00021 
00022 #include <eq/client/packets.h> // base structs
00023 #include <eq/client/statistic.h> // member
00024 
00026 namespace eq
00027 {
00028     struct ChannelConfigInitPacket : public ChannelPacket
00029     {
00030         ChannelConfigInitPacket( const uint128_t& initID_ )
00031                 : initID( initID )
00032             {
00033                 command = fabric::CMD_CHANNEL_CONFIG_INIT;
00034                 size    = sizeof( ChannelConfigInitPacket );
00035             }
00036 
00037         const 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 ChannelFrameTransmitImagePacket : public ChannelTaskPacket
00179     {
00180         ChannelFrameTransmitImagePacket()
00181         {
00182             command       = fabric::CMD_CHANNEL_FRAME_TRANSMIT_IMAGE;
00183             size          = sizeof( ChannelFrameTransmitImagePacket );
00184         }
00185 
00186         co::ObjectVersion  frameData;
00187         uint128_t          netNodeID;
00188         uint128_t          clientNodeID;
00189         uint32_t           statisticsIndex;
00190         uint32_t           frameNumber;
00191         uint64_t           imageIndex;
00192     };
00193 
00194     struct ChannelFrameSetReadyPacket : public ChannelFrameTransmitImagePacket
00195     {
00196         ChannelFrameSetReadyPacket()
00197         {
00198             command       = fabric::CMD_CHANNEL_FRAME_SET_READY;
00199             size          = sizeof( ChannelFrameSetReadyPacket );
00200         }
00201     };
00202 
00203     struct ChannelFrameViewStartPacket : public ChannelTaskPacket
00204     {
00205         ChannelFrameViewStartPacket()
00206             {
00207                 command       = fabric::CMD_CHANNEL_FRAME_VIEW_START;
00208                 size          = sizeof( ChannelFrameViewStartPacket );
00209             }
00210     };
00211 
00212     struct ChannelFrameViewFinishPacket : public ChannelTaskPacket
00213     {
00214         ChannelFrameViewFinishPacket()
00215             {
00216                 command       = fabric::CMD_CHANNEL_FRAME_VIEW_FINISH;
00217                 size          = sizeof( ChannelFrameViewFinishPacket );
00218             }
00219     };
00220 
00221     struct ChannelFrameTilesPacket : public ChannelTaskPacket
00222     {
00223         ChannelFrameTilesPacket()
00224         {
00225             command           = fabric::CMD_CHANNEL_FRAME_TILES;
00226             size              = sizeof( ChannelFrameTilesPacket );
00227         }
00228 
00229         bool              isLocal;
00230         co::ObjectVersion queueVersion;
00231         uint32_t          tasks;
00232         uint32_t          nFrames;
00233         EQ_ALIGN8( co::ObjectVersion frames[1] );
00234     };
00235 
00236     inline std::ostream& operator << ( std::ostream& os, 
00237                                     const ChannelConfigInitReplyPacket* packet )
00238     {
00239         os << (co::ObjectPacket*)packet << " result " << packet->result;
00240         return os;
00241     }
00242 
00243     inline std::ostream& operator << ( std::ostream& os, 
00244                                        const ChannelFrameStartPacket* packet )
00245     {
00246         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber;
00247         return os;
00248     }
00249     inline std::ostream& operator << ( std::ostream& os, 
00250                                    const ChannelFrameFinishReplyPacket* packet )
00251     {
00252         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber;
00253         return os;
00254     }
00255     inline std::ostream& operator << ( std::ostream& os, 
00256                                     const ChannelFrameDrawFinishPacket* packet )
00257     {
00258         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00259            << " id " << packet->frameID;
00260         return os;
00261     }
00262     inline std::ostream& operator << ( std::ostream& os, 
00263                                       const ChannelFrameReadbackPacket* packet )
00264     {
00265         os << (ChannelTaskPacket*)packet << " nFrames " << packet->nFrames;
00266         return os;
00267     }
00268     inline std::ostream& operator << ( std::ostream& os, 
00269                                      const ChannelFrameTransmitImagePacket* packet )
00270     {
00271         os << (co::ObjectPacket*)packet << " frame data " << packet->frameData
00272            << " receiver " << packet->clientNodeID << " on "
00273            << packet->netNodeID;
00274         return os;
00275     }
00276     inline std::ostream& operator << ( std::ostream& os, 
00277                                       const ChannelFrameAssemblePacket* packet )
00278     {
00279         os << (ChannelTaskPacket*)packet << " nFrames " << packet->nFrames;
00280         return os;
00281     }
00282 }
00284 #endif //EQ_CHANNELPACKETS_H
Generated on Fri Jun 8 2012 15:44:29 for Equalizer 1.2.1 by  doxygen 1.8.0