Skip to content

Commit

Permalink
Move ManagerBuilderAllocatorConstructor into DataStorageConstructor h…
Browse files Browse the repository at this point in the history
…eader.
  • Loading branch information
nitrocaster committed Dec 10, 2015
1 parent d78563d commit d7b940d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 36 deletions.
31 changes: 30 additions & 1 deletion src/xrAICore/Navigation/data_storage_constructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,36 @@
template <typename T> class CEmptyClassTemplate {};
template <typename T1, typename T2> class CEmptyClassTemplate2 {};

#include "xrAICore/Navigation/manager_builder_allocator_constructor.h"
template <
typename _manager,
typename _builder, // CVertexPath
typename _allocator
>
struct CManagerBuilderAllocatorConstructor {
template <
template <typename T> class _vertex = CEmptyClassTemplate,
template <typename T1, typename T2> class _index_vertex = CEmptyClassTemplate2
>
class CDataStorage :
public _manager::template CDataStorage<_builder, _allocator, _vertex, _index_vertex>
{
public:
typedef typename _manager::template CDataStorage<_builder, _allocator, _vertex, _index_vertex> inherited;
typedef typename inherited::CDataStorageAllocator inherited_allocator;
typedef typename inherited::CGraphVertex CGraphVertex;
typedef typename CGraphVertex::_index_type _index_type;

public:
CDataStorage(const u32 vertex_count) :
inherited(vertex_count)
{}
virtual ~CDataStorage() {}
void init() { inherited::init(); }
CGraphVertex &create_vertex(const _index_type &vertex_id)
{ return inherited::create_vertex(inherited_allocator::create_vertex(), vertex_id); }
};
};

// instantiated in CDijkstra
template <
typename _algorithm, // CDataStorageBucketList|CDataStorageBinaryHeap
Expand Down
35 changes: 0 additions & 35 deletions src/xrAICore/Navigation/manager_builder_allocator_constructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,3 @@
////////////////////////////////////////////////////////////////////////////

#pragma once

template <
typename _manager,
typename _builder, // CVertexPath
typename _allocator
>
struct CManagerBuilderAllocatorConstructor {
template <
template <typename T> class _vertex = CEmptyClassTemplate,
template <typename T1, typename T2> class _index_vertex = CEmptyClassTemplate2
>
class CDataStorage :
public _manager::template CDataStorage<
_builder,
_allocator,
_vertex,
_index_vertex
>
{
public:
typedef typename _manager::template CDataStorage<_builder, _allocator, _vertex, _index_vertex> inherited;
typedef typename inherited::CDataStorageAllocator inherited_allocator;
typedef typename inherited::CGraphVertex CGraphVertex;
typedef typename CGraphVertex::_index_type _index_type;

public:
CDataStorage(const u32 vertex_count) :
inherited(vertex_count)
{}
virtual ~CDataStorage() {}
void init() { inherited::init(); }
CGraphVertex &create_vertex(const _index_type &vertex_id)
{ return inherited::create_vertex(inherited_allocator::create_vertex(), vertex_id); }
};
};

0 comments on commit d7b940d

Please sign in to comment.