DataPacket.h

Go to the documentation of this file.
00001 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00002  *
00003  * VR Juggler is (C) Copyright 1998-2005 by Iowa State University
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum, Christopher Just,
00007  *   Patrick Hartling, Kevin Meinert,
00008  *   Carolina Cruz-Neira, Albert Baker
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Library General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Library General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Library General Public
00021  * License along with this library; if not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00023  * Boston, MA 02111-1307, USA.
00024  *
00025  * -----------------------------------------------------------------
00026  * File:          $RCSfile$
00027  * Date modified: $Date: 2005-01-15 18:00:37 -0600 (Sat, 15 Jan 2005) $
00028  * Version:       $Revision: 16622 $
00029  * -----------------------------------------------------------------
00030  *
00031  *************** <auto-copyright.pl END do not edit this line> ***************/
00032 
00033 #ifndef _GADGET_RIM_DATA_PACKET_H
00034 #define _GADGET_RIM_DATA_PACKET_H
00035 
00036 #include <gadget/gadgetConfig.h>
00037 #include <vpr/vprTypes.h>
00038 #include <vpr/IO/Socket/SocketStream.h>
00039 
00040 #include <cluster/Packets/Header.h>
00041 #include <cluster/Packets/Packet.h>
00042 
00043 namespace cluster
00044 {
00045 
00050 class GADGET_CLASS_API DataPacket : public Packet
00051 {
00052 public:
00056    DataPacket();
00057 
00067    DataPacket(const vpr::GUID& plugin_id, const vpr::GUID& object_id,
00068               std::vector<vpr::Uint8>* data);
00069 
00073    virtual ~DataPacket()
00074    {
00075       delete mDeviceData;
00076    }
00077 
00081    void serialize();
00082 
00086    virtual void parse(vpr::BufferObjectReader* reader);
00087 
00091    virtual void printData(int debug_level);
00092 
00096    static vpr::Uint16 getPacketFactoryType()
00097    {
00098       return(Header::RIM_DATA_PACKET);
00099    }
00100 
00104    vpr::GUID getObjectId()
00105    {
00106       return mObjectId;
00107    }
00108 
00112    std::vector<vpr::Uint8>* getDeviceData()
00113    {
00114       return mDeviceData;
00115    }
00116 
00117 private:
00118    vpr::GUID                  mObjectId;     
00119    std::vector<vpr::Uint8>*   mDeviceData;   
00120 };
00121 
00122 }// end namespace cluster
00123 
00124 
00125 #endif

Generated on Thu Jan 4 10:41:55 2007 for Gadgeteer by  doxygen 1.5.1