2018-07-17 20:01:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef include_range_type
|
|
|
|
include_range_type(NUL,-2)
|
|
|
|
#else
|
|
|
|
|
2021-07-28 20:59:31 +02:00
|
|
|
#ifdef __cxz_ranges_header__
|
2018-07-17 20:01:25 +02:00
|
|
|
// assert, that this is only used within range_types/header.h
|
|
|
|
|
2021-07-28 20:59:31 +02:00
|
|
|
#ifndef __cxz_range_type_null_def__
|
|
|
|
#define __cxz_range_type_null_def__
|
2018-07-17 20:01:25 +02:00
|
|
|
|
2021-07-28 20:29:56 +02:00
|
|
|
namespace CNORXZ
|
2018-07-17 20:01:25 +02:00
|
|
|
{
|
2019-02-12 20:26:38 +01:00
|
|
|
typedef GenSingleIndex<size_t,SpaceType::NUL,0> NullIndex;
|
2018-07-17 20:01:25 +02:00
|
|
|
|
2019-02-12 20:26:38 +01:00
|
|
|
std::shared_ptr<GenSingleRange<size_t,SpaceType::NUL,0> > nullr();
|
2018-07-20 19:13:42 +02:00
|
|
|
std::shared_ptr<NullIndex> nulli();
|
2018-07-22 18:32:43 +02:00
|
|
|
|
2018-07-17 20:01:25 +02:00
|
|
|
template <>
|
2019-02-12 20:26:38 +01:00
|
|
|
class GenSingleRangeFactory<size_t,SpaceType::NUL,0> : public RangeFactoryBase
|
2018-07-17 20:01:25 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2019-02-12 20:26:38 +01:00
|
|
|
typedef GenSingleRange<size_t,SpaceType::NUL,0> oType;
|
2018-07-17 20:01:25 +02:00
|
|
|
|
2019-02-12 20:26:38 +01:00
|
|
|
GenSingleRangeFactory();
|
2018-07-17 20:01:25 +02:00
|
|
|
std::shared_ptr<RangeBase> create();
|
2018-07-20 19:13:42 +02:00
|
|
|
|
|
|
|
friend std::shared_ptr<oType> nullr();
|
2018-07-17 20:01:25 +02:00
|
|
|
|
2018-07-20 19:13:42 +02:00
|
|
|
private:
|
|
|
|
static std::shared_ptr<oType> mRInstance;
|
2018-07-17 20:01:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
2019-02-12 20:26:38 +01:00
|
|
|
class GenSingleRange<size_t,SpaceType::NUL,0> : public RangeInterface<NullIndex>
|
2018-07-17 20:01:25 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef RangeBase RB;
|
2019-02-12 20:26:38 +01:00
|
|
|
typedef typename RangeInterface<GenSingleIndex<size_t,SpaceType::NUL,0> >::IndexType IndexType;
|
|
|
|
typedef GenSingleRange<size_t,SpaceType::NUL,0> RangeType;
|
2018-07-17 20:01:25 +02:00
|
|
|
typedef size_t MetaType;
|
2019-02-12 20:26:38 +01:00
|
|
|
typedef GenSingleRangeFactory<size_t,SpaceType::NUL,0> FType;
|
2018-07-17 20:01:25 +02:00
|
|
|
|
2018-07-29 19:17:26 +02:00
|
|
|
virtual size_t size() const final;
|
|
|
|
virtual size_t dim() const final;
|
2018-07-21 18:05:53 +02:00
|
|
|
|
2019-03-19 20:58:59 +01:00
|
|
|
virtual vector<size_t> typeNum() const final;
|
2019-03-14 14:20:38 +01:00
|
|
|
virtual size_t cmeta(char* target, size_t pos) const final;
|
2019-03-19 20:58:59 +01:00
|
|
|
virtual size_t cmetaSize() const final;
|
2018-07-29 19:17:26 +02:00
|
|
|
virtual std::string stringMeta(size_t pos) const final;
|
2019-02-13 21:59:13 +01:00
|
|
|
virtual vector<char> data() const final;
|
2018-07-28 15:27:11 +02:00
|
|
|
|
2018-07-29 19:17:26 +02:00
|
|
|
virtual SpaceType spaceType() const final;
|
2018-11-07 10:58:07 +01:00
|
|
|
virtual DataHeader dataHeader() const final;
|
|
|
|
|
2018-07-17 20:01:25 +02:00
|
|
|
size_t get(size_t pos) const;
|
|
|
|
size_t getMeta(size_t metapos) const;
|
|
|
|
|
2018-07-29 19:17:26 +02:00
|
|
|
virtual IndexType begin() const final;
|
|
|
|
virtual IndexType end() const final;
|
|
|
|
//virtual std::shared_ptr<VIWB> index() const final;
|
2018-07-17 20:01:25 +02:00
|
|
|
|
2019-02-12 20:26:38 +01:00
|
|
|
friend GenSingleRangeFactory<size_t,SpaceType::NUL,0>;
|
2018-07-17 20:01:25 +02:00
|
|
|
|
|
|
|
static constexpr bool defaultable = true;
|
|
|
|
|
|
|
|
static constexpr size_t ISSTATIC = 1;
|
|
|
|
static constexpr size_t SIZE = 1;
|
|
|
|
static constexpr bool HASMETACONT = false;
|
|
|
|
|
2019-02-12 20:26:38 +01:00
|
|
|
static GenSingleRangeFactory<size_t,SpaceType::NUL,0> factory()
|
|
|
|
{ return GenSingleRangeFactory<size_t,SpaceType::NUL,0>(); }
|
2018-07-17 20:01:25 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2019-02-12 20:26:38 +01:00
|
|
|
GenSingleRange() = default;
|
|
|
|
GenSingleRange(const GenSingleRange& in) = delete;
|
2018-07-17 20:01:25 +02:00
|
|
|
|
2019-02-12 20:26:38 +01:00
|
|
|
//GenSingleRange(size_t spinNum);
|
2018-07-17 20:01:25 +02:00
|
|
|
};
|
|
|
|
|
2019-02-12 20:26:38 +01:00
|
|
|
typedef GenSingleRange<size_t,SpaceType::NUL,0> NullRange;
|
|
|
|
typedef GenSingleRangeFactory<size_t,SpaceType::NUL,0> NullRF;
|
2018-07-22 18:32:43 +02:00
|
|
|
|
2018-07-28 20:05:58 +02:00
|
|
|
std::shared_ptr<NullRF> mkNUL(const char* dp, size_t size);
|
2018-07-22 18:32:43 +02:00
|
|
|
|
2018-07-17 20:01:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-28 20:59:31 +02:00
|
|
|
#endif // #ifndef __cxz_range_type_null_def__
|
2018-07-17 20:01:25 +02:00
|
|
|
|
2021-07-28 20:59:31 +02:00
|
|
|
#endif // #ifdef __cxz_ranges_header__
|
2018-07-17 20:01:25 +02:00
|
|
|
|
|
|
|
#endif // #ifdef include_range_type
|