NetSim Source Code Help
Loading...
Searching...
No Matches
Queue.h
Go to the documentation of this file.
1#pragma once
2/************************************************************************************
3* Copyright (C) 2021 *
4* TETCOS, Bangalore. India *
5* *
6* Tetcos owns the intellectual property rights in the Product and its content. *
7* The copying, redistribution, reselling or publication of any or all of the *
8* Product or its content without express prior written consent of Tetcos is *
9* prohibited. Ownership and / or any other right relating to the software and all *
10* intellectual property rights therein shall remain at all times with Tetcos. *
11* *
12* This source code is licensed per the NetSim license agreement. *
13* *
14* No portion of this source code may be used as the basis for a derivative work, *
15* or used, for any purpose other than its intended use per the NetSim license *
16* agreement. *
17* *
18* This source code and the algorithms contained within it are confidential trade *
19* secrets of TETCOS and may not be used as the basis for any other software, *
20* hardware, product or service. *
21* *
22* Author: Shashi Kant Suman *
23* *
24* ----------------------------------------------------------------------------------*/
25
26/* ,~~. *
27 * ( 6 )-_, *
28 * (\___ )=='-'
29 * \ . ) )
30 * \ `-' /
31 * ~'`~'`~'`~'`~
32 *
33 * *
34 * ---------------------------------------------------------------------------------*/
35#ifndef _NETSIM_QUEUE_H_
36#define _NETSIM_QUEUE_H_
37#ifdef __cplusplus
38extern "C" {
39#endif
40#pragma comment(lib,"NetSim_utility.lib")
41 typedef void* ptrQUEUE;
42
43 _declspec(dllexport) ptrQUEUE queue_init(double size);
44 _declspec(dllexport) void queue_free(ptrQUEUE q);
45 _declspec(dllexport) bool queue_enqueue(ptrQUEUE queue, const void* mem, double size);
46 _declspec(dllexport) void* queue_get_head_ptr(ptrQUEUE queue);
47 _declspec(dllexport) void* queue_dequeue(ptrQUEUE queue);
48 _declspec(dllexport) double queue_get_size(ptrQUEUE queue);
49 _declspec(dllexport) bool queue_is_empty(ptrQUEUE queue);
50#define queue_is_not_empty(q) (queue_is_empty((q)) == false)
51 _declspec(dllexport) double queue_get_head_size(ptrQUEUE queue);
52 _declspec(dllexport) void queue_update_head_size(ptrQUEUE queue, double newSize);
53
54#ifdef __cplusplus
55}
56#endif
57#endif //_NETSIM_QUEUE_H_
#define _declspec(dllexport)
This function is used to trigger the update.
Definition: Linux.h:41
double queue_get_size(ptrQUEUE queue)
void queue_free(ptrQUEUE q)
void queue_update_head_size(ptrQUEUE queue, double newSize)
void * ptrQUEUE
Definition: Queue.h:41
bool queue_enqueue(ptrQUEUE queue, const void *mem, double size)
void * queue_get_head_ptr(ptrQUEUE queue)
void * queue_dequeue(ptrQUEUE queue)
ptrQUEUE queue_init(double size)
double queue_get_head_size(ptrQUEUE queue)
bool queue_is_empty(ptrQUEUE queue)