COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coHostType.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef _CO_HOST_TYPE_H
9 #define _CO_HOST_TYPE_H
10 
11 // type of host, CO_HOST/CO_PARTNER result of add partner or add host
12 // CO_*_MIRROR result during mirrored session
13 typedef enum
14 {
19 } co_Host_Type;
20 
21 class HType
22 {
23 
24 public:
26  {
27  _type = type;
28  if (_type == CO_HOST)
29  {
30  _type_msg[0] = 'H';
31  _type_msg[1] = 0;
32  }
33  else
34  {
35  _type_msg[0] = 'P';
36  _type_msg[1] = 0;
37  }
38  }
39  HType(const char *msg)
40  {
41  if (msg[0] == 'H')
42  {
43  _type = CO_HOST;
44  }
45  else
46  {
47  _type = CO_PARTNER;
48  }
49  }
50  HType(const HType &h)
51  {
52  _type = h._type;
53  _type_msg[0] = h._type_msg[0];
54  _type_msg[1] = 0;
55  }
57  {
58  _type = h._type;
59  _type_msg[0] = h._type_msg[0];
60  _type_msg[1] = 0;
61  return *this;
62  }
63  const char *get_msg() const
64  {
65  return _type_msg;
66  }
68  {
69  return _type;
70  }
71  void mirror()
72  {
73  switch (_type)
74  {
75  case CO_HOST:
76  {
78  break;
79  }
80  case CO_PARTNER:
81  {
83  break;
84  }
85  case CO_HOST_MIRROR:
86  {
87  _type = CO_HOST;
88  break;
89  }
90  case CO_PARTNER_MIRROR:
91  {
92  _type = CO_PARTNER;
93  break;
94  }
95  }
96  }
97 
98 protected:
99 private:
101  char _type_msg[2];
102 };
104 #endif
GLfloat GLfloat GLfloat GLfloat h
Definition: khronos-glext.h:8441
HType(co_Host_Type type)
Definition: coHostType.h:25
Definition: coHostType.h:21
char _type_msg[2]
Definition: coHostType.h:101
HType(const char *msg)
Definition: coHostType.h:39
HType coHostType
Definition: coHostType.h:103
const char * get_msg() const
Definition: coHostType.h:63
Definition: coHostType.h:15
HType(const HType &h)
Definition: coHostType.h:50
co_Host_Type _type
Definition: coHostType.h:100
GLenum type
Definition: khronos-glext.h:6279
void mirror()
Definition: coHostType.h:71
HType & operator=(const HType &h)
Definition: coHostType.h:56
co_Host_Type
Definition: coHostType.h:13
Definition: coHostType.h:16
Definition: coHostType.h:17
Definition: coHostType.h:18
co_Host_Type get_type() const
Definition: coHostType.h:67