added the idea of each line of a column corresponding to a vector, with

the added informations of the number of elements per line and the
elements' names in the column's header structure
This commit is contained in:
celinemercier
2015-07-20 16:08:50 +02:00
parent 484fcca557
commit 5c674715ee
6 changed files with 66 additions and 55 deletions

View File

@ -33,23 +33,25 @@ typedef int32_t obiversion_t; /**< Used to store the column version number
*/
typedef struct OBIDMS_column_header {
bool little_endian; /**< endianness of the column:
- `true` on little endian platforms
- `false` on big endian platforms
@see obi_is_little_end()
*/
int header_size; /**< size of the header in bytes */
size_t line_count; /**< number of lines of data */
size_t lines_used; /**< number of lines of data used*/
OBIType_t data_type; /**< type of the data */
time_t creation_date; /**< date of creation of the file */
obiversion_t version; /**< version of the OBIColumn */
bool little_endian; /**< endianness of the column:
* - `true` on little endian platforms
* - `false` on big endian platforms
*
* @see obi_is_little_endian()
*/
int header_size; /**< size of the header in bytes */
size_t line_count; /**< number of lines of data */
size_t lines_used; /**< number of lines of data used */
size_t nb_elements_per_line; /**< number of elements per line (default : 1) */
char* elements_names; /**< names of the line elements (default : "["column_name"]") */
OBIType_t data_type; /**< type of the data */
time_t creation_date; /**< date of creation of the file */
obiversion_t version; /**< version of the OBIColumn */
char name[OBIDMS_MAX_COLNAME+1]; /**< The column name as a NULL
* terminated string.
*/
* terminated string.
*/
char comments[1]; /**< comments stored as a classical
zero end C string. T
zero end C string.
The size of the comment is only limited
by the header size
*/
@ -63,27 +65,24 @@ typedef struct OBIDMS_column_header {
* creating, opening or cloning an OBIDMS_column.
*/
typedef struct OBIDMS_column {
OBIDMS_p dms; /**< A pointer to a DMS instance
*/
OBIDMS_column_directory_p column_directory; /**< A pointer to an OBIDMS column directory instance
*/
OBIDMS_column_header_p header; /**< A pointer to the header of the column
*/
void* data; /**< A `void` pointer to the beginning of the
* data.
*
* @warning never use this member directly
* outside of the code of the
* low level functions
* of the OBITools DMS
*/
bool writable; /**< Indicates if the column is writable or not.
* - `true` the column is writable
* - `false` the column is read-only
*
* A column is writable only by its creator
* until it closes it.
*/
OBIDMS_p dms; /**< A pointer to a DMS instance */
OBIDMS_column_directory_p column_directory; /**< A pointer to an OBIDMS column directory instance */
OBIDMS_column_header_p header; /**< A pointer to the header of the column */
void* data; /**< A `void` pointer to the beginning of the
* data.
*
* @warning never use this member directly
* outside of the code of the
* low level functions
* of the OBITools DMS
*/
bool writable; /**< Indicates if the column is writable or not.
* - `true` the column is writable
* - `false` the column is read-only
*
* A column is writable only by its creator
* until it closes it.
*/
} OBIDMS_column_t, *OBIDMS_column_p;
@ -115,7 +114,9 @@ size_t obi_get_platform_header_size();
OBIDMS_column_p obi_create_column(OBIDMS_p dms,
const char* column_name,
OBIType_t type,
size_t nb_elements);
size_t nb_elements,
size_t nb_elements_per_line,
const char* elements_names);
/**