Stock Control System
Loading...
Searching...
No Matches
Pool.c File Reference

Pool class implementation. More...

#include <assert.h>
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Pool.h"
#include "Product.h"
Include dependency graph for Pool.c:

Go to the source code of this file.

Data Structures

struct  Pool
 An ordered expandable collection of dynamically allocated Product records. More...
 

Functions

struct Poolpool_create (const unsigned int initial_capacity, const float growth_factor)
 
void pool_delete (struct Pool **const this)
 
bool pool_insert_element (struct Pool *const this, struct Product *const product)
 
int pool_serialise_report (const struct Pool *const this, FILE *const buffer)
 
int pool_serialise_stock_file (const struct Pool *const this, FILE *const buffer)
 
struct Productpool_get_product_by_index (const struct Pool *const this, const unsigned int index)
 

Detailed Description

Pool class implementation.

Author
Oliver Dixon
Date
2025-09-06
Version
Development

Definition in file Pool.c.

Function Documentation

◆ pool_create()

struct Pool * pool_create ( const unsigned int  initial_capacity,
const float  growth_factor 
)

Definition at line 46 of file Pool.c.

◆ pool_delete()

void pool_delete ( struct Pool **const  this)

Definition at line 67 of file Pool.c.

◆ pool_get_product_by_index()

struct Product * pool_get_product_by_index ( const struct Pool *const  this,
const unsigned int  index 
)

Definition at line 140 of file Pool.c.

◆ pool_insert_element()

bool pool_insert_element ( struct Pool *const  this,
struct Product *const  product 
)

Definition at line 78 of file Pool.c.

◆ pool_serialise_report()

int pool_serialise_report ( const struct Pool *const  this,
FILE *const  buffer 
)

Definition at line 102 of file Pool.c.

◆ pool_serialise_stock_file()

int pool_serialise_stock_file ( const struct Pool *const  this,
FILE *const  buffer 
)

Definition at line 128 of file Pool.c.