mirror of https://github.com/dnomd343/klotski.git
Dnomd343
8 months ago
8 changed files with 134 additions and 105 deletions
@ -1,49 +0,0 @@ |
|||
#pragma once |
|||
|
|||
namespace klotski::cases { |
|||
|
|||
// ----------------------------------------------------------------------------------------- // |
|||
|
|||
inline BasicRanges& BasicRanges::instance() noexcept { |
|||
static BasicRanges instance; |
|||
return instance; |
|||
} |
|||
|
|||
inline Ranges& BasicRanges::get_ranges() noexcept { |
|||
static Ranges ranges; |
|||
return ranges; |
|||
} |
|||
|
|||
inline const Ranges& BasicRanges::fetch() noexcept { |
|||
this->build(); |
|||
return get_ranges(); |
|||
} |
|||
|
|||
inline bool BasicRanges::is_available() const noexcept { |
|||
return available_; // no mutex required in one-way state |
|||
} |
|||
|
|||
// ----------------------------------------------------------------------------------------- // |
|||
|
|||
inline AllCases& AllCases::instance() noexcept { |
|||
static AllCases instance; |
|||
return instance; |
|||
} |
|||
|
|||
inline RangesUnion& AllCases::get_cases() noexcept { |
|||
static RangesUnion cases; |
|||
return cases; |
|||
} |
|||
|
|||
inline const RangesUnion& AllCases::fetch() noexcept { |
|||
this->build(); |
|||
return get_cases(); |
|||
} |
|||
|
|||
inline bool AllCases::is_available() const noexcept { |
|||
return available_; // no mutex required in one-way state |
|||
} |
|||
|
|||
// ----------------------------------------------------------------------------------------- // |
|||
|
|||
} // namespace klotski::codec |
@ -0,0 +1,21 @@ |
|||
#pragma once |
|||
|
|||
namespace klotski::cases { |
|||
|
|||
inline RangesUnion& AllCases::get_cases() { |
|||
static RangesUnion cases; |
|||
return cases; |
|||
} |
|||
|
|||
inline const RangesUnion& AllCases::fetch() { |
|||
if (!available_) { |
|||
build(); |
|||
} |
|||
return get_cases(); |
|||
} |
|||
|
|||
inline bool AllCases::is_available() const { |
|||
return available_; // no mutex required in one-way state |
|||
} |
|||
|
|||
} // namespace klotski::codec |
@ -0,0 +1,21 @@ |
|||
#pragma once |
|||
|
|||
namespace klotski::cases { |
|||
|
|||
inline Ranges& BasicRanges::get_ranges() { |
|||
static Ranges ranges; |
|||
return ranges; |
|||
} |
|||
|
|||
inline const Ranges& BasicRanges::fetch() { |
|||
if (!available_) { |
|||
build(); |
|||
} |
|||
return get_ranges(); |
|||
} |
|||
|
|||
inline bool BasicRanges::is_available() const { |
|||
return available_; // no mutex required in one-way state |
|||
} |
|||
|
|||
} // namespace klotski::codec |
Loading…
Reference in new issue