1 | /****************************************************************************** |
---|
2 | * SAGE - Scalable Adaptive Graphics Environment |
---|
3 | * |
---|
4 | * Module: sageVirtualDesktop.h |
---|
5 | * Author : Byungil Jeong |
---|
6 | * |
---|
7 | * Copyright (C) 2004 Electronic Visualization Laboratory, |
---|
8 | * University of Illinois at Chicago |
---|
9 | * |
---|
10 | * All rights reserved. |
---|
11 | * |
---|
12 | * Redistribution and use in source and binary forms, with or without |
---|
13 | * modification, are permitted provided that the following conditions are met: |
---|
14 | * |
---|
15 | * * Redistributions of source code must retain the above copyright |
---|
16 | * notice, this list of conditions and the following disclaimer. |
---|
17 | * * Redistributions in binary form must reproduce the above |
---|
18 | * copyright notice, this list of conditions and the following disclaimer |
---|
19 | * in the documentation and/or other materials provided with the distribution. |
---|
20 | * * Neither the name of the University of Illinois at Chicago nor |
---|
21 | * the names of its contributors may be used to endorse or promote |
---|
22 | * products derived from this software without specific prior written permission. |
---|
23 | * |
---|
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
---|
27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
---|
28 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
---|
29 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
30 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
---|
31 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
35 | * |
---|
36 | * Direct questions, comments etc about SAGE to sage_users@listserv.uic.edu or |
---|
37 | * http://www.evl.uic.edu/cavern/forum/ |
---|
38 | * |
---|
39 | *****************************************************************************/ |
---|
40 | |
---|
41 | #ifndef _SAGE_VIRTUAL_DESKTOP_H |
---|
42 | #define _SAGE_VIRTUAL_DESKTOP_H |
---|
43 | |
---|
44 | #include "sage.h" |
---|
45 | #include "tileConfig.h" |
---|
46 | |
---|
47 | class streamInfo; |
---|
48 | class streamGroup; |
---|
49 | class fsManager; |
---|
50 | class appInExec; |
---|
51 | |
---|
52 | class sageVirtualDesktop : public virtualDesktop { |
---|
53 | public: |
---|
54 | std::vector<int> tileNodeList; // nodeIDs of display nodes |
---|
55 | std::vector<int> clientList; // clientIDs of display nodes |
---|
56 | |
---|
57 | std::vector<int> audioNodeList; // nodeIDs of audio nodes |
---|
58 | std::vector<int> audioClientList; // clientIDs of audio nodes |
---|
59 | |
---|
60 | fsManager *fsm; |
---|
61 | |
---|
62 | sageVirtualDesktop(fsManager *f, int id); |
---|
63 | ~sageVirtualDesktop(); |
---|
64 | int generateStreamInfo(streamGroup &sGrp, std::vector<int> &rcvList, int offset = 0); |
---|
65 | |
---|
66 | /** |
---|
67 | * launches the binary sageDisplayManager |
---|
68 | */ |
---|
69 | int launchReceivers(char *fsIP, int port, int syncPort, bool globalSync = true, int syncBarrierPort=11001, int refreshInterval=60, int syncMasterPollingInterval=1000, int syncLevel=2 ); |
---|
70 | |
---|
71 | /** |
---|
72 | * launches the binary sageAudioManager |
---|
73 | */ |
---|
74 | int launchAudioReceivers(char *fsIP, int port, int syncPort); |
---|
75 | |
---|
76 | int getRcvId(int nodeId); |
---|
77 | int getNodeNum() { return displayCluster.size(); } |
---|
78 | int getTileNum() { return tileList.size(); } |
---|
79 | int getNodeId(int tileId) { return tileList[tileId]->nodeID; } |
---|
80 | int getNodeIPs(int nodeId, char *ipStr); |
---|
81 | int getForwardIP(int nodeId, char *ipStr); |
---|
82 | |
---|
83 | int getRcvInfo(int nodeID, char *info); |
---|
84 | int regRcv(int cId, int nodeID); |
---|
85 | int getLocalPort(int nodeID); |
---|
86 | int getForwardPort(int nodeID); |
---|
87 | |
---|
88 | int getAudioRcvId(int nodeId); |
---|
89 | int getAudioRcvInfo(int nodeId, char *info); |
---|
90 | int regAudioRcv(int cId, int nodeId); |
---|
91 | int getAudioNodeIPs(int nodeId, char *ipStr); |
---|
92 | int generateAudioStreamInfo(streamGroup &sGrp, std::vector<int> &rcvList); |
---|
93 | int generateAudioRcvInfo(int port, char* msgStr); |
---|
94 | int generateAudioRcvInfo(char* ip, int port, char* msgStr); |
---|
95 | |
---|
96 | std::vector<int> getRcvClientList() { return clientList; } |
---|
97 | std::vector<int> getAudioRcvClientList() { return audioClientList; } |
---|
98 | int changeBGColor(int red, int green, int blue); |
---|
99 | int sendToAll(int code, char *data); |
---|
100 | int convertYaxis(int y) { return height - y; } |
---|
101 | bool checkLayout(appInExec* app); |
---|
102 | void checkNeighbors(appInExec *app, int edge); |
---|
103 | }; |
---|
104 | |
---|
105 | #endif |
---|
106 | |
---|