COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
covise_converter.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 /********************************************************************************
9  * Class Converter encapsulates the conversion requirements for the exchange
10  * data format used between COVISE processes. We have four different kinds of
11  * methods in this class:
12  *
13  * type_to_exch : conversion of one element of the mentionend type to
14  * corresponding type used by the exchange format.
15  * exch_to_type : the other way round
16  * type_array_to_exch : conversion of a number of elements of the type to
17  * the exchange format.
18  * exch_to_type_array : again the other way
19  *
20  * The data given in exchange format will be handled as char*. For array
21  * conversion the number of elements describes the number of type elements ---
22  * ATTENTION: the user of this class is responsible for checking if there is
23  * enough space or enough data available inside all arrays.
24  *******************************************************************************/
25 
26 #ifndef _COVISE_CONVERTER_H_
27 #define _COVISE_CONVERTER_H_
28 
29 #include "covise.h"
30 
31 namespace covise
32 {
33 
35 {
36 public:
37  void short_to_exch(short input, char *output);
38  void int_to_exch(int input, char *output);
39  void long_to_exch(long input, char *output);
40  void float_to_exch(float input, char *output);
41  void double_to_exch(double input, char *output);
42 
43  void ushort_to_exch(unsigned short input, char *output);
44  void uint_to_exch(unsigned int input, char *output);
45  void ulong_to_exch(unsigned long input, char *output);
46 
47  void exch_to_short(char *input, short *output);
48  void exch_to_int(char *input, int *output);
49  void exch_to_long(char *input, long *output);
50  void exch_to_float(char *input, float *output);
51  void exch_to_double(char *input, double *output);
52 
53  void exch_to_ushort(char *input, unsigned short *output);
54  void exch_to_uint(char *input, unsigned int *output);
55  void exch_to_ulong(char *input, unsigned long *output);
56 
57  void short_array_to_exch(short *input, char *output, int n);
58  void int_array_to_exch(int *input, char *output, int n);
59  void long_array_to_exch(long *input, char *output, int n);
60  void float_array_to_exch(float *input, char *output, int n);
61  void double_array_to_exch(double *input, char *output, int n);
62 
63  void exch_to_short_array(char *input, short *output, int n);
64  void exch_to_int_array(char *input, int *output, int n);
65  void exch_to_long_array(char *input, long *output, int n);
66  void exch_to_float_array(char *input, float *output, int n);
67  void exch_to_double_array(char *input, double *output, int n);
68 };
69 
70 extern Converter converter;
71 }
72 #endif
#define COVISEEXPORT
Definition: coExport.h:176
GLdouble n
Definition: khronos-glext.h:8447
Converter converter
GLenum GLenum GLenum input
Definition: khronos-glext.h:9990
Definition: covise_converter.h:34