1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-02-26 13:23:55 +00:00

Move MaxSizedArray to helpers include dir.

This commit is contained in:
King_DuckZ 2016-05-23 10:06:59 +02:00
parent b6d45eee3c
commit baa67138eb
6 changed files with 15 additions and 13 deletions

View file

@ -18,15 +18,15 @@
#ifndef idBC9F804ADD33468A9C7657E823FFC706 #ifndef idBC9F804ADD33468A9C7657E823FFC706
#define idBC9F804ADD33468A9C7657E823FFC706 #define idBC9F804ADD33468A9C7657E823FFC706
#include "AutomemBase.hpp" #include "implem/AutomemBase.hpp"
#include "IteratorOnPtr.hpp" #include "implem/IteratorOnPtr.hpp"
#include <memory> #include <memory>
#include <cstddef> #include <cstddef>
#include <type_traits> #include <type_traits>
#include <cassert> #include <cassert>
#include <utility> #include <utility>
namespace din { namespace dinhelp {
const size_t MAXSZARR_MAX_STACK_ALLOC_SIZE = MAX_STACK_ALLOC_SIZE; const size_t MAXSZARR_MAX_STACK_ALLOC_SIZE = MAX_STACK_ALLOC_SIZE;
//TODO: add a template parameter to force stack allocation regardless of //TODO: add a template parameter to force stack allocation regardless of
@ -107,7 +107,7 @@ namespace din {
T* m_localMem; //A copy of memory pointer is required T* m_localMem; //A copy of memory pointer is required
size_type m_used; size_type m_used;
}; };
} //namespace din } //namespace dinhelp
#include "MaxSizedArray.inl" #include "MaxSizedArray.inl"

View file

@ -15,7 +15,7 @@
* along with "dindexer". If not, see <http://www.gnu.org/licenses/>. * along with "dindexer". If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace din { namespace dinhelp {
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------
template <typename T, size_t S, typename A> template <typename T, size_t S, typename A>
@ -278,4 +278,4 @@ namespace din {
throw std::length_error("Unable to reserve more memory than the build-time size for MaxSizedArray"); throw std::length_error("Unable to reserve more memory than the build-time size for MaxSizedArray");
} }
} }
} //namespace din } //namespace dinhelp

View file

@ -30,7 +30,7 @@
# define ASSERTIONSENABLED # define ASSERTIONSENABLED
#endif #endif
namespace din { namespace dinhelp {
const size_t MAX_STACK_ALLOC_SIZE = 128; const size_t MAX_STACK_ALLOC_SIZE = 128;
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------
@ -81,7 +81,7 @@ namespace din {
void operator= (const AutomemRawBase_stack&); void operator= (const AutomemRawBase_stack&);
typename std::aligned_storage<sizeof(T), alignof(T)>::type m_localMem[S]; typename std::aligned_storage<sizeof(T), alignof(T)>::type m_localMem[S];
}; };
} //namespace din } //namespace dinhelp
#include "AutomemBase.inl" #include "AutomemBase.inl"

View file

@ -15,7 +15,7 @@
* along with "dindexer". If not, see <http://www.gnu.org/licenses/>. * along with "dindexer". If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace din { namespace dinhelp {
namespace { namespace {
#if defined(ASSERTIONSENABLED) #if defined(ASSERTIONSENABLED)
const char g_guard = 0xAB; const char g_guard = 0xAB;
@ -115,4 +115,4 @@ namespace din {
#endif #endif
return new(location) T(std::forward<Args...>(parArgs)...); return new(location) T(std::forward<Args...>(parArgs)...);
} }
} //namespace din } //namespace dinhelp

View file

@ -23,7 +23,7 @@
#include <type_traits> #include <type_traits>
#include <cassert> #include <cassert>
namespace din { namespace dinhelp {
namespace implem_iop { namespace implem_iop {
template <typename P, typename T, int32_t I> template <typename P, typename T, int32_t I>
class IteratorOnPtr_base : public std::iterator<std::random_access_iterator_tag, T> { class IteratorOnPtr_base : public std::iterator<std::random_access_iterator_tag, T> {
@ -309,6 +309,6 @@ namespace din {
this->MoveIterator(-parOther); this->MoveIterator(-parOther);
return *this; return *this;
} }
} //namespace din } //namespace dinhelp
#endif #endif

View file

@ -20,7 +20,7 @@
#include "dindexer-machinery/recorddata.hpp" #include "dindexer-machinery/recorddata.hpp"
#include "flatinsertin2dlist.hpp" #include "flatinsertin2dlist.hpp"
#include "MaxSizedArray.hpp" #include "helpers/MaxSizedArray.hpp"
#include <memory> #include <memory>
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
@ -40,6 +40,8 @@ namespace pq {
} //namespace pq } //namespace pq
namespace din { namespace din {
using dinhelp::MaxSizedArray;
enum SetDetails { enum SetDetails {
SetDetail_Desc = 0x01, SetDetail_Desc = 0x01,
SetDetail_Type = 0x02, SetDetail_Type = 0x02,