|
7 | 7 | //////////////////////////////////////////////////////////////////////////// |
8 | 8 |
|
9 | 9 | #pragma once |
10 | | -struct EmptyVertexData {}; |
11 | | -template <typename T> class CEmptyClassTemplate {}; |
12 | | -template <typename T1, typename T2> class CEmptyClassTemplate2 {}; |
13 | 10 |
|
14 | | -template < |
15 | | - typename _manager, |
16 | | - typename _builder, // CVertexPath |
17 | | - typename _allocator |
18 | | -> |
19 | | -struct CManagerBuilderAllocatorConstructor |
20 | | -{ |
21 | | - template<typename TCompoundVertex> |
22 | | - class CDataStorage : |
23 | | - public _manager::template CDataStorage<_builder, _allocator, TCompoundVertex> |
24 | | - { |
25 | | - public: |
26 | | - typedef typename _manager::template CDataStorage<_builder, _allocator, TCompoundVertex> inherited; |
27 | | - typedef typename inherited::CDataStorageAllocator inherited_allocator; |
28 | | - typedef TCompoundVertex CGraphVertex; |
29 | | - typedef typename CGraphVertex::_index_type _index_type; |
| 11 | +struct EmptyVertexData |
| 12 | +{}; |
30 | 13 |
|
31 | | - public: |
32 | | - CDataStorage(const u32 vertex_count) : |
33 | | - inherited(vertex_count) |
34 | | - {} |
35 | | - virtual ~CDataStorage() {} |
36 | | - void init() { inherited::init(); } |
37 | | - CGraphVertex &create_vertex(const _index_type &vertex_id) |
38 | | - { return inherited::create_vertex(inherited_allocator::create_vertex(), vertex_id); } |
39 | | - }; |
40 | | -}; |
| 14 | +template<typename... Components> |
| 15 | +struct CompoundVertex : Components::template VertexData<CompoundVertex<Components...>>... |
| 16 | +{}; |
41 | 17 |
|
42 | | -// instantiated in CDijkstra |
43 | | -template < |
44 | | - typename _algorithm, // CDataStorageBucketList|CDataStorageBinaryHeap |
45 | | - typename _manager, // CVertexManagerFixed|CVertexManagerHashFixed |
46 | | - typename _builder, // CEdgePath|CVertexPath |
47 | | - typename _allocator, // CVertexAllocatorFixed |
48 | | - typename TCompoundVertex // _Vertex -- dijkstra vertex |
| 18 | +template< |
| 19 | + typename TStorage, // CDataStorageBucketList|CDataStorageBinaryHeap |
| 20 | + typename TVertexManager, // CVertexManagerFixed|CVertexManagerHashFixed |
| 21 | + typename TPathBuilder, // CEdgePath|CVertexPath |
| 22 | + typename TVertexAllocator, // CVertexAllocatorFixed |
| 23 | + typename TCompoundVertex, |
| 24 | + typename TManagerDataStorage = typename TVertexManager::template |
| 25 | + CDataStorage<TPathBuilder, TVertexAllocator, TCompoundVertex>, |
| 26 | + typename TDataStorageBase = typename TStorage::template CDataStorage<TManagerDataStorage> |
49 | 27 | > |
50 | | -struct CDataStorageConstructor : // CDataStorageBucketList::CDataStorage<CManagerBuilderAllocatorConstructor<manager, path, allocator> > |
51 | | - public _algorithm::template CDataStorage< |
52 | | - CManagerBuilderAllocatorConstructor<_manager, _builder, _allocator>, TCompoundVertex> |
| 28 | +struct CDataStorageConstructor : public TDataStorageBase |
53 | 29 | { |
54 | | - typedef typename _algorithm::template CDataStorage< |
55 | | - CManagerBuilderAllocatorConstructor<_manager, _builder, _allocator>, TCompoundVertex> inherited; |
56 | | - |
| 30 | + typedef TDataStorageBase inherited; |
57 | 31 | typedef TCompoundVertex CGraphVertex; |
58 | | - typedef typename CGraphVertex::_index_type _index_type; |
| 32 | + typedef typename CGraphVertex::_index_type _index_type; |
59 | 33 |
|
60 | | - CDataStorageConstructor (const u32 vertex_count) : |
61 | | - inherited(vertex_count) |
| 34 | + CDataStorageConstructor(const u32 vertex_count) : inherited(vertex_count) |
62 | 35 | {} |
| 36 | + void init() { inherited::init(); } |
| 37 | + CGraphVertex &create_vertex(const _index_type &vertex_id) |
| 38 | + { return inherited::create_vertex(inherited::CDataStorageAllocator::create_vertex(), vertex_id); } |
63 | 39 | }; |
0 commit comments