Equalizer  1.4.1
client/pipePackets.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_PIPEPACKETS_H
00020 #define EQ_PIPEPACKETS_H
00021 
00022 #include <eq/client/packets.h> // base structs
00023 
00025 namespace eq
00026 {
00027     struct PipeCreateWindowPacket : public co::ObjectPacket
00028     {
00029         PipeCreateWindowPacket()
00030             {
00031                 command = fabric::CMD_PIPE_CREATE_WINDOW;
00032                 size    = sizeof( PipeCreateWindowPacket );
00033             }
00034 
00035         UUID windowID;
00036     };
00037 
00038     struct PipeDestroyWindowPacket : public co::ObjectPacket
00039     {
00040         PipeDestroyWindowPacket( const UUID& id )
00041                 : windowID( id )
00042             {
00043                 command = fabric::CMD_PIPE_DESTROY_WINDOW;
00044                 size    = sizeof( PipeDestroyWindowPacket );
00045             }
00046 
00047         const UUID windowID;
00048     };
00049 
00050     struct PipeConfigInitPacket : public co::ObjectPacket
00051     {
00052         PipeConfigInitPacket()
00053             {
00054                 command = fabric::CMD_PIPE_CONFIG_INIT;
00055                 size    = sizeof( PipeConfigInitPacket );
00056             }
00057 
00058         uint128_t      initID;
00059         uint32_t      frameNumber;
00060     };
00061 
00062     struct PipeConfigInitReplyPacket : public co::ObjectPacket
00063     {
00064         PipeConfigInitReplyPacket()
00065             {
00066                 command   = fabric::CMD_PIPE_CONFIG_INIT_REPLY;
00067                 size      = sizeof( PipeConfigInitReplyPacket );
00068             }
00069 
00070         bool          result;
00071     };
00072 
00073     struct PipeConfigExitPacket : public co::ObjectPacket
00074     {
00075         PipeConfigExitPacket()
00076             {
00077                 command = fabric::CMD_PIPE_CONFIG_EXIT;
00078                 size    = sizeof( PipeConfigExitPacket );
00079             }
00080     };
00081 
00082     struct PipeConfigExitReplyPacket : public co::ObjectPacket
00083     {
00084         PipeConfigExitReplyPacket( const UUID& pipeID, const bool res )
00085                 : result( res )
00086             {
00087                 command   = fabric::CMD_PIPE_CONFIG_EXIT_REPLY;
00088                 size      = sizeof( PipeConfigExitReplyPacket );
00089                 objectID  = pipeID;
00090             }
00091 
00092         const bool result;
00093     };
00094 
00095     struct PipeFrameStartClockPacket : public co::ObjectPacket
00096     {
00097         PipeFrameStartClockPacket()
00098             {
00099                 command       = fabric::CMD_PIPE_FRAME_START_CLOCK;
00100                 size          = sizeof( PipeFrameStartClockPacket );
00101             }
00102     };
00103 
00104     struct PipeFrameStartPacket : public co::ObjectPacket
00105     {
00106         PipeFrameStartPacket()
00107             {
00108                 command        = fabric::CMD_PIPE_FRAME_START;
00109                 size           = sizeof( PipeFrameStartPacket );
00110             }
00111 
00112         uint128_t version;
00113         uint128_t frameID;
00114         uint32_t frameNumber;
00115     };
00116 
00117     struct PipeFrameFinishPacket : public co::ObjectPacket
00118     {
00119         PipeFrameFinishPacket()
00120             {
00121                 command        = fabric::CMD_PIPE_FRAME_FINISH;
00122                 size           = sizeof( PipeFrameFinishPacket );
00123             }
00124 
00125         uint128_t frameID;
00126         uint32_t frameNumber;
00127     };
00128 
00129     struct PipeFrameDrawFinishPacket : public PipePacket
00130     {
00131         PipeFrameDrawFinishPacket()
00132             {
00133                 command       = fabric::CMD_PIPE_FRAME_DRAW_FINISH;
00134                 size          = sizeof( PipeFrameDrawFinishPacket );
00135             }
00136         uint128_t frameID;
00137         uint32_t frameNumber;
00138     };
00139 
00140     struct PipeExitThreadPacket : public PipePacket
00141     {
00142         PipeExitThreadPacket()
00143             {
00144                 command = fabric::CMD_PIPE_EXIT_THREAD;
00145                 size    = sizeof( PipeExitThreadPacket );
00146             }
00147     };
00148 
00149     struct PipeExitTransferThreadPacket : public PipePacket
00150     {
00151         PipeExitTransferThreadPacket()
00152             {
00153                 command = fabric::CMD_PIPE_EXIT_TRANSFER_THREAD;
00154                 size    = sizeof( PipeExitTransferThreadPacket );
00155             }
00156     };
00157 
00158     struct PipeDetachViewPacket : public co::ObjectPacket
00159     {
00160         PipeDetachViewPacket( const uint128_t& view ) : viewID( view )
00161             {
00162                 command        = fabric::CMD_PIPE_DETACH_VIEW;
00163                 size           = sizeof( PipeDetachViewPacket );
00164             }
00165 
00166         uint128_t viewID;
00167     };
00168 
00169     inline std::ostream& operator << ( std::ostream& os, 
00170                                        const PipeCreateWindowPacket* packet )
00171     {
00172         os << (co::ObjectPacket*)packet << " id " << packet->windowID;
00173         return os;
00174     }
00175     inline std::ostream& operator << ( std::ostream& os, 
00176                                        const PipeConfigInitPacket* packet )
00177     {
00178         os << (co::ObjectPacket*)packet << " init id " << packet->initID
00179            << " frame " << packet->frameNumber;
00180         return os;
00181     }
00182     inline std::ostream& operator << ( std::ostream& os, 
00183                                        const PipeConfigInitReplyPacket* packet )
00184     {
00185         os << (co::ObjectPacket*)packet << " result " << packet->result;
00186         return os;
00187     }
00188     inline std::ostream& operator << ( std::ostream& os, 
00189                                        const PipeFrameStartPacket* packet )
00190     {
00191         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00192            << " id " << packet->frameID;
00193         return os;
00194     }
00195     inline std::ostream& operator << ( std::ostream& os, 
00196                                        const PipeFrameDrawFinishPacket* packet )
00197     {
00198         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00199            << " id " << packet->frameID;
00200         return os;
00201     }
00202     inline std::ostream& operator << ( std::ostream& os, 
00203                                        const PipeFrameFinishPacket* packet )
00204     {
00205         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00206            << " id " << packet->frameID;
00207         return os;
00208     }
00209 }
00211 #endif //EQ_PIPEPACKETS_H
Generated on Mon Nov 26 2012 14:41:49 for Equalizer 1.4.1 by  doxygen 1.7.6.1