Reordered view functions for better coherence

This commit is contained in:
Celine Mercier
2016-04-25 18:07:58 +02:00
parent 2566377e2a
commit 767d9c7804
2 changed files with 258 additions and 259 deletions

View File

@ -291,35 +291,6 @@ Obiview_p obi_new_view_nuc_seqs_cloned_from_name(OBIDMS_p dms, const char* view_
Obiview_p obi_open_view(OBIDMS_p dms, const char* view_name);
/**
* @brief Opens the structure containing all the informations written in the view file.
*
* @param dms A pointer on the OBIDMS to which the view file belongs.
*
* @returns A pointer on the view informations structure.
* @retval NULL if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
Obiviews_infos_all_p obi_read_view_infos(OBIDMS_p dms);
/**
* @brief Closes the structure containing all the informations written in the view file.
*
* @param views A pointer on the view informations structure.
*
* @returns A value indicating the success of the operation.
* @retval 0 if the operation was successfully completed.
* @retval -1 if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_close_view_infos(Obiviews_infos_all_p views);
/**
* @brief Adds a column to a view.
*
@ -355,6 +326,24 @@ int obi_view_add_column(Obiview_p view,
bool create);
/**
* @brief Clones a column in the context of a view.
*
* Clones with the right line selection and replaces the cloned columns with the new ones in the view.
* If there is a line selection, all columns have to be cloned, otherwise only the column of interest is cloned.
*
* @param view A pointer on the view.
* @param column_name The name of the column in the view that should be cloned.
*
* @returns A pointer on the new column.
* @retval NULL if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
OBIDMS_column_p obi_view_clone_column(Obiview_p view, const char* column_name);
/**
* @brief Deletes a column from a view.
*
@ -373,6 +362,38 @@ int obi_view_add_column(Obiview_p view,
int obi_view_delete_column(Obiview_p view, const char* column_name);
/**
* @brief Gets the pointer on a column from its name in a view.
*
* @param view A pointer on the view.
* @param column_name The name of the column in the view.
*
* @returns A pointer on the column.
* @retval NULL if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
OBIDMS_column_p obi_view_get_column(Obiview_p view, const char* column_name);
/**
* @brief Gets the pointer on the pointer on a column from its name in a view.
*
* Note: This is used to replace old cloned columns with new ones in views in layers above the C layer.
*
* @param view A pointer on the view.
* @param column_name The name of the column in the view.
*
* @returns A pointer on the pointer on the column.
* @retval NULL if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
OBIDMS_column_p* obi_view_get_pointer_on_column_in_view(Obiview_p view, const char* column_name);
/**
* @brief Selects a line in the context of a view.
*
@ -438,56 +459,6 @@ int obi_select_lines(Obiview_p view, index_t* line_nbs);
int obi_view_update_lines(Obiview_p view, index_t line_count);
/**
* @brief Clones a column in the context of a view.
*
* Clones with the right line selection and replaces the cloned columns with the new ones in the view.
* If there is a line selection, all columns have to be cloned, otherwise only the column of interest is cloned.
*
* @param view A pointer on the view.
* @param column_name The name of the column in the view that should be cloned.
*
* @returns A pointer on the new column.
* @retval NULL if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
OBIDMS_column_p obi_view_clone_column(Obiview_p view, const char* column_name);
/**
* @brief Gets the pointer on a column from its name in a view.
*
* @param view A pointer on the view.
* @param column_name The name of the column in the view.
*
* @returns A pointer on the column.
* @retval NULL if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
OBIDMS_column_p obi_view_get_column(Obiview_p view, const char* column_name);
/**
* @brief Gets the pointer on the pointer on a column from its name in a view.
*
* Note: This is used to replace old cloned columns with new ones in views in layers above the C layer.
*
* @param view A pointer on the view.
* @param column_name The name of the column in the view.
*
* @returns A pointer on the pointer on the column.
* @retval NULL if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
OBIDMS_column_p* obi_view_get_pointer_on_column_in_view(Obiview_p view, const char* column_name);
/**
* @brief Saves a view, writing it in the view file.
*
@ -539,6 +510,35 @@ int obi_close_view(Obiview_p view);
int obi_save_and_close_view(Obiview_p view);
/**
* @brief Opens the structure containing all the informations written in the view file.
*
* @param dms A pointer on the OBIDMS to which the view file belongs.
*
* @returns A pointer on the view informations structure.
* @retval NULL if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
Obiviews_infos_all_p obi_read_view_infos(OBIDMS_p dms);
/**
* @brief Closes the structure containing all the informations written in the view file.
*
* @param views A pointer on the view informations structure.
*
* @returns A value indicating the success of the operation.
* @retval 0 if the operation was successfully completed.
* @retval -1 if an error occurred.
*
* @since February 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_close_view_infos(Obiviews_infos_all_p views);
// TODO in following functions would it be better to use column names instead of column pointers?
// check if it would be a gain or loss of time