graph_process_manager_core 0.2.0

Utilities to explore parts of a tree-like or graph-like structure that is not known in advance
Documentation
/*
Copyright 2020 Erwan Mahe (github.com/erwanM974)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


/** 
 * Generator to have unique identifier for:
 * - all nodes of the graph structure
 * - all the filtration results
 * **/
pub struct UniqueIdentifierGenerator {
    next : u32 
}


impl UniqueIdentifierGenerator {

    pub fn new() -> Self {
        Self{next:1}
    }

    pub fn get_next(&mut self) -> u32 {
        let next_id = self.next;
        self.next += 1;
        next_id
    }

}