minor changes to handler and removed some comments from engine
This commit is contained in:
parent
bd7e3212da
commit
585768f33d
3 changed files with 25 additions and 74 deletions
|
|
@ -5,7 +5,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "arc/std/bool.h"
|
||||
#include "arc/std/vector.h"
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
|
|
@ -13,18 +13,6 @@ extern "C" {
|
|||
*/
|
||||
typedef struct ARC_Handler ARC_Handler;
|
||||
|
||||
/**
|
||||
* @brief data comparison function ptr
|
||||
*
|
||||
* @note this is used for comparison within vectors
|
||||
*
|
||||
* @param a first data struct
|
||||
* @param b second data struct
|
||||
*
|
||||
* @return 0 when a == b
|
||||
*/
|
||||
typedef ARC_Bool (* ARC_Handler_CompareDataFn)(void *a, void *b);
|
||||
|
||||
/**
|
||||
* @brief a function that will take iterated data
|
||||
*
|
||||
|
|
@ -32,22 +20,13 @@ typedef ARC_Bool (* ARC_Handler_CompareDataFn)(void *a, void *b);
|
|||
*/
|
||||
typedef void (* ARC_Handler_DataFn)(void *data);
|
||||
|
||||
/**
|
||||
* @brief a function that will be used during destruction of trash vector
|
||||
*
|
||||
* @param data data that is being destroyed from trash
|
||||
*/
|
||||
typedef void (* ARC_Handler_CleanDataFn)(void *data);
|
||||
|
||||
/**
|
||||
* @brief creates ARC_Handler type
|
||||
*
|
||||
* @param config ARC_Handler to initialize
|
||||
* @param compareFn function to remove handler data
|
||||
* @param cleanFn function to clean data in handler
|
||||
* can be null
|
||||
* @param config ARC_Handler to initialize
|
||||
* @param destroyDataFn function to clean data in handler, can be null
|
||||
*/
|
||||
void ARC_Handler_Create(ARC_Handler **handler, ARC_Handler_CompareDataFn *compareFn, ARC_Handler_CleanDataFn cleanFn);
|
||||
void ARC_Handler_Create(ARC_Handler **handler, ARC_Vector_DestroyDataFn *destroyDataFn);
|
||||
|
||||
/**
|
||||
* @brief destroyes ARC_Handler type
|
||||
|
|
@ -64,18 +43,6 @@ void ARC_Handler_Destroy(ARC_Handler *handler);
|
|||
*/
|
||||
void ARC_Handler_Add(ARC_Handler *handler, void *data);
|
||||
|
||||
/**
|
||||
* @brief remove from handler
|
||||
*
|
||||
* @note the data that is removed is stored in a trash vector
|
||||
* the ARC_Handler_Clean function must be called clean the trash vector
|
||||
* the trash vector is to make sure a state is not deleted while being run
|
||||
*
|
||||
* @param handler ARC_Handler to remove from
|
||||
* @param data data that is being removed
|
||||
*/
|
||||
void ARC_Handler_Remove(ARC_Handler *handler, void *data);
|
||||
|
||||
/**
|
||||
* @brief remove from handler
|
||||
*
|
||||
|
|
@ -123,4 +90,4 @@ uint32_t ARC_Handler_GetSize(ARC_Handler *handler);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif //ARC_STD_HANDLER_H_
|
||||
#endif //ARC_STD_HANDLER_H_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue