TaPAS  0.2
Macros | Functions
ccl-array.h File Reference

A kind of template for dynamic arrays. More...

#include <ccl/ccl-common.h>
#include <ccl/ccl-memory.h>

Go to the source code of this file.

Macros

#define CCL_ARRAY(_t_)
 Macro to define an array of objects of type t
 
#define ccl_array_init(_a_)   ccl_array_init_with_size(_a_, 0)
 Initialize the array a with no cell.
 
#define ccl_array_init_with_size(_a_, _sz_)
 Initialize the array a with sz cells.
 
#define ccl_array_add(_a_, _el_)
 Adds the element el in a new cell added at the end of the array a
 
#define ccl_array_ensure_size(_a_, _sz_)
 Resize the array a up to sz cells if necessary i.e. if the current number of cells is less than sz
 
#define ccl_array_ensure_size_plus_one(_a_)   ccl_array_ensure_size (_a_, (_a_).size + 1)
 Add a new cell to the array a
 
#define ccl_array_trim(_a_, _sz_)
 Resize the array to the given size.
 
#define ccl_array_trim_to_size(_a_)   ccl_array_trim (_a_, (_a_).size)
 Resize the array to its actual size.
 

Functions

 CCL_DECLARE_DELETE_PROC (ccl_array_delete_array)
 Deletes the memory allocated for a. Objects stored into the array are not deleted.
 

Detailed Description

A kind of template for dynamic arrays.

Definition in file ccl-array.h.