Equalizer 1.0

nodePackets.h

00001 
00002 /* Copyright (c) 2005-2011, 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_NODEPACKETS_H
00020 #define EQ_NODEPACKETS_H
00021 
00022 #include <eq/packets.h>   // base structs
00023 #include <eq/frameData.h> // member
00024 
00026 namespace eq
00027 {
00028 
00029     struct NodeConfigInitPacket : public co::ObjectPacket
00030     {
00031         NodeConfigInitPacket()
00032             {
00033                 command        = fabric::CMD_NODE_CONFIG_INIT;
00034                 size           = sizeof( NodeConfigInitPacket );
00035             }
00036 
00037         uint128_t initID;
00038         uint32_t frameNumber;
00039     };
00040 
00041     struct NodeConfigInitReplyPacket : public co::ObjectPacket
00042     {
00043         NodeConfigInitReplyPacket()
00044             {
00045                 command   = fabric::CMD_NODE_CONFIG_INIT_REPLY;
00046                 size      = sizeof( NodeConfigInitReplyPacket );
00047             }
00048 
00049         bool     result;
00050     };
00051 
00052     struct NodeConfigExitPacket : public NodePacket
00053     {
00054         NodeConfigExitPacket()
00055             {
00056                 command = fabric::CMD_NODE_CONFIG_EXIT;
00057                 size    = sizeof( NodeConfigExitPacket );
00058             }
00059     };
00060 
00061     struct NodeConfigExitReplyPacket : public NodePacket
00062     {
00063         NodeConfigExitReplyPacket( const UUID& nodeID, const bool res )
00064                 : result( res )
00065             {
00066                 command   = fabric::CMD_NODE_CONFIG_EXIT_REPLY;
00067                 size      = sizeof( NodeConfigExitReplyPacket );
00068                 objectID  = nodeID;
00069             }
00070 
00071         const bool result;
00072     };
00073 
00074     struct NodeCreatePipePacket : public NodePacket
00075     {
00076         NodeCreatePipePacket()
00077             {
00078                 command = fabric::CMD_NODE_CREATE_PIPE;
00079                 size    = sizeof( NodeCreatePipePacket );
00080             }
00081 
00082         co::base::UUID pipeID;
00083         bool     threaded;
00084     };
00085 
00086     struct NodeDestroyPipePacket : public NodePacket
00087     {
00088         NodeDestroyPipePacket( const co::base::UUID& id )
00089                 : pipeID( id )
00090             {
00091                 command = fabric::CMD_NODE_DESTROY_PIPE;
00092                 size    = sizeof( NodeDestroyPipePacket );
00093             }
00094 
00095         const co::base::UUID pipeID;
00096     };
00097     
00098     struct NodeFrameStartPacket : public NodePacket
00099     {
00100         NodeFrameStartPacket() : configVersion( co::VERSION_INVALID )
00101             {
00102                 command        = fabric::CMD_NODE_FRAME_START;
00103                 size           = sizeof( NodeFrameStartPacket );
00104             }
00105 
00106         uint128_t version;
00107         uint128_t configVersion;
00108         uint128_t frameID;
00109         uint32_t frameNumber;
00110     };
00111 
00112     struct NodeFrameFinishPacket : public NodePacket
00113     {
00114         NodeFrameFinishPacket()
00115             {
00116                 command          = fabric::CMD_NODE_FRAME_FINISH;
00117                 size             = sizeof( NodeFrameFinishPacket );
00118             }
00119 
00120         uint128_t frameID;
00121         uint32_t frameNumber;
00122     };
00123 
00124     struct NodeFrameFinishReplyPacket : public NodePacket
00125     {
00126         NodeFrameFinishReplyPacket()
00127             {
00128                 command        = fabric::CMD_NODE_FRAME_FINISH_REPLY;
00129                 size           = sizeof( NodeFrameFinishReplyPacket );
00130             }
00131 
00132         uint32_t frameNumber;
00133     };
00134         
00135     struct NodeFrameDrawFinishPacket : public NodePacket
00136     {
00137         NodeFrameDrawFinishPacket()
00138             {
00139                 command       = fabric::CMD_NODE_FRAME_DRAW_FINISH;
00140                 size          = sizeof( NodeFrameDrawFinishPacket );
00141             }
00142         uint128_t frameID;
00143         uint32_t frameNumber;
00144     };
00145 
00146     struct NodeFrameDataTransmitPacket : public NodePacket
00147     {
00148         NodeFrameDataTransmitPacket()
00149             {
00150                 command = fabric::CMD_NODE_FRAMEDATA_TRANSMIT;
00151                 size    = sizeof( NodeFrameDataTransmitPacket );
00152             }
00153 
00154         co::ObjectVersion frameData;
00155         PixelViewport pvp;
00156         uint32_t      buffers;
00157         uint32_t      frameNumber;
00158         bool          useAlpha;
00159 
00160         EQ_ALIGN8( uint8_t data[8] );
00161     };
00162 
00163     struct NodeFrameDataReadyPacket : public NodePacket
00164     {
00165         NodeFrameDataReadyPacket( const FrameData* fd )
00166                 : frameData( fd ), data( fd->_data )
00167             {
00168                 command = fabric::CMD_NODE_FRAMEDATA_READY;
00169                 size    = sizeof( NodeFrameDataReadyPacket );
00170             }
00171 
00172         const co::ObjectVersion frameData;
00173         const FrameData::Data data;
00174     };
00175 
00176     struct NodeFrameTasksFinishPacket : public NodePacket
00177     {
00178         NodeFrameTasksFinishPacket()
00179             {
00180                 command     = fabric::CMD_NODE_FRAME_TASKS_FINISH;
00181                 size        = sizeof( NodeFrameTasksFinishPacket );
00182             }
00183 
00184         uint128_t frameID;
00185         uint32_t frameNumber;
00186     };
00187 
00188     inline std::ostream& operator << ( std::ostream& os, 
00189                                        const NodeCreatePipePacket* packet )
00190     {
00191         os << (co::ObjectPacket*)packet << " id " << packet->pipeID;
00192         return os;
00193     }
00194     inline std::ostream& operator << ( std::ostream& os, 
00195                                        const NodeFrameStartPacket* packet )
00196     {
00197         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00198            << " id " << packet->frameID;
00199         return os;
00200     }
00201     inline std::ostream& operator << ( std::ostream& os, 
00202                                        const NodeFrameDrawFinishPacket* packet )
00203     {
00204         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00205            << " id " << packet->frameID;
00206         return os;
00207     }
00208     inline std::ostream& operator << ( std::ostream& os, 
00209                                        const NodeFrameFinishPacket* packet )
00210     {
00211         os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber
00212            << " id " << packet->frameID;
00213         return os;
00214     }
00215 }
00217 #endif //EQ_NODEPACKETS_H
Generated on Sun May 8 2011 19:11:07 for Equalizer 1.0 by  doxygen 1.7.3