Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfQueue.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of mdcore.
3 * Coypright (c) 2010 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
4 * Coypright (c) 2017 Andy Somogyi (somogyie at indiana dot edu)
5 * Copyright (c) 2022-2024 T.J. Sego
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 ******************************************************************************/
21
27#ifndef _MDCORE_INCLUDE_TFQUEUE_H_
28#define _MDCORE_INCLUDE_TFQUEUE_H_
29
30#include "tf_platform.h"
31#include "tf_lock.h"
32
33MDCORE_BEGIN_DECLS
34
35/* Some constants. */
36#define queue_maxhit 10
37
38
39namespace TissueForge {
40
41
43 typedef struct queue {
44
45 /* Allocated size. */
46 int size;
47
48 /* The queue data. */
49 struct task *tasks;
50
51 /* The space in which this queue lives. */
52 struct space *space;
53
54 /* The queue indices. */
55 int *ind;
56
57 /* Index of next entry. */
58 int next;
59
60 /* Index of last entry. */
61 int count;
62
63 /* Lock for this queue. */
64 lock_type lock;
65
67
68
69 /* Associated functions */
70
85 HRESULT queue_init(struct queue *q, int size, struct space *s, struct task *tasks);
86
92 void queue_reset(struct queue *q);
93
106 int queue_insert(struct queue *q, struct task *t);
107
118 struct task *queue_get(struct queue *q, int rid, int keep);
119
120};
121
122MDCORE_END_DECLS
123#endif // _MDCORE_INCLUDE_TFQUEUE_H_
Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
Definition tfAngleConfig.h:26
int queue_insert(struct queue *q, struct task *t)
Add an index to the given queue.
struct TissueForge::queue queue
HRESULT queue_init(struct queue *q, int size, struct space *s, struct task *tasks)
Initialize a task queue.
struct task * queue_get(struct queue *q, int rid, int keep)
Get a task from the queue.
void queue_reset(struct queue *q)
Reset the queue.
Definition tfQueue.h:43
Definition tfSpace.h:127
Definition tfTask.h:60
int32_t HRESULT
Definition tf_port.h:255