Skip to content

Commit b54aca7

Browse files
author
nitrocaster
committed
Remove ManagerBuilderAllocatorConstructor.
1 parent 822594a commit b54aca7

File tree

6 files changed

+33
-65
lines changed

6 files changed

+33
-65
lines changed

src/xrAICore/Navigation/data_storage_binary_heap.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ struct CDataStorageBinaryHeap
1414
struct VertexData
1515
{};
1616

17-
template<typename _data_storage, typename TCompoundVertex>
18-
class CDataStorage : public _data_storage::template CDataStorage<TCompoundVertex>
17+
template<typename TManagerDataStorage>
18+
class CDataStorage : public TManagerDataStorage
1919
{
2020
public:
21-
typedef typename _data_storage::template CDataStorage<TCompoundVertex> inherited;
22-
typedef TCompoundVertex CGraphVertex;
21+
typedef TManagerDataStorage inherited;
22+
typedef typename TManagerDataStorage::CGraphVertex CGraphVertex;
2323
typedef typename CGraphVertex::_dist_type _dist_type;
2424
typedef typename CGraphVertex::_index_type _index_type;
2525

src/xrAICore/Navigation/data_storage_binary_heap_inline.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88

99
#pragma once
1010

11-
#define TEMPLATE_SPECIALIZATION \
12-
template<typename _data_storage, typename TCompoundVertex>
11+
#define TEMPLATE_SPECIALIZATION template<typename TManagerDataStorage>
1312

14-
#define CBinaryHeap CDataStorageBinaryHeap::CDataStorage<_data_storage,TCompoundVertex>
13+
#define CBinaryHeap CDataStorageBinaryHeap::CDataStorage<TManagerDataStorage>
1514

1615
TEMPLATE_SPECIALIZATION
1716
IC CBinaryHeap::CDataStorage (const u32 vertex_count) :

src/xrAICore/Navigation/data_storage_bucket_list.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ struct CDataStorageBucketList
2727
TCompoundVertex *&prev() { return _prev; }
2828
};
2929

30-
template<typename _data_storage, typename TCompoundVertex>
31-
class CDataStorage : public _data_storage::template CDataStorage<TCompoundVertex>
30+
template<typename TManagerDataStorage>
31+
class CDataStorage : public TManagerDataStorage
3232
{
3333
public:
34-
typedef typename _data_storage::template CDataStorage<TCompoundVertex> inherited;
35-
typedef TCompoundVertex CGraphVertex;
34+
typedef TManagerDataStorage inherited;
35+
typedef typename TManagerDataStorage::CGraphVertex CGraphVertex;
3636
typedef typename CGraphVertex::_dist_type _dist_type;
3737
typedef typename CGraphVertex::_index_type _index_type;
3838

src/xrAICore/Navigation/data_storage_bucket_list_inline.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@
1515
u32 bucket_count,\
1616
bool clear_buckets\
1717
>\
18-
template <\
19-
typename _data_storage,\
20-
typename TCompoundVertex\
21-
>
18+
template<typename TManagerDataStorage>
2219

23-
#define CBucketList CDataStorageBucketList<_path_id_type,_bucket_id_type,bucket_count,clear_buckets>::CDataStorage<_data_storage,TCompoundVertex>
20+
#define CBucketList CDataStorageBucketList<_path_id_type,_bucket_id_type,bucket_count,clear_buckets>::CDataStorage<TManagerDataStorage>
2421

2522
TEMPLATE_SPECIALIZATION
2623
IC CBucketList::CDataStorage (const u32 vertex_count) :

src/xrAICore/Navigation/data_storage_constructor.h

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,33 @@
77
////////////////////////////////////////////////////////////////////////////
88

99
#pragma once
10-
struct EmptyVertexData {};
11-
template <typename T> class CEmptyClassTemplate {};
12-
template <typename T1, typename T2> class CEmptyClassTemplate2 {};
1310

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+
{};
3013

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+
{};
4117

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>
4927
>
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
5329
{
54-
typedef typename _algorithm::template CDataStorage<
55-
CManagerBuilderAllocatorConstructor<_manager, _builder, _allocator>, TCompoundVertex> inherited;
56-
30+
typedef TDataStorageBase inherited;
5731
typedef TCompoundVertex CGraphVertex;
58-
typedef typename CGraphVertex::_index_type _index_type;
32+
typedef typename CGraphVertex::_index_type _index_type;
5933

60-
CDataStorageConstructor (const u32 vertex_count) :
61-
inherited(vertex_count)
34+
CDataStorageConstructor(const u32 vertex_count) : inherited(vertex_count)
6235
{}
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); }
6339
};

src/xrAICore/Navigation/graph_engine.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ using namespace GraphEngineSpace;
3636
class CGraphEngine
3737
{
3838
public:
39-
template<typename... Components>
40-
struct CompoundVertex : Components::template VertexData<CompoundVertex<Components...>>...
41-
{};
42-
4339
#ifndef AI_COMPILER
4440
using CSolverPriorityQueue = CDataStorageBinaryHeap;
4541
using CStringPriorityQueue = CDataStorageBinaryHeap;

0 commit comments

Comments
 (0)