Stock Control System
Loading...
Searching...
No Matches
Pool.h
Go to the documentation of this file.
1/*
2 * Copyright (c) All Rights Reserved
3 * 2025 Oliver Dixon <od641@york.ac.uk>
4 */
5
14#ifndef STOCKCONTROL_POOL_H
15#define STOCKCONTROL_POOL_H
16
17#include <stdio.h>
18
19#include "Product.h"
20
25struct Pool;
26
34struct Pool *pool_create(const unsigned int initial_capacity, const float growth_factor);
35
42void pool_delete(struct Pool **this);
43
51bool pool_insert_element(struct Pool *this, struct Product *product);
52
60int pool_serialise_report(const struct Pool *this, FILE *buffer);
61
69int pool_serialise_stock_file(const struct Pool *this, FILE *buffer);
70
78struct Product *pool_get_product_by_index(const struct Pool *this, unsigned int index);
79
80#endif // STOCKCONTROL_POOL_H
int pool_serialise_report(const struct Pool *const this, FILE *const buffer)
Definition Pool.c:102
bool pool_insert_element(struct Pool *const this, struct Product *const product)
Definition Pool.c:78
struct Product * pool_get_product_by_index(const struct Pool *const this, const unsigned int index)
Definition Pool.c:140
void pool_delete(struct Pool **const this)
Definition Pool.c:67
struct Pool * pool_create(const unsigned int initial_capacity, const float growth_factor)
Definition Pool.c:46
int pool_serialise_stock_file(const struct Pool *const this, FILE *const buffer)
Definition Pool.c:128
Product class specification.
An ordered expandable collection of dynamically allocated Product records.
Definition Pool.c:25
float growth_factor
Factor by which the Pool capacity should be expanded.
Definition Pool.c:28
The Product represents a single product with a unique numerical identifier, human-readable name,...
Definition Product.c:22