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

Revision 19729, 2.9 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_RIM_CONNECTION_REQUEST_H
28 #define _GADGET_RIM_CONNECTION_REQUEST_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 ConnectionRequest ConnectionRequest.h cluster/Packets/ConnectionRequest.h
44  *
45  * Connection request packet.
46  */
47 class GADGET_CLASS_API ConnectionRequest : public Packet
48 {
49 public:
50    ConnectionRequest()
51    {;}
52
53    /**
54     * Create a ConnectionRequest packet to request a remote connection.
55     *
56     * @param host_name Hostname of the machine requesting the connection.
57     * @param port      Port that the requesting machine is listening on.
58     */
59    ConnectionRequest(std::string host_name, vpr::Uint16 port);
60
61    /**
62     * Serializes member variables into a data stream.
63     */
64    void serialize();
65
66    /**
67     * Parses the data stream into the local member variables.
68     */
69    virtual void parse(vpr::BufferObjectReader* reader);
70
71    /**
72     * Print the data to the screen in a readable form.
73     */
74    virtual void printData(int debug_level);
75
76    /**
77     * Return the type of this packet.
78     */
79    static vpr::Uint16 getPacketFactoryType()
80    {
81       return(Header::RIM_CONNECTION_REQ);
82    }
83
84    /**
85     * Return the hostname of the machine requesting the connection.
86     */
87    std::string getHostname()
88    {
89       return mHostname;
90    }
91
92    /**
93     * Return the port that the requesting machine is listening on.
94     */
95    vpr::Uint16 getPort()
96    {
97       return mPort;
98    }
99
100 private:
101    std::string mHostname;  /**< Hostname of the machine requesting the connection. */
102    vpr::Uint16 mPort;      /**< Port that the requesting machine is listening on. */
103 };
104
105 }
106
107
108 #endif
Note: See TracBrowser for help on using the browser.