36#ifndef __YTLIB_INT_ARRAY_H
37#define __YTLIB_INT_ARRAY_H
42#include "lang/ytObject.h"
44#define ytIntArray_ERROR_VALUE ((size_t) -1)
52typedef struct ytIntArray_t {
61#define ytIntArray_new() ytIntArray_newm(__FILE__,__LINE__)
62ytIntArray * ytIntArray_newm(
const char * file,
int line);
67void ytIntArray_deletev(
void *
this);
69void ytIntArray_deleteAllv(
void *
this);
74void ytIntArray_dump(
const ytIntArray *
this, FILE * fp);
75void ytIntArray_dumpv(
const ytObject *
this, FILE * fp);
76size_t ytIntArray_size(
const ytIntArray *
this);
90int ytIntArray_get(
const ytIntArray *
this,
size_t index);
96int ytIntArray_sprint(
const ytIntArray *
this,
char * buff,
size_t size,
char * delim);
101size_t ytIntArray_memorySize(
const ytIntArray *
this);
102size_t ytIntArray_memorySizeI(
const ytObject *
this);
103ytByte * ytIntArray_serializeI(
const ytObject * obj, ytByte ** pptr);
104ytByte * ytIntArray_serialize(
const ytIntArray *
this, ytByte ** pptr);
105ytIntArray * ytIntArray_deserialize(ytByte **
const pptr);
106ytObject * ytIntArray_deserializeI(ytByte **
const ptr);
110void ytIntArray_MPI_BcastI(
ytObject ** pObject,
int root, MPI_Comm comm);
void ytIntArray_copy(ytIntArray *this, const ytIntArray *src)
Copies values in another array into this.
Definition: ytIntArray.c:404
ytIntArray * ytIntArray_arrayNew(size_t size)
Creates the array of ytIntArray instances.
Definition: ytIntArray.c:180
ytIntArray * ytIntArray_setBuffSize(ytIntArray *this, size_t new_size)
Changes the size of buffer.
Definition: ytIntArray.c:239
void ytIntArray_MPI_Bcast(ytIntArray **pObject, int root, MPI_Comm comm)
Broadcasts the array with MPI.
Definition: ytIntArray.c:648
ytIntArray * ytIntArray_new()
Creates a new ytIntArray instance.
Definition: ytIntArray.c:84
size_t ytIntArray_arrayMemSize(const ytIntArray *this, size_t n)
Returns the total size of memory used by the array of the array.
Definition: ytIntArray.c:266
ytObject * ytIntArray_cloneI(const ytObject *this)
Returns the clone of this ytIntArray instance.
Definition: ytIntArray.c:153
size_t ytIntArray_find(const ytIntArray *this, const int v)
Returns the index of the value identical to the given one.
Definition: ytIntArray.c:466
void ytIntArray_deleteAll(ytIntArray *this)
Releases the array and all the elements in the array.
Definition: ytIntArray.c:114
size_t ytIntArray_memSize(const ytIntArray *this)
Returns the size of memory where the specified instance occupies.
Definition: ytIntArray.c:258
void ytIntArray_clear(ytIntArray *this)
Removes all the elements in the array.
Definition: ytIntArray.c:280
void ytIntArray_add(ytIntArray *this, int value)
Adds a value.
Definition: ytIntArray.c:288
size_t ytIntArray_buffSize(const ytIntArray *this)
Returns the current buffer size allocated.
Definition: ytIntArray.c:227
void ytIntArray_insert(ytIntArray *this, size_t index, int value)
Inserts a value at the specified position.
Definition: ytIntArray.c:369
int ytIntArray_pop(ytIntArray *this)
Returns the last element.
Definition: ytIntArray.c:440
void ytIntArray_sort(ytIntArray *this)
Sorts the elements in ascending order.
Definition: ytIntArray.c:457
ytIntArray * ytIntArray_clone(const ytIntArray *this)
Returns the clone of this ytIntArray instance.
Definition: ytIntArray.c:138
void ytIntArray_set(ytIntArray *this, size_t index, int value)
Sets a value at the specified position.
Definition: ytIntArray.c:323
void ytIntArray_setSize(ytIntArray *this, size_t size)
Changes the size of the array.
Definition: ytIntArray.c:357
void ytIntArray_arrayDelete(ytIntArray *this, size_t size)
Deletes the array of ytIntArray instances.
Definition: ytIntArray.c:197
void ytIntArray_print(const ytIntArray *this, FILE *fp, char *delim)
Prints the elements in the array.
Definition: ytIntArray.c:480
void ytIntArray_copyArray(ytIntArray *this, size_t index, const int *array, size_t size)
Copies values in an array into this array.
Definition: ytIntArray.c:418
int ytIntArray_remove(ytIntArray *this, size_t index)
Definition: ytIntArray.c:392