This commit is contained in:
Celine Mercier
2016-07-18 13:57:49 +02:00
parent 38718320f9
commit b89af38109
4 changed files with 33 additions and 22 deletions

View File

@ -57,6 +57,8 @@ cdef class OBIView:
index_t nb_elements_per_line=*,
list elements_names=*,
str indexer_name=*,
str associated_column_name=*,
obiversion_t associated_column_version=*,
str comments=*,
bint create=*
)

View File

@ -339,6 +339,8 @@ cdef class OBIView :
index_t nb_elements_per_line=1,
list elements_names=None,
str indexer_name="",
str associated_column_name="",
obiversion_t associated_column_version=-1,
str comments="",
bint create=True
) :
@ -376,6 +378,7 @@ cdef class OBIView :
if (obi_view_add_column(self.pointer, column_name_b, version_number, # TODO should return pointer on column?
data_type, nb_lines, nb_elements_per_line,
elements_names_b, str2bytes(indexer_name),
str2bytes(associated_column_name), associated_column_version,
str2bytes(comments), create) < 0) :
raise Exception("Problem adding a column in a view")

View File

@ -16,6 +16,12 @@ from libc.stdint cimport uint8_t
cdef extern from "obidmscolumn.h" nogil:
struct Column_reference_t :
const_char_p column_name
obiversion_t version
ctypedef Column_reference_t* Column_reference_p
struct OBIDMS_column_header_t:
size_t header_size
size_t data_size
@ -30,6 +36,7 @@ cdef extern from "obidmscolumn.h" nogil:
obiversion_t cloned_from
const_char_p name
const_char_p indexer_name
Column_reference_t associated_column
const_char_p comments
ctypedef OBIDMS_column_header_t* OBIDMS_column_header_p
@ -48,6 +55,8 @@ cdef extern from "obidmscolumn.h" nogil:
index_t nb_elements_per_line,
const_char_p elements_names,
const_char_p indexer_name,
const_char_p associated_colum_name,
obiversion_t associated_colum_version,
const_char_p comments)
OBIDMS_column_p obi_open_column(OBIDMS_p dms,

View File

@ -10,7 +10,9 @@ from .obitypes cimport const_char_p, \
index_t, \
time_t
from ..capi.obidms cimport OBIDMS_p
from ..capi.obidmscolumn cimport OBIDMS_column_p
from ..capi.obidmscolumn cimport OBIDMS_column_p, \
Column_reference_t, \
Column_reference_p
from libc.stdint cimport uint8_t
@ -24,13 +26,6 @@ cdef extern from "obiview.h" nogil:
extern const_char_p QUALITY_COLUMN
struct Column_reference_t :
const_char_p column_name
obiversion_t version
ctypedef Column_reference_t* Column_reference_p
struct Obiview_infos_t :
time_t creation_date
const_char_p name
@ -79,6 +74,8 @@ cdef extern from "obiview.h" nogil:
index_t nb_elements_per_line,
const_char_p elements_names,
const_char_p indexer_name,
const_char_p associated_column_name,
obiversion_t associated_column_version,
const_char_p comments,
bint create)