use progress::{Timestamp, Operate};
use progress::nested::{Source, Target};
use logging::Logger;
use timely_communication::Allocate;
pub mod root;
pub mod child;
pub use self::child::Child;
pub use self::root::Root;
pub trait ScopeParent: Allocate+Clone {
type Timestamp : Timestamp;
fn new_identifier(&mut self) -> usize;
}
pub trait Scope: ScopeParent {
fn name(&self) -> String;
fn addr(&self) -> Vec<usize>;
fn add_edge(&self, source: Source, target: Target);
fn add_operator<SC: Operate<Self::Timestamp>+'static>(&mut self, scope: SC) -> usize {
let index = self.allocate_operator_index();
self.add_operator_with_index(scope, index);
index
}
fn allocate_operator_index(&mut self) -> usize;
fn add_operator_with_index<SC: Operate<Self::Timestamp>+'static>(&mut self, scope: SC, index: usize);
fn scoped<T: Timestamp, R, F:FnOnce(&mut Child<Self, T>)->R>(&mut self, func: F) -> R;
fn logging(&self) -> Logger;
}