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=*, index_t nb_elements_per_line=*,
list elements_names=*, list elements_names=*,
str indexer_name=*, str indexer_name=*,
str associated_column_name=*,
obiversion_t associated_column_version=*,
str comments=*, str comments=*,
bint create=* bint create=*
) )

View File

@ -339,6 +339,8 @@ cdef class OBIView :
index_t nb_elements_per_line=1, index_t nb_elements_per_line=1,
list elements_names=None, list elements_names=None,
str indexer_name="", str indexer_name="",
str associated_column_name="",
obiversion_t associated_column_version=-1,
str comments="", str comments="",
bint create=True 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? 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, data_type, nb_lines, nb_elements_per_line,
elements_names_b, str2bytes(indexer_name), elements_names_b, str2bytes(indexer_name),
str2bytes(associated_column_name), associated_column_version,
str2bytes(comments), create) < 0) : str2bytes(comments), create) < 0) :
raise Exception("Problem adding a column in a view") raise Exception("Problem adding a column in a view")

View File

@ -16,21 +16,28 @@ from libc.stdint cimport uint8_t
cdef extern from "obidmscolumn.h" nogil: 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: struct OBIDMS_column_header_t:
size_t header_size size_t header_size
size_t data_size size_t data_size
index_t line_count index_t line_count
index_t lines_used index_t lines_used
index_t nb_elements_per_line index_t nb_elements_per_line
const_char_p elements_names const_char_p elements_names
OBIType_t returned_data_type OBIType_t returned_data_type
OBIType_t stored_data_type OBIType_t stored_data_type
time_t creation_date time_t creation_date
obiversion_t version obiversion_t version
obiversion_t cloned_from obiversion_t cloned_from
const_char_p name const_char_p name
const_char_p indexer_name const_char_p indexer_name
const_char_p comments Column_reference_t associated_column
const_char_p comments
ctypedef OBIDMS_column_header_t* OBIDMS_column_header_p 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, index_t nb_elements_per_line,
const_char_p elements_names, const_char_p elements_names,
const_char_p indexer_name, const_char_p indexer_name,
const_char_p associated_colum_name,
obiversion_t associated_colum_version,
const_char_p comments) const_char_p comments)
OBIDMS_column_p obi_open_column(OBIDMS_p dms, OBIDMS_column_p obi_open_column(OBIDMS_p dms,

View File

@ -10,7 +10,9 @@ from .obitypes cimport const_char_p, \
index_t, \ index_t, \
time_t time_t
from ..capi.obidms cimport OBIDMS_p 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 from libc.stdint cimport uint8_t
@ -24,13 +26,6 @@ cdef extern from "obiview.h" nogil:
extern const_char_p QUALITY_COLUMN 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 : struct Obiview_infos_t :
time_t creation_date time_t creation_date
const_char_p name const_char_p name
@ -79,6 +74,8 @@ cdef extern from "obiview.h" nogil:
index_t nb_elements_per_line, index_t nb_elements_per_line,
const_char_p elements_names, const_char_p elements_names,
const_char_p indexer_name, const_char_p indexer_name,
const_char_p associated_column_name,
obiversion_t associated_column_version,
const_char_p comments, const_char_p comments,
bint create) bint create)