36#ifndef __YTLIB_STR_ARRAY_H
37#define __YTLIB_STR_ARRAY_H
42#include "lang/ytObject.h"
44#define ytStrArray_ERROR_VALUE ((size_t) -1)
52typedef struct ytStrArray_t {
61#define ytStrArray_new() ytStrArray_newm(__FILE__,__LINE__)
62ytStrArray * ytStrArray_newm(
const char * file,
int line);
67void ytStrArray_deletev(
void *
this);
69void ytStrArray_deleteAllv(
void *
this);
74void ytStrArray_dump(
const ytStrArray *
this, FILE * fp);
75void ytStrArray_dumpv(
const ytObject *
this, FILE * fp);
76size_t ytStrArray_size(
const ytStrArray *
this);
90char * ytStrArray_get(
const ytStrArray *
this,
size_t index);
96int ytStrArray_sprint(
const ytStrArray *
this,
char * buff,
size_t size,
char * delim);
101size_t ytStrArray_memorySize(
const ytStrArray *
this);
102size_t ytStrArray_memorySizeI(
const ytObject *
this);
103ytByte * ytStrArray_serializeI(
const ytObject * obj, ytByte ** pptr);
104ytByte * ytStrArray_serialize(
const ytStrArray *
this, ytByte ** pptr);
105ytStrArray * ytStrArray_deserialize(ytByte **
const pptr);
106ytObject * ytStrArray_deserializeI(ytByte **
const ptr);
110void ytStrArray_MPI_BcastI(
ytObject ** pObject,
int root, MPI_Comm comm);
ytStrArray * ytStrArray_setBuffSize(ytStrArray *this, size_t new_size)
Changes the size of buffer.
Definition: ytStrArray.c:240
size_t ytStrArray_find(const ytStrArray *this, const char *v)
Returns the index of the value identical to the given one.
Definition: ytStrArray.c:467
void ytStrArray_copy(ytStrArray *this, const ytStrArray *src)
Copies values in another array into this.
Definition: ytStrArray.c:405
void ytStrArray_MPI_Bcast(ytStrArray **pObject, int root, MPI_Comm comm)
Broadcasts the array with MPI.
Definition: ytStrArray.c:649
ytStrArray * ytStrArray_new()
Creates a new ytStrArray instance.
Definition: ytStrArray.c:85
ytStrArray * ytStrArray_arrayNew(size_t size)
Creates the array of ytStrArray instances.
Definition: ytStrArray.c:181
void ytStrArray_set(ytStrArray *this, size_t index, char *value)
Sets a value at the specified position.
Definition: ytStrArray.c:324
void ytStrArray_clear(ytStrArray *this)
Removes all the elements in the array.
Definition: ytStrArray.c:281
void ytStrArray_deleteAll(ytStrArray *this)
Releases the array and all the elements in the array.
Definition: ytStrArray.c:115
void ytStrArray_setSize(ytStrArray *this, size_t size)
Changes the size of the array.
Definition: ytStrArray.c:358
void ytStrArray_print(const ytStrArray *this, FILE *fp, char *delim)
Prints the elements in the array.
Definition: ytStrArray.c:481
size_t ytStrArray_buffSize(const ytStrArray *this)
Returns the current buffer size allocated.
Definition: ytStrArray.c:228
char * ytStrArray_pop(ytStrArray *this)
Returns the last element.
Definition: ytStrArray.c:441
void ytStrArray_arrayDelete(ytStrArray *this, size_t size)
Deletes the array of ytStrArray instances.
Definition: ytStrArray.c:198
char * ytStrArray_remove(ytStrArray *this, size_t index)
Definition: ytStrArray.c:393
ytObject * ytStrArray_cloneI(const ytObject *this)
Returns the clone of this ytStrArray instance.
Definition: ytStrArray.c:154
void ytStrArray_copyArray(ytStrArray *this, size_t index, const char **array, size_t size)
Copies values in an array into this array.
Definition: ytStrArray.c:419
size_t ytStrArray_arrayMemSize(const ytStrArray *this, size_t n)
Returns the total size of memory used by the array of the array.
Definition: ytStrArray.c:267
void ytStrArray_add(ytStrArray *this, char *value)
Adds a value.
Definition: ytStrArray.c:289
void ytStrArray_insert(ytStrArray *this, size_t index, char *value)
Inserts a value at the specified position.
Definition: ytStrArray.c:370
size_t ytStrArray_memSize(const ytStrArray *this)
Returns the size of memory where the specified instance occupies.
Definition: ytStrArray.c:259
ytStrArray * ytStrArray_clone(const ytStrArray *this)
Returns the clone of this ytStrArray instance.
Definition: ytStrArray.c:139
void ytStrArray_sort(ytStrArray *this)
Sorts the elements in ascending order.
Definition: ytStrArray.c:458