dvcompute_dist/simulation/internal/
output_message_queue.rs

1// Copyright (c) 2020-2022  David Sorokin <davsor@mail.ru>, based in Yoshkar-Ola, Russia
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
7use libc::*;
8
9use crate::simulation::Point;
10use crate::simulation::utils::byte_vec::ByteVecRepr;
11
12/// Represents the output message queue.
13pub type OutputMessageQueue = c_void;
14
15#[cfg(all(feature="dist_mode", not(feature="dist_core_mode")))]
16#[cfg_attr(windows, link(name = "dvcompute_core_dist.dll"))]
17#[cfg_attr(not(windows), link(name = "dvcompute_core_dist"))]
18extern {
19
20    /// Create a new output message queue.
21    #[doc(hidden)]
22    pub fn create_extern_output_message_queue() -> *mut OutputMessageQueue;
23
24    /// Delete the output message queue.
25    #[doc(hidden)]
26    pub fn delete_extern_output_message_queue(queue: *mut OutputMessageQueue);
27
28    /// Send the specified message within the simulation run.
29    #[doc(hidden)]
30    pub fn extern_send(receiver_id: c_int, receive_time: f64, vec: ByteVecRepr, p: *const Point);
31}
32
33#[cfg(all(feature="dist_mode", feature="dist_core_mode"))]
34extern {
35
36    /// Create a new output message queue.
37    #[doc(hidden)]
38    pub fn create_extern_output_message_queue() -> *mut OutputMessageQueue;
39
40    /// Delete the output message queue.
41    #[doc(hidden)]
42    pub fn delete_extern_output_message_queue(queue: *mut OutputMessageQueue);
43
44    /// Send the specified message within the simulation run.
45    #[doc(hidden)]
46    pub fn extern_send(receiver_id: c_int, receive_time: f64, vec: ByteVecRepr, p: *const Point);
47}