1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use grapl_graph_descriptions::graph_description::*;
use grapl_graph_descriptions::*;
use grapl_graph_descriptions::graph_description::{Static, IdStrategy};

use derive_dynamic_node::{DynamicNode as GraplNode};

pub const IPC_CREATOR: &'static str = "ipc_creator";
pub const IPC_RECIPIENT: &'static str = "ipc_recipient";

#[derive(Clone, GraplNode)]
pub struct Ipc {
    src_pid: u64,
    dst_pid: u64,
    ipc_type: String,
}

pub fn static_strategy() -> IdStrategy {
    Static {
        primary_key_properties: vec![
                    "src_pid".to_string(), "dst_pid".to_string()
                ],
        primary_key_requires_asset_id: true,
    }.into()
}

impl IIpcNode for IpcNode {
    fn get_mut_dynamic_node(&mut self) -> &mut DynamicNode {
        &mut self.dynamic_node
    }
}