CObjectVec

Overview

Module that defines the CObjectVec type and the associated functions.

Example
#include "clingo/lang/expect.h"
#include "clingo/container/CBitVec.h"
#include "clingo/container/CByteVec.h"
#include "clingo/container/CInt64Map.h"
#include "clingo/container/CInt64Set.h"
#include "clingo/container/CInt64Vec.h"
#include "clingo/container/CObjectVec.h"

int main( void )
{
   init_tap_c_();

   CObjectVec* gc = retain_c( new_object_vec_c() );
   cVecInfo const* info = info_of_object_vec_c( gc );

   add_to_object_vec_c( gc, new_bit_vec_c( 64 ) );
   add_to_object_vec_c( gc, new_byte_vec_c() );
   add_to_object_vec_c( gc, new_int64_map_c() );
   add_to_object_vec_c( gc, new_int64_set_c() );
   add_to_object_vec_c( gc, new_int64_vec_c() );

   expect_c_( info->count == 5 );

   release_c( gc );

   return finish_tap_c_();
}

Types and Definitions

Generated

CObjectVec

struct CObjectVec;
typedef struct CObjectVec CObjectVec;

Via the macros OBJ_VEC_DEF_C_ and OBJ_VEC_IMPL_C_ declared and implemented struct. The macros declare and implement also the following functions.

/* create */
CObjectVec* make_object_vec_c( int64_t cap );
CObjectVec* new_object_vec_c( void );
/* data */
CObject* const* data_of_object_vec_c( CObjectVec const* vec );
CObject** var_data_of_object_vec_c( CObjectVec* vec );
/* resize */
bool resize_object_vec_c( CObjectVec* vec, int64_t cap );
/* info */
cVecInfo const* info_of_object_vec_c( CObjectVec const* list );
/* use */
bool add_to_object_vec_c( CObjectVec* vec, CObject* val );
bool add_array_to_object_vec_c( CObjectVec* vec, int64_t n, CObject* const* arr );
CObject* get_from_object_vec_c( CObjectVec const* vec, int64_t pos );
bool insert_into_object_vec_c( CObjectVec* vec, int64_t pos, CObject* val );
bool remove_from_object_vec_c( CObjectVec* vec, int64_t pos );
void set_on_object_vec_c( CObjectVec* vec, int64_t pos, CObject* val );