GFitsTableByteCol.i
2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/***************************************************************************
* GFitsTableByteCol.i - FITS table Byte column class SWIG definition *
* ----------------------------------------------------------------------- *
* copyright : (C) 2008-2010 by Jurgen Knodlseder *
* ----------------------------------------------------------------------- *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/**
* @file GFitsTableByteCol.i
* @brief GFitsTableByteCol class SWIG file.
* @author J. Knodlseder
*/
%{
/* Put headers and other declarations here that are needed for compilation */
#include "GFitsTableByteCol.hpp"
%}
/***********************************************************************//**
* @class GFitsTableByteCol
*
* @brief SWIG interface for FITS table short integer column
***************************************************************************/
class GFitsTableByteCol : public GFitsTableCol {
public:
// Constructors and destructors
GFitsTableByteCol(void);
GFitsTableByteCol(const std::string& name, const int& length, const int& size = 1);
GFitsTableByteCol(const GFitsTableByteCol& column);
virtual ~GFitsTableByteCol(void);
// Methods
std::string string(const int& row, const int& col = 0);
double real(const int& row, const int& col = 0);
int integer(const int& row, const int& col = 0);
unsigned char* data(void) { return m_data; }
void nulval(const unsigned char* value);
unsigned char* nulval(void) { return m_nulval; }
};
/***********************************************************************//**
* @brief GFitsTableByteCol class extension
***************************************************************************/
%extend GFitsTableByteCol {
unsigned char __getitem__(int GFitsTableColInx[]) {
if (GFitsTableColInx[0] == 1)
return (*self)(GFitsTableColInx[1]);
else
return (*self)(GFitsTableColInx[1], GFitsTableColInx[2]);
}
void __setitem__(int GFitsTableColInx[], unsigned char value) {
if (GFitsTableColInx[0] == 1)
(*self)(GFitsTableColInx[1]) = value;
else
(*self)(GFitsTableColInx[1], GFitsTableColInx[2]) = value;
}
GFitsTableByteCol copy() {
return (*self);
}
};