Foundation
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
Container.hpp File Reference
#include <algorithm>
#include <array>
#include <bitset>
#include <functional>
#include <list>
#include <map>
#include <numeric>
#include <optional>
#include <queue>
#include <ranges>
#include <set>
#include <span>
#include <string>
#include <string_view>
#include <unordered_map>
#include <unordered_set>
#include <variant>
#include <vector>
#include <stack>
#include "Allocator.hpp"
#include "Hash.hpp"
#include "Logging.hpp"

Go to the source code of this file.

Classes

struct  Foundation::Core::Optional< T >
 std::optional with convenience Get()/GetIf() methods. More...
 
struct  Foundation::Core::Variant< Args >
 std::variant with C++23 visit() behavior and convenience Get()/GetIf() methods. Also read upon https://bitbashing.io/std-visit.html - which is not used here. More...
 
struct  Foundation::Core::Ranges::ContainedBy< Range >
 Range predicate that checks if a value is contained within a given range. More...
 

Namespaces

namespace  Foundation
 
namespace  Foundation::Core
 Lock-free atomic primitives and implementations of data structures.
 
namespace  Foundation::Core::Ranges
 Ranges extensions.
 

Typedefs

template<typename First , typename Second >
using Foundation::Core::Pair = std::pair< First, Second >
 Alias for std::pair
 
template<typename... Args>
using Foundation::Core::Tuple = std::tuple< Args... >
 Alias for std::tuple
 
template<typename T , size_t Size>
using Foundation::Core::Array = std::array< T, Size >
 Alias for std::array
 
template<size_t Size>
using Foundation::Core::Bitset = std::bitset< Size >
 Alias for std::bitset
 
using Foundation::Core::StringView = std::basic_string_view< char >
 Alias for std::basic_string_view<char>
 
template<typename T >
using Foundation::Core::Span = std::span< T >
 Alias for std::span
 
using Foundation::Core::String = std::basic_string< char, std::char_traits< char >, StlDefaultAllocator< char > >
 Alias for std::basic_string<char>, without an explicit allocator constructor.
 
using Foundation::Core::StringAlloc = std::basic_string< char, std::char_traits< char >, StlAllocator< char > >
 std::basic_string<char> with explicit Foundation::Core::StlAllocator constructor
 
template<typename T >
using Foundation::Core::Vector = std::vector< T, StlAllocator< T > >
 std::vector with explicit Foundation::Core::StlAllocator constructor
 
template<typename T , typename Predicate = std::less<T>>
using Foundation::Core::Set = std::set< T, Predicate, StlAllocator< T > >
 std::set with explicit Foundation::Core::StlAllocator constructor
 
template<typename T , typename Predicate = std::less<T>>
using Foundation::Core::MultiSet = std::multiset< T, Predicate, StlAllocator< T > >
 std::multiset with explicit Foundation::Core::StlAllocator constructor
 
template<typename K , typename V , typename Predicate = std::less<K>>
using Foundation::Core::Map = std::map< K, V, Predicate, StlAllocator< Pair< const K, V > > >
 std::map with explicit Foundation::Core::StlAllocator constructor
 
template<typename K , typename V , typename Hash = std::hash<K>, typename KeyEq = std::equal_to<K>>
using Foundation::Core::HashMap = std::unordered_map< K, V, Hash, KeyEq, StlAllocator< Pair< const K, V > > >
 std::unordered_map with explicit Foundation::Core::StlAllocator constructor.
 
template<typename K , typename Hash = std::hash<K>, typename KeyEq = std::equal_to<K>>
using Foundation::Core::HashSet = std::unordered_set< K, Hash, KeyEq, StlAllocator< K > >
 std::unordered_set with explicit Foundation::Core::StlAllocator constructor.
 
template<typename K , typename V , typename Predicate = std::less<K>>
using Foundation::Core::MultiMap = std::multimap< K, V, Predicate, StlAllocator< Pair< const K, V > > >
 std::multimap with explicit Foundation::Core::StlAllocator constructor
 
template<typename T >
using Foundation::Core::Deque = std::deque< T, StlAllocator< T > >
 std::deque with explicit Foundation::Core::StlAllocator constructor
 
template<typename T >
using Foundation::Core::Stack = std::stack< T, Deque< T > >
 std::stack with explicit Foundation::Core::StlAllocator constructor
 
template<typename T >
using Foundation::Core::List = std::list< T, StlAllocator< T > >
 std::list with explicit Foundation::Core::StlAllocator constructor
 
template<typename T , typename Container = Deque<T>>
using Foundation::Core::Queue = std::queue< T, Container >
 std::queue with explicit Foundation::Core::StlAllocator constructor
 
template<typename T , typename Predicate = std::less<T>, typename Container = Vector<T>>
using Foundation::Core::PriorityQueue = std::priority_queue< T, Container, Predicate >
 std::priority_queue with explicit Foundation::Core::StlAllocator constructor
 

Functions

template<typename T >
Span< const char > Foundation::Core::AsBytes (Span< T > data)
 
template<typename T >
requires std::is_trivially_copyable_v<T>
Span< const T > Foundation::Core::AsSpan (T const &data)
 Helper to construct one const r-value as a single element span.
 
template<typename T , typename... Args>
Span< T > Foundation::Core::ConstructSpan (Allocator *resource, size_t size, Args &&... args)
 Convenience function for constructing a Span with memory allocated from a Foundation::Core::Allocator. Possibly constructs objects in-place if they are not trivially constructible (e.g. non-PODs)
 
template<typename T >
void Foundation::Core::DestructSpan (Allocator *resource, Span< T > span)
 Convenience function for destructing a Span allocated with ConstructSpan. Calls destructors in-place if the type is not trivially destructible (e.g. non-PODs)
 
template<typename... Args>
constexpr String Foundation::Core::Format (fmt::format_string< Args... > format, Args &&... args)
 String wrapper for Format().
 
template<typename T >
constexpr Optional< range_value_t< T > > Foundation::Core::Ranges::FirstOf (T &&range)
 Returns the first element of a range, or an empty Optional if the range is empty.
 
template<typename T >
constexpr uint64_t Foundation::Core::FNV1a64 (Span< const T > span) noexcept