VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ciServerClient.h
Go to the documentation of this file.
1 
2 // Copyright JRM Enterprises, Inc. 2004
3 // All rights reserved.
4 //
5 // This code is the intellectual property of JRM Enterprises, Inc.
6 // It may not be used or released as source or compiled binary form
7 // without the prior written consent of JRM Enterprises, Inc.
8 //
9 // Original Author:
10 // Date:
11 //
12 //
13 //
15 
16 #if !defined(_CISERVER_CLIENT_H_)
17 #define _CISERVER_CLIENT_H_
18 
19 #if _MSC_VER > 1000
20 #pragma once
21 #endif // _MSC_VER > 1000
22 #ifndef LINUX
23 #pragma warning (disable : 4996) // Eliminate warnings about old C stdio routines.
24 #endif
25 
29 #include "ciApi.h"
30 #include <stdio.h>
31 #include <string.h>
32 #include <fstream>
33 #include <iostream>
34 #include <assert.h>
35 #include <map>
36 #include <string>
37 #include "clXML.h"
38 #include "clXMLNode.h"
39 #include "ciXML.h"
40 
41 #define MAX_CLIENT_COUNT 256
42 
44 {
45 public:
46 
48  {
49  disable = 0,
50  server = 1,
51  client =2
52  };
53 
54  typedef std::multimap<int, std::string> PortAddressMultiMap;
55  typedef std::multimap<int, PortAddressMultiMap> ConnectionsMultiMap;
56 
60  bool m_clientUpdateMap[MAX_CLIENT_COUNT];
62 
64  //getConnectionPortsAddresses
69  const ConnectionsMultiMap &getConnectionPortsAddresses() const
70  {
71  return m_portAddressMultiMap;
72  }
73 
75  //setConnectionPortsAddresses
80  void setConnectionPortsAddresses(const ConnectionsMultiMap &connectionsMultiMap);
81 
83  //getServerClientConnectionType
89  return m_serverClientConnectionType;
90  }
92  //setServerClientConnectionType
97  void setServerClientConnectionType(int connectionType) {
98  m_serverClientConnectionType = connectionType;
99  }
100 
102  //getUpdateLut
108  bool getUpdateLut(int index) {return m_clientUpdateMap[index];}
110  //setUpdateLut
116  void setUpdateLut(int index, bool value = false) { m_clientUpdateMap[index] = value? true : false;}
117 
119  // getNetworkMode
127  int getNetworkMode() {return m_networkMode;};
128 
130  // getNetworkMode
138  void setNetworkMode(int mode = 0) {m_networkMode = mode;};
139 
141  // archive
149  bool save(std::ofstream &outf);
150 
151  //
152  // loadXML
153  //
154  // \par Description:
155  // Loads attributes from an XML node
156  //
157  // \param clXMLNode* trackNode
158  // \return bool
159  //
160  bool loadXML(clXMLNode* trackNode);
161 
162  //
163  // parseXML
164  //
165  // \par Description:
166  // Parses an XML document for specific tags
167  //
168  // \param clXML xmlDocument
169  // \return bool
170  //
171  bool parseXML(clXML& xmlDocument);
172 
174  //loadXMLNode
181  bool loadXMLNode(std::string tag, char *nodeString);
183  //loadXMLNode
190  bool loadXMLNode(std::string tag, bool *nodeBool);
192  //loadXMLNode
199  bool loadXMLNode(std::string tag, int *nodeBool);
201  //loadXMLNode
208  bool loadXMLNode(std::string tag, double *nodeBool);
209 
210  //
211  // saveXML
212  //
213  // \par Description:
214  // Saves XML nodes to an XML document
215  //
216  // \param clXML* xmlDocument
217  //
218  void saveXML(clXML* xmlDocument);
219 
221  // serialize
229  bool load(char *filepath);
230 
231 protected: // methods
232 
233  void clearContainers();
234 
235 public: // construction/destruction
236 
238  // ciServerClient
243  ciServerClient();
244 
246  // ciServerClient
253  // ciServerClient(ciServerClient &obj);
254 
255  virtual ~ciServerClient();
256 
258  // operator =
266  ciServerClient operator = (ciServerClient &obj);
267 };
268 
269 #endif // _CISERVER_CLIENT_H_


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)