| 19 | namespace embedx { |
| 20 | |
| 21 | class CacheNodeBuilder { |
| 22 | private: |
| 23 | vec_int_t nodes_; |
| 24 | const InMemoryGraph* graph_; |
| 25 | double cache_thld_; |
| 26 | std::mutex mtx_; |
| 27 | |
| 28 | public: |
| 29 | static std::unique_ptr<CacheNodeBuilder> Create(const InMemoryGraph* graph, |
| 30 | int cache_type, |
| 31 | double cache_thld, |
| 32 | int thread_num); |
| 33 | |
| 34 | public: |
| 35 | const vec_int_t* nodes() const noexcept { return &nodes_; } |
| 36 | |
| 37 | private: |
| 38 | bool Build(const InMemoryGraph* graph, int cache_type, double cache_thld, |
| 39 | int thread_num); |
| 40 | bool RandomCache(const vec_int_t& nodes, int thread_id); |
| 41 | bool DegreeCache(const vec_int_t& nodes, int thread_id); |
| 42 | bool ImportanceCache(const vec_int_t& nodes, int thread_id); |
| 43 | |
| 44 | private: |
| 45 | CacheNodeBuilder() = default; |
| 46 | }; |
| 47 | |
| 48 | } // namespace embedx |
nothing calls this directly
no outgoing calls
no test coverage detected