pcp/propagation/
concept.rs

1// Copyright 2016 Pierre Talbot (IRCAM)
2
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6
7//     http://www.apache.org/licenses/LICENSE-2.0
8
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use kernel::DisplayStateful;
16use logic::ops::*;
17use propagation::ops::*;
18use model::*;
19use std::fmt::Debug;
20
21pub trait PropagatorConcept_<VStore, Event> :
22  Propagator<VStore>
23  + Subsumption<VStore>
24  + PropagatorDependencies<Event>
25  + DisplayStateful<Model> + Debug
26  + NotFormula<VStore>
27{}
28
29impl<VStore, Event, R> PropagatorConcept_<VStore, Event> for R where
30 R: Propagator<VStore>,
31 R: Subsumption<VStore>,
32 R: PropagatorDependencies<Event>,
33 R: DisplayStateful<Model> + Debug,
34 R: NotFormula<VStore>
35{}
36
37pub trait PropagatorConcept<VStore, Event>:
38  PropagatorConcept_<VStore, Event>
39{
40  fn bclone(&self) -> Box<dyn PropagatorConcept<VStore, Event>>;
41}
42
43impl<VStore, Event, R> PropagatorConcept<VStore, Event> for R where
44  R: PropagatorConcept_<VStore, Event>,
45  R: Clone + NotFormula<VStore> + 'static,
46{
47  fn bclone(&self) -> Box<dyn PropagatorConcept<VStore, Event>> {
48    Box::new(self.clone())
49  }
50}