Skip to content
Snippets Groups Projects
Commit c092421f authored by erwan's avatar erwan
Browse files

New: add in neighbor the pid of the process the neighbor is the a neighbor of

parent 21e43d9e
No related branches found
No related tags found
1 merge request!2WIP: Resolve "Process should have acess to their identity"
Pipeline #25706 passed
(* Time-stamp: <modified the 20/06/2019 (at 11:19) by Erwan Jahier> *) (* Time-stamp: <modified the 21/06/2019 (at 15:05) by Erwan Jahier> *)
open Sasacore open Sasacore
...@@ -9,6 +9,7 @@ type action = string (* just a label *) ...@@ -9,6 +9,7 @@ type action = string (* just a label *)
type 's neighbor = { type 's neighbor = {
state: 's ; state: 's ;
pid: unit -> string; pid: unit -> string;
spid: unit -> string;
reply: unit -> int; reply: unit -> int;
} }
...@@ -33,7 +34,8 @@ let (to_reg_neigbor : 's Register.neighbor -> 's neighbor) = ...@@ -33,7 +34,8 @@ let (to_reg_neigbor : 's Register.neighbor -> 's neighbor) =
fun n -> fun n ->
{ {
state = n.Register.state ; state = n.Register.state ;
pid = n.Register.pid; pid = n.Register.pid;
spid = n.Register.pid;
reply = n.Register.reply; reply = n.Register.reply;
} }
......
(* Time-stamp: <modified the 19/06/2019 (at 17:41) by Erwan Jahier> *) (* Time-stamp: <modified the 21/06/2019 (at 15:05) by Erwan Jahier> *)
(** Process programmer API *) (** Process programmer API *)
type 's neighbor = { type 's neighbor = {
state: 's; (* processes local state (user defined) *) state: 's; (* processes local state (user defined) *)
pid : unit -> string; (* nb: this pid is not available in all pid : unit -> string; (* nb: this pid is not available in all
simulation modes (e.g., anonymous) *) simulation modes (e.g., anonymous) *)
spid: unit -> string; (* pid of the process this neighbor is the neighbor of *)
reply: unit -> int; reply: unit -> int;
(* Returns the channel number that let this neighbor access to the (* Returns the channel number that let this neighbor access to the
content of the process, if it neighbor can access it. Returns -1 content of the process, if it neighbor can access it. Returns -1
......
(* Time-stamp: <modified the 19/06/2019 (at 10:51) by Erwan Jahier> *) (* Time-stamp: <modified the 21/06/2019 (at 15:05) by Erwan Jahier> *)
type 's neighbor = { type 's neighbor = {
state: 's ; state: 's ;
pid: unit -> string; pid: unit -> string;
spid: unit -> string;
reply: unit -> int; reply: unit -> int;
} }
......
(* Time-stamp: <modified the 19/06/2019 (at 11:28) by Erwan Jahier> *) (* Time-stamp: <modified the 21/06/2019 (at 15:05) by Erwan Jahier> *)
type 's neighbor = { type 's neighbor = {
state: 's ; state: 's ;
pid: unit -> string; pid: unit -> string;
spid: unit -> string;
reply: unit -> int; reply: unit -> int;
} }
......
(* Time-stamp: <modified the 20/06/2019 (at 16:12) by Erwan Jahier> *) (* Time-stamp: <modified the 21/06/2019 (at 15:06) by Erwan Jahier> *)
open Register open Register
open Sasacore open Sasacore
...@@ -34,6 +34,7 @@ let (get_neighors: Topology.t -> Topology.node_id -> 'v -> 'v Register.neighbor ...@@ -34,6 +34,7 @@ let (get_neighors: Topology.t -> Topology.node_id -> 'v -> 'v Register.neighbor
(* XXX For the 2 fields above, check the graph kind (anonymous, (* XXX For the 2 fields above, check the graph kind (anonymous,
identified, etc. *) identified, etc. *)
pid = (fun () -> node.id); pid = (fun () -> node.id);
spid = (fun () -> source_id);
reply = (fun () -> reply g source_id neighbor_id); reply = (fun () -> reply g source_id neighbor_id);
} }
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment