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

Revision 19729, 2.7 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_DEVICE_REQUEST_H
28 #define _GADGET_RIM_DEVICE_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 DeviceRequest DeviceRequest.h cluster/Packets/DeviceRequest.h
44  *
45  * Device request packet.
46  */
47 class GADGET_CLASS_API DeviceRequest : public Packet
48 {
49 public:
50    DeviceRequest()
51    {;}
52
53    /**
54     * Create a DeviceRequest packet to request a remote device.
55     *
56     * @param plugin_guid GUID of the ClusterPlugin that should handle this
57     *                    packet.
58     * @param device_name Name of the remote device being requested.
59     */
60    DeviceRequest(const vpr::GUID& plugin_guid, const std::string& device_name);
61
62    /**
63     * Serializes member variables into a data stream.
64     */
65    void serialize();
66
67    /**
68     * Parses the data stream into the local member variables.
69     */
70    virtual void parse(vpr::BufferObjectReader* reader);
71
72    /**
73     * Print the data to the screen in a readable form.
74     */
75    virtual void printData(int debug_level);
76
77    /**
78     * Return the type of this packet.
79     */
80    static vpr::Uint16 getPacketFactoryType()
81    {
82        return(Header::RIM_DEVICE_REQ);
83    }
84
85    /**
86     * Return the name of the remote device being requested.
87     */
88    std::string getDeviceName()
89    {
90       return mDeviceName;
91    }
92
93 private:
94    std::string mDeviceName;   /**< The name of the remote device being requested */
95 };
96
97 }
98
99
100 #endif
Note: See TracBrowser for help on using the browser.