root/juggler/branches/2.2/modules/gadgeteer/cluster/Packets/ApplicationDataAck.h

Revision 19729, 3.2 kB (checked in by patrick, 2 years ago)

Copyright update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
2  *
3  * VR Juggler is (C) Copyright 1998-2007 by Iowa State University
4  *
5  * Original Authors:
6  *   Allen Bierbaum, Christopher Just,
7  *   Patrick Hartling, Kevin Meinert,
8  *   Carolina Cruz-Neira, Albert Baker
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public
21  * License along with this library; if not, write to the
22  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23  * Boston, MA 02111-1307, USA.
24  *
25  *************** <auto-copyright.pl END do not edit this line> ***************/
26
27 #ifndef _GADGET_USER_DATA_ACK_H
28 #define _GADGET_USER_DATA_ACK_H
29
30 #include <gadget/gadgetConfig.h>
31
32 #include <vpr/vprTypes.h>
33 #include <vpr/IO/BufferObjectReader.h>
34 #include <vpr/IO/BufferObjectWriter.h>
35 #include <vpr/IO/Socket/SocketStream.h>
36
37 #include <cluster/Packets/Header.h>
38 #include <cluster/Packets/Packet.h>
39
40 namespace cluster
41 {
42
43 /** \class ApplicationDataAck ApplicationDataAck.h cluster/Packets/ApplicationDataAck.h
44  *
45  * Application-specific data acknowledgement packet.
46  */
47 class GADGET_CLASS_API ApplicationDataAck : public Packet
48 {
49 public:
50    ApplicationDataAck()
51    {;}
52
53    /**
54     * Create a ApplicationDataAck packet to acknowledge a
55     * ApplicationDataRequest.
56     *
57     * @param plugin_guid GUID of the ClusterPlugin that should handle this
58     *                    packet.
59     * @param id          GUID of the ApplicationData object that we are
60     *                    acknowledging.
61     * @param ack         Boolean determining if this is a positive (ACK) or a
62     *                    negative (NACK) responce.
63     */
64    ApplicationDataAck(const vpr::GUID& plugin_guid,
65                       const vpr::GUID& id,
66                       const bool ack);
67
68    /**
69     * Serializes member variables into a data stream.
70     */
71    void serialize();
72
73    /**
74     * Parses the data stream into the local member variables.
75     */
76    virtual void parse(vpr::BufferObjectReader* reader);
77
78    /**
79     * Print the data to the screen in a readable form.
80     */
81    virtual void printData(int debug_level);
82
83    /**
84     * Return the type of this packet.
85     */
86    static vpr::Uint16 getPacketFactoryType()
87    {
88        return(Header::RIM_APPDATA_ACK);
89    }
90
91    /**
92     * Return the GUID of the ApplicationData object being acknoledged
93     */
94    vpr::GUID getId() { return mId; }
95
96    /**
97     * Return a boolean determining if this is a positive(ACK) or a
98     * negative(NACK) responce.
99     */
100    bool getAck()
101    {
102       return mAck;
103    }
104
105 private:
106    vpr::GUID   mId;  /**< GUID for the ApplicationData object being acknoledged. */
107    bool        mAck; /**< Boolean determining if this is a positive(ACK) or a negative(NACK) responce. */
108 };
109
110 }
111
112 #endif
Note: See TracBrowser for help on using the browser.